unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
13 lines • 384 B
JavaScript
export const validateJsonString = (value) => {
// from https://stackoverflow.com/a/20392392
try {
const parsedStr = JSON.parse(value);
if (parsedStr && typeof parsedStr === 'object') {
return true;
}
}
catch (err) { }
// an error is considered a non valid json
return false;
};
//# sourceMappingURL=validateJsonString.js.map