We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebccb64 commit 2230d7eCopy full SHA for 2230d7e
src/JSONC.js
@@ -202,7 +202,7 @@
202
203
for (nIndex = 0; nIndex < nLenKeys; nIndex++) {
204
aKey = aKeys[nIndex];
205
- str = str.replace(new RegExp(escapeRegExp('"' + aKey[1] + '"'), 'g'), '"' + aKey[0] + '"');
+ str = str.replace(new RegExp('(?:"' + escapeRegExp(aKey[1]) + '"):', 'g'), '"' + aKey[0] + '":');
206
}
207
obj = JSON.parse(str);
208
obj._ = oKeys;
@@ -236,7 +236,7 @@
236
str = JSON.stringify(jsonCopy);
237
for (sKey in oKeys) {
238
if (oKeys.hasOwnProperty(sKey)) {
239
- str = str.replace(new RegExp('"' + sKey + '"', 'g'), '"' + oKeys[sKey] + '"');
+ str = str.replace(new RegExp('(?:"' + sKey + '"):', 'g'), '"' + oKeys[sKey] + '":');
240
241
242
return str;
0 commit comments