@depup/js-yaml 5.2.1-depup.9 → 5.2.2-depup.0

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.
@@ -1,4 +1,4 @@
1
- /*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
1
+ /*! js-yaml 5.2.2 https://github.com/nodeca/js-yaml @license MIT */
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  //#region src/tag.ts
4
4
  var NOT_RESOLVED = Symbol("NOT_RESOLVED");
@@ -1504,6 +1504,17 @@ function addMappingEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd,
1504
1504
  style
1505
1505
  });
1506
1506
  }
1507
+ function insertFlowPairMappingEvent(state, snapshot) {
1508
+ state.events.splice(snapshot.eventsLength, 0, {
1509
+ type: 3,
1510
+ start: snapshot.position,
1511
+ anchorStart: NO_RANGE$1,
1512
+ anchorEnd: NO_RANGE$1,
1513
+ tagStart: NO_RANGE$1,
1514
+ tagEnd: NO_RANGE$1,
1515
+ style: 2
1516
+ });
1517
+ }
1507
1518
  function addScalarEvent(state, valueStart, valueEnd, anchorStart, anchorEnd, tagStart, tagEnd, style, chomping = 1, indent = -1, fast = false) {
1508
1519
  state.events.push({
1509
1520
  type: 4,
@@ -1947,12 +1958,8 @@ function readFlowCollection(state, nodeIndent, props) {
1947
1958
  state.position++;
1948
1959
  skipFlowSeparationSpace(state, nodeIndent);
1949
1960
  if (!isMapping) {
1950
- restoreState(state, entryStart);
1951
- addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
1952
- if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
1953
- skipFlowSeparationSpace(state, nodeIndent);
1954
- state.position++;
1955
- skipFlowSeparationSpace(state, nodeIndent);
1961
+ insertFlowPairMappingEvent(state, entryStart);
1962
+ if (!keyWasRead) addEmptyScalarEvent(state);
1956
1963
  } else if (!keyWasRead) addEmptyScalarEvent(state);
1957
1964
  if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
1958
1965
  skipFlowSeparationSpace(state, nodeIndent);
@@ -1962,9 +1969,8 @@ function readFlowCollection(state, nodeIndent, props) {
1962
1969
  addEmptyScalarEvent(state);
1963
1970
  } else if (isMapping) addEmptyScalarEvent(state);
1964
1971
  else if (isPair) {
1965
- restoreState(state, entryStart);
1966
- addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
1967
- parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1972
+ insertFlowPairMappingEvent(state, entryStart);
1973
+ if (!keyWasRead) addEmptyScalarEvent(state);
1968
1974
  addEmptyScalarEvent(state);
1969
1975
  addPopEvent(state);
1970
1976
  }
@@ -2609,7 +2615,7 @@ function isNsCharOrWhitespace(c) {
2609
2615
  function isPlainSafe(c, prev, inblock) {
2610
2616
  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
2611
2617
  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
2612
- return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
2618
+ return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar && (inblock || c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET);
2613
2619
  }
2614
2620
  function isPlainSafeFirst(c) {
2615
2621
  return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;