-
Notifications
You must be signed in to change notification settings - Fork 0
/
funJSON.js.map
1 lines (1 loc) · 2.95 KB
/
funJSON.js.map
1
{"version":3,"file":"funJSON.js","sources":["es/funJSON.js"],"sourcesContent":["function reviver(key, value) {\n if (detect(key, value)) {\n try {\n value = eval('(' + value + ')');\n } catch (exc) {\n /* invalid js? leave as is */\n }\n }\n return value;\n}\n\nfunction detect(key, value) {\n return (\n typeof value == 'string' &&\n (/^\\s*(async\\s+)*function\\s*\\([\\s\\w$,_/*]*\\)\\s*\\{[\\s\\S]*\\}$/.test(value) ||\n /^\\s*(async\\s+)*\\([\\s\\w$,_/*]*\\)\\s*=>\\s*\\{[\\s\\S]*\\}$/.test(value))\n );\n}\n\nfunction replacer(key, value) {\n if (typeof value == 'function') value = value.toString();\n return value;\n}\n\nexport function parse(text, extReviver) {\n return JSON.parse(text, extReviver || reviver);\n}\n\nexport function stringify(value, extReplacer, space) {\n return JSON.stringify(value, extReplacer || replacer, space);\n}\n\nexport function stringifyToScript(value, extReplacer, space) {\n var functions = [];\n var rp = function(key, value) {\n if (typeof value == 'function') {\n value = extReplacer ? extReplacer(key, value) : value.toString();\n functions.push(value);\n }\n return value;\n };\n var script = stringify(value, rp, space);\n for (var i = 0; i < functions.length; i++) {\n script = script.replace(stringify(functions[i], rp, space), functions[i]);\n }\n return script;\n}\n"],"names":[],"mappings":";;AAAA,SAAS,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AAC7B,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;AAC1B,IAAI,IAAI;AACR,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;AACtC,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB;AACA,KAAK;AACL,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACD;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE;AACF,IAAI,OAAO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