@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.
Files changed (183) hide show
  1. package/lib/dist/server/cli.js +1 -1
  2. package/lib/dist/server/routes/sse.js +1 -1
  3. package/lib/dist/server/server.js +1 -1
  4. package/lib/node_modules/.package-lock.json +11 -20
  5. package/lib/node_modules/ajv/node_modules/fast-uri/index.js +1 -1
  6. package/lib/node_modules/ajv/node_modules/fast-uri/package.json +1 -1
  7. package/lib/node_modules/ajv/node_modules/fast-uri/test/security.test.js +28 -0
  8. package/lib/node_modules/toad-cache/README.md +10 -9
  9. package/lib/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
  10. package/lib/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
  11. package/lib/node_modules/toad-cache/package.json +8 -8
  12. package/lib/node_modules/toad-cache/toad-cache.d.cts +20 -14
  13. package/lib/node_modules/toad-cache/toad-cache.d.ts +18 -14
  14. package/lib/node_modules/yaml/README.md +14 -31
  15. package/lib/node_modules/yaml/browser/dist/compose/compose-collection.js +3 -3
  16. package/lib/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -1
  17. package/lib/node_modules/yaml/browser/dist/compose/compose-node.js +4 -21
  18. package/lib/node_modules/yaml/browser/dist/compose/compose-scalar.js +8 -14
  19. package/lib/node_modules/yaml/browser/dist/compose/composer.js +2 -4
  20. package/lib/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -2
  21. package/lib/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -3
  22. package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -8
  23. package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +4 -6
  24. package/lib/node_modules/yaml/browser/dist/compose/resolve-props.js +5 -3
  25. package/lib/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +2 -1
  26. package/lib/node_modules/yaml/browser/dist/compose/util-map-includes.js +5 -1
  27. package/lib/node_modules/yaml/browser/dist/doc/Document.js +2 -3
  28. package/lib/node_modules/yaml/browser/dist/doc/anchors.js +2 -1
  29. package/lib/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -1
  30. package/lib/node_modules/yaml/browser/dist/doc/createNode.js +2 -1
  31. package/lib/node_modules/yaml/browser/dist/errors.js +1 -1
  32. package/lib/node_modules/yaml/browser/dist/log.js +6 -1
  33. package/lib/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +21 -0
  34. package/lib/node_modules/yaml/browser/dist/nodes/Alias.js +12 -27
  35. package/lib/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
  36. package/lib/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +49 -8
  37. package/lib/node_modules/yaml/browser/dist/parse/lexer.js +24 -28
  38. package/lib/node_modules/yaml/browser/dist/parse/parser.js +8 -31
  39. package/lib/node_modules/yaml/browser/dist/public-api.js +0 -3
  40. package/lib/node_modules/yaml/browser/dist/schema/Schema.js +2 -1
  41. package/lib/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
  42. package/lib/node_modules/yaml/browser/dist/schema/tags.js +16 -29
  43. package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +13 -5
  44. package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
  45. package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -2
  46. package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
  47. package/lib/node_modules/yaml/browser/dist/stringify/stringify.js +5 -10
  48. package/lib/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +3 -13
  49. package/lib/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -3
  50. package/lib/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
  51. package/lib/node_modules/yaml/browser/dist/stringify/stringifyString.js +16 -24
  52. package/lib/node_modules/yaml/browser/dist/util.js +1 -1
  53. package/lib/node_modules/yaml/dist/cli.d.ts +1 -1
  54. package/lib/node_modules/yaml/dist/cli.mjs +3 -5
  55. package/lib/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
  56. package/lib/node_modules/yaml/dist/compose/compose-collection.js +3 -3
  57. package/lib/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
  58. package/lib/node_modules/yaml/dist/compose/compose-doc.js +0 -1
  59. package/lib/node_modules/yaml/dist/compose/compose-node.d.ts +7 -8
  60. package/lib/node_modules/yaml/dist/compose/compose-node.js +4 -21
  61. package/lib/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
  62. package/lib/node_modules/yaml/dist/compose/compose-scalar.js +7 -13
  63. package/lib/node_modules/yaml/dist/compose/composer.d.ts +6 -7
  64. package/lib/node_modules/yaml/dist/compose/composer.js +3 -6
  65. package/lib/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
  66. package/lib/node_modules/yaml/dist/compose/resolve-block-map.js +0 -2
  67. package/lib/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
  68. package/lib/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
  69. package/lib/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -3
  70. package/lib/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
  71. package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
  72. package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -8
  73. package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
  74. package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.js +4 -6
  75. package/lib/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
  76. package/lib/node_modules/yaml/dist/compose/resolve-props.js +5 -3
  77. package/lib/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
  78. package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
  79. package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.js +2 -1
  80. package/lib/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
  81. package/lib/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
  82. package/lib/node_modules/yaml/dist/compose/util-map-includes.js +5 -1
  83. package/lib/node_modules/yaml/dist/doc/Document.d.ts +11 -11
  84. package/lib/node_modules/yaml/dist/doc/Document.js +2 -3
  85. package/lib/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
  86. package/lib/node_modules/yaml/dist/doc/anchors.js +2 -1
  87. package/lib/node_modules/yaml/dist/doc/applyReviver.js +0 -1
  88. package/lib/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
  89. package/lib/node_modules/yaml/dist/doc/createNode.js +2 -1
  90. package/lib/node_modules/yaml/dist/doc/directives.d.ts +1 -1
  91. package/lib/node_modules/yaml/dist/errors.d.ts +1 -1
  92. package/lib/node_modules/yaml/dist/errors.js +1 -1
  93. package/lib/node_modules/yaml/dist/index.d.ts +18 -21
  94. package/lib/node_modules/yaml/dist/log.js +4 -4
  95. package/lib/node_modules/yaml/dist/nodes/Alias.d.ts +9 -10
  96. package/lib/node_modules/yaml/dist/nodes/Alias.js +11 -26
  97. package/lib/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
  98. package/lib/node_modules/yaml/dist/nodes/Node.d.ts +9 -16
  99. package/lib/node_modules/yaml/dist/nodes/Pair.d.ts +8 -9
  100. package/lib/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -9
  101. package/lib/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
  102. package/lib/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
  103. package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
  104. package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.js +48 -7
  105. package/lib/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
  106. package/lib/node_modules/yaml/dist/nodes/toJS.d.ts +2 -4
  107. package/lib/node_modules/yaml/dist/options.d.ts +10 -22
  108. package/lib/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
  109. package/lib/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
  110. package/lib/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
  111. package/lib/node_modules/yaml/dist/parse/cst.d.ts +3 -4
  112. package/lib/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
  113. package/lib/node_modules/yaml/dist/parse/lexer.js +24 -28
  114. package/lib/node_modules/yaml/dist/parse/parser.d.ts +4 -4
  115. package/lib/node_modules/yaml/dist/parse/parser.js +9 -33
  116. package/lib/node_modules/yaml/dist/public-api.d.ts +5 -6
  117. package/lib/node_modules/yaml/dist/public-api.js +0 -3
  118. package/lib/node_modules/yaml/dist/schema/Schema.d.ts +5 -4
  119. package/lib/node_modules/yaml/dist/schema/Schema.js +2 -1
  120. package/lib/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
  121. package/lib/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
  122. package/lib/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
  123. package/lib/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
  124. package/lib/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
  125. package/lib/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
  126. package/lib/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
  127. package/lib/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
  128. package/lib/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
  129. package/lib/node_modules/yaml/dist/schema/json/schema.js +1 -1
  130. package/lib/node_modules/yaml/dist/schema/tags.d.ts +3 -11
  131. package/lib/node_modules/yaml/dist/schema/tags.js +13 -26
  132. package/lib/node_modules/yaml/dist/schema/types.d.ts +12 -14
  133. package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
  134. package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.js +7 -9
  135. package/lib/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
  136. package/lib/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
  137. package/lib/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
  138. package/lib/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +17 -11
  139. package/lib/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
  140. package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
  141. package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -2
  142. package/lib/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
  143. package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
  144. package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
  145. package/lib/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
  146. package/lib/node_modules/yaml/dist/stringify/stringify.js +5 -10
  147. package/lib/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
  148. package/lib/node_modules/yaml/dist/stringify/stringifyCollection.js +3 -13
  149. package/lib/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
  150. package/lib/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
  151. package/lib/node_modules/yaml/dist/stringify/stringifyNumber.js +2 -3
  152. package/lib/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
  153. package/lib/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
  154. package/lib/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
  155. package/lib/node_modules/yaml/dist/stringify/stringifyString.js +15 -23
  156. package/lib/node_modules/yaml/dist/util.d.ts +12 -16
  157. package/lib/node_modules/yaml/dist/util.js +2 -2
  158. package/lib/node_modules/yaml/dist/visit.d.ts +7 -7
  159. package/lib/node_modules/yaml/package.json +14 -13
  160. package/lib/package.json +5 -6
  161. package/package.json +1 -1
  162. package/lib/node_modules/jsonc-parser/CHANGELOG.md +0 -76
  163. package/lib/node_modules/jsonc-parser/LICENSE.md +0 -21
  164. package/lib/node_modules/jsonc-parser/README.md +0 -364
  165. package/lib/node_modules/jsonc-parser/SECURITY.md +0 -41
  166. package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +0 -185
  167. package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +0 -261
  168. package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +0 -659
  169. package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +0 -443
  170. package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +0 -29
  171. package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +0 -351
  172. package/lib/node_modules/jsonc-parser/lib/esm/main.js +0 -178
  173. package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +0 -201
  174. package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +0 -275
  175. package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +0 -682
  176. package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +0 -456
  177. package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +0 -42
  178. package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +0 -351
  179. package/lib/node_modules/jsonc-parser/lib/umd/main.js +0 -194
  180. package/lib/node_modules/jsonc-parser/package.json +0 -37
  181. package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -67
  182. package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
  183. 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 'block-start';
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
- let n = 0;
637
- loop: while (true) {
638
- switch (this.charAt(0)) {
639
- case '!':
640
- n += yield* this.pushTag();
641
- n += yield* this.pushSpaces(true);
642
- continue loop;
643
- case '&':
644
- n += yield* this.pushUntil(isNotAnchorChar);
645
- n += yield* this.pushSpaces(true);
646
- continue loop;
647
- case '-': // this is an error
648
- case '?': // this is an error outside flow collections
649
- case ':': {
650
- const inFlow = this.flowLevel > 0;
651
- const ch1 = this.charAt(1);
652
- if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
653
- if (!inFlow)
654
- this.indentNext = this.indentValue + 1;
655
- else if (this.flowKey)
656
- this.flowKey = false;
657
- n += yield* this.pushCount(1);
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 n;
661
+ return 0;
666
662
  }
667
663
  *pushTag() {
668
664
  if (this.charAt(1) === '<') {
@@ -1,4 +1,4 @@
1
- import type { Token } from './cst';
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
- arrayPushArray(it.value.end, it.sep);
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
- arrayPushArray(it.start, it.sep);
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 (node_process.env.LOG_TOKENS)
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?.type !== 'doc-end') {
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
- arrayPushArray(end, it.start);
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 === 'block-seq') {
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
- arrayPushArray(end, it.start);
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?.type === 'flow-collection');
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 type { Replacer } from './doc/Document';
4
- import { Document } from './doc/Document';
5
- import type { Node, ParsedNode } from './nodes/Node';
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, merge);
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,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const nullTag: ScalarTag & {
3
3
  test: RegExp;
4
4
  };
@@ -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,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const boolTag: ScalarTag & {
3
3
  test: RegExp;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const floatNaN: ScalarTag;
3
3
  export declare const floatExp: ScalarTag;
4
4
  export declare const float: ScalarTag;
@@ -1,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const intOct: ScalarTag;
3
3
  export declare const int: ScalarTag;
4
4
  export declare const intHex: ScalarTag;
@@ -1 +1 @@
1
- export declare const schema: (import('../types').CollectionTag | import('../types').ScalarTag)[];
1
+ export declare const schema: (import("../types.js").CollectionTag | import("../types.js").ScalarTag)[];
@@ -1,2 +1,2 @@
1
- import type { CollectionTag, ScalarTag } from '../types';
1
+ import { CollectionTag, ScalarTag } from '../types.js';
2
2
  export declare const schema: (CollectionTag | ScalarTag)[];
@@ -29,7 +29,7 @@ const jsonScalars = [
29
29
  identify: value => typeof value === 'boolean',
30
30
  default: true,
31
31
  tag: 'tag:yaml.org,2002:bool',
32
- test: /^true$|^false$/,
32
+ test: /^true|false$/,
33
33
  resolve: str => str === 'true',
34
34
  stringify: stringifyJSON
35
35
  },
@@ -1,5 +1,5 @@
1
- import type { SchemaOptions } from '../options';
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, addMergeTag?: boolean): (CollectionTag | ScalarTag)[];
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, addMergeTag) {
56
- const schemaTags = schemas.get(schemaName);
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
- if (addMergeTag)
82
- tags = tags.concat(merge.merge);
83
- return tags.reduce((tags, tag) => {
84
- const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
85
- if (!tagObj) {
86
- const tagName = JSON.stringify(tag);
87
- const keys = Object.keys(tagsByName)
88
- .map(key => JSON.stringify(key))
89
- .join(', ');
90
- throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
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 together with `test`.
17
- * If `'key'`, this only applies if the value is used as a mapping key.
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 | 'key';
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 node_buffer.Buffer === 'function') {
21
- return node_buffer.Buffer.from(src, 'base64');
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 node_buffer.Buffer === 'function') {
38
+ if (typeof Buffer === 'function') {
42
39
  str =
43
- buf instanceof node_buffer.Buffer
40
+ buf instanceof Buffer
44
41
  ? buf.toString('base64')
45
- : node_buffer.Buffer.from(buf.buffer).toString('base64');
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
- type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
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,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const trueTag: ScalarTag & {
3
3
  test: RegExp;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const floatNaN: ScalarTag;
3
3
  export declare const floatExp: ScalarTag;
4
4
  export declare const float: ScalarTag;
@@ -1,4 +1,4 @@
1
- import type { ScalarTag } from '../types';
1
+ import type { ScalarTag } from '../types.js';
2
2
  export declare const intBin: ScalarTag;
3
3
  export declare const intOct: ScalarTag;
4
4
  export declare const int: ScalarTag;
@@ -1,17 +1,23 @@
1
- import type { ToJSContext } from '../../nodes/toJS';
2
- import { YAMLMap } from '../../nodes/YAMLMap';
3
- import { YAMLSeq } from '../../nodes/YAMLSeq';
4
- import type { CreateNodeContext } from '../../util';
5
- import type { Schema } from '../Schema';
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: typeof YAMLMap.prototype.add;
11
- delete: typeof YAMLMap.prototype.delete;
12
- get: typeof YAMLMap.prototype.get;
13
- has: typeof YAMLMap.prototype.has;
14
- set: typeof YAMLMap.prototype.set;
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 type { YAMLMap } from '../../nodes/YAMLMap';
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('../types').CollectionTag | import('../types').ScalarTag)[];
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,