canopycms-cdk 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/worker/dist/index.js +1528 -347
- package/worker/dist/index.js.sha256 +1 -1
package/worker/dist/index.js
CHANGED
|
@@ -1783,7 +1783,7 @@ var require_ms = __commonJS({
|
|
|
1783
1783
|
options2 = options2 || {};
|
|
1784
1784
|
var type = typeof val;
|
|
1785
1785
|
if (type === "string" && val.length > 0) {
|
|
1786
|
-
return
|
|
1786
|
+
return parse7(val);
|
|
1787
1787
|
} else if (type === "number" && isFinite(val)) {
|
|
1788
1788
|
return options2.long ? fmtLong(val) : fmtShort(val);
|
|
1789
1789
|
}
|
|
@@ -1791,7 +1791,7 @@ var require_ms = __commonJS({
|
|
|
1791
1791
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
1792
1792
|
);
|
|
1793
1793
|
};
|
|
1794
|
-
function
|
|
1794
|
+
function parse7(str2) {
|
|
1795
1795
|
str2 = String(str2);
|
|
1796
1796
|
if (str2.length > 100) {
|
|
1797
1797
|
return;
|
|
@@ -1934,12 +1934,12 @@ var require_common = __commonJS({
|
|
|
1934
1934
|
args.unshift("%O");
|
|
1935
1935
|
}
|
|
1936
1936
|
let index2 = 0;
|
|
1937
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2,
|
|
1937
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format4) => {
|
|
1938
1938
|
if (match2 === "%%") {
|
|
1939
1939
|
return "%";
|
|
1940
1940
|
}
|
|
1941
1941
|
index2++;
|
|
1942
|
-
const formatter = createDebug2.formatters[
|
|
1942
|
+
const formatter = createDebug2.formatters[format4];
|
|
1943
1943
|
if (typeof formatter === "function") {
|
|
1944
1944
|
const val = args[index2];
|
|
1945
1945
|
match2 = formatter.call(self2, val);
|
|
@@ -7661,7 +7661,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7661
7661
|
return template.replace(/\/$/, "");
|
|
7662
7662
|
}
|
|
7663
7663
|
}
|
|
7664
|
-
function
|
|
7664
|
+
function parse7(options2) {
|
|
7665
7665
|
let method = options2.method.toUpperCase();
|
|
7666
7666
|
let url = (options2.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
7667
7667
|
let headers = Object.assign({}, options2.headers);
|
|
@@ -7685,7 +7685,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7685
7685
|
if (!isBinaryRequest) {
|
|
7686
7686
|
if (options2.mediaType.format) {
|
|
7687
7687
|
headers.accept = headers.accept.split(/,/).map(
|
|
7688
|
-
(
|
|
7688
|
+
(format4) => format4.replace(
|
|
7689
7689
|
/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
|
|
7690
7690
|
`application/vnd$1$2.${options2.mediaType.format}`
|
|
7691
7691
|
)
|
|
@@ -7695,8 +7695,8 @@ var require_dist_node3 = __commonJS({
|
|
|
7695
7695
|
if (options2.mediaType.previews?.length) {
|
|
7696
7696
|
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
|
|
7697
7697
|
headers.accept = previewsFromAcceptHeader.concat(options2.mediaType.previews).map((preview) => {
|
|
7698
|
-
const
|
|
7699
|
-
return `application/vnd.github.${preview}-preview${
|
|
7698
|
+
const format4 = options2.mediaType.format ? `.${options2.mediaType.format}` : "+json";
|
|
7699
|
+
return `application/vnd.github.${preview}-preview${format4}`;
|
|
7700
7700
|
}).join(",");
|
|
7701
7701
|
}
|
|
7702
7702
|
}
|
|
@@ -7725,7 +7725,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7725
7725
|
);
|
|
7726
7726
|
}
|
|
7727
7727
|
function endpointWithDefaults(defaults, route, options2) {
|
|
7728
|
-
return
|
|
7728
|
+
return parse7(merge2(defaults, route, options2));
|
|
7729
7729
|
}
|
|
7730
7730
|
function withDefaults(oldDefaults, newDefaults) {
|
|
7731
7731
|
const DEFAULTS2 = merge2(oldDefaults, newDefaults);
|
|
@@ -7734,7 +7734,7 @@ var require_dist_node3 = __commonJS({
|
|
|
7734
7734
|
DEFAULTS: DEFAULTS2,
|
|
7735
7735
|
defaults: withDefaults.bind(null, DEFAULTS2),
|
|
7736
7736
|
merge: merge2.bind(null, DEFAULTS2),
|
|
7737
|
-
parse:
|
|
7737
|
+
parse: parse7
|
|
7738
7738
|
});
|
|
7739
7739
|
}
|
|
7740
7740
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
@@ -12947,7 +12947,7 @@ var require_visit = __commonJS({
|
|
|
12947
12947
|
var BREAK = Symbol("break visit");
|
|
12948
12948
|
var SKIP3 = Symbol("skip children");
|
|
12949
12949
|
var REMOVE = Symbol("remove node");
|
|
12950
|
-
function
|
|
12950
|
+
function visit5(node2, visitor) {
|
|
12951
12951
|
const visitor_ = initVisitor(visitor);
|
|
12952
12952
|
if (identity.isDocument(node2)) {
|
|
12953
12953
|
const cd = visit_(null, node2.contents, visitor_, Object.freeze([node2]));
|
|
@@ -12956,9 +12956,9 @@ var require_visit = __commonJS({
|
|
|
12956
12956
|
} else
|
|
12957
12957
|
visit_(null, node2, visitor_, Object.freeze([]));
|
|
12958
12958
|
}
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12959
|
+
visit5.BREAK = BREAK;
|
|
12960
|
+
visit5.SKIP = SKIP3;
|
|
12961
|
+
visit5.REMOVE = REMOVE;
|
|
12962
12962
|
function visit_(key, node2, visitor, path44) {
|
|
12963
12963
|
const ctrl = callVisitor(key, node2, visitor, path44);
|
|
12964
12964
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
@@ -13092,7 +13092,7 @@ var require_visit = __commonJS({
|
|
|
13092
13092
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
13093
13093
|
}
|
|
13094
13094
|
}
|
|
13095
|
-
exports2.visit =
|
|
13095
|
+
exports2.visit = visit5;
|
|
13096
13096
|
exports2.visitAsync = visitAsync;
|
|
13097
13097
|
}
|
|
13098
13098
|
});
|
|
@@ -13102,7 +13102,7 @@ var require_directives = __commonJS({
|
|
|
13102
13102
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js"(exports2) {
|
|
13103
13103
|
"use strict";
|
|
13104
13104
|
var identity = require_identity();
|
|
13105
|
-
var
|
|
13105
|
+
var visit5 = require_visit();
|
|
13106
13106
|
var escapeChars = {
|
|
13107
13107
|
"!": "%21",
|
|
13108
13108
|
",": "%2C",
|
|
@@ -13246,7 +13246,7 @@ var require_directives = __commonJS({
|
|
|
13246
13246
|
let tagNames;
|
|
13247
13247
|
if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
|
|
13248
13248
|
const tags = {};
|
|
13249
|
-
|
|
13249
|
+
visit5.visit(doc.contents, (_key, node2) => {
|
|
13250
13250
|
if (identity.isNode(node2) && node2.tag)
|
|
13251
13251
|
tags[node2.tag] = true;
|
|
13252
13252
|
});
|
|
@@ -13273,7 +13273,7 @@ var require_anchors = __commonJS({
|
|
|
13273
13273
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js"(exports2) {
|
|
13274
13274
|
"use strict";
|
|
13275
13275
|
var identity = require_identity();
|
|
13276
|
-
var
|
|
13276
|
+
var visit5 = require_visit();
|
|
13277
13277
|
function anchorIsValid(anchor) {
|
|
13278
13278
|
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
13279
13279
|
const sa = JSON.stringify(anchor);
|
|
@@ -13284,7 +13284,7 @@ var require_anchors = __commonJS({
|
|
|
13284
13284
|
}
|
|
13285
13285
|
function anchorNames(root5) {
|
|
13286
13286
|
const anchors = /* @__PURE__ */ new Set();
|
|
13287
|
-
|
|
13287
|
+
visit5.visit(root5, {
|
|
13288
13288
|
Value(_key, node2) {
|
|
13289
13289
|
if (node2.anchor)
|
|
13290
13290
|
anchors.add(node2.anchor);
|
|
@@ -13464,7 +13464,7 @@ var require_Alias = __commonJS({
|
|
|
13464
13464
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js"(exports2) {
|
|
13465
13465
|
"use strict";
|
|
13466
13466
|
var anchors = require_anchors();
|
|
13467
|
-
var
|
|
13467
|
+
var visit5 = require_visit();
|
|
13468
13468
|
var identity = require_identity();
|
|
13469
13469
|
var Node3 = require_Node();
|
|
13470
13470
|
var toJS = require_toJS();
|
|
@@ -13488,7 +13488,7 @@ var require_Alias = __commonJS({
|
|
|
13488
13488
|
nodes5 = ctx.aliasResolveCache;
|
|
13489
13489
|
} else {
|
|
13490
13490
|
nodes5 = [];
|
|
13491
|
-
|
|
13491
|
+
visit5.visit(doc, {
|
|
13492
13492
|
Node: (_key, node2) => {
|
|
13493
13493
|
if (identity.isAlias(node2) || identity.hasAnchor(node2))
|
|
13494
13494
|
nodes5.push(node2);
|
|
@@ -15217,14 +15217,14 @@ var require_bool = __commonJS({
|
|
|
15217
15217
|
var require_stringifyNumber = __commonJS({
|
|
15218
15218
|
"../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
|
|
15219
15219
|
"use strict";
|
|
15220
|
-
function stringifyNumber({ format:
|
|
15220
|
+
function stringifyNumber({ format: format4, minFractionDigits, tag: tag3, value }) {
|
|
15221
15221
|
if (typeof value === "bigint")
|
|
15222
15222
|
return String(value);
|
|
15223
15223
|
const num = typeof value === "number" ? value : Number(value);
|
|
15224
15224
|
if (!isFinite(num))
|
|
15225
15225
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
15226
15226
|
let n7 = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
15227
|
-
if (!
|
|
15227
|
+
if (!format4 && minFractionDigits && (!tag3 || tag3 === "tag:yaml.org,2002:float") && /^\d/.test(n7)) {
|
|
15228
15228
|
let i10 = n7.indexOf(".");
|
|
15229
15229
|
if (i10 < 0) {
|
|
15230
15230
|
i10 = n7.length;
|
|
@@ -18401,15 +18401,15 @@ var require_cst_visit = __commonJS({
|
|
|
18401
18401
|
var BREAK = Symbol("break visit");
|
|
18402
18402
|
var SKIP3 = Symbol("skip children");
|
|
18403
18403
|
var REMOVE = Symbol("remove item");
|
|
18404
|
-
function
|
|
18404
|
+
function visit5(cst, visitor) {
|
|
18405
18405
|
if ("type" in cst && cst.type === "document")
|
|
18406
18406
|
cst = { start: cst.start, value: cst.value };
|
|
18407
18407
|
_visit(Object.freeze([]), cst, visitor);
|
|
18408
18408
|
}
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18409
|
+
visit5.BREAK = BREAK;
|
|
18410
|
+
visit5.SKIP = SKIP3;
|
|
18411
|
+
visit5.REMOVE = REMOVE;
|
|
18412
|
+
visit5.itemAtPath = (cst, path44) => {
|
|
18413
18413
|
let item = cst;
|
|
18414
18414
|
for (const [field, index2] of path44) {
|
|
18415
18415
|
const tok = item?.[field];
|
|
@@ -18420,8 +18420,8 @@ var require_cst_visit = __commonJS({
|
|
|
18420
18420
|
}
|
|
18421
18421
|
return item;
|
|
18422
18422
|
};
|
|
18423
|
-
|
|
18424
|
-
const parent =
|
|
18423
|
+
visit5.parentCollection = (cst, path44) => {
|
|
18424
|
+
const parent = visit5.itemAtPath(cst, path44.slice(0, -1));
|
|
18425
18425
|
const field = path44[path44.length - 1][0];
|
|
18426
18426
|
const coll = parent?.[field];
|
|
18427
18427
|
if (coll && "items" in coll)
|
|
@@ -18452,7 +18452,7 @@ var require_cst_visit = __commonJS({
|
|
|
18452
18452
|
}
|
|
18453
18453
|
return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
|
|
18454
18454
|
}
|
|
18455
|
-
exports2.visit =
|
|
18455
|
+
exports2.visit = visit5;
|
|
18456
18456
|
}
|
|
18457
18457
|
});
|
|
18458
18458
|
|
|
@@ -20084,7 +20084,7 @@ var require_public_api = __commonJS({
|
|
|
20084
20084
|
}
|
|
20085
20085
|
return doc;
|
|
20086
20086
|
}
|
|
20087
|
-
function
|
|
20087
|
+
function parse7(src, reviver, options2) {
|
|
20088
20088
|
let _reviver = void 0;
|
|
20089
20089
|
if (typeof reviver === "function") {
|
|
20090
20090
|
_reviver = reviver;
|
|
@@ -20125,7 +20125,7 @@ var require_public_api = __commonJS({
|
|
|
20125
20125
|
return value.toString(options2);
|
|
20126
20126
|
return new Document2.Document(value, _replacer, options2).toString(options2);
|
|
20127
20127
|
}
|
|
20128
|
-
exports2.parse =
|
|
20128
|
+
exports2.parse = parse7;
|
|
20129
20129
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
20130
20130
|
exports2.parseDocument = parseDocument3;
|
|
20131
20131
|
exports2.stringify = stringify2;
|
|
@@ -20151,7 +20151,7 @@ var require_dist4 = __commonJS({
|
|
|
20151
20151
|
var lineCounter = require_line_counter();
|
|
20152
20152
|
var parser4 = require_parser();
|
|
20153
20153
|
var publicApi = require_public_api();
|
|
20154
|
-
var
|
|
20154
|
+
var visit5 = require_visit();
|
|
20155
20155
|
exports2.Composer = composer.Composer;
|
|
20156
20156
|
exports2.Document = Document2.Document;
|
|
20157
20157
|
exports2.Schema = Schema3.Schema;
|
|
@@ -20179,8 +20179,8 @@ var require_dist4 = __commonJS({
|
|
|
20179
20179
|
exports2.parseAllDocuments = publicApi.parseAllDocuments;
|
|
20180
20180
|
exports2.parseDocument = publicApi.parseDocument;
|
|
20181
20181
|
exports2.stringify = publicApi.stringify;
|
|
20182
|
-
exports2.visit =
|
|
20183
|
-
exports2.visitAsync =
|
|
20182
|
+
exports2.visit = visit5.visit;
|
|
20183
|
+
exports2.visitAsync = visit5.visitAsync;
|
|
20184
20184
|
}
|
|
20185
20185
|
});
|
|
20186
20186
|
|
|
@@ -20479,7 +20479,7 @@ var require_common2 = __commonJS({
|
|
|
20479
20479
|
}
|
|
20480
20480
|
return target;
|
|
20481
20481
|
}
|
|
20482
|
-
function
|
|
20482
|
+
function repeat2(string3, count) {
|
|
20483
20483
|
var result = "", cycle;
|
|
20484
20484
|
for (cycle = 0; cycle < count; cycle += 1) {
|
|
20485
20485
|
result += string3;
|
|
@@ -20492,7 +20492,7 @@ var require_common2 = __commonJS({
|
|
|
20492
20492
|
module2.exports.isNothing = isNothing;
|
|
20493
20493
|
module2.exports.isObject = isObject2;
|
|
20494
20494
|
module2.exports.toArray = toArray;
|
|
20495
|
-
module2.exports.repeat =
|
|
20495
|
+
module2.exports.repeat = repeat2;
|
|
20496
20496
|
module2.exports.isNegativeZero = isNegativeZero;
|
|
20497
20497
|
module2.exports.extend = extend2;
|
|
20498
20498
|
}
|
|
@@ -21643,7 +21643,7 @@ var require_loader = __commonJS({
|
|
|
21643
21643
|
(c11 - 65536 & 1023) + 56320
|
|
21644
21644
|
);
|
|
21645
21645
|
}
|
|
21646
|
-
function
|
|
21646
|
+
function setProperty2(object, key, value) {
|
|
21647
21647
|
if (key === "__proto__") {
|
|
21648
21648
|
Object.defineProperty(object, key, {
|
|
21649
21649
|
configurable: true,
|
|
@@ -21762,7 +21762,7 @@ var require_loader = __commonJS({
|
|
|
21762
21762
|
for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) {
|
|
21763
21763
|
key = sourceKeys[index2];
|
|
21764
21764
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
21765
|
-
|
|
21765
|
+
setProperty2(destination, key, source[key]);
|
|
21766
21766
|
overridableKeys[key] = true;
|
|
21767
21767
|
}
|
|
21768
21768
|
}
|
|
@@ -21801,7 +21801,7 @@ var require_loader = __commonJS({
|
|
|
21801
21801
|
state3.position = startPos || state3.position;
|
|
21802
21802
|
throwError(state3, "duplicated mapping key");
|
|
21803
21803
|
}
|
|
21804
|
-
|
|
21804
|
+
setProperty2(_result, keyNode, valueNode);
|
|
21805
21805
|
delete overridableKeys[keyNode];
|
|
21806
21806
|
}
|
|
21807
21807
|
return _result;
|
|
@@ -23562,7 +23562,7 @@ var require_gray_matter = __commonJS({
|
|
|
23562
23562
|
var excerpt = require_excerpt();
|
|
23563
23563
|
var engines2 = require_engines();
|
|
23564
23564
|
var toFile = require_to_file();
|
|
23565
|
-
var
|
|
23565
|
+
var parse7 = require_parse();
|
|
23566
23566
|
var utils = require_utils();
|
|
23567
23567
|
function matter3(input, options2) {
|
|
23568
23568
|
if (input === "") {
|
|
@@ -23614,7 +23614,7 @@ var require_gray_matter = __commonJS({
|
|
|
23614
23614
|
file.empty = file.content;
|
|
23615
23615
|
file.data = {};
|
|
23616
23616
|
} else {
|
|
23617
|
-
file.data =
|
|
23617
|
+
file.data = parse7(file.language, file.matter, opts);
|
|
23618
23618
|
}
|
|
23619
23619
|
if (closeIndex === len) {
|
|
23620
23620
|
file.content = "";
|
|
@@ -23667,154 +23667,6 @@ var require_gray_matter = __commonJS({
|
|
|
23667
23667
|
}
|
|
23668
23668
|
});
|
|
23669
23669
|
|
|
23670
|
-
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js
|
|
23671
|
-
var require_main = __commonJS({
|
|
23672
|
-
"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/umd/main.js"(exports2, module2) {
|
|
23673
|
-
(function(factory) {
|
|
23674
|
-
if (typeof module2 === "object" && typeof module2.exports === "object") {
|
|
23675
|
-
var v5 = factory(__require, exports2);
|
|
23676
|
-
if (v5 !== void 0) module2.exports = v5;
|
|
23677
|
-
} else if (typeof define === "function" && define.amd) {
|
|
23678
|
-
define(["require", "exports", "./impl/format", "./impl/edit", "./impl/scanner", "./impl/parser"], factory);
|
|
23679
|
-
}
|
|
23680
|
-
})(function(require2, exports3) {
|
|
23681
|
-
"use strict";
|
|
23682
|
-
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
23683
|
-
exports3.applyEdits = exports3.modify = exports3.format = exports3.printParseErrorCode = exports3.ParseErrorCode = exports3.stripComments = exports3.visit = exports3.getNodeValue = exports3.getNodePath = exports3.findNodeAtOffset = exports3.findNodeAtLocation = exports3.parseTree = exports3.parse = exports3.getLocation = exports3.SyntaxKind = exports3.ScanError = exports3.createScanner = void 0;
|
|
23684
|
-
const formatter = require2("./impl/format");
|
|
23685
|
-
const edit = require2("./impl/edit");
|
|
23686
|
-
const scanner = require2("./impl/scanner");
|
|
23687
|
-
const parser4 = require2("./impl/parser");
|
|
23688
|
-
exports3.createScanner = scanner.createScanner;
|
|
23689
|
-
var ScanError;
|
|
23690
|
-
(function(ScanError2) {
|
|
23691
|
-
ScanError2[ScanError2["None"] = 0] = "None";
|
|
23692
|
-
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
23693
|
-
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
23694
|
-
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
23695
|
-
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
23696
|
-
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
23697
|
-
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
23698
|
-
})(ScanError || (exports3.ScanError = ScanError = {}));
|
|
23699
|
-
var SyntaxKind;
|
|
23700
|
-
(function(SyntaxKind2) {
|
|
23701
|
-
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
23702
|
-
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
23703
|
-
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
23704
|
-
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
23705
|
-
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
23706
|
-
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
23707
|
-
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
23708
|
-
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
23709
|
-
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
23710
|
-
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
23711
|
-
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
23712
|
-
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
23713
|
-
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
23714
|
-
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
23715
|
-
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
23716
|
-
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
23717
|
-
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
23718
|
-
})(SyntaxKind || (exports3.SyntaxKind = SyntaxKind = {}));
|
|
23719
|
-
exports3.getLocation = parser4.getLocation;
|
|
23720
|
-
exports3.parse = parser4.parse;
|
|
23721
|
-
exports3.parseTree = parser4.parseTree;
|
|
23722
|
-
exports3.findNodeAtLocation = parser4.findNodeAtLocation;
|
|
23723
|
-
exports3.findNodeAtOffset = parser4.findNodeAtOffset;
|
|
23724
|
-
exports3.getNodePath = parser4.getNodePath;
|
|
23725
|
-
exports3.getNodeValue = parser4.getNodeValue;
|
|
23726
|
-
exports3.visit = parser4.visit;
|
|
23727
|
-
exports3.stripComments = parser4.stripComments;
|
|
23728
|
-
var ParseErrorCode;
|
|
23729
|
-
(function(ParseErrorCode2) {
|
|
23730
|
-
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
23731
|
-
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
23732
|
-
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
23733
|
-
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
23734
|
-
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
23735
|
-
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
23736
|
-
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
23737
|
-
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
23738
|
-
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
23739
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
23740
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
23741
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
23742
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
23743
|
-
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
23744
|
-
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
23745
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
23746
|
-
})(ParseErrorCode || (exports3.ParseErrorCode = ParseErrorCode = {}));
|
|
23747
|
-
function printParseErrorCode(code2) {
|
|
23748
|
-
switch (code2) {
|
|
23749
|
-
case 1:
|
|
23750
|
-
return "InvalidSymbol";
|
|
23751
|
-
case 2:
|
|
23752
|
-
return "InvalidNumberFormat";
|
|
23753
|
-
case 3:
|
|
23754
|
-
return "PropertyNameExpected";
|
|
23755
|
-
case 4:
|
|
23756
|
-
return "ValueExpected";
|
|
23757
|
-
case 5:
|
|
23758
|
-
return "ColonExpected";
|
|
23759
|
-
case 6:
|
|
23760
|
-
return "CommaExpected";
|
|
23761
|
-
case 7:
|
|
23762
|
-
return "CloseBraceExpected";
|
|
23763
|
-
case 8:
|
|
23764
|
-
return "CloseBracketExpected";
|
|
23765
|
-
case 9:
|
|
23766
|
-
return "EndOfFileExpected";
|
|
23767
|
-
case 10:
|
|
23768
|
-
return "InvalidCommentToken";
|
|
23769
|
-
case 11:
|
|
23770
|
-
return "UnexpectedEndOfComment";
|
|
23771
|
-
case 12:
|
|
23772
|
-
return "UnexpectedEndOfString";
|
|
23773
|
-
case 13:
|
|
23774
|
-
return "UnexpectedEndOfNumber";
|
|
23775
|
-
case 14:
|
|
23776
|
-
return "InvalidUnicode";
|
|
23777
|
-
case 15:
|
|
23778
|
-
return "InvalidEscapeCharacter";
|
|
23779
|
-
case 16:
|
|
23780
|
-
return "InvalidCharacter";
|
|
23781
|
-
}
|
|
23782
|
-
return "<unknown ParseErrorCode>";
|
|
23783
|
-
}
|
|
23784
|
-
exports3.printParseErrorCode = printParseErrorCode;
|
|
23785
|
-
function format3(documentText, range3, options2) {
|
|
23786
|
-
return formatter.format(documentText, range3, options2);
|
|
23787
|
-
}
|
|
23788
|
-
exports3.format = format3;
|
|
23789
|
-
function modify2(text4, path44, value, options2) {
|
|
23790
|
-
return edit.setProperty(text4, path44, value, options2);
|
|
23791
|
-
}
|
|
23792
|
-
exports3.modify = modify2;
|
|
23793
|
-
function applyEdits2(text4, edits) {
|
|
23794
|
-
let sortedEdits = edits.slice(0).sort((a9, b10) => {
|
|
23795
|
-
const diff = a9.offset - b10.offset;
|
|
23796
|
-
if (diff === 0) {
|
|
23797
|
-
return a9.length - b10.length;
|
|
23798
|
-
}
|
|
23799
|
-
return diff;
|
|
23800
|
-
});
|
|
23801
|
-
let lastModifiedOffset = text4.length;
|
|
23802
|
-
for (let i10 = sortedEdits.length - 1; i10 >= 0; i10--) {
|
|
23803
|
-
let e9 = sortedEdits[i10];
|
|
23804
|
-
if (e9.offset + e9.length <= lastModifiedOffset) {
|
|
23805
|
-
text4 = edit.applyEdit(text4, e9);
|
|
23806
|
-
} else {
|
|
23807
|
-
throw new Error("Overlapping edit");
|
|
23808
|
-
}
|
|
23809
|
-
lastModifiedOffset = e9.offset;
|
|
23810
|
-
}
|
|
23811
|
-
return text4;
|
|
23812
|
-
}
|
|
23813
|
-
exports3.applyEdits = applyEdits2;
|
|
23814
|
-
});
|
|
23815
|
-
}
|
|
23816
|
-
});
|
|
23817
|
-
|
|
23818
23670
|
// ../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/xhtml.js
|
|
23819
23671
|
var require_xhtml = __commonJS({
|
|
23820
23672
|
"../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/xhtml.js"(exports2, module2) {
|
|
@@ -24551,7 +24403,7 @@ var require_acorn = __commonJS({
|
|
|
24551
24403
|
this.privateNameStack = [];
|
|
24552
24404
|
};
|
|
24553
24405
|
var prototypeAccessors2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
24554
|
-
Parser3.prototype.parse = function
|
|
24406
|
+
Parser3.prototype.parse = function parse8() {
|
|
24555
24407
|
var node2 = this.options.program || this.startNode();
|
|
24556
24408
|
this.nextToken();
|
|
24557
24409
|
return this.parseTopLevel(node2);
|
|
@@ -24631,7 +24483,7 @@ var require_acorn = __commonJS({
|
|
|
24631
24483
|
}
|
|
24632
24484
|
return cls;
|
|
24633
24485
|
};
|
|
24634
|
-
Parser3.parse = function
|
|
24486
|
+
Parser3.parse = function parse8(input, options2) {
|
|
24635
24487
|
return new this(options2, input).parse();
|
|
24636
24488
|
};
|
|
24637
24489
|
Parser3.parseExpressionAt = function parseExpressionAt3(input, pos, options2) {
|
|
@@ -29706,7 +29558,7 @@ var require_acorn = __commonJS({
|
|
|
29706
29558
|
lineBreakG: lineBreakG2,
|
|
29707
29559
|
nonASCIIwhitespace: nonASCIIwhitespace2
|
|
29708
29560
|
};
|
|
29709
|
-
function
|
|
29561
|
+
function parse7(input, options2) {
|
|
29710
29562
|
return Parser3.parse(input, options2);
|
|
29711
29563
|
}
|
|
29712
29564
|
function parseExpressionAt2(input, pos, options2) {
|
|
@@ -29731,7 +29583,7 @@ var require_acorn = __commonJS({
|
|
|
29731
29583
|
exports3.lineBreak = lineBreak2;
|
|
29732
29584
|
exports3.lineBreakG = lineBreakG2;
|
|
29733
29585
|
exports3.nonASCIIwhitespace = nonASCIIwhitespace2;
|
|
29734
|
-
exports3.parse =
|
|
29586
|
+
exports3.parse = parse7;
|
|
29735
29587
|
exports3.parseExpressionAt = parseExpressionAt2;
|
|
29736
29588
|
exports3.tokContexts = types2;
|
|
29737
29589
|
exports3.tokTypes = types$12;
|
|
@@ -35080,17 +34932,17 @@ var init_split_header = __esm({
|
|
|
35080
34932
|
function nv(input) {
|
|
35081
34933
|
return new NumericValue(String(input), "bigDecimal");
|
|
35082
34934
|
}
|
|
35083
|
-
var
|
|
34935
|
+
var format2, NumericValue;
|
|
35084
34936
|
var init_NumericValue = __esm({
|
|
35085
34937
|
"../../node_modules/.pnpm/@smithy+core@3.23.12/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() {
|
|
35086
|
-
|
|
34938
|
+
format2 = /^-?\d*(\.\d+)?$/;
|
|
35087
34939
|
NumericValue = class _NumericValue {
|
|
35088
34940
|
string;
|
|
35089
34941
|
type;
|
|
35090
34942
|
constructor(string3, type) {
|
|
35091
34943
|
this.string = string3;
|
|
35092
34944
|
this.type = type;
|
|
35093
|
-
if (!
|
|
34945
|
+
if (!format2.test(string3)) {
|
|
35094
34946
|
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
35095
34947
|
}
|
|
35096
34948
|
}
|
|
@@ -35102,7 +34954,7 @@ var init_NumericValue = __esm({
|
|
|
35102
34954
|
return false;
|
|
35103
34955
|
}
|
|
35104
34956
|
const _nv = object;
|
|
35105
|
-
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" &&
|
|
34957
|
+
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format2.test(_nv.string);
|
|
35106
34958
|
}
|
|
35107
34959
|
};
|
|
35108
34960
|
}
|
|
@@ -36095,8 +35947,8 @@ var init_FromStringShapeDeserializer = __esm({
|
|
|
36095
35947
|
return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(data4);
|
|
36096
35948
|
}
|
|
36097
35949
|
if (ns.isTimestampSchema()) {
|
|
36098
|
-
const
|
|
36099
|
-
switch (
|
|
35950
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
35951
|
+
switch (format4) {
|
|
36100
35952
|
case 5:
|
|
36101
35953
|
return _parseRfc3339DateTimeWithOffset(data4);
|
|
36102
35954
|
case 6:
|
|
@@ -36219,8 +36071,8 @@ var init_ToStringShapeSerializer = __esm({
|
|
|
36219
36071
|
if (!(value instanceof Date)) {
|
|
36220
36072
|
throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
36221
36073
|
}
|
|
36222
|
-
const
|
|
36223
|
-
switch (
|
|
36074
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
36075
|
+
switch (format4) {
|
|
36224
36076
|
case 5:
|
|
36225
36077
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
36226
36078
|
break;
|
|
@@ -40922,8 +40774,8 @@ var init_JsonShapeDeserializer = __esm({
|
|
|
40922
40774
|
return value;
|
|
40923
40775
|
}
|
|
40924
40776
|
if (ns.isTimestampSchema() && value != null) {
|
|
40925
|
-
const
|
|
40926
|
-
switch (
|
|
40777
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
40778
|
+
switch (format4) {
|
|
40927
40779
|
case 5:
|
|
40928
40780
|
return parseRfc3339DateTimeWithOffset(value);
|
|
40929
40781
|
case 6:
|
|
@@ -41143,8 +40995,8 @@ var init_JsonShapeSerializer = __esm({
|
|
|
41143
40995
|
return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value);
|
|
41144
40996
|
}
|
|
41145
40997
|
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
41146
|
-
const
|
|
41147
|
-
switch (
|
|
40998
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
40999
|
+
switch (format4) {
|
|
41148
41000
|
case 5:
|
|
41149
41001
|
return value.toISOString().replace(".000Z", "Z");
|
|
41150
41002
|
case 6:
|
|
@@ -43422,8 +43274,8 @@ var init_QueryShapeSerializer = __esm({
|
|
|
43422
43274
|
} else if (ns.isTimestampSchema()) {
|
|
43423
43275
|
if (value instanceof Date) {
|
|
43424
43276
|
this.writeKey(prefix);
|
|
43425
|
-
const
|
|
43426
|
-
switch (
|
|
43277
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
43278
|
+
switch (format4) {
|
|
43427
43279
|
case 5:
|
|
43428
43280
|
this.writeValue(value.toISOString().replace(".000Z", "Z"));
|
|
43429
43281
|
break;
|
|
@@ -43995,8 +43847,8 @@ var init_XmlShapeSerializer = __esm({
|
|
|
43995
43847
|
if (ns.isBlobSchema()) {
|
|
43996
43848
|
nodeContents = (this.serdeContext?.base64Encoder ?? import_util_base647.toBase64)(value);
|
|
43997
43849
|
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
43998
|
-
const
|
|
43999
|
-
switch (
|
|
43850
|
+
const format4 = determineTimestampFormat(ns, this.settings);
|
|
43851
|
+
switch (format4) {
|
|
44000
43852
|
case 5:
|
|
44001
43853
|
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
44002
43854
|
break;
|
|
@@ -55070,17 +54922,17 @@ var init_split_header2 = __esm({
|
|
|
55070
54922
|
function nv2(input) {
|
|
55071
54923
|
return new NumericValue2(String(input), "bigDecimal");
|
|
55072
54924
|
}
|
|
55073
|
-
var
|
|
54925
|
+
var format3, NumericValue2;
|
|
55074
54926
|
var init_NumericValue2 = __esm({
|
|
55075
54927
|
"../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() {
|
|
55076
|
-
|
|
54928
|
+
format3 = /^-?\d*(\.\d+)?$/;
|
|
55077
54929
|
NumericValue2 = class _NumericValue {
|
|
55078
54930
|
string;
|
|
55079
54931
|
type;
|
|
55080
54932
|
constructor(string3, type) {
|
|
55081
54933
|
this.string = string3;
|
|
55082
54934
|
this.type = type;
|
|
55083
|
-
if (!
|
|
54935
|
+
if (!format3.test(string3)) {
|
|
55084
54936
|
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
55085
54937
|
}
|
|
55086
54938
|
}
|
|
@@ -55092,7 +54944,7 @@ var init_NumericValue2 = __esm({
|
|
|
55092
54944
|
return false;
|
|
55093
54945
|
}
|
|
55094
54946
|
const _nv = object;
|
|
55095
|
-
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" &&
|
|
54947
|
+
return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format3.test(_nv.string);
|
|
55096
54948
|
}
|
|
55097
54949
|
};
|
|
55098
54950
|
}
|
|
@@ -62876,8 +62728,8 @@ var init_FromStringShapeDeserializer2 = __esm({
|
|
|
62876
62728
|
return (this.serdeContext?.base64Decoder ?? fromBase649)(data4);
|
|
62877
62729
|
}
|
|
62878
62730
|
if (ns.isTimestampSchema()) {
|
|
62879
|
-
const
|
|
62880
|
-
switch (
|
|
62731
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
62732
|
+
switch (format4) {
|
|
62881
62733
|
case 5:
|
|
62882
62734
|
return _parseRfc3339DateTimeWithOffset2(data4);
|
|
62883
62735
|
case 6:
|
|
@@ -62999,8 +62851,8 @@ var init_ToStringShapeSerializer2 = __esm({
|
|
|
62999
62851
|
if (!(value instanceof Date)) {
|
|
63000
62852
|
throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
63001
62853
|
}
|
|
63002
|
-
const
|
|
63003
|
-
switch (
|
|
62854
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
62855
|
+
switch (format4) {
|
|
63004
62856
|
case 5:
|
|
63005
62857
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
63006
62858
|
break;
|
|
@@ -66236,8 +66088,8 @@ var init_createUserAgentStringParsingProvider = __esm({
|
|
|
66236
66088
|
"../../node_modules/.pnpm/@aws-sdk+core@3.976.0/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.js"() {
|
|
66237
66089
|
createUserAgentStringParsingProvider = ({ serviceId, clientVersion }) => async (config) => {
|
|
66238
66090
|
const module2 = await Promise.resolve().then(() => __toESM(require_es5()));
|
|
66239
|
-
const
|
|
66240
|
-
const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ?
|
|
66091
|
+
const parse7 = module2.parse ?? module2.default.parse ?? (() => "");
|
|
66092
|
+
const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ? parse7(window.navigator.userAgent) : void 0;
|
|
66241
66093
|
const sections = [
|
|
66242
66094
|
["aws-sdk-js", clientVersion],
|
|
66243
66095
|
["ua", "2.1"],
|
|
@@ -69188,8 +69040,8 @@ var init_JsonShapeDeserializer2 = __esm({
|
|
|
69188
69040
|
return value;
|
|
69189
69041
|
}
|
|
69190
69042
|
if (ns.isTimestampSchema() && value != null) {
|
|
69191
|
-
const
|
|
69192
|
-
switch (
|
|
69043
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
69044
|
+
switch (format4) {
|
|
69193
69045
|
case 5:
|
|
69194
69046
|
return parseRfc3339DateTimeWithOffset2(value);
|
|
69195
69047
|
case 6:
|
|
@@ -69413,8 +69265,8 @@ var init_JsonShapeSerializer2 = __esm({
|
|
|
69413
69265
|
return (this.serdeContext?.base64Encoder ?? toBase649)(value);
|
|
69414
69266
|
}
|
|
69415
69267
|
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
69416
|
-
const
|
|
69417
|
-
switch (
|
|
69268
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
69269
|
+
switch (format4) {
|
|
69418
69270
|
case 5:
|
|
69419
69271
|
return value.toISOString().replace(".000Z", "Z");
|
|
69420
69272
|
case 6:
|
|
@@ -70313,8 +70165,8 @@ var init_QueryShapeSerializer2 = __esm({
|
|
|
70313
70165
|
} else if (ns.isTimestampSchema()) {
|
|
70314
70166
|
if (value instanceof Date) {
|
|
70315
70167
|
this.writeKey(prefix);
|
|
70316
|
-
const
|
|
70317
|
-
switch (
|
|
70168
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
70169
|
+
switch (format4) {
|
|
70318
70170
|
case 5:
|
|
70319
70171
|
this.writeValue(value.toISOString().replace(".000Z", "Z"));
|
|
70320
70172
|
break;
|
|
@@ -70877,8 +70729,8 @@ var init_XmlShapeSerializer2 = __esm({
|
|
|
70877
70729
|
if (ns.isBlobSchema()) {
|
|
70878
70730
|
nodeContents = (this.serdeContext?.base64Encoder ?? toBase649)(value);
|
|
70879
70731
|
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
70880
|
-
const
|
|
70881
|
-
switch (
|
|
70732
|
+
const format4 = determineTimestampFormat2(ns, this.settings);
|
|
70733
|
+
switch (format4) {
|
|
70882
70734
|
case 5:
|
|
70883
70735
|
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
70884
70736
|
break;
|
|
@@ -86373,7 +86225,7 @@ var require_parse2 = __commonJS({
|
|
|
86373
86225
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
86374
86226
|
"use strict";
|
|
86375
86227
|
var SemVer = require_semver();
|
|
86376
|
-
var
|
|
86228
|
+
var parse7 = (version2, options2, throwErrors = false) => {
|
|
86377
86229
|
if (version2 instanceof SemVer) {
|
|
86378
86230
|
return version2;
|
|
86379
86231
|
}
|
|
@@ -86386,7 +86238,7 @@ var require_parse2 = __commonJS({
|
|
|
86386
86238
|
throw er;
|
|
86387
86239
|
}
|
|
86388
86240
|
};
|
|
86389
|
-
module2.exports =
|
|
86241
|
+
module2.exports = parse7;
|
|
86390
86242
|
}
|
|
86391
86243
|
});
|
|
86392
86244
|
|
|
@@ -86394,9 +86246,9 @@ var require_parse2 = __commonJS({
|
|
|
86394
86246
|
var require_valid = __commonJS({
|
|
86395
86247
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
86396
86248
|
"use strict";
|
|
86397
|
-
var
|
|
86249
|
+
var parse7 = require_parse2();
|
|
86398
86250
|
var valid = (version2, options2) => {
|
|
86399
|
-
const v5 =
|
|
86251
|
+
const v5 = parse7(version2, options2);
|
|
86400
86252
|
return v5 ? v5.version : null;
|
|
86401
86253
|
};
|
|
86402
86254
|
module2.exports = valid;
|
|
@@ -86407,9 +86259,9 @@ var require_valid = __commonJS({
|
|
|
86407
86259
|
var require_clean = __commonJS({
|
|
86408
86260
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
86409
86261
|
"use strict";
|
|
86410
|
-
var
|
|
86262
|
+
var parse7 = require_parse2();
|
|
86411
86263
|
var clean = (version2, options2) => {
|
|
86412
|
-
const s7 =
|
|
86264
|
+
const s7 = parse7(version2.trim().replace(/^[=v]+/, ""), options2);
|
|
86413
86265
|
return s7 ? s7.version : null;
|
|
86414
86266
|
};
|
|
86415
86267
|
module2.exports = clean;
|
|
@@ -86444,10 +86296,10 @@ var require_inc = __commonJS({
|
|
|
86444
86296
|
var require_diff = __commonJS({
|
|
86445
86297
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
86446
86298
|
"use strict";
|
|
86447
|
-
var
|
|
86299
|
+
var parse7 = require_parse2();
|
|
86448
86300
|
var diff = (version1, version2) => {
|
|
86449
|
-
const v1 =
|
|
86450
|
-
const v22 =
|
|
86301
|
+
const v1 = parse7(version1, null, true);
|
|
86302
|
+
const v22 = parse7(version2, null, true);
|
|
86451
86303
|
const comparison = v1.compare(v22);
|
|
86452
86304
|
if (comparison === 0) {
|
|
86453
86305
|
return null;
|
|
@@ -86518,9 +86370,9 @@ var require_patch = __commonJS({
|
|
|
86518
86370
|
var require_prerelease = __commonJS({
|
|
86519
86371
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
86520
86372
|
"use strict";
|
|
86521
|
-
var
|
|
86373
|
+
var parse7 = require_parse2();
|
|
86522
86374
|
var prerelease = (version2, options2) => {
|
|
86523
|
-
const parsed =
|
|
86375
|
+
const parsed = parse7(version2, options2);
|
|
86524
86376
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
86525
86377
|
};
|
|
86526
86378
|
module2.exports = prerelease;
|
|
@@ -86706,7 +86558,7 @@ var require_coerce = __commonJS({
|
|
|
86706
86558
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
86707
86559
|
"use strict";
|
|
86708
86560
|
var SemVer = require_semver();
|
|
86709
|
-
var
|
|
86561
|
+
var parse7 = require_parse2();
|
|
86710
86562
|
var { safeRe: re, t: t6 } = require_re();
|
|
86711
86563
|
var coerce2 = (version2, options2) => {
|
|
86712
86564
|
if (version2 instanceof SemVer) {
|
|
@@ -86741,7 +86593,7 @@ var require_coerce = __commonJS({
|
|
|
86741
86593
|
const patch = match2[4] || "0";
|
|
86742
86594
|
const prerelease = options2.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
|
86743
86595
|
const build = options2.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
|
86744
|
-
return
|
|
86596
|
+
return parse7(`${major}.${minor}.${patch}${prerelease}${build}`, options2);
|
|
86745
86597
|
};
|
|
86746
86598
|
module2.exports = coerce2;
|
|
86747
86599
|
}
|
|
@@ -86751,7 +86603,7 @@ var require_coerce = __commonJS({
|
|
|
86751
86603
|
var require_truncate = __commonJS({
|
|
86752
86604
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
86753
86605
|
"use strict";
|
|
86754
|
-
var
|
|
86606
|
+
var parse7 = require_parse2();
|
|
86755
86607
|
var constants2 = require_constants2();
|
|
86756
86608
|
var SemVer = require_semver();
|
|
86757
86609
|
var truncate2 = (version2, truncation, options2) => {
|
|
@@ -86763,7 +86615,7 @@ var require_truncate = __commonJS({
|
|
|
86763
86615
|
};
|
|
86764
86616
|
var cloneInputVersion = (version2, options2) => {
|
|
86765
86617
|
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
86766
|
-
return
|
|
86618
|
+
return parse7(versionStringToParse, options2);
|
|
86767
86619
|
};
|
|
86768
86620
|
var doTruncation = (version2, truncation) => {
|
|
86769
86621
|
if (isPrerelease(truncation)) {
|
|
@@ -87807,7 +87659,7 @@ var require_semver2 = __commonJS({
|
|
|
87807
87659
|
var constants2 = require_constants2();
|
|
87808
87660
|
var SemVer = require_semver();
|
|
87809
87661
|
var identifiers = require_identifiers();
|
|
87810
|
-
var
|
|
87662
|
+
var parse7 = require_parse2();
|
|
87811
87663
|
var valid = require_valid();
|
|
87812
87664
|
var clean = require_clean();
|
|
87813
87665
|
var inc = require_inc();
|
|
@@ -87846,7 +87698,7 @@ var require_semver2 = __commonJS({
|
|
|
87846
87698
|
var simplifyRange = require_simplify();
|
|
87847
87699
|
var subset = require_subset();
|
|
87848
87700
|
module2.exports = {
|
|
87849
|
-
parse:
|
|
87701
|
+
parse: parse7,
|
|
87850
87702
|
valid,
|
|
87851
87703
|
clean,
|
|
87852
87704
|
inc,
|
|
@@ -92229,7 +92081,7 @@ function parseStringResponse(result, parsers12, texts, trim = true) {
|
|
|
92229
92081
|
}
|
|
92230
92082
|
return lines[i10 + offset2];
|
|
92231
92083
|
};
|
|
92232
|
-
parsers12.some(({ parse:
|
|
92084
|
+
parsers12.some(({ parse: parse7 }) => parse7(line, result));
|
|
92233
92085
|
}
|
|
92234
92086
|
});
|
|
92235
92087
|
return result;
|
|
@@ -93594,9 +93446,9 @@ var init_init = __esm2({
|
|
|
93594
93446
|
});
|
|
93595
93447
|
function logFormatFromCommand(customArgs) {
|
|
93596
93448
|
for (let i10 = 0; i10 < customArgs.length; i10++) {
|
|
93597
|
-
const
|
|
93598
|
-
if (
|
|
93599
|
-
return `--${
|
|
93449
|
+
const format4 = logFormatRegex.exec(customArgs[i10]);
|
|
93450
|
+
if (format4) {
|
|
93451
|
+
return `--${format4[1]}`;
|
|
93600
93452
|
}
|
|
93601
93453
|
}
|
|
93602
93454
|
return "";
|
|
@@ -93625,8 +93477,8 @@ var init_DiffSummary = __esm2({
|
|
|
93625
93477
|
};
|
|
93626
93478
|
}
|
|
93627
93479
|
});
|
|
93628
|
-
function getDiffParser(
|
|
93629
|
-
const parser4 = diffSummaryParsers[
|
|
93480
|
+
function getDiffParser(format4 = "") {
|
|
93481
|
+
const parser4 = diffSummaryParsers[format4];
|
|
93630
93482
|
return (stdOut) => parseStringResponse(new DiffSummary(), parser4, stdOut, false);
|
|
93631
93483
|
}
|
|
93632
93484
|
var statParser;
|
|
@@ -93845,12 +93697,12 @@ var init_diff = __esm2({
|
|
|
93845
93697
|
init_task();
|
|
93846
93698
|
}
|
|
93847
93699
|
});
|
|
93848
|
-
function prettyFormat(
|
|
93700
|
+
function prettyFormat(format4, splitter) {
|
|
93849
93701
|
const fields = [];
|
|
93850
93702
|
const formatStr = [];
|
|
93851
|
-
Object.keys(
|
|
93703
|
+
Object.keys(format4).forEach((field) => {
|
|
93852
93704
|
fields.push(field);
|
|
93853
|
-
formatStr.push(String(
|
|
93705
|
+
formatStr.push(String(format4[field]));
|
|
93854
93706
|
});
|
|
93855
93707
|
return [fields, formatStr.join(splitter)];
|
|
93856
93708
|
}
|
|
@@ -93864,7 +93716,7 @@ function userOptions(input) {
|
|
|
93864
93716
|
}
|
|
93865
93717
|
function parseLogOptions(opt = {}, customArgs = []) {
|
|
93866
93718
|
const splitter = filterType(opt.splitter, filterString, SPLITTER);
|
|
93867
|
-
const
|
|
93719
|
+
const format4 = filterPlainObject(opt.format) ? opt.format : {
|
|
93868
93720
|
hash: "%H",
|
|
93869
93721
|
date: opt.strictDate === false ? "%ai" : "%aI",
|
|
93870
93722
|
message: "%s",
|
|
@@ -93873,7 +93725,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
|
|
|
93873
93725
|
author_name: opt.mailMap !== false ? "%aN" : "%an",
|
|
93874
93726
|
author_email: opt.mailMap !== false ? "%aE" : "%ae"
|
|
93875
93727
|
};
|
|
93876
|
-
const [fields, formatStr] = prettyFormat(
|
|
93728
|
+
const [fields, formatStr] = prettyFormat(format4, splitter);
|
|
93877
93729
|
const suffix = [];
|
|
93878
93730
|
const command5 = [
|
|
93879
93731
|
`--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,
|
|
@@ -95829,7 +95681,7 @@ var require_git = __commonJS2({
|
|
|
95829
95681
|
Git2.prototype.binaryCatFile = function() {
|
|
95830
95682
|
return this._catFile("buffer", arguments);
|
|
95831
95683
|
};
|
|
95832
|
-
Git2.prototype._catFile = function(
|
|
95684
|
+
Git2.prototype._catFile = function(format4, args) {
|
|
95833
95685
|
var handler = trailingFunctionArgument2(args);
|
|
95834
95686
|
var command5 = ["cat-file"];
|
|
95835
95687
|
var options2 = args[0];
|
|
@@ -95842,7 +95694,7 @@ var require_git = __commonJS2({
|
|
|
95842
95694
|
if (Array.isArray(options2)) {
|
|
95843
95695
|
command5.push.apply(command5, options2);
|
|
95844
95696
|
}
|
|
95845
|
-
const task =
|
|
95697
|
+
const task = format4 === "buffer" ? straightThroughBufferTask2(command5) : straightThroughStringTask2(command5);
|
|
95846
95698
|
return this._runTask(task, handler);
|
|
95847
95699
|
};
|
|
95848
95700
|
Git2.prototype.diff = function(options2, then) {
|
|
@@ -96443,10 +96295,10 @@ var parseTypedFilename = (filename, entryTypes) => {
|
|
|
96443
96295
|
};
|
|
96444
96296
|
|
|
96445
96297
|
// ../canopycms/src/utils/format.ts
|
|
96446
|
-
var getFormatExtension = (
|
|
96447
|
-
if (
|
|
96448
|
-
if (
|
|
96449
|
-
if (
|
|
96298
|
+
var getFormatExtension = (format4) => {
|
|
96299
|
+
if (format4 === "md") return ".md";
|
|
96300
|
+
if (format4 === "mdx") return ".mdx";
|
|
96301
|
+
if (format4 === "yaml") return ".yaml";
|
|
96450
96302
|
return ".json";
|
|
96451
96303
|
};
|
|
96452
96304
|
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
@@ -96458,7 +96310,7 @@ function toLogicalCollectionPath(physicalPath) {
|
|
|
96458
96310
|
return physicalPath.split("/").map((seg) => extractSlugFromFilename(seg)).join("/");
|
|
96459
96311
|
}
|
|
96460
96312
|
var ENTRY_EXTENSIONS = new Set(
|
|
96461
|
-
Object.keys({ md: true, mdx: true, json: true, yaml: true }).map((
|
|
96313
|
+
Object.keys({ md: true, mdx: true, json: true, yaml: true }).map((format4) => getFormatExtension(format4))
|
|
96462
96314
|
);
|
|
96463
96315
|
function entryLogicalPathOfFile(relativePath, contentRoot) {
|
|
96464
96316
|
const root5 = normalizeFilesystemPath(contentRoot);
|
|
@@ -97772,11 +97624,11 @@ async function list(dir) {
|
|
|
97772
97624
|
throw err;
|
|
97773
97625
|
});
|
|
97774
97626
|
}
|
|
97775
|
-
async function walk(dir,
|
|
97627
|
+
async function walk(dir, visit5) {
|
|
97776
97628
|
for (const entry of await list(dir)) {
|
|
97777
97629
|
const full = path9.join(dir, entry.name);
|
|
97778
|
-
if (entry.isDirectory()) await walk(full,
|
|
97779
|
-
else await
|
|
97630
|
+
if (entry.isDirectory()) await walk(full, visit5);
|
|
97631
|
+
else await visit5(full);
|
|
97780
97632
|
}
|
|
97781
97633
|
}
|
|
97782
97634
|
|
|
@@ -100828,7 +100680,7 @@ init_error();
|
|
|
100828
100680
|
init_worker_status();
|
|
100829
100681
|
|
|
100830
100682
|
// ../canopycms/src/version.ts
|
|
100831
|
-
var CANOPYCMS_VERSION = "0.14.
|
|
100683
|
+
var CANOPYCMS_VERSION = "0.14.1";
|
|
100832
100684
|
|
|
100833
100685
|
// ../canopycms/src/worker/schema-gate.ts
|
|
100834
100686
|
import fs15 from "node:fs/promises";
|
|
@@ -103331,8 +103183,1337 @@ init_item_keys();
|
|
|
103331
103183
|
init_error();
|
|
103332
103184
|
|
|
103333
103185
|
// ../canopycms/src/utils/json-source-splice.ts
|
|
103334
|
-
var import_jsonc_parser = __toESM(require_main(), 1);
|
|
103335
103186
|
import { isDeepStrictEqual } from "node:util";
|
|
103187
|
+
|
|
103188
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
103189
|
+
function createScanner(text4, ignoreTrivia = false) {
|
|
103190
|
+
const len = text4.length;
|
|
103191
|
+
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
103192
|
+
function scanHexDigits(count, exact) {
|
|
103193
|
+
let digits = 0;
|
|
103194
|
+
let value2 = 0;
|
|
103195
|
+
while (digits < count || !exact) {
|
|
103196
|
+
let ch = text4.charCodeAt(pos);
|
|
103197
|
+
if (ch >= 48 && ch <= 57) {
|
|
103198
|
+
value2 = value2 * 16 + ch - 48;
|
|
103199
|
+
} else if (ch >= 65 && ch <= 70) {
|
|
103200
|
+
value2 = value2 * 16 + ch - 65 + 10;
|
|
103201
|
+
} else if (ch >= 97 && ch <= 102) {
|
|
103202
|
+
value2 = value2 * 16 + ch - 97 + 10;
|
|
103203
|
+
} else {
|
|
103204
|
+
break;
|
|
103205
|
+
}
|
|
103206
|
+
pos++;
|
|
103207
|
+
digits++;
|
|
103208
|
+
}
|
|
103209
|
+
if (digits < count) {
|
|
103210
|
+
value2 = -1;
|
|
103211
|
+
}
|
|
103212
|
+
return value2;
|
|
103213
|
+
}
|
|
103214
|
+
function setPosition(newPosition) {
|
|
103215
|
+
pos = newPosition;
|
|
103216
|
+
value = "";
|
|
103217
|
+
tokenOffset = 0;
|
|
103218
|
+
token = 16;
|
|
103219
|
+
scanError = 0;
|
|
103220
|
+
}
|
|
103221
|
+
function scanNumber() {
|
|
103222
|
+
let start2 = pos;
|
|
103223
|
+
if (text4.charCodeAt(pos) === 48) {
|
|
103224
|
+
pos++;
|
|
103225
|
+
} else {
|
|
103226
|
+
pos++;
|
|
103227
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103228
|
+
pos++;
|
|
103229
|
+
}
|
|
103230
|
+
}
|
|
103231
|
+
if (pos < text4.length && text4.charCodeAt(pos) === 46) {
|
|
103232
|
+
pos++;
|
|
103233
|
+
if (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103234
|
+
pos++;
|
|
103235
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103236
|
+
pos++;
|
|
103237
|
+
}
|
|
103238
|
+
} else {
|
|
103239
|
+
scanError = 3;
|
|
103240
|
+
return text4.substring(start2, pos);
|
|
103241
|
+
}
|
|
103242
|
+
}
|
|
103243
|
+
let end = pos;
|
|
103244
|
+
if (pos < text4.length && (text4.charCodeAt(pos) === 69 || text4.charCodeAt(pos) === 101)) {
|
|
103245
|
+
pos++;
|
|
103246
|
+
if (pos < text4.length && text4.charCodeAt(pos) === 43 || text4.charCodeAt(pos) === 45) {
|
|
103247
|
+
pos++;
|
|
103248
|
+
}
|
|
103249
|
+
if (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103250
|
+
pos++;
|
|
103251
|
+
while (pos < text4.length && isDigit(text4.charCodeAt(pos))) {
|
|
103252
|
+
pos++;
|
|
103253
|
+
}
|
|
103254
|
+
end = pos;
|
|
103255
|
+
} else {
|
|
103256
|
+
scanError = 3;
|
|
103257
|
+
}
|
|
103258
|
+
}
|
|
103259
|
+
return text4.substring(start2, end);
|
|
103260
|
+
}
|
|
103261
|
+
function scanString() {
|
|
103262
|
+
let result = "", start2 = pos;
|
|
103263
|
+
while (true) {
|
|
103264
|
+
if (pos >= len) {
|
|
103265
|
+
result += text4.substring(start2, pos);
|
|
103266
|
+
scanError = 2;
|
|
103267
|
+
break;
|
|
103268
|
+
}
|
|
103269
|
+
const ch = text4.charCodeAt(pos);
|
|
103270
|
+
if (ch === 34) {
|
|
103271
|
+
result += text4.substring(start2, pos);
|
|
103272
|
+
pos++;
|
|
103273
|
+
break;
|
|
103274
|
+
}
|
|
103275
|
+
if (ch === 92) {
|
|
103276
|
+
result += text4.substring(start2, pos);
|
|
103277
|
+
pos++;
|
|
103278
|
+
if (pos >= len) {
|
|
103279
|
+
scanError = 2;
|
|
103280
|
+
break;
|
|
103281
|
+
}
|
|
103282
|
+
const ch2 = text4.charCodeAt(pos++);
|
|
103283
|
+
switch (ch2) {
|
|
103284
|
+
case 34:
|
|
103285
|
+
result += '"';
|
|
103286
|
+
break;
|
|
103287
|
+
case 92:
|
|
103288
|
+
result += "\\";
|
|
103289
|
+
break;
|
|
103290
|
+
case 47:
|
|
103291
|
+
result += "/";
|
|
103292
|
+
break;
|
|
103293
|
+
case 98:
|
|
103294
|
+
result += "\b";
|
|
103295
|
+
break;
|
|
103296
|
+
case 102:
|
|
103297
|
+
result += "\f";
|
|
103298
|
+
break;
|
|
103299
|
+
case 110:
|
|
103300
|
+
result += "\n";
|
|
103301
|
+
break;
|
|
103302
|
+
case 114:
|
|
103303
|
+
result += "\r";
|
|
103304
|
+
break;
|
|
103305
|
+
case 116:
|
|
103306
|
+
result += " ";
|
|
103307
|
+
break;
|
|
103308
|
+
case 117:
|
|
103309
|
+
const ch3 = scanHexDigits(4, true);
|
|
103310
|
+
if (ch3 >= 0) {
|
|
103311
|
+
result += String.fromCharCode(ch3);
|
|
103312
|
+
} else {
|
|
103313
|
+
scanError = 4;
|
|
103314
|
+
}
|
|
103315
|
+
break;
|
|
103316
|
+
default:
|
|
103317
|
+
scanError = 5;
|
|
103318
|
+
}
|
|
103319
|
+
start2 = pos;
|
|
103320
|
+
continue;
|
|
103321
|
+
}
|
|
103322
|
+
if (ch >= 0 && ch <= 31) {
|
|
103323
|
+
if (isLineBreak(ch)) {
|
|
103324
|
+
result += text4.substring(start2, pos);
|
|
103325
|
+
scanError = 2;
|
|
103326
|
+
break;
|
|
103327
|
+
} else {
|
|
103328
|
+
scanError = 6;
|
|
103329
|
+
}
|
|
103330
|
+
}
|
|
103331
|
+
pos++;
|
|
103332
|
+
}
|
|
103333
|
+
return result;
|
|
103334
|
+
}
|
|
103335
|
+
function scanNext() {
|
|
103336
|
+
value = "";
|
|
103337
|
+
scanError = 0;
|
|
103338
|
+
tokenOffset = pos;
|
|
103339
|
+
lineStartOffset = lineNumber;
|
|
103340
|
+
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
103341
|
+
if (pos >= len) {
|
|
103342
|
+
tokenOffset = len;
|
|
103343
|
+
return token = 17;
|
|
103344
|
+
}
|
|
103345
|
+
let code2 = text4.charCodeAt(pos);
|
|
103346
|
+
if (isWhiteSpace(code2)) {
|
|
103347
|
+
do {
|
|
103348
|
+
pos++;
|
|
103349
|
+
value += String.fromCharCode(code2);
|
|
103350
|
+
code2 = text4.charCodeAt(pos);
|
|
103351
|
+
} while (isWhiteSpace(code2));
|
|
103352
|
+
return token = 15;
|
|
103353
|
+
}
|
|
103354
|
+
if (isLineBreak(code2)) {
|
|
103355
|
+
pos++;
|
|
103356
|
+
value += String.fromCharCode(code2);
|
|
103357
|
+
if (code2 === 13 && text4.charCodeAt(pos) === 10) {
|
|
103358
|
+
pos++;
|
|
103359
|
+
value += "\n";
|
|
103360
|
+
}
|
|
103361
|
+
lineNumber++;
|
|
103362
|
+
tokenLineStartOffset = pos;
|
|
103363
|
+
return token = 14;
|
|
103364
|
+
}
|
|
103365
|
+
switch (code2) {
|
|
103366
|
+
// tokens: []{}:,
|
|
103367
|
+
case 123:
|
|
103368
|
+
pos++;
|
|
103369
|
+
return token = 1;
|
|
103370
|
+
case 125:
|
|
103371
|
+
pos++;
|
|
103372
|
+
return token = 2;
|
|
103373
|
+
case 91:
|
|
103374
|
+
pos++;
|
|
103375
|
+
return token = 3;
|
|
103376
|
+
case 93:
|
|
103377
|
+
pos++;
|
|
103378
|
+
return token = 4;
|
|
103379
|
+
case 58:
|
|
103380
|
+
pos++;
|
|
103381
|
+
return token = 6;
|
|
103382
|
+
case 44:
|
|
103383
|
+
pos++;
|
|
103384
|
+
return token = 5;
|
|
103385
|
+
// strings
|
|
103386
|
+
case 34:
|
|
103387
|
+
pos++;
|
|
103388
|
+
value = scanString();
|
|
103389
|
+
return token = 10;
|
|
103390
|
+
// comments
|
|
103391
|
+
case 47:
|
|
103392
|
+
const start2 = pos - 1;
|
|
103393
|
+
if (text4.charCodeAt(pos + 1) === 47) {
|
|
103394
|
+
pos += 2;
|
|
103395
|
+
while (pos < len) {
|
|
103396
|
+
if (isLineBreak(text4.charCodeAt(pos))) {
|
|
103397
|
+
break;
|
|
103398
|
+
}
|
|
103399
|
+
pos++;
|
|
103400
|
+
}
|
|
103401
|
+
value = text4.substring(start2, pos);
|
|
103402
|
+
return token = 12;
|
|
103403
|
+
}
|
|
103404
|
+
if (text4.charCodeAt(pos + 1) === 42) {
|
|
103405
|
+
pos += 2;
|
|
103406
|
+
const safeLength = len - 1;
|
|
103407
|
+
let commentClosed = false;
|
|
103408
|
+
while (pos < safeLength) {
|
|
103409
|
+
const ch = text4.charCodeAt(pos);
|
|
103410
|
+
if (ch === 42 && text4.charCodeAt(pos + 1) === 47) {
|
|
103411
|
+
pos += 2;
|
|
103412
|
+
commentClosed = true;
|
|
103413
|
+
break;
|
|
103414
|
+
}
|
|
103415
|
+
pos++;
|
|
103416
|
+
if (isLineBreak(ch)) {
|
|
103417
|
+
if (ch === 13 && text4.charCodeAt(pos) === 10) {
|
|
103418
|
+
pos++;
|
|
103419
|
+
}
|
|
103420
|
+
lineNumber++;
|
|
103421
|
+
tokenLineStartOffset = pos;
|
|
103422
|
+
}
|
|
103423
|
+
}
|
|
103424
|
+
if (!commentClosed) {
|
|
103425
|
+
pos++;
|
|
103426
|
+
scanError = 1;
|
|
103427
|
+
}
|
|
103428
|
+
value = text4.substring(start2, pos);
|
|
103429
|
+
return token = 13;
|
|
103430
|
+
}
|
|
103431
|
+
value += String.fromCharCode(code2);
|
|
103432
|
+
pos++;
|
|
103433
|
+
return token = 16;
|
|
103434
|
+
// numbers
|
|
103435
|
+
case 45:
|
|
103436
|
+
value += String.fromCharCode(code2);
|
|
103437
|
+
pos++;
|
|
103438
|
+
if (pos === len || !isDigit(text4.charCodeAt(pos))) {
|
|
103439
|
+
return token = 16;
|
|
103440
|
+
}
|
|
103441
|
+
// found a minus, followed by a number so
|
|
103442
|
+
// we fall through to proceed with scanning
|
|
103443
|
+
// numbers
|
|
103444
|
+
case 48:
|
|
103445
|
+
case 49:
|
|
103446
|
+
case 50:
|
|
103447
|
+
case 51:
|
|
103448
|
+
case 52:
|
|
103449
|
+
case 53:
|
|
103450
|
+
case 54:
|
|
103451
|
+
case 55:
|
|
103452
|
+
case 56:
|
|
103453
|
+
case 57:
|
|
103454
|
+
value += scanNumber();
|
|
103455
|
+
return token = 11;
|
|
103456
|
+
// literals and unknown symbols
|
|
103457
|
+
default:
|
|
103458
|
+
while (pos < len && isUnknownContentCharacter(code2)) {
|
|
103459
|
+
pos++;
|
|
103460
|
+
code2 = text4.charCodeAt(pos);
|
|
103461
|
+
}
|
|
103462
|
+
if (tokenOffset !== pos) {
|
|
103463
|
+
value = text4.substring(tokenOffset, pos);
|
|
103464
|
+
switch (value) {
|
|
103465
|
+
case "true":
|
|
103466
|
+
return token = 8;
|
|
103467
|
+
case "false":
|
|
103468
|
+
return token = 9;
|
|
103469
|
+
case "null":
|
|
103470
|
+
return token = 7;
|
|
103471
|
+
}
|
|
103472
|
+
return token = 16;
|
|
103473
|
+
}
|
|
103474
|
+
value += String.fromCharCode(code2);
|
|
103475
|
+
pos++;
|
|
103476
|
+
return token = 16;
|
|
103477
|
+
}
|
|
103478
|
+
}
|
|
103479
|
+
function isUnknownContentCharacter(code2) {
|
|
103480
|
+
if (isWhiteSpace(code2) || isLineBreak(code2)) {
|
|
103481
|
+
return false;
|
|
103482
|
+
}
|
|
103483
|
+
switch (code2) {
|
|
103484
|
+
case 125:
|
|
103485
|
+
case 93:
|
|
103486
|
+
case 123:
|
|
103487
|
+
case 91:
|
|
103488
|
+
case 34:
|
|
103489
|
+
case 58:
|
|
103490
|
+
case 44:
|
|
103491
|
+
case 47:
|
|
103492
|
+
return false;
|
|
103493
|
+
}
|
|
103494
|
+
return true;
|
|
103495
|
+
}
|
|
103496
|
+
function scanNextNonTrivia() {
|
|
103497
|
+
let result;
|
|
103498
|
+
do {
|
|
103499
|
+
result = scanNext();
|
|
103500
|
+
} while (result >= 12 && result <= 15);
|
|
103501
|
+
return result;
|
|
103502
|
+
}
|
|
103503
|
+
return {
|
|
103504
|
+
setPosition,
|
|
103505
|
+
getPosition: () => pos,
|
|
103506
|
+
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
103507
|
+
getToken: () => token,
|
|
103508
|
+
getTokenValue: () => value,
|
|
103509
|
+
getTokenOffset: () => tokenOffset,
|
|
103510
|
+
getTokenLength: () => pos - tokenOffset,
|
|
103511
|
+
getTokenStartLine: () => lineStartOffset,
|
|
103512
|
+
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
103513
|
+
getTokenError: () => scanError
|
|
103514
|
+
};
|
|
103515
|
+
}
|
|
103516
|
+
function isWhiteSpace(ch) {
|
|
103517
|
+
return ch === 32 || ch === 9;
|
|
103518
|
+
}
|
|
103519
|
+
function isLineBreak(ch) {
|
|
103520
|
+
return ch === 10 || ch === 13;
|
|
103521
|
+
}
|
|
103522
|
+
function isDigit(ch) {
|
|
103523
|
+
return ch >= 48 && ch <= 57;
|
|
103524
|
+
}
|
|
103525
|
+
var CharacterCodes;
|
|
103526
|
+
(function(CharacterCodes2) {
|
|
103527
|
+
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
103528
|
+
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
103529
|
+
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
103530
|
+
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
103531
|
+
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
103532
|
+
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
103533
|
+
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
103534
|
+
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
103535
|
+
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
103536
|
+
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
103537
|
+
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
103538
|
+
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
103539
|
+
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
103540
|
+
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
103541
|
+
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
103542
|
+
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
103543
|
+
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
103544
|
+
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
103545
|
+
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
103546
|
+
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
103547
|
+
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
103548
|
+
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
103549
|
+
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
103550
|
+
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
103551
|
+
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
103552
|
+
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
103553
|
+
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
103554
|
+
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
103555
|
+
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
103556
|
+
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
103557
|
+
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
103558
|
+
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
103559
|
+
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
103560
|
+
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
103561
|
+
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
103562
|
+
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
103563
|
+
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
103564
|
+
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
103565
|
+
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
103566
|
+
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
103567
|
+
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
103568
|
+
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
103569
|
+
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
103570
|
+
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
103571
|
+
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
103572
|
+
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
103573
|
+
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
103574
|
+
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
103575
|
+
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
103576
|
+
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
103577
|
+
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
103578
|
+
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
103579
|
+
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
103580
|
+
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
103581
|
+
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
103582
|
+
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
103583
|
+
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
103584
|
+
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
103585
|
+
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
103586
|
+
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
103587
|
+
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
103588
|
+
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
103589
|
+
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
103590
|
+
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
103591
|
+
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
103592
|
+
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
103593
|
+
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
103594
|
+
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
103595
|
+
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
103596
|
+
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
103597
|
+
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
103598
|
+
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
103599
|
+
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
103600
|
+
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
103601
|
+
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
103602
|
+
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
103603
|
+
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
103604
|
+
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
103605
|
+
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
103606
|
+
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
103607
|
+
})(CharacterCodes || (CharacterCodes = {}));
|
|
103608
|
+
|
|
103609
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
103610
|
+
var cachedSpaces = new Array(20).fill(0).map((_3, index2) => {
|
|
103611
|
+
return " ".repeat(index2);
|
|
103612
|
+
});
|
|
103613
|
+
var maxCachedValues = 200;
|
|
103614
|
+
var cachedBreakLinesWithSpaces = {
|
|
103615
|
+
" ": {
|
|
103616
|
+
"\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103617
|
+
return "\n" + " ".repeat(index2);
|
|
103618
|
+
}),
|
|
103619
|
+
"\r": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103620
|
+
return "\r" + " ".repeat(index2);
|
|
103621
|
+
}),
|
|
103622
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103623
|
+
return "\r\n" + " ".repeat(index2);
|
|
103624
|
+
})
|
|
103625
|
+
},
|
|
103626
|
+
" ": {
|
|
103627
|
+
"\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103628
|
+
return "\n" + " ".repeat(index2);
|
|
103629
|
+
}),
|
|
103630
|
+
"\r": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103631
|
+
return "\r" + " ".repeat(index2);
|
|
103632
|
+
}),
|
|
103633
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_3, index2) => {
|
|
103634
|
+
return "\r\n" + " ".repeat(index2);
|
|
103635
|
+
})
|
|
103636
|
+
}
|
|
103637
|
+
};
|
|
103638
|
+
var supportedEols = ["\n", "\r", "\r\n"];
|
|
103639
|
+
|
|
103640
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
103641
|
+
function format(documentText, range3, options2) {
|
|
103642
|
+
let initialIndentLevel;
|
|
103643
|
+
let formatText;
|
|
103644
|
+
let formatTextStart;
|
|
103645
|
+
let rangeStart;
|
|
103646
|
+
let rangeEnd;
|
|
103647
|
+
if (range3) {
|
|
103648
|
+
rangeStart = range3.offset;
|
|
103649
|
+
rangeEnd = rangeStart + range3.length;
|
|
103650
|
+
formatTextStart = rangeStart;
|
|
103651
|
+
while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {
|
|
103652
|
+
formatTextStart--;
|
|
103653
|
+
}
|
|
103654
|
+
let endOffset = rangeEnd;
|
|
103655
|
+
while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {
|
|
103656
|
+
endOffset++;
|
|
103657
|
+
}
|
|
103658
|
+
formatText = documentText.substring(formatTextStart, endOffset);
|
|
103659
|
+
initialIndentLevel = computeIndentLevel(formatText, options2);
|
|
103660
|
+
} else {
|
|
103661
|
+
formatText = documentText;
|
|
103662
|
+
initialIndentLevel = 0;
|
|
103663
|
+
formatTextStart = 0;
|
|
103664
|
+
rangeStart = 0;
|
|
103665
|
+
rangeEnd = documentText.length;
|
|
103666
|
+
}
|
|
103667
|
+
const eol = getEOL(options2, documentText);
|
|
103668
|
+
const eolFastPathSupported = supportedEols.includes(eol);
|
|
103669
|
+
let numberLineBreaks = 0;
|
|
103670
|
+
let indentLevel = 0;
|
|
103671
|
+
let indentValue;
|
|
103672
|
+
if (options2.insertSpaces) {
|
|
103673
|
+
indentValue = cachedSpaces[options2.tabSize || 4] ?? repeat(cachedSpaces[1], options2.tabSize || 4);
|
|
103674
|
+
} else {
|
|
103675
|
+
indentValue = " ";
|
|
103676
|
+
}
|
|
103677
|
+
const indentType = indentValue === " " ? " " : " ";
|
|
103678
|
+
let scanner = createScanner(formatText, false);
|
|
103679
|
+
let hasError = false;
|
|
103680
|
+
function newLinesAndIndent() {
|
|
103681
|
+
if (numberLineBreaks > 1) {
|
|
103682
|
+
return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);
|
|
103683
|
+
}
|
|
103684
|
+
const amountOfSpaces = indentValue.length * (initialIndentLevel + indentLevel);
|
|
103685
|
+
if (!eolFastPathSupported || amountOfSpaces > cachedBreakLinesWithSpaces[indentType][eol].length) {
|
|
103686
|
+
return eol + repeat(indentValue, initialIndentLevel + indentLevel);
|
|
103687
|
+
}
|
|
103688
|
+
if (amountOfSpaces <= 0) {
|
|
103689
|
+
return eol;
|
|
103690
|
+
}
|
|
103691
|
+
return cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces];
|
|
103692
|
+
}
|
|
103693
|
+
function scanNext() {
|
|
103694
|
+
let token = scanner.scan();
|
|
103695
|
+
numberLineBreaks = 0;
|
|
103696
|
+
while (token === 15 || token === 14) {
|
|
103697
|
+
if (token === 14 && options2.keepLines) {
|
|
103698
|
+
numberLineBreaks += 1;
|
|
103699
|
+
} else if (token === 14) {
|
|
103700
|
+
numberLineBreaks = 1;
|
|
103701
|
+
}
|
|
103702
|
+
token = scanner.scan();
|
|
103703
|
+
}
|
|
103704
|
+
hasError = token === 16 || scanner.getTokenError() !== 0;
|
|
103705
|
+
return token;
|
|
103706
|
+
}
|
|
103707
|
+
const editOperations = [];
|
|
103708
|
+
function addEdit(text4, startOffset, endOffset) {
|
|
103709
|
+
if (!hasError && (!range3 || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text4) {
|
|
103710
|
+
editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text4 });
|
|
103711
|
+
}
|
|
103712
|
+
}
|
|
103713
|
+
let firstToken = scanNext();
|
|
103714
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103715
|
+
addEdit(repeat(eol, numberLineBreaks), 0, 0);
|
|
103716
|
+
}
|
|
103717
|
+
if (firstToken !== 17) {
|
|
103718
|
+
let firstTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103719
|
+
let initialIndent = indentValue.length * initialIndentLevel < 20 && options2.insertSpaces ? cachedSpaces[indentValue.length * initialIndentLevel] : repeat(indentValue, initialIndentLevel);
|
|
103720
|
+
addEdit(initialIndent, formatTextStart, firstTokenStart);
|
|
103721
|
+
}
|
|
103722
|
+
while (firstToken !== 17) {
|
|
103723
|
+
let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
|
|
103724
|
+
let secondToken = scanNext();
|
|
103725
|
+
let replaceContent = "";
|
|
103726
|
+
let needsLineBreak = false;
|
|
103727
|
+
while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {
|
|
103728
|
+
let commentTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103729
|
+
addEdit(cachedSpaces[1], firstTokenEnd, commentTokenStart);
|
|
103730
|
+
firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
|
|
103731
|
+
needsLineBreak = secondToken === 12;
|
|
103732
|
+
replaceContent = needsLineBreak ? newLinesAndIndent() : "";
|
|
103733
|
+
secondToken = scanNext();
|
|
103734
|
+
}
|
|
103735
|
+
if (secondToken === 2) {
|
|
103736
|
+
if (firstToken !== 1) {
|
|
103737
|
+
indentLevel--;
|
|
103738
|
+
}
|
|
103739
|
+
;
|
|
103740
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines && firstToken !== 1) {
|
|
103741
|
+
replaceContent = newLinesAndIndent();
|
|
103742
|
+
} else if (options2.keepLines) {
|
|
103743
|
+
replaceContent = cachedSpaces[1];
|
|
103744
|
+
}
|
|
103745
|
+
} else if (secondToken === 4) {
|
|
103746
|
+
if (firstToken !== 3) {
|
|
103747
|
+
indentLevel--;
|
|
103748
|
+
}
|
|
103749
|
+
;
|
|
103750
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines && firstToken !== 3) {
|
|
103751
|
+
replaceContent = newLinesAndIndent();
|
|
103752
|
+
} else if (options2.keepLines) {
|
|
103753
|
+
replaceContent = cachedSpaces[1];
|
|
103754
|
+
}
|
|
103755
|
+
} else {
|
|
103756
|
+
switch (firstToken) {
|
|
103757
|
+
case 3:
|
|
103758
|
+
case 1:
|
|
103759
|
+
indentLevel++;
|
|
103760
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines) {
|
|
103761
|
+
replaceContent = newLinesAndIndent();
|
|
103762
|
+
} else {
|
|
103763
|
+
replaceContent = cachedSpaces[1];
|
|
103764
|
+
}
|
|
103765
|
+
break;
|
|
103766
|
+
case 5:
|
|
103767
|
+
if (options2.keepLines && numberLineBreaks > 0 || !options2.keepLines) {
|
|
103768
|
+
replaceContent = newLinesAndIndent();
|
|
103769
|
+
} else {
|
|
103770
|
+
replaceContent = cachedSpaces[1];
|
|
103771
|
+
}
|
|
103772
|
+
break;
|
|
103773
|
+
case 12:
|
|
103774
|
+
replaceContent = newLinesAndIndent();
|
|
103775
|
+
break;
|
|
103776
|
+
case 13:
|
|
103777
|
+
if (numberLineBreaks > 0) {
|
|
103778
|
+
replaceContent = newLinesAndIndent();
|
|
103779
|
+
} else if (!needsLineBreak) {
|
|
103780
|
+
replaceContent = cachedSpaces[1];
|
|
103781
|
+
}
|
|
103782
|
+
break;
|
|
103783
|
+
case 6:
|
|
103784
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103785
|
+
replaceContent = newLinesAndIndent();
|
|
103786
|
+
} else if (!needsLineBreak) {
|
|
103787
|
+
replaceContent = cachedSpaces[1];
|
|
103788
|
+
}
|
|
103789
|
+
break;
|
|
103790
|
+
case 10:
|
|
103791
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103792
|
+
replaceContent = newLinesAndIndent();
|
|
103793
|
+
} else if (secondToken === 6 && !needsLineBreak) {
|
|
103794
|
+
replaceContent = "";
|
|
103795
|
+
}
|
|
103796
|
+
break;
|
|
103797
|
+
case 7:
|
|
103798
|
+
case 8:
|
|
103799
|
+
case 9:
|
|
103800
|
+
case 11:
|
|
103801
|
+
case 2:
|
|
103802
|
+
case 4:
|
|
103803
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103804
|
+
replaceContent = newLinesAndIndent();
|
|
103805
|
+
} else {
|
|
103806
|
+
if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {
|
|
103807
|
+
replaceContent = cachedSpaces[1];
|
|
103808
|
+
} else if (secondToken !== 5 && secondToken !== 17) {
|
|
103809
|
+
hasError = true;
|
|
103810
|
+
}
|
|
103811
|
+
}
|
|
103812
|
+
break;
|
|
103813
|
+
case 16:
|
|
103814
|
+
hasError = true;
|
|
103815
|
+
break;
|
|
103816
|
+
}
|
|
103817
|
+
if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) {
|
|
103818
|
+
replaceContent = newLinesAndIndent();
|
|
103819
|
+
}
|
|
103820
|
+
}
|
|
103821
|
+
if (secondToken === 17) {
|
|
103822
|
+
if (options2.keepLines && numberLineBreaks > 0) {
|
|
103823
|
+
replaceContent = newLinesAndIndent();
|
|
103824
|
+
} else {
|
|
103825
|
+
replaceContent = options2.insertFinalNewline ? eol : "";
|
|
103826
|
+
}
|
|
103827
|
+
}
|
|
103828
|
+
const secondTokenStart = scanner.getTokenOffset() + formatTextStart;
|
|
103829
|
+
addEdit(replaceContent, firstTokenEnd, secondTokenStart);
|
|
103830
|
+
firstToken = secondToken;
|
|
103831
|
+
}
|
|
103832
|
+
return editOperations;
|
|
103833
|
+
}
|
|
103834
|
+
function repeat(s7, count) {
|
|
103835
|
+
let result = "";
|
|
103836
|
+
for (let i10 = 0; i10 < count; i10++) {
|
|
103837
|
+
result += s7;
|
|
103838
|
+
}
|
|
103839
|
+
return result;
|
|
103840
|
+
}
|
|
103841
|
+
function computeIndentLevel(content3, options2) {
|
|
103842
|
+
let i10 = 0;
|
|
103843
|
+
let nChars = 0;
|
|
103844
|
+
const tabSize = options2.tabSize || 4;
|
|
103845
|
+
while (i10 < content3.length) {
|
|
103846
|
+
let ch = content3.charAt(i10);
|
|
103847
|
+
if (ch === cachedSpaces[1]) {
|
|
103848
|
+
nChars++;
|
|
103849
|
+
} else if (ch === " ") {
|
|
103850
|
+
nChars += tabSize;
|
|
103851
|
+
} else {
|
|
103852
|
+
break;
|
|
103853
|
+
}
|
|
103854
|
+
i10++;
|
|
103855
|
+
}
|
|
103856
|
+
return Math.floor(nChars / tabSize);
|
|
103857
|
+
}
|
|
103858
|
+
function getEOL(options2, text4) {
|
|
103859
|
+
for (let i10 = 0; i10 < text4.length; i10++) {
|
|
103860
|
+
const ch = text4.charAt(i10);
|
|
103861
|
+
if (ch === "\r") {
|
|
103862
|
+
if (i10 + 1 < text4.length && text4.charAt(i10 + 1) === "\n") {
|
|
103863
|
+
return "\r\n";
|
|
103864
|
+
}
|
|
103865
|
+
return "\r";
|
|
103866
|
+
} else if (ch === "\n") {
|
|
103867
|
+
return "\n";
|
|
103868
|
+
}
|
|
103869
|
+
}
|
|
103870
|
+
return options2 && options2.eol || "\n";
|
|
103871
|
+
}
|
|
103872
|
+
function isEOL(text4, offset2) {
|
|
103873
|
+
return "\r\n".indexOf(text4.charAt(offset2)) !== -1;
|
|
103874
|
+
}
|
|
103875
|
+
|
|
103876
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
103877
|
+
var ParseOptions;
|
|
103878
|
+
(function(ParseOptions2) {
|
|
103879
|
+
ParseOptions2.DEFAULT = {
|
|
103880
|
+
allowTrailingComma: false
|
|
103881
|
+
};
|
|
103882
|
+
})(ParseOptions || (ParseOptions = {}));
|
|
103883
|
+
function parseTree(text4, errors = [], options2 = ParseOptions.DEFAULT) {
|
|
103884
|
+
let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
|
|
103885
|
+
function ensurePropertyComplete(endOffset) {
|
|
103886
|
+
if (currentParent.type === "property") {
|
|
103887
|
+
currentParent.length = endOffset - currentParent.offset;
|
|
103888
|
+
currentParent = currentParent.parent;
|
|
103889
|
+
}
|
|
103890
|
+
}
|
|
103891
|
+
function onValue(valueNode) {
|
|
103892
|
+
currentParent.children.push(valueNode);
|
|
103893
|
+
return valueNode;
|
|
103894
|
+
}
|
|
103895
|
+
const visitor = {
|
|
103896
|
+
onObjectBegin: (offset2) => {
|
|
103897
|
+
currentParent = onValue({ type: "object", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103898
|
+
},
|
|
103899
|
+
onObjectProperty: (name3, offset2, length) => {
|
|
103900
|
+
currentParent = onValue({ type: "property", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103901
|
+
currentParent.children.push({ type: "string", value: name3, offset: offset2, length, parent: currentParent });
|
|
103902
|
+
},
|
|
103903
|
+
onObjectEnd: (offset2, length) => {
|
|
103904
|
+
ensurePropertyComplete(offset2 + length);
|
|
103905
|
+
currentParent.length = offset2 + length - currentParent.offset;
|
|
103906
|
+
currentParent = currentParent.parent;
|
|
103907
|
+
ensurePropertyComplete(offset2 + length);
|
|
103908
|
+
},
|
|
103909
|
+
onArrayBegin: (offset2, length) => {
|
|
103910
|
+
currentParent = onValue({ type: "array", offset: offset2, length: -1, parent: currentParent, children: [] });
|
|
103911
|
+
},
|
|
103912
|
+
onArrayEnd: (offset2, length) => {
|
|
103913
|
+
currentParent.length = offset2 + length - currentParent.offset;
|
|
103914
|
+
currentParent = currentParent.parent;
|
|
103915
|
+
ensurePropertyComplete(offset2 + length);
|
|
103916
|
+
},
|
|
103917
|
+
onLiteralValue: (value, offset2, length) => {
|
|
103918
|
+
onValue({ type: getNodeType(value), offset: offset2, length, parent: currentParent, value });
|
|
103919
|
+
ensurePropertyComplete(offset2 + length);
|
|
103920
|
+
},
|
|
103921
|
+
onSeparator: (sep2, offset2, length) => {
|
|
103922
|
+
if (currentParent.type === "property") {
|
|
103923
|
+
if (sep2 === ":") {
|
|
103924
|
+
currentParent.colonOffset = offset2;
|
|
103925
|
+
} else if (sep2 === ",") {
|
|
103926
|
+
ensurePropertyComplete(offset2);
|
|
103927
|
+
}
|
|
103928
|
+
}
|
|
103929
|
+
},
|
|
103930
|
+
onError: (error3, offset2, length) => {
|
|
103931
|
+
errors.push({ error: error3, offset: offset2, length });
|
|
103932
|
+
}
|
|
103933
|
+
};
|
|
103934
|
+
visit(text4, visitor, options2);
|
|
103935
|
+
const result = currentParent.children[0];
|
|
103936
|
+
if (result) {
|
|
103937
|
+
delete result.parent;
|
|
103938
|
+
}
|
|
103939
|
+
return result;
|
|
103940
|
+
}
|
|
103941
|
+
function findNodeAtLocation(root5, path44) {
|
|
103942
|
+
if (!root5) {
|
|
103943
|
+
return void 0;
|
|
103944
|
+
}
|
|
103945
|
+
let node2 = root5;
|
|
103946
|
+
for (let segment of path44) {
|
|
103947
|
+
if (typeof segment === "string") {
|
|
103948
|
+
if (node2.type !== "object" || !Array.isArray(node2.children)) {
|
|
103949
|
+
return void 0;
|
|
103950
|
+
}
|
|
103951
|
+
let found = false;
|
|
103952
|
+
for (const propertyNode of node2.children) {
|
|
103953
|
+
if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {
|
|
103954
|
+
node2 = propertyNode.children[1];
|
|
103955
|
+
found = true;
|
|
103956
|
+
break;
|
|
103957
|
+
}
|
|
103958
|
+
}
|
|
103959
|
+
if (!found) {
|
|
103960
|
+
return void 0;
|
|
103961
|
+
}
|
|
103962
|
+
} else {
|
|
103963
|
+
const index2 = segment;
|
|
103964
|
+
if (node2.type !== "array" || index2 < 0 || !Array.isArray(node2.children) || index2 >= node2.children.length) {
|
|
103965
|
+
return void 0;
|
|
103966
|
+
}
|
|
103967
|
+
node2 = node2.children[index2];
|
|
103968
|
+
}
|
|
103969
|
+
}
|
|
103970
|
+
return node2;
|
|
103971
|
+
}
|
|
103972
|
+
function visit(text4, visitor, options2 = ParseOptions.DEFAULT) {
|
|
103973
|
+
const _scanner = createScanner(text4, false);
|
|
103974
|
+
const _jsonPath = [];
|
|
103975
|
+
let suppressedCallbacks = 0;
|
|
103976
|
+
function toNoArgVisit(visitFunction) {
|
|
103977
|
+
return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
103978
|
+
}
|
|
103979
|
+
function toOneArgVisit(visitFunction) {
|
|
103980
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
103981
|
+
}
|
|
103982
|
+
function toOneArgVisitWithPath(visitFunction) {
|
|
103983
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
103984
|
+
}
|
|
103985
|
+
function toBeginVisit(visitFunction) {
|
|
103986
|
+
return visitFunction ? () => {
|
|
103987
|
+
if (suppressedCallbacks > 0) {
|
|
103988
|
+
suppressedCallbacks++;
|
|
103989
|
+
} else {
|
|
103990
|
+
let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
|
|
103991
|
+
if (cbReturn === false) {
|
|
103992
|
+
suppressedCallbacks = 1;
|
|
103993
|
+
}
|
|
103994
|
+
}
|
|
103995
|
+
} : () => true;
|
|
103996
|
+
}
|
|
103997
|
+
function toEndVisit(visitFunction) {
|
|
103998
|
+
return visitFunction ? () => {
|
|
103999
|
+
if (suppressedCallbacks > 0) {
|
|
104000
|
+
suppressedCallbacks--;
|
|
104001
|
+
}
|
|
104002
|
+
if (suppressedCallbacks === 0) {
|
|
104003
|
+
visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
|
|
104004
|
+
}
|
|
104005
|
+
} : () => true;
|
|
104006
|
+
}
|
|
104007
|
+
const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError2 = toOneArgVisit(visitor.onError);
|
|
104008
|
+
const disallowComments = options2 && options2.disallowComments;
|
|
104009
|
+
const allowTrailingComma = options2 && options2.allowTrailingComma;
|
|
104010
|
+
function scanNext() {
|
|
104011
|
+
while (true) {
|
|
104012
|
+
const token = _scanner.scan();
|
|
104013
|
+
switch (_scanner.getTokenError()) {
|
|
104014
|
+
case 4:
|
|
104015
|
+
handleError(
|
|
104016
|
+
14
|
|
104017
|
+
/* ParseErrorCode.InvalidUnicode */
|
|
104018
|
+
);
|
|
104019
|
+
break;
|
|
104020
|
+
case 5:
|
|
104021
|
+
handleError(
|
|
104022
|
+
15
|
|
104023
|
+
/* ParseErrorCode.InvalidEscapeCharacter */
|
|
104024
|
+
);
|
|
104025
|
+
break;
|
|
104026
|
+
case 3:
|
|
104027
|
+
handleError(
|
|
104028
|
+
13
|
|
104029
|
+
/* ParseErrorCode.UnexpectedEndOfNumber */
|
|
104030
|
+
);
|
|
104031
|
+
break;
|
|
104032
|
+
case 1:
|
|
104033
|
+
if (!disallowComments) {
|
|
104034
|
+
handleError(
|
|
104035
|
+
11
|
|
104036
|
+
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
104037
|
+
);
|
|
104038
|
+
}
|
|
104039
|
+
break;
|
|
104040
|
+
case 2:
|
|
104041
|
+
handleError(
|
|
104042
|
+
12
|
|
104043
|
+
/* ParseErrorCode.UnexpectedEndOfString */
|
|
104044
|
+
);
|
|
104045
|
+
break;
|
|
104046
|
+
case 6:
|
|
104047
|
+
handleError(
|
|
104048
|
+
16
|
|
104049
|
+
/* ParseErrorCode.InvalidCharacter */
|
|
104050
|
+
);
|
|
104051
|
+
break;
|
|
104052
|
+
}
|
|
104053
|
+
switch (token) {
|
|
104054
|
+
case 12:
|
|
104055
|
+
case 13:
|
|
104056
|
+
if (disallowComments) {
|
|
104057
|
+
handleError(
|
|
104058
|
+
10
|
|
104059
|
+
/* ParseErrorCode.InvalidCommentToken */
|
|
104060
|
+
);
|
|
104061
|
+
} else {
|
|
104062
|
+
onComment();
|
|
104063
|
+
}
|
|
104064
|
+
break;
|
|
104065
|
+
case 16:
|
|
104066
|
+
handleError(
|
|
104067
|
+
1
|
|
104068
|
+
/* ParseErrorCode.InvalidSymbol */
|
|
104069
|
+
);
|
|
104070
|
+
break;
|
|
104071
|
+
case 15:
|
|
104072
|
+
case 14:
|
|
104073
|
+
break;
|
|
104074
|
+
default:
|
|
104075
|
+
return token;
|
|
104076
|
+
}
|
|
104077
|
+
}
|
|
104078
|
+
}
|
|
104079
|
+
function handleError(error3, skipUntilAfter = [], skipUntil = []) {
|
|
104080
|
+
onError2(error3);
|
|
104081
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
104082
|
+
let token = _scanner.getToken();
|
|
104083
|
+
while (token !== 17) {
|
|
104084
|
+
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
104085
|
+
scanNext();
|
|
104086
|
+
break;
|
|
104087
|
+
} else if (skipUntil.indexOf(token) !== -1) {
|
|
104088
|
+
break;
|
|
104089
|
+
}
|
|
104090
|
+
token = scanNext();
|
|
104091
|
+
}
|
|
104092
|
+
}
|
|
104093
|
+
}
|
|
104094
|
+
function parseString(isValue) {
|
|
104095
|
+
const value = _scanner.getTokenValue();
|
|
104096
|
+
if (isValue) {
|
|
104097
|
+
onLiteralValue(value);
|
|
104098
|
+
} else {
|
|
104099
|
+
onObjectProperty(value);
|
|
104100
|
+
_jsonPath.push(value);
|
|
104101
|
+
}
|
|
104102
|
+
scanNext();
|
|
104103
|
+
return true;
|
|
104104
|
+
}
|
|
104105
|
+
function parseLiteral() {
|
|
104106
|
+
switch (_scanner.getToken()) {
|
|
104107
|
+
case 11:
|
|
104108
|
+
const tokenValue = _scanner.getTokenValue();
|
|
104109
|
+
let value = Number(tokenValue);
|
|
104110
|
+
if (isNaN(value)) {
|
|
104111
|
+
handleError(
|
|
104112
|
+
2
|
|
104113
|
+
/* ParseErrorCode.InvalidNumberFormat */
|
|
104114
|
+
);
|
|
104115
|
+
value = 0;
|
|
104116
|
+
}
|
|
104117
|
+
onLiteralValue(value);
|
|
104118
|
+
break;
|
|
104119
|
+
case 7:
|
|
104120
|
+
onLiteralValue(null);
|
|
104121
|
+
break;
|
|
104122
|
+
case 8:
|
|
104123
|
+
onLiteralValue(true);
|
|
104124
|
+
break;
|
|
104125
|
+
case 9:
|
|
104126
|
+
onLiteralValue(false);
|
|
104127
|
+
break;
|
|
104128
|
+
default:
|
|
104129
|
+
return false;
|
|
104130
|
+
}
|
|
104131
|
+
scanNext();
|
|
104132
|
+
return true;
|
|
104133
|
+
}
|
|
104134
|
+
function parseProperty() {
|
|
104135
|
+
if (_scanner.getToken() !== 10) {
|
|
104136
|
+
handleError(3, [], [
|
|
104137
|
+
2,
|
|
104138
|
+
5
|
|
104139
|
+
/* SyntaxKind.CommaToken */
|
|
104140
|
+
]);
|
|
104141
|
+
return false;
|
|
104142
|
+
}
|
|
104143
|
+
parseString(false);
|
|
104144
|
+
if (_scanner.getToken() === 6) {
|
|
104145
|
+
onSeparator(":");
|
|
104146
|
+
scanNext();
|
|
104147
|
+
if (!parseValue()) {
|
|
104148
|
+
handleError(4, [], [
|
|
104149
|
+
2,
|
|
104150
|
+
5
|
|
104151
|
+
/* SyntaxKind.CommaToken */
|
|
104152
|
+
]);
|
|
104153
|
+
}
|
|
104154
|
+
} else {
|
|
104155
|
+
handleError(5, [], [
|
|
104156
|
+
2,
|
|
104157
|
+
5
|
|
104158
|
+
/* SyntaxKind.CommaToken */
|
|
104159
|
+
]);
|
|
104160
|
+
}
|
|
104161
|
+
_jsonPath.pop();
|
|
104162
|
+
return true;
|
|
104163
|
+
}
|
|
104164
|
+
function parseObject() {
|
|
104165
|
+
onObjectBegin();
|
|
104166
|
+
scanNext();
|
|
104167
|
+
let needsComma = false;
|
|
104168
|
+
while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
|
|
104169
|
+
if (_scanner.getToken() === 5) {
|
|
104170
|
+
if (!needsComma) {
|
|
104171
|
+
handleError(4, [], []);
|
|
104172
|
+
}
|
|
104173
|
+
onSeparator(",");
|
|
104174
|
+
scanNext();
|
|
104175
|
+
if (_scanner.getToken() === 2 && allowTrailingComma) {
|
|
104176
|
+
break;
|
|
104177
|
+
}
|
|
104178
|
+
} else if (needsComma) {
|
|
104179
|
+
handleError(6, [], []);
|
|
104180
|
+
}
|
|
104181
|
+
if (!parseProperty()) {
|
|
104182
|
+
handleError(4, [], [
|
|
104183
|
+
2,
|
|
104184
|
+
5
|
|
104185
|
+
/* SyntaxKind.CommaToken */
|
|
104186
|
+
]);
|
|
104187
|
+
}
|
|
104188
|
+
needsComma = true;
|
|
104189
|
+
}
|
|
104190
|
+
onObjectEnd();
|
|
104191
|
+
if (_scanner.getToken() !== 2) {
|
|
104192
|
+
handleError(7, [
|
|
104193
|
+
2
|
|
104194
|
+
/* SyntaxKind.CloseBraceToken */
|
|
104195
|
+
], []);
|
|
104196
|
+
} else {
|
|
104197
|
+
scanNext();
|
|
104198
|
+
}
|
|
104199
|
+
return true;
|
|
104200
|
+
}
|
|
104201
|
+
function parseArray() {
|
|
104202
|
+
onArrayBegin();
|
|
104203
|
+
scanNext();
|
|
104204
|
+
let isFirstElement = true;
|
|
104205
|
+
let needsComma = false;
|
|
104206
|
+
while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
|
|
104207
|
+
if (_scanner.getToken() === 5) {
|
|
104208
|
+
if (!needsComma) {
|
|
104209
|
+
handleError(4, [], []);
|
|
104210
|
+
}
|
|
104211
|
+
onSeparator(",");
|
|
104212
|
+
scanNext();
|
|
104213
|
+
if (_scanner.getToken() === 4 && allowTrailingComma) {
|
|
104214
|
+
break;
|
|
104215
|
+
}
|
|
104216
|
+
} else if (needsComma) {
|
|
104217
|
+
handleError(6, [], []);
|
|
104218
|
+
}
|
|
104219
|
+
if (isFirstElement) {
|
|
104220
|
+
_jsonPath.push(0);
|
|
104221
|
+
isFirstElement = false;
|
|
104222
|
+
} else {
|
|
104223
|
+
_jsonPath[_jsonPath.length - 1]++;
|
|
104224
|
+
}
|
|
104225
|
+
if (!parseValue()) {
|
|
104226
|
+
handleError(4, [], [
|
|
104227
|
+
4,
|
|
104228
|
+
5
|
|
104229
|
+
/* SyntaxKind.CommaToken */
|
|
104230
|
+
]);
|
|
104231
|
+
}
|
|
104232
|
+
needsComma = true;
|
|
104233
|
+
}
|
|
104234
|
+
onArrayEnd();
|
|
104235
|
+
if (!isFirstElement) {
|
|
104236
|
+
_jsonPath.pop();
|
|
104237
|
+
}
|
|
104238
|
+
if (_scanner.getToken() !== 4) {
|
|
104239
|
+
handleError(8, [
|
|
104240
|
+
4
|
|
104241
|
+
/* SyntaxKind.CloseBracketToken */
|
|
104242
|
+
], []);
|
|
104243
|
+
} else {
|
|
104244
|
+
scanNext();
|
|
104245
|
+
}
|
|
104246
|
+
return true;
|
|
104247
|
+
}
|
|
104248
|
+
function parseValue() {
|
|
104249
|
+
switch (_scanner.getToken()) {
|
|
104250
|
+
case 3:
|
|
104251
|
+
return parseArray();
|
|
104252
|
+
case 1:
|
|
104253
|
+
return parseObject();
|
|
104254
|
+
case 10:
|
|
104255
|
+
return parseString(true);
|
|
104256
|
+
default:
|
|
104257
|
+
return parseLiteral();
|
|
104258
|
+
}
|
|
104259
|
+
}
|
|
104260
|
+
scanNext();
|
|
104261
|
+
if (_scanner.getToken() === 17) {
|
|
104262
|
+
if (options2.allowEmptyContent) {
|
|
104263
|
+
return true;
|
|
104264
|
+
}
|
|
104265
|
+
handleError(4, [], []);
|
|
104266
|
+
return false;
|
|
104267
|
+
}
|
|
104268
|
+
if (!parseValue()) {
|
|
104269
|
+
handleError(4, [], []);
|
|
104270
|
+
return false;
|
|
104271
|
+
}
|
|
104272
|
+
if (_scanner.getToken() !== 17) {
|
|
104273
|
+
handleError(9, [], []);
|
|
104274
|
+
}
|
|
104275
|
+
return true;
|
|
104276
|
+
}
|
|
104277
|
+
function getNodeType(value) {
|
|
104278
|
+
switch (typeof value) {
|
|
104279
|
+
case "boolean":
|
|
104280
|
+
return "boolean";
|
|
104281
|
+
case "number":
|
|
104282
|
+
return "number";
|
|
104283
|
+
case "string":
|
|
104284
|
+
return "string";
|
|
104285
|
+
case "object": {
|
|
104286
|
+
if (!value) {
|
|
104287
|
+
return "null";
|
|
104288
|
+
} else if (Array.isArray(value)) {
|
|
104289
|
+
return "array";
|
|
104290
|
+
}
|
|
104291
|
+
return "object";
|
|
104292
|
+
}
|
|
104293
|
+
default:
|
|
104294
|
+
return "null";
|
|
104295
|
+
}
|
|
104296
|
+
}
|
|
104297
|
+
|
|
104298
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
104299
|
+
function setProperty(text4, originalPath, value, options2) {
|
|
104300
|
+
const path44 = originalPath.slice();
|
|
104301
|
+
const errors = [];
|
|
104302
|
+
const root5 = parseTree(text4, errors);
|
|
104303
|
+
let parent = void 0;
|
|
104304
|
+
let lastSegment = void 0;
|
|
104305
|
+
while (path44.length > 0) {
|
|
104306
|
+
lastSegment = path44.pop();
|
|
104307
|
+
parent = findNodeAtLocation(root5, path44);
|
|
104308
|
+
if (parent === void 0 && value !== void 0) {
|
|
104309
|
+
if (typeof lastSegment === "string") {
|
|
104310
|
+
value = { [lastSegment]: value };
|
|
104311
|
+
} else {
|
|
104312
|
+
value = [value];
|
|
104313
|
+
}
|
|
104314
|
+
} else {
|
|
104315
|
+
break;
|
|
104316
|
+
}
|
|
104317
|
+
}
|
|
104318
|
+
if (!parent) {
|
|
104319
|
+
if (value === void 0) {
|
|
104320
|
+
throw new Error("Can not delete in empty document");
|
|
104321
|
+
}
|
|
104322
|
+
return withFormatting(text4, { offset: root5 ? root5.offset : 0, length: root5 ? root5.length : 0, content: JSON.stringify(value) }, options2);
|
|
104323
|
+
} else if (parent.type === "object" && typeof lastSegment === "string" && Array.isArray(parent.children)) {
|
|
104324
|
+
const existing = findNodeAtLocation(parent, [lastSegment]);
|
|
104325
|
+
if (existing !== void 0) {
|
|
104326
|
+
if (value === void 0) {
|
|
104327
|
+
if (!existing.parent) {
|
|
104328
|
+
throw new Error("Malformed AST");
|
|
104329
|
+
}
|
|
104330
|
+
const propertyIndex = parent.children.indexOf(existing.parent);
|
|
104331
|
+
let removeBegin;
|
|
104332
|
+
let removeEnd = existing.parent.offset + existing.parent.length;
|
|
104333
|
+
if (propertyIndex > 0) {
|
|
104334
|
+
let previous3 = parent.children[propertyIndex - 1];
|
|
104335
|
+
removeBegin = previous3.offset + previous3.length;
|
|
104336
|
+
} else {
|
|
104337
|
+
removeBegin = parent.offset + 1;
|
|
104338
|
+
if (parent.children.length > 1) {
|
|
104339
|
+
let next = parent.children[1];
|
|
104340
|
+
removeEnd = next.offset;
|
|
104341
|
+
}
|
|
104342
|
+
}
|
|
104343
|
+
return withFormatting(text4, { offset: removeBegin, length: removeEnd - removeBegin, content: "" }, options2);
|
|
104344
|
+
} else {
|
|
104345
|
+
return withFormatting(text4, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options2);
|
|
104346
|
+
}
|
|
104347
|
+
} else {
|
|
104348
|
+
if (value === void 0) {
|
|
104349
|
+
return [];
|
|
104350
|
+
}
|
|
104351
|
+
const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
|
|
104352
|
+
const index2 = options2.getInsertionIndex ? options2.getInsertionIndex(parent.children.map((p8) => p8.children[0].value)) : parent.children.length;
|
|
104353
|
+
let edit;
|
|
104354
|
+
if (index2 > 0) {
|
|
104355
|
+
let previous3 = parent.children[index2 - 1];
|
|
104356
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104357
|
+
} else if (parent.children.length === 0) {
|
|
104358
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty };
|
|
104359
|
+
} else {
|
|
104360
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty + "," };
|
|
104361
|
+
}
|
|
104362
|
+
return withFormatting(text4, edit, options2);
|
|
104363
|
+
}
|
|
104364
|
+
} else if (parent.type === "array" && typeof lastSegment === "number" && Array.isArray(parent.children)) {
|
|
104365
|
+
const insertIndex = lastSegment;
|
|
104366
|
+
if (insertIndex === -1) {
|
|
104367
|
+
const newProperty = `${JSON.stringify(value)}`;
|
|
104368
|
+
let edit;
|
|
104369
|
+
if (parent.children.length === 0) {
|
|
104370
|
+
edit = { offset: parent.offset + 1, length: 0, content: newProperty };
|
|
104371
|
+
} else {
|
|
104372
|
+
const previous3 = parent.children[parent.children.length - 1];
|
|
104373
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104374
|
+
}
|
|
104375
|
+
return withFormatting(text4, edit, options2);
|
|
104376
|
+
} else if (value === void 0 && parent.children.length >= 0) {
|
|
104377
|
+
const removalIndex = lastSegment;
|
|
104378
|
+
const toRemove = parent.children[removalIndex];
|
|
104379
|
+
let edit;
|
|
104380
|
+
if (parent.children.length === 1) {
|
|
104381
|
+
edit = { offset: parent.offset + 1, length: parent.length - 2, content: "" };
|
|
104382
|
+
} else if (parent.children.length - 1 === removalIndex) {
|
|
104383
|
+
let previous3 = parent.children[removalIndex - 1];
|
|
104384
|
+
let offset2 = previous3.offset + previous3.length;
|
|
104385
|
+
let parentEndOffset = parent.offset + parent.length;
|
|
104386
|
+
edit = { offset: offset2, length: parentEndOffset - 2 - offset2, content: "" };
|
|
104387
|
+
} else {
|
|
104388
|
+
edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: "" };
|
|
104389
|
+
}
|
|
104390
|
+
return withFormatting(text4, edit, options2);
|
|
104391
|
+
} else if (value !== void 0) {
|
|
104392
|
+
let edit;
|
|
104393
|
+
const newProperty = `${JSON.stringify(value)}`;
|
|
104394
|
+
if (!options2.isArrayInsertion && parent.children.length > lastSegment) {
|
|
104395
|
+
const toModify = parent.children[lastSegment];
|
|
104396
|
+
edit = { offset: toModify.offset, length: toModify.length, content: newProperty };
|
|
104397
|
+
} else if (parent.children.length === 0 || lastSegment === 0) {
|
|
104398
|
+
edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + "," };
|
|
104399
|
+
} else {
|
|
104400
|
+
const index2 = lastSegment > parent.children.length ? parent.children.length : lastSegment;
|
|
104401
|
+
const previous3 = parent.children[index2 - 1];
|
|
104402
|
+
edit = { offset: previous3.offset + previous3.length, length: 0, content: "," + newProperty };
|
|
104403
|
+
}
|
|
104404
|
+
return withFormatting(text4, edit, options2);
|
|
104405
|
+
} else {
|
|
104406
|
+
throw new Error(`Can not ${value === void 0 ? "remove" : options2.isArrayInsertion ? "insert" : "modify"} Array index ${insertIndex} as length is not sufficient`);
|
|
104407
|
+
}
|
|
104408
|
+
} else {
|
|
104409
|
+
throw new Error(`Can not add ${typeof lastSegment !== "number" ? "index" : "property"} to parent of type ${parent.type}`);
|
|
104410
|
+
}
|
|
104411
|
+
}
|
|
104412
|
+
function withFormatting(text4, edit, options2) {
|
|
104413
|
+
if (!options2.formattingOptions) {
|
|
104414
|
+
return [edit];
|
|
104415
|
+
}
|
|
104416
|
+
let newText = applyEdit(text4, edit);
|
|
104417
|
+
let begin = edit.offset;
|
|
104418
|
+
let end = edit.offset + edit.content.length;
|
|
104419
|
+
if (edit.length === 0 || edit.content.length === 0) {
|
|
104420
|
+
while (begin > 0 && !isEOL(newText, begin - 1)) {
|
|
104421
|
+
begin--;
|
|
104422
|
+
}
|
|
104423
|
+
while (end < newText.length && !isEOL(newText, end)) {
|
|
104424
|
+
end++;
|
|
104425
|
+
}
|
|
104426
|
+
}
|
|
104427
|
+
const edits = format(newText, { offset: begin, length: end - begin }, { ...options2.formattingOptions, keepLines: false });
|
|
104428
|
+
for (let i10 = edits.length - 1; i10 >= 0; i10--) {
|
|
104429
|
+
const edit2 = edits[i10];
|
|
104430
|
+
newText = applyEdit(newText, edit2);
|
|
104431
|
+
begin = Math.min(begin, edit2.offset);
|
|
104432
|
+
end = Math.max(end, edit2.offset + edit2.length);
|
|
104433
|
+
end += edit2.content.length - edit2.length;
|
|
104434
|
+
}
|
|
104435
|
+
const editLength = text4.length - (newText.length - end) - begin;
|
|
104436
|
+
return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];
|
|
104437
|
+
}
|
|
104438
|
+
function applyEdit(text4, edit) {
|
|
104439
|
+
return text4.substring(0, edit.offset) + edit.content + text4.substring(edit.offset + edit.length);
|
|
104440
|
+
}
|
|
104441
|
+
|
|
104442
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
104443
|
+
var ScanError;
|
|
104444
|
+
(function(ScanError2) {
|
|
104445
|
+
ScanError2[ScanError2["None"] = 0] = "None";
|
|
104446
|
+
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
104447
|
+
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
104448
|
+
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
104449
|
+
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
104450
|
+
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
104451
|
+
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
104452
|
+
})(ScanError || (ScanError = {}));
|
|
104453
|
+
var SyntaxKind;
|
|
104454
|
+
(function(SyntaxKind2) {
|
|
104455
|
+
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
104456
|
+
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
104457
|
+
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
104458
|
+
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
104459
|
+
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
104460
|
+
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
104461
|
+
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
104462
|
+
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
104463
|
+
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
104464
|
+
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
104465
|
+
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
104466
|
+
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
104467
|
+
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
104468
|
+
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
104469
|
+
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
104470
|
+
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
104471
|
+
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
104472
|
+
})(SyntaxKind || (SyntaxKind = {}));
|
|
104473
|
+
var ParseErrorCode;
|
|
104474
|
+
(function(ParseErrorCode2) {
|
|
104475
|
+
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
104476
|
+
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
104477
|
+
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
104478
|
+
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
104479
|
+
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
104480
|
+
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
104481
|
+
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
104482
|
+
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
104483
|
+
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
104484
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
104485
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
104486
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
104487
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
104488
|
+
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
104489
|
+
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
104490
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
104491
|
+
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
104492
|
+
function modify(text4, path44, value, options2) {
|
|
104493
|
+
return setProperty(text4, path44, value, options2);
|
|
104494
|
+
}
|
|
104495
|
+
function applyEdits(text4, edits) {
|
|
104496
|
+
let sortedEdits = edits.slice(0).sort((a9, b10) => {
|
|
104497
|
+
const diff = a9.offset - b10.offset;
|
|
104498
|
+
if (diff === 0) {
|
|
104499
|
+
return a9.length - b10.length;
|
|
104500
|
+
}
|
|
104501
|
+
return diff;
|
|
104502
|
+
});
|
|
104503
|
+
let lastModifiedOffset = text4.length;
|
|
104504
|
+
for (let i10 = sortedEdits.length - 1; i10 >= 0; i10--) {
|
|
104505
|
+
let e9 = sortedEdits[i10];
|
|
104506
|
+
if (e9.offset + e9.length <= lastModifiedOffset) {
|
|
104507
|
+
text4 = applyEdit(text4, e9);
|
|
104508
|
+
} else {
|
|
104509
|
+
throw new Error("Overlapping edit");
|
|
104510
|
+
}
|
|
104511
|
+
lastModifiedOffset = e9.offset;
|
|
104512
|
+
}
|
|
104513
|
+
return text4;
|
|
104514
|
+
}
|
|
104515
|
+
|
|
104516
|
+
// ../canopycms/src/utils/json-source-splice.ts
|
|
103336
104517
|
init_error();
|
|
103337
104518
|
var log5 = createDebugLogger({ prefix: "JsonSourceSplice" });
|
|
103338
104519
|
function isRecord(value) {
|
|
@@ -103350,23 +104531,23 @@ function detectFormatting(text4) {
|
|
|
103350
104531
|
}
|
|
103351
104532
|
function insertMember(text4, path44, key, value, formattingOptions) {
|
|
103352
104533
|
const at2 = [...path44, key];
|
|
103353
|
-
const [edit] =
|
|
104534
|
+
const [edit] = modify(text4, at2, value, {});
|
|
103354
104535
|
const closing = edit ? /^[ \t]*\r?\n([ \t]*)\}/.exec(text4.slice(edit.offset)) : null;
|
|
103355
104536
|
if (edit && closing && edit.length === 0 && edit.content.startsWith(",")) {
|
|
103356
104537
|
const unit = formattingOptions.insertSpaces ? " ".repeat(formattingOptions.tabSize ?? 2) : " ";
|
|
103357
104538
|
const eol = formattingOptions.eol ?? "\n";
|
|
103358
104539
|
const indent2 = closing[1] + unit;
|
|
103359
104540
|
const rendered = JSON.stringify(value, null, unit).split("\n").join(eol + indent2);
|
|
103360
|
-
return
|
|
104541
|
+
return applyEdits(text4, [
|
|
103361
104542
|
{ ...edit, content: `,${eol}${indent2}${JSON.stringify(key)}: ${rendered}` }
|
|
103362
104543
|
]);
|
|
103363
104544
|
}
|
|
103364
|
-
return
|
|
104545
|
+
return applyEdits(text4, modify(text4, at2, value, { formattingOptions }));
|
|
103365
104546
|
}
|
|
103366
104547
|
function removeMember(text4, path44) {
|
|
103367
|
-
return
|
|
104548
|
+
return applyEdits(
|
|
103368
104549
|
text4,
|
|
103369
|
-
|
|
104550
|
+
modify(text4, path44, void 0, {}).map((edit) => {
|
|
103370
104551
|
const removed = text4.slice(edit.offset, edit.offset + edit.length);
|
|
103371
104552
|
const lead = /^\s+/.exec(removed)?.[0].length ?? 0;
|
|
103372
104553
|
const atMember = /\S/.test(text4.charAt(edit.offset + edit.length));
|
|
@@ -103377,7 +104558,7 @@ function removeMember(text4, path44) {
|
|
|
103377
104558
|
function reconcile(text4, path44, before, after, formattingOptions) {
|
|
103378
104559
|
if (isRecord(before) && isRecord(after)) {
|
|
103379
104560
|
if (Object.keys(after).length === 0 && Object.keys(before).length > 0) {
|
|
103380
|
-
return
|
|
104561
|
+
return applyEdits(text4, modify(text4, path44, {}, { formattingOptions }));
|
|
103381
104562
|
}
|
|
103382
104563
|
let next = text4;
|
|
103383
104564
|
for (const key of Object.keys(before)) {
|
|
@@ -103396,7 +104577,7 @@ function reconcile(text4, path44, before, after, formattingOptions) {
|
|
|
103396
104577
|
);
|
|
103397
104578
|
}
|
|
103398
104579
|
if (JSON.stringify(before) === JSON.stringify(after)) return text4;
|
|
103399
|
-
return
|
|
104580
|
+
return applyEdits(text4, modify(text4, path44, after, { formattingOptions }));
|
|
103400
104581
|
}
|
|
103401
104582
|
function serializeJson(data4, existingRaw) {
|
|
103402
104583
|
if (existingRaw === void 0) return plainStringify(data4);
|
|
@@ -109487,7 +110668,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
109487
110668
|
}
|
|
109488
110669
|
|
|
109489
110670
|
// ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.js
|
|
109490
|
-
function
|
|
110671
|
+
function parse3(options2) {
|
|
109491
110672
|
const settings = options2 || {};
|
|
109492
110673
|
const constructs2 = (
|
|
109493
110674
|
/** @type {FullNormalizedExtension} */
|
|
@@ -109649,7 +110830,7 @@ function fromMarkdown(value, encoding, options2) {
|
|
|
109649
110830
|
options2 = encoding;
|
|
109650
110831
|
encoding = void 0;
|
|
109651
110832
|
}
|
|
109652
|
-
return compiler(options2)(postprocess(
|
|
110833
|
+
return compiler(options2)(postprocess(parse3(options2).document().write(preprocess()(value, encoding, true))));
|
|
109653
110834
|
}
|
|
109654
110835
|
function compiler(options2) {
|
|
109655
110836
|
const config = {
|
|
@@ -110511,12 +111692,12 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
110511
111692
|
typeof value.name === "string" ? value.name : void 0
|
|
110512
111693
|
)
|
|
110513
111694
|
);
|
|
110514
|
-
Object.defineProperty(
|
|
111695
|
+
Object.defineProperty(visit5, "name", {
|
|
110515
111696
|
value: "node (" + color(node2.type + (name3 ? "<" + name3 + ">" : "")) + ")"
|
|
110516
111697
|
});
|
|
110517
111698
|
}
|
|
110518
|
-
return
|
|
110519
|
-
function
|
|
111699
|
+
return visit5;
|
|
111700
|
+
function visit5() {
|
|
110520
111701
|
let result = empty2;
|
|
110521
111702
|
let subresult;
|
|
110522
111703
|
let offset2;
|
|
@@ -113673,7 +114854,7 @@ var Parser = function Parser2(options2, input, startPos) {
|
|
|
113673
114854
|
this.privateNameStack = [];
|
|
113674
114855
|
};
|
|
113675
114856
|
var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
113676
|
-
Parser.prototype.parse = function
|
|
114857
|
+
Parser.prototype.parse = function parse4() {
|
|
113677
114858
|
var node2 = this.options.program || this.startNode();
|
|
113678
114859
|
this.nextToken();
|
|
113679
114860
|
return this.parseTopLevel(node2);
|
|
@@ -113753,7 +114934,7 @@ Parser.extend = function extend() {
|
|
|
113753
114934
|
}
|
|
113754
114935
|
return cls;
|
|
113755
114936
|
};
|
|
113756
|
-
Parser.parse = function
|
|
114937
|
+
Parser.parse = function parse5(input, options2) {
|
|
113757
114938
|
return new this(options2, input).parse();
|
|
113758
114939
|
};
|
|
113759
114940
|
Parser.parseExpressionAt = function parseExpressionAt(input, pos, options2) {
|
|
@@ -118848,7 +120029,7 @@ var own3 = {}.hasOwnProperty;
|
|
|
118848
120029
|
var CONTINUE2 = Symbol("continue");
|
|
118849
120030
|
var EXIT2 = Symbol("exit");
|
|
118850
120031
|
var SKIP2 = Symbol("skip");
|
|
118851
|
-
function
|
|
120032
|
+
function visit2(tree, visitor) {
|
|
118852
120033
|
let enter;
|
|
118853
120034
|
let leave;
|
|
118854
120035
|
if (typeof visitor === "function") {
|
|
@@ -118860,10 +120041,10 @@ function visit(tree, visitor) {
|
|
|
118860
120041
|
build(tree, void 0, void 0, [])();
|
|
118861
120042
|
function build(node2, key, index2, parents) {
|
|
118862
120043
|
if (nodelike(node2)) {
|
|
118863
|
-
|
|
120044
|
+
visit5.displayName = "node (" + color2(node2.type) + ")";
|
|
118864
120045
|
}
|
|
118865
|
-
return
|
|
118866
|
-
function
|
|
120046
|
+
return visit5;
|
|
120047
|
+
function visit5() {
|
|
118867
120048
|
const result = enter ? toResult2(enter(node2, key, index2, parents)) : [];
|
|
118868
120049
|
if (result[0] === EXIT2) {
|
|
118869
120050
|
return result;
|
|
@@ -119004,7 +120185,7 @@ function eventsToAcorn(events, options2) {
|
|
|
119004
120185
|
}
|
|
119005
120186
|
if (estree) {
|
|
119006
120187
|
estree.comments = comments;
|
|
119007
|
-
|
|
120188
|
+
visit2(estree, function(esnode, field, index2, parents) {
|
|
119008
120189
|
let context = (
|
|
119009
120190
|
/** @type {AcornNode | Array<AcornNode>} */
|
|
119010
120191
|
parents[parents.length - 1]
|
|
@@ -120055,9 +121236,9 @@ function mdxjs(options2) {
|
|
|
120055
121236
|
// ../canopycms/src/utils/markdown-parse.ts
|
|
120056
121237
|
init_error();
|
|
120057
121238
|
var log6 = createDebugLogger({ prefix: "MarkdownParse" });
|
|
120058
|
-
function parseMarkdownBody(text4,
|
|
121239
|
+
function parseMarkdownBody(text4, format4) {
|
|
120059
121240
|
try {
|
|
120060
|
-
return
|
|
121241
|
+
return format4 === "mdx" ? fromMarkdown(text4, {
|
|
120061
121242
|
extensions: [gfm(), mdxjs()],
|
|
120062
121243
|
mdastExtensions: [gfmFromMarkdown(), mdxFromMarkdown()]
|
|
120063
121244
|
}) : fromMarkdown(text4, { extensions: [gfm()], mdastExtensions: [gfmFromMarkdown()] });
|
|
@@ -121098,10 +122279,10 @@ function listMarkers(text4, items, ordered) {
|
|
|
121098
122279
|
return marker + itemText.slice(current2[0].length);
|
|
121099
122280
|
};
|
|
121100
122281
|
}
|
|
121101
|
-
function preserveMarkdownSource(original, updated,
|
|
122282
|
+
function preserveMarkdownSource(original, updated, format4) {
|
|
121102
122283
|
if (original === updated) return original;
|
|
121103
122284
|
try {
|
|
121104
|
-
return splice2(original, updated,
|
|
122285
|
+
return splice2(original, updated, format4) ?? updated;
|
|
121105
122286
|
} catch (err) {
|
|
121106
122287
|
log7.debug("markdown-body-splice", "splice failed", { error: getErrorMessage(err) });
|
|
121107
122288
|
return updated;
|
|
@@ -121125,9 +122306,9 @@ function diskBlocks(oNodes, nNodes) {
|
|
|
121125
122306
|
});
|
|
121126
122307
|
return fromDisk;
|
|
121127
122308
|
}
|
|
121128
|
-
function splice2(original, updated,
|
|
121129
|
-
const before = original === void 0 ? void 0 : parseMarkdownBody(original,
|
|
121130
|
-
const after = parseMarkdownBody(updated,
|
|
122309
|
+
function splice2(original, updated, format4) {
|
|
122310
|
+
const before = original === void 0 ? void 0 : parseMarkdownBody(original, format4);
|
|
122311
|
+
const after = parseMarkdownBody(updated, format4);
|
|
121131
122312
|
if (after === void 0) return void 0;
|
|
121132
122313
|
const target = canonical(after);
|
|
121133
122314
|
const fromDisk = diskBlocks(before?.children ?? [], after.children);
|
|
@@ -121136,7 +122317,7 @@ function splice2(original, updated, format3) {
|
|
|
121136
122317
|
after,
|
|
121137
122318
|
(index2) => fromDisk.has(index2),
|
|
121138
122319
|
(text4) => {
|
|
121139
|
-
const tree = parseMarkdownBody(text4,
|
|
122320
|
+
const tree = parseMarkdownBody(text4, format4);
|
|
121140
122321
|
return tree !== void 0 && canonical(tree) === target ? tree : void 0;
|
|
121141
122322
|
}
|
|
121142
122323
|
);
|
|
@@ -121147,7 +122328,7 @@ function splice2(original, updated, format3) {
|
|
|
121147
122328
|
for (const deep of [true, false]) {
|
|
121148
122329
|
const candidate = new Splicer(original, edit.text, deep).body(before, edit.tree);
|
|
121149
122330
|
if (candidate === void 0) continue;
|
|
121150
|
-
const reparsed = parseMarkdownBody(candidate,
|
|
122331
|
+
const reparsed = parseMarkdownBody(candidate, format4);
|
|
121151
122332
|
if (reparsed !== void 0 && canonical(reparsed) === target) return candidate;
|
|
121152
122333
|
log7.debug("markdown-body-splice", "splice does not read back as the edit", {
|
|
121153
122334
|
deep,
|
|
@@ -121412,9 +122593,9 @@ function extractBody(raw) {
|
|
|
121412
122593
|
function writesFrontmatter(data4) {
|
|
121413
122594
|
return Object.values(data4).some((value) => value !== void 0);
|
|
121414
122595
|
}
|
|
121415
|
-
function bodyToWrite(body, data4,
|
|
122596
|
+
function bodyToWrite(body, data4, format4, existingRaw) {
|
|
121416
122597
|
const priorBody = existingRaw === void 0 ? void 0 : extractBody(existingRaw);
|
|
121417
|
-
const spliced = preserveMarkdownSource(priorBody, body,
|
|
122598
|
+
const spliced = preserveMarkdownSource(priorBody, body, format4);
|
|
121418
122599
|
if (!writesFrontmatter(data4)) {
|
|
121419
122600
|
const flush2 = spliced.replace(/^(?:\r?\n)+/, "");
|
|
121420
122601
|
return /^\uFEFF?---/.test(flush2) ? `
|
|
@@ -121492,8 +122673,8 @@ ${asKey ? `${text4}: v` : `v: ${text4}`}
|
|
|
121492
122673
|
return true;
|
|
121493
122674
|
}
|
|
121494
122675
|
}
|
|
121495
|
-
function serializeFrontmatter(editorBody, data4, existingRaw,
|
|
121496
|
-
const file = { content: bodyToWrite(editorBody, data4,
|
|
122676
|
+
function serializeFrontmatter(editorBody, data4, existingRaw, format4, fields = []) {
|
|
122677
|
+
const file = { content: bodyToWrite(editorBody, data4, format4, existingRaw) };
|
|
121497
122678
|
if (existingRaw === void 0) return import_gray_matter.default.stringify(file, data4);
|
|
121498
122679
|
const existingFrontmatter = extractRawFrontmatter(existingRaw);
|
|
121499
122680
|
if (existingFrontmatter === void 0) return import_gray_matter.default.stringify(file, data4);
|
|
@@ -121543,9 +122724,9 @@ var heldRoots = new AsyncLocalStorage();
|
|
|
121543
122724
|
|
|
121544
122725
|
// ../canopycms/src/content-listing.ts
|
|
121545
122726
|
var log9 = createDebugLogger({ prefix: "ContentListing" });
|
|
121546
|
-
var parseEntryParts = (raw,
|
|
121547
|
-
if (
|
|
121548
|
-
if (
|
|
122727
|
+
var parseEntryParts = (raw, format4) => {
|
|
122728
|
+
if (format4 === "json") return { data: asRecord(JSON.parse(raw)) };
|
|
122729
|
+
if (format4 === "yaml") return { data: asRecord((0, import_yaml3.parse)(raw)) };
|
|
121549
122730
|
const parsed = (0, import_gray_matter2.default)(raw);
|
|
121550
122731
|
return { data: { ...parsed.data ?? {} }, body: parsed.content };
|
|
121551
122732
|
};
|
|
@@ -122610,7 +123791,7 @@ function withListKey(merged, ai, bi, keys, used, at2, walk2) {
|
|
|
122610
123791
|
var withBody = (side, bodyName) => side.body === void 0 ? side.data : { ...side.data, [bodyName]: side.body };
|
|
122611
123792
|
var mdxParses = (text4) => parseMarkdownBody(text4, "mdx") !== void 0;
|
|
122612
123793
|
var sameContent = (x6, y3) => sameValue(x6.data, y3.data) && (x6.body ?? "") === (y3.body ?? "");
|
|
122613
|
-
function mergeBody(o8, a9, b10,
|
|
123794
|
+
function mergeBody(o8, a9, b10, format4, at2, walk2) {
|
|
122614
123795
|
if (a9 === b10 || o8 === a9) return b10;
|
|
122615
123796
|
if (o8 === b10) return a9;
|
|
122616
123797
|
const merged = mergeText(o8, a9, b10);
|
|
@@ -122619,7 +123800,7 @@ function mergeBody(o8, a9, b10, format3, at2, walk2) {
|
|
|
122619
123800
|
return b10;
|
|
122620
123801
|
}
|
|
122621
123802
|
const { text: text4, regions } = merged;
|
|
122622
|
-
const parses = (body) =>
|
|
123803
|
+
const parses = (body) => format4 !== "mdx" || mdxParses(body);
|
|
122623
123804
|
if (!parses(text4) && parses(a9) && parses(b10)) {
|
|
122624
123805
|
walk2.conflicts.push({
|
|
122625
123806
|
at: at2.segments,
|
|
@@ -122642,7 +123823,7 @@ function mergeBody(o8, a9, b10, format3, at2, walk2) {
|
|
|
122642
123823
|
return text4;
|
|
122643
123824
|
}
|
|
122644
123825
|
function mergeEntry({
|
|
122645
|
-
format:
|
|
123826
|
+
format: format4,
|
|
122646
123827
|
ancestor,
|
|
122647
123828
|
base,
|
|
122648
123829
|
branch,
|
|
@@ -122711,7 +123892,7 @@ function mergeEntry({
|
|
|
122711
123892
|
ancestor.body ?? "",
|
|
122712
123893
|
base.body ?? "",
|
|
122713
123894
|
branch.body ?? "",
|
|
122714
|
-
|
|
123895
|
+
format4,
|
|
122715
123896
|
child(ROOT, { field: bodyName }, { o: ancestor.body, a: base.body, b: branch.body }),
|
|
122716
123897
|
walk2
|
|
122717
123898
|
) : void 0;
|
|
@@ -122737,20 +123918,20 @@ function mergeEntry({
|
|
|
122737
123918
|
function ambiguityOf(branch, schemaRead) {
|
|
122738
123919
|
const seen = /* @__PURE__ */ new Map();
|
|
122739
123920
|
const name3 = (within, key) => JSON.stringify([...within, key]);
|
|
122740
|
-
const
|
|
123921
|
+
const visit5 = (node2, within) => {
|
|
122741
123922
|
if (Array.isArray(node2)) {
|
|
122742
123923
|
const readKeys2 = schemaRead ? [] : itemKeysAsRead(node2);
|
|
122743
123924
|
node2.forEach((item, n7) => {
|
|
122744
123925
|
const key = schemaRead ? usableKey(item) : readKeys2[n7];
|
|
122745
123926
|
if (key === void 0) return;
|
|
122746
123927
|
seen.set(name3(within, key), (seen.get(name3(within, key)) ?? 0) + 1);
|
|
122747
|
-
|
|
123928
|
+
visit5(item, [...within, key]);
|
|
122748
123929
|
});
|
|
122749
123930
|
} else if (isPlainRecord(node2)) {
|
|
122750
|
-
for (const value of Object.values(node2))
|
|
123931
|
+
for (const value of Object.values(node2)) visit5(value, within);
|
|
122751
123932
|
}
|
|
122752
123933
|
};
|
|
122753
|
-
|
|
123934
|
+
visit5(branch, []);
|
|
122754
123935
|
return (within, key) => (seen.get(name3(within, key)) ?? 0) > 1;
|
|
122755
123936
|
}
|
|
122756
123937
|
function keyedItems(data4) {
|
|
@@ -123187,18 +124368,18 @@ async function readText(git, oid) {
|
|
|
123187
124368
|
const text4 = await git.raw(["cat-file", "blob", "--end-of-options", oid]);
|
|
123188
124369
|
return Buffer.byteLength(text4, "utf8") === size && !text4.includes("\uFFFD") ? text4 : void 0;
|
|
123189
124370
|
}
|
|
123190
|
-
function holdsRecord(text4,
|
|
123191
|
-
if (
|
|
123192
|
-
if (
|
|
124371
|
+
function holdsRecord(text4, format4) {
|
|
124372
|
+
if (format4 === "json") return isPlainRecord(JSON.parse(text4));
|
|
124373
|
+
if (format4 !== "yaml") return true;
|
|
123193
124374
|
const value = (0, import_yaml4.parse)(text4);
|
|
123194
124375
|
return value === null || value === void 0 || isPlainRecord(value);
|
|
123195
124376
|
}
|
|
123196
|
-
async function readEntry(git, file,
|
|
124377
|
+
async function readEntry(git, file, format4) {
|
|
123197
124378
|
const text4 = await readText(git, file.oid);
|
|
123198
124379
|
if (text4 === void 0) return void 0;
|
|
123199
124380
|
try {
|
|
123200
|
-
if (!holdsRecord(text4,
|
|
123201
|
-
const { data: data4, body } = parseEntryParts(text4,
|
|
124381
|
+
if (!holdsRecord(text4, format4)) return void 0;
|
|
124382
|
+
const { data: data4, body } = parseEntryParts(text4, format4);
|
|
123202
124383
|
const side = { data: structuredClone(data4) };
|
|
123203
124384
|
if (body !== void 0) side.body = body;
|
|
123204
124385
|
const type = parseTypedFilename(path27.posix.basename(file.path))?.type;
|
|
@@ -123219,10 +124400,10 @@ function fieldsFor(flatSchema, file, root5) {
|
|
|
123219
124400
|
return item?.type === "entry-type" ? item.schema : void 0;
|
|
123220
124401
|
}
|
|
123221
124402
|
var sameContent2 = (x6, y3) => exactToken(x6.data) === exactToken(y3.data) && x6.body === y3.body;
|
|
123222
|
-
function serializeEntry(
|
|
123223
|
-
if (
|
|
123224
|
-
if (
|
|
123225
|
-
return serializeFrontmatter(merged.body ?? "", merged.data, onto,
|
|
124403
|
+
function serializeEntry(format4, merged, onto) {
|
|
124404
|
+
if (format4 === "json") return serializeJson(merged.data, onto);
|
|
124405
|
+
if (format4 === "yaml") return serializeYaml(merged.data, onto);
|
|
124406
|
+
return serializeFrontmatter(merged.body ?? "", merged.data, onto, format4);
|
|
123226
124407
|
}
|
|
123227
124408
|
var blobSides = (unit) => {
|
|
123228
124409
|
const [ancestor, base, branch] = [unit.ancestor, sideFile(unit, "base"), sideFile(unit, "branch")];
|
|
@@ -123248,10 +124429,10 @@ var LOCATION = {
|
|
|
123248
124429
|
sidePaths: {},
|
|
123249
124430
|
kind: "changed"
|
|
123250
124431
|
};
|
|
123251
|
-
function readsAs(text4,
|
|
124432
|
+
function readsAs(text4, format4, merged) {
|
|
123252
124433
|
try {
|
|
123253
|
-
if (!holdsRecord(text4,
|
|
123254
|
-
const back = parseEntryParts(text4,
|
|
124434
|
+
if (!holdsRecord(text4, format4)) return false;
|
|
124435
|
+
const back = parseEntryParts(text4, format4);
|
|
123255
124436
|
return sameContent2(
|
|
123256
124437
|
{ data: back.data, ...back.body !== void 0 && { body: back.body } },
|
|
123257
124438
|
merged
|
|
@@ -123268,10 +124449,10 @@ var withoutItemKeys = (value) => {
|
|
|
123268
124449
|
);
|
|
123269
124450
|
};
|
|
123270
124451
|
async function differsInItemKeysOnly(git, x6, y3, contentRoot) {
|
|
123271
|
-
const
|
|
123272
|
-
if (!
|
|
124452
|
+
const format4 = formatOf(y3.path);
|
|
124453
|
+
if (!format4 || x6.path !== y3.path || x6.mode !== y3.mode) return false;
|
|
123273
124454
|
if (entryLogicalPathOfFile(y3.path, normalizeFilesystemPath(contentRoot)) === null) return false;
|
|
123274
|
-
const [a9, b10] = await Promise.all([readEntry(git, x6,
|
|
124455
|
+
const [a9, b10] = await Promise.all([readEntry(git, x6, format4), readEntry(git, y3, format4)]);
|
|
123275
124456
|
return !!a9 && !!b10 && a9.side.body === b10.side.body && exactToken(withoutItemKeys(a9.side.data)) === exactToken(withoutItemKeys(b10.side.data));
|
|
123276
124457
|
}
|
|
123277
124458
|
var Resolver = class {
|
|
@@ -123359,19 +124540,19 @@ var Resolver = class {
|
|
|
123359
124540
|
return { file: { ...b10, path: own4 }, conflict: { path: own4, kind: "unreadable", sides } };
|
|
123360
124541
|
};
|
|
123361
124542
|
if (a9.oid === b10.oid && !apart) return { file: { ...b10, path: at2 } };
|
|
123362
|
-
const
|
|
123363
|
-
if (!
|
|
124543
|
+
const format4 = formatOf(b10.path);
|
|
124544
|
+
if (!format4 || [o8, a9].some((f9) => f9 && formatOf(f9.path) !== format4)) {
|
|
123364
124545
|
return gitClean ? null : keepBranch();
|
|
123365
124546
|
}
|
|
123366
124547
|
const [oSide, aSide, bSide] = await Promise.all(
|
|
123367
|
-
[o8, a9, b10].map((f9) => f9 ? readEntry(git, f9,
|
|
124548
|
+
[o8, a9, b10].map((f9) => f9 ? readEntry(git, f9, format4) : void 0)
|
|
123368
124549
|
);
|
|
123369
124550
|
if (!aSide || !bSide || o8 && !oSide) return gitClean ? null : keepBranch();
|
|
123370
124551
|
const fields = fieldsFor(this.args.flatSchema, b10.path, this.root);
|
|
123371
124552
|
let result;
|
|
123372
124553
|
try {
|
|
123373
124554
|
result = mergeEntry({
|
|
123374
|
-
format:
|
|
124555
|
+
format: format4,
|
|
123375
124556
|
ancestor: oSide?.side ?? { data: {} },
|
|
123376
124557
|
base: aSide.side,
|
|
123377
124558
|
branch: bSide.side,
|
|
@@ -123395,8 +124576,8 @@ var Resolver = class {
|
|
|
123395
124576
|
isBranch: sameContent2(bSide.side, merged),
|
|
123396
124577
|
reads: (text4) => {
|
|
123397
124578
|
try {
|
|
123398
|
-
if (!holdsRecord(text4,
|
|
123399
|
-
const back = parseEntryParts(text4,
|
|
124579
|
+
if (!holdsRecord(text4, format4)) return false;
|
|
124580
|
+
const back = parseEntryParts(text4, format4);
|
|
123400
124581
|
return sameContent2(
|
|
123401
124582
|
{ data: back.data, ...back.body !== void 0 && { body: back.body } },
|
|
123402
124583
|
merged
|
|
@@ -123405,7 +124586,7 @@ var Resolver = class {
|
|
|
123405
124586
|
return false;
|
|
123406
124587
|
}
|
|
123407
124588
|
},
|
|
123408
|
-
serialize: (onto) => serializeEntry(
|
|
124589
|
+
serialize: (onto) => serializeEntry(format4, merged, onto)
|
|
123409
124590
|
},
|
|
123410
124591
|
at2
|
|
123411
124592
|
);
|
|
@@ -123424,17 +124605,17 @@ var Resolver = class {
|
|
|
123424
124605
|
const { git } = this.args;
|
|
123425
124606
|
const [o8, a9, b10] = [unit.ancestor, sideFile(unit, "base"), sideFile(unit, "branch")];
|
|
123426
124607
|
if (!a9 || !b10 || !gitFile || a9.oid === b10.oid) return null;
|
|
123427
|
-
const
|
|
123428
|
-
if (!
|
|
124608
|
+
const format4 = formatOf(gitFile.path);
|
|
124609
|
+
if (!format4 || [o8, a9, b10].some((f9) => f9 && formatOf(f9.path) !== format4)) return null;
|
|
123429
124610
|
const [oSide, aSide, bSide, gitSide] = await Promise.all(
|
|
123430
|
-
[o8, a9, b10, gitFile].map((f9) => f9 ? readEntry(git, f9,
|
|
124611
|
+
[o8, a9, b10, gitFile].map((f9) => f9 ? readEntry(git, f9, format4) : void 0)
|
|
123431
124612
|
);
|
|
123432
124613
|
if (!aSide || !bSide || !gitSide || o8 && !oSide) return null;
|
|
123433
124614
|
const fields = fieldsFor(this.args.flatSchema, b10.path, this.root);
|
|
123434
124615
|
let result;
|
|
123435
124616
|
try {
|
|
123436
124617
|
result = mergeEntry({
|
|
123437
|
-
format:
|
|
124618
|
+
format: format4,
|
|
123438
124619
|
ancestor: oSide?.side ?? { data: {} },
|
|
123439
124620
|
base: aSide.side,
|
|
123440
124621
|
branch: bSide.side,
|
|
@@ -123454,8 +124635,8 @@ var Resolver = class {
|
|
|
123454
124635
|
branch: gitFile,
|
|
123455
124636
|
isBase: false,
|
|
123456
124637
|
isBranch: false,
|
|
123457
|
-
reads: (text4) => readsAs(text4,
|
|
123458
|
-
serialize: (onto) => serializeEntry(
|
|
124638
|
+
reads: (text4) => readsAs(text4, format4, merged),
|
|
124639
|
+
serialize: (onto) => serializeEntry(format4, merged, onto)
|
|
123459
124640
|
},
|
|
123460
124641
|
gitFile.path
|
|
123461
124642
|
);
|
|
@@ -123480,7 +124661,7 @@ var Resolver = class {
|
|
|
123480
124661
|
};
|
|
123481
124662
|
}
|
|
123482
124663
|
if (!o8 || !a9 || !b10) return null;
|
|
123483
|
-
const
|
|
124664
|
+
const parse7 = async (file2) => {
|
|
123484
124665
|
const text4 = await readText(git, file2.oid);
|
|
123485
124666
|
if (text4 === void 0) return void 0;
|
|
123486
124667
|
try {
|
|
@@ -123490,7 +124671,7 @@ var Resolver = class {
|
|
|
123490
124671
|
return void 0;
|
|
123491
124672
|
}
|
|
123492
124673
|
};
|
|
123493
|
-
const [oJson, aJson, bJson] = await Promise.all([o8, a9, b10].map(
|
|
124674
|
+
const [oJson, aJson, bJson] = await Promise.all([o8, a9, b10].map(parse7));
|
|
123494
124675
|
if (!oJson || !aJson || !bJson) return null;
|
|
123495
124676
|
const merged = mergeCollectionMeta(oJson.json, aJson.json, bJson.json);
|
|
123496
124677
|
const dirId = extractIdFromFilename(path27.posix.basename(path27.posix.dirname(b10.path)));
|
|
@@ -130737,7 +131918,7 @@ var runtime = {
|
|
|
130737
131918
|
};
|
|
130738
131919
|
var base64url = {
|
|
130739
131920
|
parse(string3, opts) {
|
|
130740
|
-
return
|
|
131921
|
+
return parse6(string3, base64UrlEncoding, opts);
|
|
130741
131922
|
},
|
|
130742
131923
|
stringify(data4, opts) {
|
|
130743
131924
|
return stringify(data4, base64UrlEncoding, opts);
|
|
@@ -130747,7 +131928,7 @@ var base64UrlEncoding = {
|
|
|
130747
131928
|
chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
|
|
130748
131929
|
bits: 6
|
|
130749
131930
|
};
|
|
130750
|
-
function
|
|
131931
|
+
function parse6(string3, encoding, opts = {}) {
|
|
130751
131932
|
if (!encoding.codes) {
|
|
130752
131933
|
encoding.codes = {};
|
|
130753
131934
|
for (let i10 = 0; i10 < encoding.chars.length; ++i10) {
|
|
@@ -130985,8 +132166,8 @@ function importKey(key, algorithm, keyUsage) {
|
|
|
130985
132166
|
return runtime.crypto.subtle.importKey("jwk", key, algorithm, false, [keyUsage]);
|
|
130986
132167
|
}
|
|
130987
132168
|
const keyData = pemToBuffer(key);
|
|
130988
|
-
const
|
|
130989
|
-
return runtime.crypto.subtle.importKey(
|
|
132169
|
+
const format4 = keyUsage === "sign" ? "pkcs8" : "spki";
|
|
132170
|
+
return runtime.crypto.subtle.importKey(format4, keyData, algorithm, false, [keyUsage]);
|
|
130990
132171
|
}
|
|
130991
132172
|
var DEFAULT_CLOCK_SKEW_IN_MS = 5 * 1e3;
|
|
130992
132173
|
async function hasValidSignature(jwt, key) {
|