@speclynx/apidom-parser-adapter-yaml-1-2 4.10.0 → 4.10.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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.10.1](https://github.com/speclynx/apidom/compare/v4.10.0...v4.10.1) (2026-05-20)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
9
+
6
10
  # [4.10.0](https://github.com/speclynx/apidom/compare/v4.9.1...v4.10.0) (2026-05-12)
7
11
 
8
12
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
@@ -12569,8 +12569,10 @@ class Composer {
12569
12569
  }
12570
12570
  }
12571
12571
  if (afterDoc) {
12572
- Array.prototype.push.apply(doc.errors, this.errors);
12573
- Array.prototype.push.apply(doc.warnings, this.warnings);
12572
+ for (let i = 0; i < this.errors.length; ++i)
12573
+ doc.errors.push(this.errors[i]);
12574
+ for (let i = 0; i < this.warnings.length; ++i)
12575
+ doc.warnings.push(this.warnings[i]);
12574
12576
  }
12575
12577
  else {
12576
12578
  doc.errors = this.errors;
@@ -16678,7 +16680,7 @@ class Lexer {
16678
16680
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
16679
16681
  this.indentNext = this.indentValue + 1;
16680
16682
  this.indentValue += n;
16681
- return yield* this.parseBlockStart();
16683
+ return 'block-start';
16682
16684
  }
16683
16685
  return 'doc';
16684
16686
  }
@@ -16999,32 +17001,36 @@ class Lexer {
16999
17001
  return 0;
17000
17002
  }
17001
17003
  *pushIndicators() {
17002
- switch (this.charAt(0)) {
17003
- case '!':
17004
- return ((yield* this.pushTag()) +
17005
- (yield* this.pushSpaces(true)) +
17006
- (yield* this.pushIndicators()));
17007
- case '&':
17008
- return ((yield* this.pushUntil(isNotAnchorChar)) +
17009
- (yield* this.pushSpaces(true)) +
17010
- (yield* this.pushIndicators()));
17011
- case '-': // this is an error
17012
- case '?': // this is an error outside flow collections
17013
- case ':': {
17014
- const inFlow = this.flowLevel > 0;
17015
- const ch1 = this.charAt(1);
17016
- if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
17017
- if (!inFlow)
17018
- this.indentNext = this.indentValue + 1;
17019
- else if (this.flowKey)
17020
- this.flowKey = false;
17021
- return ((yield* this.pushCount(1)) +
17022
- (yield* this.pushSpaces(true)) +
17023
- (yield* this.pushIndicators()));
17004
+ let n = 0;
17005
+ loop: while (true) {
17006
+ switch (this.charAt(0)) {
17007
+ case '!':
17008
+ n += yield* this.pushTag();
17009
+ n += yield* this.pushSpaces(true);
17010
+ continue loop;
17011
+ case '&':
17012
+ n += yield* this.pushUntil(isNotAnchorChar);
17013
+ n += yield* this.pushSpaces(true);
17014
+ continue loop;
17015
+ case '-': // this is an error
17016
+ case '?': // this is an error outside flow collections
17017
+ case ':': {
17018
+ const inFlow = this.flowLevel > 0;
17019
+ const ch1 = this.charAt(1);
17020
+ if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
17021
+ if (!inFlow)
17022
+ this.indentNext = this.indentValue + 1;
17023
+ else if (this.flowKey)
17024
+ this.flowKey = false;
17025
+ n += yield* this.pushCount(1);
17026
+ n += yield* this.pushSpaces(true);
17027
+ continue loop;
17028
+ }
17024
17029
  }
17025
17030
  }
17031
+ break loop;
17026
17032
  }
17027
- return 0;
17033
+ return n;
17028
17034
  }
17029
17035
  *pushTag() {
17030
17036
  if (this.charAt(1) === '<') {
@@ -17217,6 +17223,14 @@ function getFirstKeyStartProps(prev) {
17217
17223
  }
17218
17224
  return prev.splice(i, prev.length);
17219
17225
  }
17226
+ function arrayPushArray(target, source) {
17227
+ // May exhaust call stack with large `source` array
17228
+ if (source.length < 1e5)
17229
+ Array.prototype.push.apply(target, source);
17230
+ else
17231
+ for (let i = 0; i < source.length; ++i)
17232
+ target.push(source[i]);
17233
+ }
17220
17234
  function fixFlowSeqItems(fc) {
17221
17235
  if (fc.start.type === 'flow-seq-start') {
17222
17236
  for (const it of fc.items) {
@@ -17229,12 +17243,12 @@ function fixFlowSeqItems(fc) {
17229
17243
  delete it.key;
17230
17244
  if (isFlowToken(it.value)) {
17231
17245
  if (it.value.end)
17232
- Array.prototype.push.apply(it.value.end, it.sep);
17246
+ arrayPushArray(it.value.end, it.sep);
17233
17247
  else
17234
17248
  it.value.end = it.sep;
17235
17249
  }
17236
17250
  else
17237
- Array.prototype.push.apply(it.start, it.sep);
17251
+ arrayPushArray(it.start, it.sep);
17238
17252
  delete it.sep;
17239
17253
  }
17240
17254
  }
@@ -17652,7 +17666,7 @@ class Parser {
17652
17666
  const prev = map.items[map.items.length - 2];
17653
17667
  const end = prev?.value?.end;
17654
17668
  if (Array.isArray(end)) {
17655
- Array.prototype.push.apply(end, it.start);
17669
+ arrayPushArray(end, it.start);
17656
17670
  end.push(this.sourceToken);
17657
17671
  map.items.pop();
17658
17672
  return;
@@ -17867,7 +17881,7 @@ class Parser {
17867
17881
  const prev = seq.items[seq.items.length - 2];
17868
17882
  const end = prev?.value?.end;
17869
17883
  if (Array.isArray(end)) {
17870
- Array.prototype.push.apply(end, it.start);
17884
+ arrayPushArray(end, it.start);
17871
17885
  end.push(this.sourceToken);
17872
17886
  seq.items.pop();
17873
17887
  return;