@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 492 B
Source Map (JSON)
{"version":3,"file":"safeParseJSON.mjs","names":[],"sources":["../../src/utils/safeParseJSON.ts"],"sourcesContent":["export const safeParseJSON = <T = Record<string, any>>(text?: string) => {\n if (typeof text !== 'string') return;\n\n let json: T;\n try {\n json = JSON.parse(text);\n } catch {\n return;\n }\n\n return json;\n};\n"],"mappings":";AAAA,MAAa,iBAA0C,SAAkB;CACvE,IAAI,OAAO,SAAS,UAAU;CAE9B,IAAI;CACJ,IAAI;EACF,OAAO,KAAK,MAAM,IAAI;CACxB,QAAQ;EACN;CACF;CAEA,OAAO;AACT"}