/
sweetebin
/
hackaton_26
Обзор
Документация
Войти
/
sweetebin
/
hackaton_26
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
web-form-project/node_modules/concurrently/dist/src/jsonc.js
29 строк
851 B
AKorostelev
web form project added
28 июл 2026, 10:57
28 июл 2026, 10:57
4339e77
Код
Авторство
О чём код?
"use strict"; /* ORIGINAL https://www.npmjs.com/package/tiny-jsonc BY Fabio Spampinato MIT license Copied due to the dependency not being compatible with CommonJS */ Object.defineProperty(exports, "__esModule", { value: true }); /* HELPERS */ const stringOrCommentRe = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g; const stringOrTrailingCommaRe = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g; /* MAIN */ const JSONC = { parse: (text) => { text = String(text); // To be extra safe try { // Fast path for valid JSON return JSON.parse(text); } catch { // Slow path for JSONC and invalid inputs return JSON.parse(text.replace(stringOrCommentRe, '$1').replace(stringOrTrailingCommaRe, '$1')); } }, stringify: JSON.stringify, }; /* EXPORT */ exports.default = JSONC;