Repository URL to install this package:
|
Version:
3.12.2 ▾
|
// if the value is a possible (JSON string) then we need to parse it to JS object, if not and it's a real string or other type then return it.
var getJsonParsedValue = function getJsonParsedValue(value) {
var parsedValue = value;
if (typeof parsedValue === 'string') {
try {
parsedValue = JSON.parse(parsedValue);
} catch (e) {}
}
return parsedValue;
};
export default getJsonParsedValue;