source: node_modules/es-toolkit/dist/predicate/isJSON.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 216 bytes
Line 
1function isJSON(value) {
2 if (typeof value !== 'string') {
3 return false;
4 }
5 try {
6 JSON.parse(value);
7 return true;
8 }
9 catch {
10 return false;
11 }
12}
13
14export { isJSON };
Note: See TracBrowser for help on using the repository browser.