What: Prevent JSON.parse to be called with a non string value
Why: Sometimes (non standard storages) the item provided by getItem method is already of Object type.
How: In general, JSON parse needs to be called with a string parameter, if this is satisfied, do it. If not, check if it is already a Object, and if it is, return it. Otherwise, return undefined.
What: Prevent JSON.parse to be called with a non string value
Why: Sometimes (non standard storages) the item provided by getItem method is already of Object type.
How: In general, JSON parse needs to be called with a string parameter, if this is satisfied, do it. If not, check if it is already a Object, and if it is, return it. Otherwise, return undefined.
Checklist: