@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 575 B
Source Map (JSON)
{"version":3,"file":"validate-json.cjs","names":[],"sources":["../../../../src/components/JsonInput/validate-json/validate-json.ts"],"sourcesContent":["export function validateJson(value: string, deserialize: typeof JSON.parse) {\n if (typeof value === 'string' && value.trim().length === 0) {\n return true;\n }\n\n try {\n deserialize(value);\n return true;\n } catch (e) {\n return false;\n }\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,OAAe,aAAgC;AAC1E,KAAI,OAAO,UAAU,YAAY,MAAM,MAAM,CAAC,WAAW,EACvD,QAAO;AAGT,KAAI;AACF,cAAY,MAAM;AAClB,SAAO;UACA,GAAG;AACV,SAAO"}