@specship/specship-win32-arm64 0.13.0 → 0.13.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/lib/dist/server/cli.js +1 -1
- package/lib/dist/server/routes/sse.js +1 -1
- package/lib/dist/server/server.js +1 -1
- package/lib/node_modules/.package-lock.json +11 -20
- package/lib/node_modules/ajv/node_modules/fast-uri/index.js +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/package.json +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/test/security.test.js +28 -0
- package/lib/node_modules/toad-cache/README.md +10 -9
- package/lib/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
- package/lib/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
- package/lib/node_modules/toad-cache/package.json +8 -8
- package/lib/node_modules/toad-cache/toad-cache.d.cts +20 -14
- package/lib/node_modules/toad-cache/toad-cache.d.ts +18 -14
- package/lib/node_modules/yaml/README.md +14 -31
- package/lib/node_modules/yaml/browser/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/browser/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/browser/dist/compose/compose-scalar.js +8 -14
- package/lib/node_modules/yaml/browser/dist/compose/composer.js +2 -4
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/browser/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/browser/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/browser/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/browser/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/browser/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/browser/dist/errors.js +1 -1
- package/lib/node_modules/yaml/browser/dist/log.js +6 -1
- package/lib/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +21 -0
- package/lib/node_modules/yaml/browser/dist/nodes/Alias.js +12 -27
- package/lib/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
- package/lib/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +49 -8
- package/lib/node_modules/yaml/browser/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/browser/dist/parse/parser.js +8 -31
- package/lib/node_modules/yaml/browser/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/browser/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/tags.js +16 -29
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +13 -5
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyString.js +16 -24
- package/lib/node_modules/yaml/browser/dist/util.js +1 -1
- package/lib/node_modules/yaml/dist/cli.d.ts +1 -1
- package/lib/node_modules/yaml/dist/cli.mjs +3 -5
- package/lib/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
- package/lib/node_modules/yaml/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/dist/compose/compose-node.d.ts +7 -8
- package/lib/node_modules/yaml/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-scalar.js +7 -13
- package/lib/node_modules/yaml/dist/compose/composer.d.ts +6 -7
- package/lib/node_modules/yaml/dist/compose/composer.js +3 -6
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
- package/lib/node_modules/yaml/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/dist/doc/Document.d.ts +11 -11
- package/lib/node_modules/yaml/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
- package/lib/node_modules/yaml/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
- package/lib/node_modules/yaml/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/dist/doc/directives.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.js +1 -1
- package/lib/node_modules/yaml/dist/index.d.ts +18 -21
- package/lib/node_modules/yaml/dist/log.js +4 -4
- package/lib/node_modules/yaml/dist/nodes/Alias.d.ts +9 -10
- package/lib/node_modules/yaml/dist/nodes/Alias.js +11 -26
- package/lib/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/nodes/Node.d.ts +9 -16
- package/lib/node_modules/yaml/dist/nodes/Pair.d.ts +8 -9
- package/lib/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -9
- package/lib/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.js +48 -7
- package/lib/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
- package/lib/node_modules/yaml/dist/nodes/toJS.d.ts +2 -4
- package/lib/node_modules/yaml/dist/options.d.ts +10 -22
- package/lib/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
- package/lib/node_modules/yaml/dist/parse/cst.d.ts +3 -4
- package/lib/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/dist/parse/parser.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/parser.js +9 -33
- package/lib/node_modules/yaml/dist/public-api.d.ts +5 -6
- package/lib/node_modules/yaml/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/dist/schema/Schema.d.ts +5 -4
- package/lib/node_modules/yaml/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/dist/schema/tags.d.ts +3 -11
- package/lib/node_modules/yaml/dist/schema/tags.js +13 -26
- package/lib/node_modules/yaml/dist/schema/types.d.ts +12 -14
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.js +7 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +17 -11
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyString.js +15 -23
- package/lib/node_modules/yaml/dist/util.d.ts +12 -16
- package/lib/node_modules/yaml/dist/util.js +2 -2
- package/lib/node_modules/yaml/dist/visit.d.ts +7 -7
- package/lib/node_modules/yaml/package.json +14 -13
- package/lib/package.json +5 -6
- package/package.json +1 -1
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/lib/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/lib/node_modules/jsonc-parser/README.md +0 -364
- package/lib/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +0 -185
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +0 -261
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +0 -659
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +0 -443
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +0 -29
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +0 -178
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +0 -201
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +0 -275
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +0 -682
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +0 -456
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +0 -42
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +0 -194
- package/lib/node_modules/jsonc-parser/package.json +0 -37
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -67
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -71
|
@@ -312,7 +312,7 @@ class Lexer {
|
|
|
312
312
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
313
313
|
this.indentNext = this.indentValue + 1;
|
|
314
314
|
this.indentValue += n;
|
|
315
|
-
return
|
|
315
|
+
return yield* this.parseBlockStart();
|
|
316
316
|
}
|
|
317
317
|
return 'doc';
|
|
318
318
|
}
|
|
@@ -633,36 +633,32 @@ class Lexer {
|
|
|
633
633
|
return 0;
|
|
634
634
|
}
|
|
635
635
|
*pushIndicators() {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
n += yield* this.pushSpaces(true);
|
|
659
|
-
continue loop;
|
|
660
|
-
}
|
|
636
|
+
switch (this.charAt(0)) {
|
|
637
|
+
case '!':
|
|
638
|
+
return ((yield* this.pushTag()) +
|
|
639
|
+
(yield* this.pushSpaces(true)) +
|
|
640
|
+
(yield* this.pushIndicators()));
|
|
641
|
+
case '&':
|
|
642
|
+
return ((yield* this.pushUntil(isNotAnchorChar)) +
|
|
643
|
+
(yield* this.pushSpaces(true)) +
|
|
644
|
+
(yield* this.pushIndicators()));
|
|
645
|
+
case '-': // this is an error
|
|
646
|
+
case '?': // this is an error outside flow collections
|
|
647
|
+
case ':': {
|
|
648
|
+
const inFlow = this.flowLevel > 0;
|
|
649
|
+
const ch1 = this.charAt(1);
|
|
650
|
+
if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
|
|
651
|
+
if (!inFlow)
|
|
652
|
+
this.indentNext = this.indentValue + 1;
|
|
653
|
+
else if (this.flowKey)
|
|
654
|
+
this.flowKey = false;
|
|
655
|
+
return ((yield* this.pushCount(1)) +
|
|
656
|
+
(yield* this.pushSpaces(true)) +
|
|
657
|
+
(yield* this.pushIndicators()));
|
|
661
658
|
}
|
|
662
659
|
}
|
|
663
|
-
break loop;
|
|
664
660
|
}
|
|
665
|
-
return
|
|
661
|
+
return 0;
|
|
666
662
|
}
|
|
667
663
|
*pushTag() {
|
|
668
664
|
if (this.charAt(1) === '<') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Token } from './cst.js';
|
|
2
2
|
/**
|
|
3
3
|
* A YAML concrete syntax tree (CST) parser
|
|
4
4
|
*
|
|
@@ -57,14 +57,14 @@ export declare class Parser {
|
|
|
57
57
|
*
|
|
58
58
|
* @returns A generator of tokens representing each directive, document, and other structure.
|
|
59
59
|
*/
|
|
60
|
-
parse(source: string, incomplete?: boolean): Generator<Token, void>;
|
|
60
|
+
parse(source: string, incomplete?: boolean): Generator<Token, void, unknown>;
|
|
61
61
|
/**
|
|
62
62
|
* Advance the parser by the `source` of one lexical token.
|
|
63
63
|
*/
|
|
64
|
-
next(source: string): Generator<Token, void>;
|
|
64
|
+
next(source: string): Generator<Token, void, unknown>;
|
|
65
65
|
private lexer;
|
|
66
66
|
/** Call at end of input to push out any remaining constructions */
|
|
67
|
-
end(): Generator<Token, void>;
|
|
67
|
+
end(): Generator<Token, void, unknown>;
|
|
68
68
|
private get sourceToken();
|
|
69
69
|
private step;
|
|
70
70
|
private peek;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var node_process = require('process');
|
|
4
3
|
var cst = require('./cst.js');
|
|
5
4
|
var lexer = require('./lexer.js');
|
|
6
5
|
|
|
@@ -70,14 +69,6 @@ function getFirstKeyStartProps(prev) {
|
|
|
70
69
|
}
|
|
71
70
|
return prev.splice(i, prev.length);
|
|
72
71
|
}
|
|
73
|
-
function arrayPushArray(target, source) {
|
|
74
|
-
// May exhaust call stack with large `source` array
|
|
75
|
-
if (source.length < 1e5)
|
|
76
|
-
Array.prototype.push.apply(target, source);
|
|
77
|
-
else
|
|
78
|
-
for (let i = 0; i < source.length; ++i)
|
|
79
|
-
target.push(source[i]);
|
|
80
|
-
}
|
|
81
72
|
function fixFlowSeqItems(fc) {
|
|
82
73
|
if (fc.start.type === 'flow-seq-start') {
|
|
83
74
|
for (const it of fc.items) {
|
|
@@ -90,12 +81,12 @@ function fixFlowSeqItems(fc) {
|
|
|
90
81
|
delete it.key;
|
|
91
82
|
if (isFlowToken(it.value)) {
|
|
92
83
|
if (it.value.end)
|
|
93
|
-
|
|
84
|
+
Array.prototype.push.apply(it.value.end, it.sep);
|
|
94
85
|
else
|
|
95
86
|
it.value.end = it.sep;
|
|
96
87
|
}
|
|
97
88
|
else
|
|
98
|
-
|
|
89
|
+
Array.prototype.push.apply(it.start, it.sep);
|
|
99
90
|
delete it.sep;
|
|
100
91
|
}
|
|
101
92
|
}
|
|
@@ -175,7 +166,7 @@ class Parser {
|
|
|
175
166
|
*/
|
|
176
167
|
*next(source) {
|
|
177
168
|
this.source = source;
|
|
178
|
-
if (
|
|
169
|
+
if (process.env.LOG_TOKENS)
|
|
179
170
|
console.log('|', cst.prettyToken(source));
|
|
180
171
|
if (this.atScalar) {
|
|
181
172
|
this.atScalar = false;
|
|
@@ -239,7 +230,7 @@ class Parser {
|
|
|
239
230
|
}
|
|
240
231
|
*step() {
|
|
241
232
|
const top = this.peek(1);
|
|
242
|
-
if (this.type === 'doc-end' && top
|
|
233
|
+
if (this.type === 'doc-end' && (!top || top.type !== 'doc-end')) {
|
|
243
234
|
while (this.stack.length > 0)
|
|
244
235
|
yield* this.pop();
|
|
245
236
|
this.stack.push({
|
|
@@ -515,7 +506,7 @@ class Parser {
|
|
|
515
506
|
const prev = map.items[map.items.length - 2];
|
|
516
507
|
const end = prev?.value?.end;
|
|
517
508
|
if (Array.isArray(end)) {
|
|
518
|
-
|
|
509
|
+
Array.prototype.push.apply(end, it.start);
|
|
519
510
|
end.push(this.sourceToken);
|
|
520
511
|
map.items.pop();
|
|
521
512
|
return;
|
|
@@ -621,9 +612,7 @@ class Parser {
|
|
|
621
612
|
const sep = it.sep;
|
|
622
613
|
sep.push(this.sourceToken);
|
|
623
614
|
// @ts-expect-error type guard is wrong here
|
|
624
|
-
delete it.key;
|
|
625
|
-
// @ts-expect-error type guard is wrong here
|
|
626
|
-
delete it.sep;
|
|
615
|
+
delete it.key, delete it.sep;
|
|
627
616
|
this.stack.push({
|
|
628
617
|
type: 'block-map',
|
|
629
618
|
offset: this.offset,
|
|
@@ -681,20 +670,7 @@ class Parser {
|
|
|
681
670
|
default: {
|
|
682
671
|
const bv = this.startBlockValue(map);
|
|
683
672
|
if (bv) {
|
|
684
|
-
if (bv.type
|
|
685
|
-
if (!it.explicitKey &&
|
|
686
|
-
it.sep &&
|
|
687
|
-
!includesToken(it.sep, 'newline')) {
|
|
688
|
-
yield* this.pop({
|
|
689
|
-
type: 'error',
|
|
690
|
-
offset: this.offset,
|
|
691
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
692
|
-
source: this.source
|
|
693
|
-
});
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
else if (atMapIndent) {
|
|
673
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
698
674
|
map.items.push({ start });
|
|
699
675
|
}
|
|
700
676
|
this.stack.push(bv);
|
|
@@ -730,7 +706,7 @@ class Parser {
|
|
|
730
706
|
const prev = seq.items[seq.items.length - 2];
|
|
731
707
|
const end = prev?.value?.end;
|
|
732
708
|
if (Array.isArray(end)) {
|
|
733
|
-
|
|
709
|
+
Array.prototype.push.apply(end, it.start);
|
|
734
710
|
end.push(this.sourceToken);
|
|
735
711
|
seq.items.pop();
|
|
736
712
|
return;
|
|
@@ -771,7 +747,7 @@ class Parser {
|
|
|
771
747
|
do {
|
|
772
748
|
yield* this.pop();
|
|
773
749
|
top = this.peek(1);
|
|
774
|
-
} while (top
|
|
750
|
+
} while (top && top.type === 'flow-collection');
|
|
775
751
|
}
|
|
776
752
|
else if (fc.end.length === 0) {
|
|
777
753
|
switch (this.type) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Composer } from './compose/composer';
|
|
2
|
-
import type { Reviver } from './doc/applyReviver';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
import type { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, ToStringOptions } from './options';
|
|
1
|
+
import { Composer } from './compose/composer.js';
|
|
2
|
+
import type { Reviver } from './doc/applyReviver.js';
|
|
3
|
+
import { Document, Replacer } from './doc/Document.js';
|
|
4
|
+
import type { Node, ParsedNode } from './nodes/Node.js';
|
|
5
|
+
import type { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, ToStringOptions } from './options.js';
|
|
7
6
|
export interface EmptyStream extends Array<Document.Parsed>, ReturnType<Composer['streamInfo']> {
|
|
8
7
|
empty: true;
|
|
9
8
|
}
|
|
@@ -4,7 +4,6 @@ var composer = require('./compose/composer.js');
|
|
|
4
4
|
var Document = require('./doc/Document.js');
|
|
5
5
|
var errors = require('./errors.js');
|
|
6
6
|
var log = require('./log.js');
|
|
7
|
-
var identity = require('./nodes/identity.js');
|
|
8
7
|
var lineCounter = require('./parse/line-counter.js');
|
|
9
8
|
var parser = require('./parse/parser.js');
|
|
10
9
|
|
|
@@ -96,8 +95,6 @@ function stringify(value, replacer, options) {
|
|
|
96
95
|
if (!keepUndefined)
|
|
97
96
|
return undefined;
|
|
98
97
|
}
|
|
99
|
-
if (identity.isDocument(value) && !_replacer)
|
|
100
|
-
return value.toString(options);
|
|
101
98
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
102
99
|
}
|
|
103
100
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { MAP, SCALAR, SEQ } from '../nodes/identity';
|
|
2
|
-
import type { Pair } from '../nodes/Pair';
|
|
3
|
-
import type { SchemaOptions, ToStringOptions } from '../options';
|
|
4
|
-
import type { CollectionTag, ScalarTag } from './types';
|
|
1
|
+
import { MAP, SCALAR, SEQ } from '../nodes/identity.js';
|
|
2
|
+
import type { Pair } from '../nodes/Pair.js';
|
|
3
|
+
import type { SchemaOptions, ToStringOptions } from '../options.js';
|
|
4
|
+
import type { CollectionTag, ScalarTag } from './types.js';
|
|
5
5
|
export declare class Schema {
|
|
6
6
|
compat: Array<CollectionTag | ScalarTag> | null;
|
|
7
7
|
knownTags: Record<string, CollectionTag | ScalarTag>;
|
|
8
|
+
merge: boolean;
|
|
8
9
|
name: string;
|
|
9
10
|
sortMapEntries: ((a: Pair, b: Pair) => number) | null;
|
|
10
11
|
tags: Array<CollectionTag | ScalarTag>;
|
|
@@ -14,9 +14,10 @@ class Schema {
|
|
|
14
14
|
: compat
|
|
15
15
|
? tags.getTags(null, compat)
|
|
16
16
|
: null;
|
|
17
|
+
this.merge = !!merge;
|
|
17
18
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
18
19
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
19
|
-
this.tags = tags.getTags(customTags, this.name
|
|
20
|
+
this.tags = tags.getTags(customTags, this.name);
|
|
20
21
|
this.toStringOptions = toStringDefaults ?? null;
|
|
21
22
|
Object.defineProperty(this, identity.MAP, { value: map.map });
|
|
22
23
|
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CollectionTag } from '../types';
|
|
1
|
+
import type { CollectionTag } from '../types.js';
|
|
2
2
|
export declare const map: CollectionTag;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CollectionTag } from '../types';
|
|
1
|
+
import type { CollectionTag } from '../types.js';
|
|
2
2
|
export declare const seq: CollectionTag;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ScalarTag } from '../types';
|
|
1
|
+
import type { ScalarTag } from '../types.js';
|
|
2
2
|
export declare const string: ScalarTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const schema: (import(
|
|
1
|
+
export declare const schema: (import("../types.js").CollectionTag | import("../types.js").ScalarTag)[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CollectionTag, ScalarTag } from '../types.js';
|
|
2
2
|
export declare const schema: (CollectionTag | ScalarTag)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { CollectionTag, ScalarTag } from './types';
|
|
1
|
+
import { SchemaOptions } from '../options.js';
|
|
2
|
+
import type { CollectionTag, ScalarTag } from './types.js';
|
|
3
3
|
declare const tagsByName: {
|
|
4
4
|
binary: ScalarTag;
|
|
5
5
|
bool: ScalarTag & {
|
|
@@ -14,10 +14,6 @@ declare const tagsByName: {
|
|
|
14
14
|
intOct: ScalarTag;
|
|
15
15
|
intTime: ScalarTag;
|
|
16
16
|
map: CollectionTag;
|
|
17
|
-
merge: ScalarTag & {
|
|
18
|
-
identify(value: unknown): boolean;
|
|
19
|
-
test: RegExp;
|
|
20
|
-
};
|
|
21
17
|
null: ScalarTag & {
|
|
22
18
|
test: RegExp;
|
|
23
19
|
};
|
|
@@ -33,10 +29,6 @@ export type TagId = keyof typeof tagsByName;
|
|
|
33
29
|
export type Tags = Array<ScalarTag | CollectionTag | TagId>;
|
|
34
30
|
export declare const coreKnownTags: {
|
|
35
31
|
'tag:yaml.org,2002:binary': ScalarTag;
|
|
36
|
-
'tag:yaml.org,2002:merge': ScalarTag & {
|
|
37
|
-
identify(value: unknown): boolean;
|
|
38
|
-
test: RegExp;
|
|
39
|
-
};
|
|
40
32
|
'tag:yaml.org,2002:omap': CollectionTag;
|
|
41
33
|
'tag:yaml.org,2002:pairs': CollectionTag;
|
|
42
34
|
'tag:yaml.org,2002:set': CollectionTag;
|
|
@@ -44,5 +36,5 @@ export declare const coreKnownTags: {
|
|
|
44
36
|
test: RegExp;
|
|
45
37
|
};
|
|
46
38
|
};
|
|
47
|
-
export declare function getTags(customTags: SchemaOptions['customTags'] | undefined, schemaName: string
|
|
39
|
+
export declare function getTags(customTags: SchemaOptions['customTags'] | undefined, schemaName: string): (CollectionTag | ScalarTag)[];
|
|
48
40
|
export {};
|
|
@@ -10,7 +10,6 @@ var int = require('./core/int.js');
|
|
|
10
10
|
var schema = require('./core/schema.js');
|
|
11
11
|
var schema$1 = require('./json/schema.js');
|
|
12
12
|
var binary = require('./yaml-1.1/binary.js');
|
|
13
|
-
var merge = require('./yaml-1.1/merge.js');
|
|
14
13
|
var omap = require('./yaml-1.1/omap.js');
|
|
15
14
|
var pairs = require('./yaml-1.1/pairs.js');
|
|
16
15
|
var schema$2 = require('./yaml-1.1/schema.js');
|
|
@@ -36,7 +35,6 @@ const tagsByName = {
|
|
|
36
35
|
intOct: int.intOct,
|
|
37
36
|
intTime: timestamp.intTime,
|
|
38
37
|
map: map.map,
|
|
39
|
-
merge: merge.merge,
|
|
40
38
|
null: _null.nullTag,
|
|
41
39
|
omap: omap.omap,
|
|
42
40
|
pairs: pairs.pairs,
|
|
@@ -46,20 +44,13 @@ const tagsByName = {
|
|
|
46
44
|
};
|
|
47
45
|
const coreKnownTags = {
|
|
48
46
|
'tag:yaml.org,2002:binary': binary.binary,
|
|
49
|
-
'tag:yaml.org,2002:merge': merge.merge,
|
|
50
47
|
'tag:yaml.org,2002:omap': omap.omap,
|
|
51
48
|
'tag:yaml.org,2002:pairs': pairs.pairs,
|
|
52
49
|
'tag:yaml.org,2002:set': set.set,
|
|
53
50
|
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
|
54
51
|
};
|
|
55
|
-
function getTags(customTags, schemaName
|
|
56
|
-
|
|
57
|
-
if (schemaTags && !customTags) {
|
|
58
|
-
return addMergeTag && !schemaTags.includes(merge.merge)
|
|
59
|
-
? schemaTags.concat(merge.merge)
|
|
60
|
-
: schemaTags.slice();
|
|
61
|
-
}
|
|
62
|
-
let tags = schemaTags;
|
|
52
|
+
function getTags(customTags, schemaName) {
|
|
53
|
+
let tags = schemas.get(schemaName);
|
|
63
54
|
if (!tags) {
|
|
64
55
|
if (Array.isArray(customTags))
|
|
65
56
|
tags = [];
|
|
@@ -78,21 +69,17 @@ function getTags(customTags, schemaName, addMergeTag) {
|
|
|
78
69
|
else if (typeof customTags === 'function') {
|
|
79
70
|
tags = customTags(tags.slice());
|
|
80
71
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const tagObj =
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (!tags.includes(tagObj))
|
|
93
|
-
tags.push(tagObj);
|
|
94
|
-
return tags;
|
|
95
|
-
}, []);
|
|
72
|
+
return tags.map(tag => {
|
|
73
|
+
if (typeof tag !== 'string')
|
|
74
|
+
return tag;
|
|
75
|
+
const tagObj = tagsByName[tag];
|
|
76
|
+
if (tagObj)
|
|
77
|
+
return tagObj;
|
|
78
|
+
const keys = Object.keys(tagsByName)
|
|
79
|
+
.map(key => JSON.stringify(key))
|
|
80
|
+
.join(', ');
|
|
81
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
82
|
+
});
|
|
96
83
|
}
|
|
97
84
|
|
|
98
85
|
exports.coreKnownTags = coreKnownTags;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import type { CreateNodeContext } from '../doc/createNode';
|
|
2
|
-
import type { Node } from '../nodes/Node';
|
|
3
|
-
import type { Scalar } from '../nodes/Scalar';
|
|
4
|
-
import type { YAMLMap } from '../nodes/YAMLMap';
|
|
5
|
-
import type { YAMLSeq } from '../nodes/YAMLSeq';
|
|
6
|
-
import type { ParseOptions } from '../options';
|
|
7
|
-
import type { StringifyContext } from '../stringify/stringify';
|
|
8
|
-
import type { Schema } from './Schema';
|
|
1
|
+
import type { CreateNodeContext } from '../doc/createNode.js';
|
|
2
|
+
import type { Node } from '../nodes/Node.js';
|
|
3
|
+
import type { Scalar } from '../nodes/Scalar.js';
|
|
4
|
+
import type { YAMLMap } from '../nodes/YAMLMap.js';
|
|
5
|
+
import type { YAMLSeq } from '../nodes/YAMLSeq.js';
|
|
6
|
+
import type { ParseOptions } from '../options.js';
|
|
7
|
+
import type { StringifyContext } from '../stringify/stringify.js';
|
|
8
|
+
import type { Schema } from './Schema.js';
|
|
9
9
|
interface TagBase {
|
|
10
10
|
/**
|
|
11
11
|
* An optional factory function, used e.g. by collections when wrapping JS objects as AST nodes.
|
|
12
12
|
*/
|
|
13
13
|
createNode?: (schema: Schema, value: unknown, ctx: CreateNodeContext) => Node;
|
|
14
14
|
/**
|
|
15
|
-
* If `true`, allows for values to be stringified without
|
|
16
|
-
* an explicit tag
|
|
17
|
-
*
|
|
18
|
-
* For most cases, it's unlikely that you'll actually want to use this,
|
|
19
|
-
* even if you first think you do.
|
|
15
|
+
* If `true`, together with `test` allows for values to be stringified without
|
|
16
|
+
* an explicit tag. For most cases, it's unlikely that you'll actually want to
|
|
17
|
+
* use this, even if you first think you do.
|
|
20
18
|
*/
|
|
21
|
-
default?: boolean
|
|
19
|
+
default?: boolean;
|
|
22
20
|
/**
|
|
23
21
|
* If a tag has multiple forms that should be parsed and/or stringified
|
|
24
22
|
* differently, use `format` to identify them.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ScalarTag } from '../types';
|
|
1
|
+
import type { ScalarTag } from '../types.js';
|
|
2
2
|
export declare const binary: ScalarTag;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var node_buffer = require('buffer');
|
|
4
3
|
var Scalar = require('../../nodes/Scalar.js');
|
|
5
4
|
var stringifyString = require('../../stringify/stringifyString.js');
|
|
6
5
|
|
|
@@ -17,8 +16,8 @@ const binary = {
|
|
|
17
16
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
18
17
|
*/
|
|
19
18
|
resolve(src, onError) {
|
|
20
|
-
if (typeof
|
|
21
|
-
return
|
|
19
|
+
if (typeof Buffer === 'function') {
|
|
20
|
+
return Buffer.from(src, 'base64');
|
|
22
21
|
}
|
|
23
22
|
else if (typeof atob === 'function') {
|
|
24
23
|
// On IE 11, atob() can't handle newlines
|
|
@@ -34,15 +33,13 @@ const binary = {
|
|
|
34
33
|
}
|
|
35
34
|
},
|
|
36
35
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
37
|
-
if (!value)
|
|
38
|
-
return '';
|
|
39
36
|
const buf = value; // checked earlier by binary.identify()
|
|
40
37
|
let str;
|
|
41
|
-
if (typeof
|
|
38
|
+
if (typeof Buffer === 'function') {
|
|
42
39
|
str =
|
|
43
|
-
buf instanceof
|
|
40
|
+
buf instanceof Buffer
|
|
44
41
|
? buf.toString('base64')
|
|
45
|
-
:
|
|
42
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
46
43
|
}
|
|
47
44
|
else if (typeof btoa === 'function') {
|
|
48
45
|
let s = '';
|
|
@@ -53,7 +50,8 @@ const binary = {
|
|
|
53
50
|
else {
|
|
54
51
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
55
52
|
}
|
|
56
|
-
|
|
53
|
+
if (!type)
|
|
54
|
+
type = Scalar.Scalar.BLOCK_LITERAL;
|
|
57
55
|
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
58
56
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
59
57
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
6
|
-
import type { CollectionTag } from '../types';
|
|
1
|
+
import { ToJSContext } from '../../nodes/toJS.js';
|
|
2
|
+
import { YAMLSeq } from '../../nodes/YAMLSeq.js';
|
|
3
|
+
import { CreateNodeContext } from '../../util.js';
|
|
4
|
+
import type { Schema } from '../Schema.js';
|
|
5
|
+
import { CollectionTag } from '../types.js';
|
|
7
6
|
export declare class YAMLOMap extends YAMLSeq {
|
|
8
7
|
static tag: string;
|
|
9
8
|
constructor();
|
|
10
|
-
add:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
add: (pair: import("../../index.js").Pair<any, any> | {
|
|
10
|
+
key: any;
|
|
11
|
+
value: any;
|
|
12
|
+
}, overwrite?: boolean) => void;
|
|
13
|
+
delete: (key: unknown) => boolean;
|
|
14
|
+
get: {
|
|
15
|
+
(key: unknown, keepScalar: true): import("../../index.js").Scalar<any> | undefined;
|
|
16
|
+
(key: unknown, keepScalar?: false): any;
|
|
17
|
+
(key: unknown, keepScalar?: boolean): any;
|
|
18
|
+
};
|
|
19
|
+
has: (key: unknown) => boolean;
|
|
20
|
+
set: (key: any, value: any) => void;
|
|
15
21
|
/**
|
|
16
22
|
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
|
|
17
23
|
* but TypeScript won't allow widening the signature of a child method.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { CreateNodeContext } from '../../doc/createNode';
|
|
2
|
-
import type { ParsedNode } from '../../nodes/Node';
|
|
3
|
-
import { Pair } from '../../nodes/Pair';
|
|
4
|
-
import
|
|
5
|
-
import { YAMLSeq } from '../../nodes/YAMLSeq';
|
|
6
|
-
import type { Schema } from '../../schema/Schema';
|
|
7
|
-
import type { CollectionTag } from '../types';
|
|
1
|
+
import type { CreateNodeContext } from '../../doc/createNode.js';
|
|
2
|
+
import type { ParsedNode } from '../../nodes/Node.js';
|
|
3
|
+
import { Pair } from '../../nodes/Pair.js';
|
|
4
|
+
import { YAMLMap } from '../../nodes/YAMLMap.js';
|
|
5
|
+
import { YAMLSeq } from '../../nodes/YAMLSeq.js';
|
|
6
|
+
import type { Schema } from '../../schema/Schema.js';
|
|
7
|
+
import type { CollectionTag } from '../types.js';
|
|
8
8
|
export declare function resolvePairs(seq: YAMLSeq.Parsed<ParsedNode | Pair<ParsedNode, ParsedNode | null>> | YAMLMap.Parsed, onError: (message: string) => void): YAMLSeq.Parsed<Pair<ParsedNode, ParsedNode | null>>;
|
|
9
9
|
export declare function createPairs(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSeq<unknown>;
|
|
10
10
|
export declare const pairs: CollectionTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const schema: (import(
|
|
1
|
+
export declare const schema: (import("../types.js").CollectionTag | import("../types.js").ScalarTag)[];
|
|
@@ -8,7 +8,6 @@ var binary = require('./binary.js');
|
|
|
8
8
|
var bool = require('./bool.js');
|
|
9
9
|
var float = require('./float.js');
|
|
10
10
|
var int = require('./int.js');
|
|
11
|
-
var merge = require('./merge.js');
|
|
12
11
|
var omap = require('./omap.js');
|
|
13
12
|
var pairs = require('./pairs.js');
|
|
14
13
|
var set = require('./set.js');
|
|
@@ -29,7 +28,6 @@ const schema = [
|
|
|
29
28
|
float.floatExp,
|
|
30
29
|
float.float,
|
|
31
30
|
binary.binary,
|
|
32
|
-
merge.merge,
|
|
33
31
|
omap.omap,
|
|
34
32
|
pairs.pairs,
|
|
35
33
|
set.set,
|