"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.JSONC = void 0; var stripJsonComments = require("strip-json-comments"); var json_file_1 = require("./json_file"); var JSONC = /** @class */ (function (_super) { __extends(JSONC, _super); function JSONC() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.lineCommentPattern = /^(\s+)?\/\*|\*\/|\/\//; return _this; } JSONC.prototype.parse = function (content) { return JSON.parse(stripJsonComments(content)); }; JSONC.prototype.finalize = function (content, rawContent) { var _this = this; var contentLines = this.stringify(content).split('\n'); var rawContentLines = rawContent.split('\n'); rawContentLines.forEach(function (line, i) { if (line.match(_this.lineCommentPattern)) { contentLines.splice(i - 1, 0, line); } }); return contentLines.join('\n'); }; return JSONC; }(json_file_1.JSONFile)); exports.JSONC = JSONC; //# sourceMappingURL=jsonc.js.map