{"version":3,"file":"jsonc.js","sourceRoot":"","sources":["../src/jsonc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAyD;AACzD,yCAAiD;AAEjD;IAA2B,yBAAQ;IAAnC;QAAA,qEAeC;QAdC,wBAAkB,GAAG,uBAAuB,CAAC;;IAc/C,CAAC;IAbC,qBAAK,GAAL,UAAM,OAAe;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,wBAAQ,GAAR,UAAS,OAAmB,EAAE,UAAkB;QAAhD,iBASC;QARC,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzD,IAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,eAAe,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,KAAI,CAAC,kBAAkB,CAAC,EAAE;gBACvC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;aACrC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACH,YAAC;AAAD,CAAC,AAfD,CAA2B,oBAAQ,GAelC;AAfY,sBAAK","sourcesContent":["import * as stripJsonComments from 'strip-json-comments';\nimport {JSONFile, JSONObject} from './json_file';\n\nexport class JSONC extends JSONFile {\n lineCommentPattern = /^(\\s+)?\\/\\*|\\*\\/|\\/\\//;\n parse(content: string): JSONObject {\n return JSON.parse(stripJsonComments(content));\n }\n finalize(content: JSONObject, rawContent: string): string {\n const contentLines = this.stringify(content).split('\\n');\n const rawContentLines = rawContent.split('\\n');\n rawContentLines.forEach((line, i) => {\n if (line.match(this.lineCommentPattern)) {\n contentLines.splice(i - 1, 0, line);\n }\n });\n return contentLines.join('\\n');\n }\n}\n"]}