gray-matter-es 0.0.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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/dist/defaults.mjs +19 -0
  4. package/dist/defaults.mjs.map +1 -0
  5. package/dist/engines.d.mts +8 -0
  6. package/dist/engines.mjs +63 -0
  7. package/dist/engines.mjs.map +1 -0
  8. package/dist/excerpt.mjs +26 -0
  9. package/dist/excerpt.mjs.map +1 -0
  10. package/dist/index.d.mts +12 -0
  11. package/dist/index.mjs +126 -0
  12. package/dist/index.mjs.map +1 -0
  13. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_chars.mjs +45 -0
  14. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_chars.mjs.map +1 -0
  15. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_dumper_state.mjs +437 -0
  16. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_dumper_state.mjs.map +1 -0
  17. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_loader_state.mjs +909 -0
  18. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_loader_state.mjs.map +1 -0
  19. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_schema.mjs +115 -0
  20. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_schema.mjs.map +1 -0
  21. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/binary.mjs +89 -0
  22. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/binary.mjs.map +1 -0
  23. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/bool.mjs +35 -0
  24. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/bool.mjs.map +1 -0
  25. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/float.mjs +55 -0
  26. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/float.mjs.map +1 -0
  27. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/int.mjs +114 -0
  28. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/int.mjs.map +1 -0
  29. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/map.mjs +15 -0
  30. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/map.mjs.map +1 -0
  31. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/merge.mjs +11 -0
  32. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/merge.mjs.map +1 -0
  33. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/nil.mjs +20 -0
  34. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/nil.mjs.map +1 -0
  35. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/omap.mjs +28 -0
  36. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/omap.mjs.map +1 -0
  37. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/pairs.mjs +19 -0
  38. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/pairs.mjs.map +1 -0
  39. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/regexp.mjs +26 -0
  40. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/regexp.mjs.map +1 -0
  41. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/seq.mjs +11 -0
  42. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/seq.mjs.map +1 -0
  43. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/set.mjs +14 -0
  44. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/set.mjs.map +1 -0
  45. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/str.mjs +11 -0
  46. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/str.mjs.map +1 -0
  47. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/timestamp.mjs +54 -0
  48. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/timestamp.mjs.map +1 -0
  49. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/undefined.mjs +19 -0
  50. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/undefined.mjs.map +1 -0
  51. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_utils.mjs +14 -0
  52. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/_utils.mjs.map +1 -0
  53. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/mod.mjs +4 -0
  54. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/parse.mjs +50 -0
  55. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/parse.mjs.map +1 -0
  56. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/stringify.mjs +32 -0
  57. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.10/node_modules/@jsr/std__yaml/stringify.mjs.map +1 -0
  58. package/dist/parse.mjs +13 -0
  59. package/dist/parse.mjs.map +1 -0
  60. package/dist/stringify.mjs +52 -0
  61. package/dist/stringify.mjs.map +1 -0
  62. package/dist/to-file.mjs +44 -0
  63. package/dist/to-file.mjs.map +1 -0
  64. package/dist/types.d.mts +85 -0
  65. package/dist/utils.mjs +60 -0
  66. package/dist/utils.mjs.map +1 -0
  67. package/package.json +61 -0
  68. package/src/defaults.ts +17 -0
  69. package/src/engines.ts +217 -0
  70. package/src/excerpt.ts +146 -0
  71. package/src/index.ts +481 -0
  72. package/src/parse.ts +9 -0
  73. package/src/stringify.ts +187 -0
  74. package/src/to-file.ts +178 -0
  75. package/src/types.ts +84 -0
  76. package/src/utils.ts +158 -0
@@ -0,0 +1,437 @@
1
+ import { AMPERSAND, ASTERISK, BOM, COLON, COMMA, COMMERCIAL_AT, DOUBLE_QUOTE, EXCLAMATION, GRAVE_ACCENT, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LINE_FEED, MINUS, PERCENT, QUESTION, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SHARP, SINGLE_QUOTE, VERTICAL_LINE, isWhiteSpace } from "./_chars.mjs";
2
+ import { isObject } from "./_utils.mjs";
3
+ import { DEFAULT_SCHEMA } from "./_schema.mjs";
4
+
5
+ //#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_dumper_state.js
6
+ const STYLE_PLAIN = 1;
7
+ const STYLE_SINGLE = 2;
8
+ const STYLE_LITERAL = 3;
9
+ const STYLE_FOLDED = 4;
10
+ const STYLE_DOUBLE = 5;
11
+ const LEADING_SPACE_REGEXP = /^\n* /;
12
+ const ESCAPE_SEQUENCES = new Map([
13
+ [0, "\\0"],
14
+ [7, "\\a"],
15
+ [8, "\\b"],
16
+ [9, "\\t"],
17
+ [10, "\\n"],
18
+ [11, "\\v"],
19
+ [12, "\\f"],
20
+ [13, "\\r"],
21
+ [27, "\\e"],
22
+ [34, "\\\""],
23
+ [92, "\\\\"],
24
+ [133, "\\N"],
25
+ [160, "\\_"],
26
+ [8232, "\\L"],
27
+ [8233, "\\P"]
28
+ ]);
29
+ const DEPRECATED_BOOLEANS_SYNTAX = [
30
+ "y",
31
+ "Y",
32
+ "yes",
33
+ "Yes",
34
+ "YES",
35
+ "on",
36
+ "On",
37
+ "ON",
38
+ "n",
39
+ "N",
40
+ "no",
41
+ "No",
42
+ "NO",
43
+ "off",
44
+ "Off",
45
+ "OFF"
46
+ ];
47
+ /**
48
+ * Encodes a Unicode character code point as a hexadecimal escape sequence.
49
+ */ function charCodeToHexString(charCode) {
50
+ const hexString = charCode.toString(16).toUpperCase();
51
+ if (charCode <= 255) return `\\x${hexString.padStart(2, "0")}`;
52
+ if (charCode <= 65535) return `\\u${hexString.padStart(4, "0")}`;
53
+ if (charCode <= 4294967295) return `\\U${hexString.padStart(8, "0")}`;
54
+ throw new Error("Code point within a string may not be greater than 0xFFFFFFFF");
55
+ }
56
+ function createStyleMap(map) {
57
+ const result = /* @__PURE__ */ new Map();
58
+ for (let tag of Object.keys(map)) {
59
+ const style = String(map[tag]);
60
+ if (tag.slice(0, 2) === "!!") tag = `tag:yaml.org,2002:${tag.slice(2)}`;
61
+ result.set(tag, style);
62
+ }
63
+ return result;
64
+ }
65
+ function indentString(string, spaces) {
66
+ const indent = " ".repeat(spaces);
67
+ return string.split("\n").map((line) => line.length ? indent + line : line).join("\n");
68
+ }
69
+ function generateNextLine(indent, level) {
70
+ return `\n${" ".repeat(indent * level)}`;
71
+ }
72
+ /**
73
+ * @link https://yaml.org/spec/1.2.2/ 5.1. Character Set
74
+ * @return `true` if the character is printable without escaping, `false` otherwise.
75
+ */ function isPrintable(c) {
76
+ return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== BOM || 65536 <= c && c <= 1114111;
77
+ }
78
+ /**
79
+ * @return `true` if value is allowed after the first character in plain style, `false` otherwise.
80
+ */ function isPlainSafe(c) {
81
+ return isPrintable(c) && c !== BOM && c !== COMMA && c !== LEFT_SQUARE_BRACKET && c !== RIGHT_SQUARE_BRACKET && c !== LEFT_CURLY_BRACKET && c !== RIGHT_CURLY_BRACKET && c !== COLON && c !== SHARP;
82
+ }
83
+ /**
84
+ * @return `true` if value is allowed as the first character in plain style, `false` otherwise.
85
+ */ function isPlainSafeFirst(c) {
86
+ return isPlainSafe(c) && !isWhiteSpace(c) && c !== MINUS && c !== QUESTION && c !== AMPERSAND && c !== ASTERISK && c !== EXCLAMATION && c !== VERTICAL_LINE && c !== GREATER_THAN && c !== SINGLE_QUOTE && c !== DOUBLE_QUOTE && c !== PERCENT && c !== COMMERCIAL_AT && c !== GRAVE_ACCENT;
87
+ }
88
+ function needIndentIndicator(string) {
89
+ return LEADING_SPACE_REGEXP.test(string);
90
+ }
91
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, implicitTypes, quoteStyle) {
92
+ const shouldTrackWidth = lineWidth !== -1;
93
+ let hasLineBreak = false;
94
+ let hasFoldableLine = false;
95
+ let previousLineBreak = -1;
96
+ let plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhiteSpace(string.charCodeAt(string.length - 1));
97
+ let char;
98
+ let i;
99
+ if (singleLineOnly) for (i = 0; i < string.length; i++) {
100
+ char = string.charCodeAt(i);
101
+ if (!isPrintable(char)) return STYLE_DOUBLE;
102
+ plain = plain && isPlainSafe(char);
103
+ }
104
+ else {
105
+ for (i = 0; i < string.length; i++) {
106
+ char = string.charCodeAt(i);
107
+ if (char === LINE_FEED) {
108
+ hasLineBreak = true;
109
+ if (shouldTrackWidth) {
110
+ hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
111
+ previousLineBreak = i;
112
+ }
113
+ } else if (!isPrintable(char)) return STYLE_DOUBLE;
114
+ plain = plain && isPlainSafe(char);
115
+ }
116
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
117
+ }
118
+ if (!hasLineBreak && !hasFoldableLine) return plain && !implicitTypes.some((type) => type.resolve(string)) ? STYLE_PLAIN : quoteStyle === "'" ? STYLE_SINGLE : STYLE_DOUBLE;
119
+ if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
120
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
121
+ }
122
+ function foldLine(line, width) {
123
+ if (line === "" || line[0] === " ") return line;
124
+ const breakRegExp = / [^ ]/g;
125
+ let start = 0;
126
+ let end;
127
+ let curr = 0;
128
+ let next = 0;
129
+ const lines = [];
130
+ for (const match of line.matchAll(breakRegExp)) {
131
+ next = match.index;
132
+ if (next - start > width) {
133
+ end = curr > start ? curr : next;
134
+ lines.push(line.slice(start, end));
135
+ start = end + 1;
136
+ }
137
+ curr = next;
138
+ }
139
+ if (line.length - start > width && curr > start) {
140
+ lines.push(line.slice(start, curr));
141
+ lines.push(line.slice(curr + 1));
142
+ } else lines.push(line.slice(start));
143
+ return lines.join("\n");
144
+ }
145
+ function trimTrailingNewline(string) {
146
+ return string.at(-1) === "\n" ? string.slice(0, -1) : string;
147
+ }
148
+ function foldString(string, width) {
149
+ const lineRe = /(\n+)([^\n]*)/g;
150
+ let result = (() => {
151
+ let nextLF = string.indexOf("\n");
152
+ nextLF = nextLF !== -1 ? nextLF : string.length;
153
+ lineRe.lastIndex = nextLF;
154
+ return foldLine(string.slice(0, nextLF), width);
155
+ })();
156
+ let prevMoreIndented = string[0] === "\n" || string[0] === " ";
157
+ let moreIndented;
158
+ let match;
159
+ while (match = lineRe.exec(string)) {
160
+ const prefix = match[1];
161
+ const line = match[2] || "";
162
+ moreIndented = line[0] === " ";
163
+ result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
164
+ prevMoreIndented = moreIndented;
165
+ }
166
+ return result;
167
+ }
168
+ function escapeString(string) {
169
+ let result = "";
170
+ let char;
171
+ let nextChar;
172
+ let escapeSeq;
173
+ for (let i = 0; i < string.length; i++) {
174
+ char = string.charCodeAt(i);
175
+ if (char >= 55296 && char <= 56319) {
176
+ nextChar = string.charCodeAt(i + 1);
177
+ if (nextChar >= 56320 && nextChar <= 57343) {
178
+ result += charCodeToHexString((char - 55296) * 1024 + nextChar - 56320 + 65536);
179
+ i++;
180
+ continue;
181
+ }
182
+ }
183
+ escapeSeq = ESCAPE_SEQUENCES.get(char);
184
+ result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || charCodeToHexString(char);
185
+ }
186
+ return result;
187
+ }
188
+ function blockHeader(string, indentPerLevel) {
189
+ const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
190
+ const clip = string[string.length - 1] === "\n";
191
+ return `${indentIndicator}${clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-"}\n`;
192
+ }
193
+ function inspectNode(object, objects, duplicateObjects) {
194
+ if (!isObject(object)) return;
195
+ if (objects.has(object)) {
196
+ duplicateObjects.add(object);
197
+ return;
198
+ }
199
+ objects.add(object);
200
+ const entries = Array.isArray(object) ? object : Object.values(object);
201
+ for (const value of entries) inspectNode(value, objects, duplicateObjects);
202
+ }
203
+ var DumperState = class {
204
+ indent;
205
+ arrayIndent;
206
+ skipInvalid;
207
+ flowLevel;
208
+ sortKeys;
209
+ lineWidth;
210
+ useAnchors;
211
+ compatMode;
212
+ condenseFlow;
213
+ implicitTypes;
214
+ explicitTypes;
215
+ duplicates = [];
216
+ usedDuplicates = /* @__PURE__ */ new Set();
217
+ styleMap = /* @__PURE__ */ new Map();
218
+ quoteStyle;
219
+ constructor({ schema = DEFAULT_SCHEMA, indent = 2, arrayIndent = true, skipInvalid = false, flowLevel = -1, styles = void 0, sortKeys = false, lineWidth = 80, useAnchors = true, compatMode = true, condenseFlow = false, quoteStyle = "'" }) {
220
+ this.indent = Math.max(1, indent);
221
+ this.arrayIndent = arrayIndent;
222
+ this.skipInvalid = skipInvalid;
223
+ this.flowLevel = flowLevel;
224
+ if (styles) this.styleMap = createStyleMap(styles);
225
+ this.sortKeys = sortKeys;
226
+ this.lineWidth = lineWidth;
227
+ this.useAnchors = useAnchors;
228
+ this.compatMode = compatMode;
229
+ this.condenseFlow = condenseFlow;
230
+ this.implicitTypes = schema.implicitTypes;
231
+ this.explicitTypes = schema.explicitTypes;
232
+ this.quoteStyle = quoteStyle;
233
+ }
234
+ stringifyScalar(string, { level, isKey }) {
235
+ if (string.length === 0) return "''";
236
+ if (this.compatMode && DEPRECATED_BOOLEANS_SYNTAX.includes(string)) return `'${string}'`;
237
+ const indent = this.indent * Math.max(1, level);
238
+ const lineWidth = this.lineWidth === -1 ? -1 : Math.max(Math.min(this.lineWidth, 40), this.lineWidth - indent);
239
+ switch (chooseScalarStyle(string, isKey || this.flowLevel > -1 && level >= this.flowLevel, this.indent, lineWidth, this.implicitTypes, this.quoteStyle)) {
240
+ case STYLE_PLAIN: return string;
241
+ case STYLE_SINGLE: return `'${string.replace(/'/g, "''")}'`;
242
+ case STYLE_LITERAL: return `|${blockHeader(string, this.indent)}${trimTrailingNewline(indentString(string, indent))}`;
243
+ case STYLE_FOLDED: return `>${blockHeader(string, this.indent)}${trimTrailingNewline(indentString(foldString(string, lineWidth), indent))}`;
244
+ case STYLE_DOUBLE: return `"${escapeString(string)}"`;
245
+ default: throw new TypeError("Invalid scalar style should be unreachable: please file a bug report against Deno at https://github.com/denoland/std/issues");
246
+ }
247
+ }
248
+ stringifyFlowSequence(array, { level }) {
249
+ const results = [];
250
+ for (const value of array) {
251
+ const string = this.stringifyNode(value, {
252
+ level,
253
+ block: false,
254
+ compact: false,
255
+ isKey: false
256
+ });
257
+ if (string === null) continue;
258
+ results.push(string);
259
+ }
260
+ const separator = this.condenseFlow ? "," : ", ";
261
+ return `[${results.join(separator)}]`;
262
+ }
263
+ stringifyBlockSequence(array, { level, compact }) {
264
+ const whitespace = generateNextLine(this.indent, level);
265
+ const prefix = compact ? "" : whitespace;
266
+ const results = [];
267
+ for (const value of array) {
268
+ const string = this.stringifyNode(value, {
269
+ level: level + 1,
270
+ block: true,
271
+ compact: true,
272
+ isKey: false
273
+ });
274
+ if (string === null) continue;
275
+ const linePrefix = LINE_FEED === string.charCodeAt(0) ? "-" : "- ";
276
+ results.push(`${linePrefix}${string}`);
277
+ }
278
+ return results.length ? prefix + results.join(whitespace) : "[]";
279
+ }
280
+ stringifyFlowMapping(object, { level }) {
281
+ const quote = this.condenseFlow ? "\"" : "";
282
+ const separator = this.condenseFlow ? ":" : ": ";
283
+ const results = [];
284
+ for (const [key, value] of Object.entries(object)) {
285
+ const keyString = this.stringifyNode(key, {
286
+ level,
287
+ block: false,
288
+ compact: false,
289
+ isKey: false
290
+ });
291
+ if (keyString === null) continue;
292
+ const valueString = this.stringifyNode(value, {
293
+ level,
294
+ block: false,
295
+ compact: false,
296
+ isKey: false
297
+ });
298
+ if (valueString === null) continue;
299
+ const keyPrefix = keyString.length > 1024 ? "? " : "";
300
+ results.push(quote + keyPrefix + keyString + quote + separator + valueString);
301
+ }
302
+ return `{${results.join(", ")}}`;
303
+ }
304
+ stringifyBlockMapping(object, { tag, level, compact }) {
305
+ const keys = Object.keys(object);
306
+ if (this.sortKeys === true) keys.sort();
307
+ else if (typeof this.sortKeys === "function") keys.sort(this.sortKeys);
308
+ else if (this.sortKeys) throw new TypeError(`"sortKeys" must be a boolean or a function: received ${typeof this.sortKeys}`);
309
+ const separator = generateNextLine(this.indent, level);
310
+ const results = [];
311
+ for (const key of keys) {
312
+ const value = object[key];
313
+ const keyString = this.stringifyNode(key, {
314
+ level: level + 1,
315
+ block: true,
316
+ compact: true,
317
+ isKey: true
318
+ });
319
+ if (keyString === null) continue;
320
+ const explicitPair = tag !== null && tag !== "?" || keyString.length > 1024;
321
+ const valueString = this.stringifyNode(value, {
322
+ level: level + 1,
323
+ block: true,
324
+ compact: explicitPair,
325
+ isKey: false
326
+ });
327
+ if (valueString === null) continue;
328
+ let pairBuffer = "";
329
+ if (explicitPair) pairBuffer += keyString.charCodeAt(0) === LINE_FEED ? "?" : "? ";
330
+ pairBuffer += keyString;
331
+ if (explicitPair) pairBuffer += separator;
332
+ pairBuffer += valueString.charCodeAt(0) === LINE_FEED ? ":" : ": ";
333
+ pairBuffer += valueString;
334
+ results.push(pairBuffer);
335
+ }
336
+ const prefix = compact ? "" : separator;
337
+ return results.length ? prefix + results.join(separator) : "{}";
338
+ }
339
+ getTypeRepresentation(type, value) {
340
+ if (!type.represent) return value;
341
+ const style = this.styleMap.get(type.tag) ?? type.defaultStyle;
342
+ if (typeof type.represent === "function") return type.represent(value, style);
343
+ const represent = type.represent[style];
344
+ if (!represent) throw new TypeError(`!<${type.tag}> tag resolver accepts not "${style}" style`);
345
+ return represent(value, style);
346
+ }
347
+ detectType(value) {
348
+ for (const type of this.implicitTypes) if (type.predicate?.(value)) {
349
+ value = this.getTypeRepresentation(type, value);
350
+ return {
351
+ tag: "?",
352
+ value
353
+ };
354
+ }
355
+ for (const type of this.explicitTypes) if (type.predicate?.(value)) {
356
+ value = this.getTypeRepresentation(type, value);
357
+ return {
358
+ tag: type.tag,
359
+ value
360
+ };
361
+ }
362
+ return {
363
+ tag: null,
364
+ value
365
+ };
366
+ }
367
+ stringifyNode(value, { level, block, compact, isKey }) {
368
+ const result = this.detectType(value);
369
+ const tag = result.tag;
370
+ value = result.value;
371
+ if (block) block = this.flowLevel < 0 || this.flowLevel > level;
372
+ if (typeof value === "string" || value instanceof String) {
373
+ value = value instanceof String ? value.valueOf() : value;
374
+ if (tag !== "?") value = this.stringifyScalar(value, {
375
+ level,
376
+ isKey
377
+ });
378
+ } else if (isObject(value)) {
379
+ const duplicateIndex = this.duplicates.indexOf(value);
380
+ const duplicate = duplicateIndex !== -1;
381
+ if (duplicate) {
382
+ if (this.usedDuplicates.has(value)) return `*ref_${duplicateIndex}`;
383
+ this.usedDuplicates.add(value);
384
+ }
385
+ if (tag !== null && tag !== "?" || duplicate || this.indent !== 2 && level > 0) compact = false;
386
+ if (Array.isArray(value)) {
387
+ const arrayLevel = !this.arrayIndent && level > 0 ? level - 1 : level;
388
+ if (block && value.length !== 0) {
389
+ value = this.stringifyBlockSequence(value, {
390
+ level: arrayLevel,
391
+ compact
392
+ });
393
+ if (duplicate) value = `&ref_${duplicateIndex}${value}`;
394
+ } else {
395
+ value = this.stringifyFlowSequence(value, { level: arrayLevel });
396
+ if (duplicate) value = `&ref_${duplicateIndex} ${value}`;
397
+ }
398
+ } else if (block && Object.keys(value).length !== 0) {
399
+ value = this.stringifyBlockMapping(value, {
400
+ tag,
401
+ level,
402
+ compact
403
+ });
404
+ if (duplicate) value = `&ref_${duplicateIndex}${value}`;
405
+ } else {
406
+ value = this.stringifyFlowMapping(value, { level });
407
+ if (duplicate) value = `&ref_${duplicateIndex} ${value}`;
408
+ }
409
+ } else {
410
+ if (this.skipInvalid) return null;
411
+ throw new TypeError(`Cannot stringify ${typeof value}`);
412
+ }
413
+ if (tag !== null && tag !== "?") value = `!<${tag}> ${value}`;
414
+ return value;
415
+ }
416
+ stringify(value) {
417
+ if (this.useAnchors) {
418
+ const values = /* @__PURE__ */ new Set();
419
+ const duplicateObjects = /* @__PURE__ */ new Set();
420
+ inspectNode(value, values, duplicateObjects);
421
+ this.duplicates = [...duplicateObjects];
422
+ this.usedDuplicates = /* @__PURE__ */ new Set();
423
+ }
424
+ const string = this.stringifyNode(value, {
425
+ level: 0,
426
+ block: true,
427
+ compact: true,
428
+ isKey: false
429
+ });
430
+ if (string !== null) return `${string}\n`;
431
+ return "";
432
+ }
433
+ };
434
+
435
+ //#endregion
436
+ export { DumperState };
437
+ //# sourceMappingURL=_dumper_state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dumper_state.mjs","names":[],"sources":["../../../../../../../node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_dumper_state.js"],"sourcesContent":["// Ported from js-yaml v3.13.1:\n// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da\n// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.\n// Copyright 2018-2025 the Deno authors. MIT license.\nimport { AMPERSAND, ASTERISK, BOM, COLON, COMMA, COMMERCIAL_AT, DOUBLE_QUOTE, EXCLAMATION, GRAVE_ACCENT, GREATER_THAN, isWhiteSpace, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LINE_FEED, MINUS, PERCENT, QUESTION, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SHARP, SINGLE_QUOTE, VERTICAL_LINE } from \"./_chars.js\";\nimport { DEFAULT_SCHEMA } from \"./_schema.js\";\nimport { isObject } from \"./_utils.js\";\nconst STYLE_PLAIN = 1;\nconst STYLE_SINGLE = 2;\nconst STYLE_LITERAL = 3;\nconst STYLE_FOLDED = 4;\nconst STYLE_DOUBLE = 5;\nconst LEADING_SPACE_REGEXP = /^\\n* /;\nconst ESCAPE_SEQUENCES = new Map([\n [\n 0x00,\n \"\\\\0\"\n ],\n [\n 0x07,\n \"\\\\a\"\n ],\n [\n 0x08,\n \"\\\\b\"\n ],\n [\n 0x09,\n \"\\\\t\"\n ],\n [\n 0x0a,\n \"\\\\n\"\n ],\n [\n 0x0b,\n \"\\\\v\"\n ],\n [\n 0x0c,\n \"\\\\f\"\n ],\n [\n 0x0d,\n \"\\\\r\"\n ],\n [\n 0x1b,\n \"\\\\e\"\n ],\n [\n 0x22,\n '\\\\\"'\n ],\n [\n 0x5c,\n \"\\\\\\\\\"\n ],\n [\n 0x85,\n \"\\\\N\"\n ],\n [\n 0xa0,\n \"\\\\_\"\n ],\n [\n 0x2028,\n \"\\\\L\"\n ],\n [\n 0x2029,\n \"\\\\P\"\n ]\n]);\nconst DEPRECATED_BOOLEANS_SYNTAX = [\n \"y\",\n \"Y\",\n \"yes\",\n \"Yes\",\n \"YES\",\n \"on\",\n \"On\",\n \"ON\",\n \"n\",\n \"N\",\n \"no\",\n \"No\",\n \"NO\",\n \"off\",\n \"Off\",\n \"OFF\"\n];\n/**\n * Encodes a Unicode character code point as a hexadecimal escape sequence.\n */ function charCodeToHexString(charCode) {\n const hexString = charCode.toString(16).toUpperCase();\n if (charCode <= 0xff) return `\\\\x${hexString.padStart(2, \"0\")}`;\n if (charCode <= 0xffff) return `\\\\u${hexString.padStart(4, \"0\")}`;\n if (charCode <= 0xffffffff) return `\\\\U${hexString.padStart(8, \"0\")}`;\n throw new Error(\"Code point within a string may not be greater than 0xFFFFFFFF\");\n}\nfunction createStyleMap(map) {\n const result = new Map();\n for (let tag of Object.keys(map)){\n const style = String(map[tag]);\n if (tag.slice(0, 2) === \"!!\") {\n tag = `tag:yaml.org,2002:${tag.slice(2)}`;\n }\n result.set(tag, style);\n }\n return result;\n}\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n const indent = \" \".repeat(spaces);\n return string.split(\"\\n\").map((line)=>line.length ? indent + line : line).join(\"\\n\");\n}\nfunction generateNextLine(indent, level) {\n return `\\n${\" \".repeat(indent * level)}`;\n}\n/**\n * @link https://yaml.org/spec/1.2.2/ 5.1. Character Set\n * @return `true` if the character is printable without escaping, `false` otherwise.\n */ function isPrintable(c) {\n return 0x00020 <= c && c <= 0x00007e || 0x000a1 <= c && c <= 0x00d7ff && c !== 0x2028 && c !== 0x2029 || 0x0e000 <= c && c <= 0x00fffd && c !== BOM || 0x10000 <= c && c <= 0x10ffff;\n}\n/**\n * @return `true` if value is allowed after the first character in plain style, `false` otherwise.\n */ function isPlainSafe(c) {\n return isPrintable(c) && c !== BOM && c !== COMMA && c !== LEFT_SQUARE_BRACKET && c !== RIGHT_SQUARE_BRACKET && c !== LEFT_CURLY_BRACKET && c !== RIGHT_CURLY_BRACKET && c !== COLON && c !== SHARP;\n}\n/**\n * @return `true` if value is allowed as the first character in plain style, `false` otherwise.\n */ function isPlainSafeFirst(c) {\n return isPlainSafe(c) && !isWhiteSpace(c) && c !== MINUS && c !== QUESTION && c !== AMPERSAND && c !== ASTERISK && c !== EXCLAMATION && c !== VERTICAL_LINE && c !== GREATER_THAN && c !== SINGLE_QUOTE && c !== DOUBLE_QUOTE && c !== PERCENT && c !== COMMERCIAL_AT && c !== GRAVE_ACCENT;\n}\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n return LEADING_SPACE_REGEXP.test(string);\n}\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth !== -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, implicitTypes, quoteStyle) {\n const shouldTrackWidth = lineWidth !== -1;\n let hasLineBreak = false;\n let hasFoldableLine = false; // only checked if shouldTrackWidth\n let previousLineBreak = -1; // count the first line correctly\n let plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhiteSpace(string.charCodeAt(string.length - 1));\n let char;\n let i;\n if (singleLineOnly) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for(i = 0; i < string.length; i++){\n char = string.charCodeAt(i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char);\n }\n } else {\n // Case: block styles permitted.\n for(i = 0; i < string.length; i++){\n char = string.charCodeAt(i);\n if (char === LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.\n i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== \" \";\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char);\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== \" \";\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n return plain && !implicitTypes.some((type)=>type.resolve(string)) ? STYLE_PLAIN : quoteStyle === \"'\" ? STYLE_SINGLE : STYLE_DOUBLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n}\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === \"\" || line[0] === \" \") return line;\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n const breakRegExp = / [^ ]/g; // note: the match index will always be <= length-2.\n // start is an inclusive index. end, curr, and next are exclusive.\n let start = 0;\n let end;\n let curr = 0;\n let next = 0;\n const lines = [];\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n for (const match of line.matchAll(breakRegExp)){\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = curr > start ? curr : next; // derive end <= length-2\n lines.push(line.slice(start, end));\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n lines.push(line.slice(start, curr));\n lines.push(line.slice(curr + 1));\n } else {\n lines.push(line.slice(start));\n }\n return lines.join(\"\\n\");\n}\nfunction trimTrailingNewline(string) {\n return string.at(-1) === \"\\n\" ? string.slice(0, -1) : string;\n}\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n const lineRe = /(\\n+)([^\\n]*)/g;\n // first line (possibly an empty line)\n let result = (()=>{\n let nextLF = string.indexOf(\"\\n\");\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n })();\n // If we haven't reached the first content line yet, don't add an extra \\n.\n let prevMoreIndented = string[0] === \"\\n\" || string[0] === \" \";\n let moreIndented;\n // rest of the lines\n let match;\n // tslint:disable-next-line:no-conditional-assignment\n while(match = lineRe.exec(string)){\n const prefix = match[1];\n const line = match[2] || \"\";\n moreIndented = line[0] === \" \";\n result += prefix + (!prevMoreIndented && !moreIndented && line !== \"\" ? \"\\n\" : \"\") + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n return result;\n}\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n let result = \"\";\n let char;\n let nextChar;\n let escapeSeq;\n for(let i = 0; i < string.length; i++){\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xd800 && char <= 0xdbff /* high surrogate */ ) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xdc00 && nextChar <= 0xdfff /* low surrogate */ ) {\n // Combine the surrogate pair and store it escaped.\n result += charCodeToHexString((char - 0xd800) * 0x400 + nextChar - 0xdc00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++;\n continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES.get(char);\n result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || charCodeToHexString(char);\n }\n return result;\n}\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : \"\";\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n const clip = string[string.length - 1] === \"\\n\";\n const keep = clip && (string[string.length - 2] === \"\\n\" || string === \"\\n\");\n const chomp = keep ? \"+\" : clip ? \"\" : \"-\";\n return `${indentIndicator}${chomp}\\n`;\n}\nfunction inspectNode(object, objects, duplicateObjects) {\n if (!isObject(object)) return;\n if (objects.has(object)) {\n duplicateObjects.add(object);\n return;\n }\n objects.add(object);\n const entries = Array.isArray(object) ? object : Object.values(object);\n for (const value of entries){\n inspectNode(value, objects, duplicateObjects);\n }\n}\nexport class DumperState {\n indent;\n arrayIndent;\n skipInvalid;\n flowLevel;\n sortKeys;\n lineWidth;\n useAnchors;\n compatMode;\n condenseFlow;\n implicitTypes;\n explicitTypes;\n duplicates = [];\n usedDuplicates = new Set();\n styleMap = new Map();\n quoteStyle;\n constructor({ schema = DEFAULT_SCHEMA, indent = 2, arrayIndent = true, skipInvalid = false, flowLevel = -1, styles = undefined, sortKeys = false, lineWidth = 80, useAnchors = true, compatMode = true, condenseFlow = false, quoteStyle = \"'\" }){\n this.indent = Math.max(1, indent);\n this.arrayIndent = arrayIndent;\n this.skipInvalid = skipInvalid;\n this.flowLevel = flowLevel;\n if (styles) this.styleMap = createStyleMap(styles);\n this.sortKeys = sortKeys;\n this.lineWidth = lineWidth;\n this.useAnchors = useAnchors;\n this.compatMode = compatMode;\n this.condenseFlow = condenseFlow;\n this.implicitTypes = schema.implicitTypes;\n this.explicitTypes = schema.explicitTypes;\n this.quoteStyle = quoteStyle;\n }\n // Note: line breaking/folding is implemented for only the folded style.\n // NB. We drop the last trailing newline (if any) of a returned block scalar\n // since the dumper adds its own newline. This always works:\n // • No ending newline => unaffected; already using strip \"-\" chomping.\n // • Ending newline => removed then restored.\n // Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\n stringifyScalar(string, { level, isKey }) {\n if (string.length === 0) {\n return \"''\";\n }\n if (this.compatMode && DEPRECATED_BOOLEANS_SYNTAX.includes(string)) {\n return `'${string}'`;\n }\n const indent = this.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(this.lineWidth, 40).\n // Note that this implies\n // this.lineWidth ≤ 40 + this.indent: width is fixed at the lower bound.\n // this.lineWidth > 40 + this.indent: width decreases until the lower\n // bound.\n // This behaves better than a constant minimum width which disallows\n // narrower options, or an indent threshold which causes the width\n // to suddenly increase.\n const lineWidth = this.lineWidth === -1 ? -1 : Math.max(Math.min(this.lineWidth, 40), this.lineWidth - indent);\n // Without knowing if keys are implicit/explicit,\n // assume implicit for safety.\n const singleLineOnly = isKey || // No block styles in flow mode.\n this.flowLevel > -1 && level >= this.flowLevel;\n const scalarStyle = chooseScalarStyle(string, singleLineOnly, this.indent, lineWidth, this.implicitTypes, this.quoteStyle);\n switch(scalarStyle){\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return `'${string.replace(/'/g, \"''\")}'`;\n case STYLE_LITERAL:\n return `|${blockHeader(string, this.indent)}${trimTrailingNewline(indentString(string, indent))}`;\n case STYLE_FOLDED:\n return `>${blockHeader(string, this.indent)}${trimTrailingNewline(indentString(foldString(string, lineWidth), indent))}`;\n case STYLE_DOUBLE:\n return `\"${escapeString(string)}\"`;\n default:\n throw new TypeError(\"Invalid scalar style should be unreachable: please file a bug report against Deno at https://github.com/denoland/std/issues\");\n }\n }\n stringifyFlowSequence(array, { level }) {\n const results = [];\n for (const value of array){\n const string = this.stringifyNode(value, {\n level,\n block: false,\n compact: false,\n isKey: false\n });\n if (string === null) continue;\n results.push(string);\n }\n const separator = this.condenseFlow ? \",\" : \", \";\n return `[${results.join(separator)}]`;\n }\n stringifyBlockSequence(array, { level, compact }) {\n const whitespace = generateNextLine(this.indent, level);\n const prefix = compact ? \"\" : whitespace;\n const results = [];\n for (const value of array){\n const string = this.stringifyNode(value, {\n level: level + 1,\n block: true,\n compact: true,\n isKey: false\n });\n if (string === null) continue;\n const linePrefix = LINE_FEED === string.charCodeAt(0) ? \"-\" : \"- \";\n results.push(`${linePrefix}${string}`);\n }\n return results.length ? prefix + results.join(whitespace) : \"[]\";\n }\n stringifyFlowMapping(object, { level }) {\n const quote = this.condenseFlow ? '\"' : \"\";\n const separator = this.condenseFlow ? \":\" : \": \";\n const results = [];\n for (const [key, value] of Object.entries(object)){\n const keyString = this.stringifyNode(key, {\n level,\n block: false,\n compact: false,\n isKey: false\n });\n if (keyString === null) continue; // Skip this pair because of invalid key;\n const valueString = this.stringifyNode(value, {\n level,\n block: false,\n compact: false,\n isKey: false\n });\n if (valueString === null) continue; // Skip this pair because of invalid value.\n const keyPrefix = keyString.length > 1024 ? \"? \" : \"\";\n results.push(quote + keyPrefix + keyString + quote + separator + valueString);\n }\n return `{${results.join(\", \")}}`;\n }\n stringifyBlockMapping(object, { tag, level, compact }) {\n const keys = Object.keys(object);\n // Allow sorting keys so that the output file is deterministic\n if (this.sortKeys === true) {\n // Default sorting\n keys.sort();\n } else if (typeof this.sortKeys === \"function\") {\n // Custom sort function\n keys.sort(this.sortKeys);\n } else if (this.sortKeys) {\n // Something is wrong\n throw new TypeError(`\"sortKeys\" must be a boolean or a function: received ${typeof this.sortKeys}`);\n }\n const separator = generateNextLine(this.indent, level);\n const results = [];\n for (const key of keys){\n const value = object[key];\n const keyString = this.stringifyNode(key, {\n level: level + 1,\n block: true,\n compact: true,\n isKey: true\n });\n if (keyString === null) continue; // Skip this pair because of invalid key.\n const explicitPair = tag !== null && tag !== \"?\" || keyString.length > 1024;\n const valueString = this.stringifyNode(value, {\n level: level + 1,\n block: true,\n compact: explicitPair,\n isKey: false\n });\n if (valueString === null) continue; // Skip this pair because of invalid value.\n let pairBuffer = \"\";\n if (explicitPair) {\n pairBuffer += keyString.charCodeAt(0) === LINE_FEED ? \"?\" : \"? \";\n }\n pairBuffer += keyString;\n if (explicitPair) pairBuffer += separator;\n pairBuffer += valueString.charCodeAt(0) === LINE_FEED ? \":\" : \": \";\n pairBuffer += valueString;\n results.push(pairBuffer);\n }\n const prefix = compact ? \"\" : separator;\n return results.length ? prefix + results.join(separator) : \"{}\"; // Empty mapping if no valid pairs.\n }\n getTypeRepresentation(type, value) {\n if (!type.represent) return value;\n const style = this.styleMap.get(type.tag) ?? type.defaultStyle;\n if (typeof type.represent === \"function\") {\n return type.represent(value, style);\n }\n const represent = type.represent[style];\n if (!represent) {\n throw new TypeError(`!<${type.tag}> tag resolver accepts not \"${style}\" style`);\n }\n return represent(value, style);\n }\n detectType(value) {\n for (const type of this.implicitTypes){\n if (type.predicate?.(value)) {\n value = this.getTypeRepresentation(type, value);\n return {\n tag: \"?\",\n value\n };\n }\n }\n for (const type of this.explicitTypes){\n if (type.predicate?.(value)) {\n value = this.getTypeRepresentation(type, value);\n return {\n tag: type.tag,\n value\n };\n }\n }\n return {\n tag: null,\n value\n };\n }\n // Serializes `object` and writes it to global `result`.\n // Returns true on success, or false on invalid object.\n stringifyNode(value, { level, block, compact, isKey }) {\n const result = this.detectType(value);\n const tag = result.tag;\n value = result.value;\n if (block) {\n block = this.flowLevel < 0 || this.flowLevel > level;\n }\n if (typeof value === \"string\" || value instanceof String) {\n value = value instanceof String ? value.valueOf() : value;\n if (tag !== \"?\") {\n value = this.stringifyScalar(value, {\n level,\n isKey\n });\n }\n } else if (isObject(value)) {\n const duplicateIndex = this.duplicates.indexOf(value);\n const duplicate = duplicateIndex !== -1;\n if (duplicate) {\n if (this.usedDuplicates.has(value)) return `*ref_${duplicateIndex}`;\n this.usedDuplicates.add(value);\n }\n if (tag !== null && tag !== \"?\" || duplicate || this.indent !== 2 && level > 0) {\n compact = false;\n }\n if (Array.isArray(value)) {\n const arrayLevel = !this.arrayIndent && level > 0 ? level - 1 : level;\n if (block && value.length !== 0) {\n value = this.stringifyBlockSequence(value, {\n level: arrayLevel,\n compact\n });\n if (duplicate) {\n value = `&ref_${duplicateIndex}${value}`;\n }\n } else {\n value = this.stringifyFlowSequence(value, {\n level: arrayLevel\n });\n if (duplicate) {\n value = `&ref_${duplicateIndex} ${value}`;\n }\n }\n } else {\n if (block && Object.keys(value).length !== 0) {\n value = this.stringifyBlockMapping(value, {\n tag,\n level,\n compact\n });\n if (duplicate) {\n value = `&ref_${duplicateIndex}${value}`;\n }\n } else {\n value = this.stringifyFlowMapping(value, {\n level\n });\n if (duplicate) {\n value = `&ref_${duplicateIndex} ${value}`;\n }\n }\n }\n } else {\n if (this.skipInvalid) return null;\n throw new TypeError(`Cannot stringify ${typeof value}`);\n }\n if (tag !== null && tag !== \"?\") {\n value = `!<${tag}> ${value}`;\n }\n return value;\n }\n stringify(value) {\n if (this.useAnchors) {\n const values = new Set();\n const duplicateObjects = new Set();\n inspectNode(value, values, duplicateObjects);\n this.duplicates = [\n ...duplicateObjects\n ];\n this.usedDuplicates = new Set();\n }\n const string = this.stringifyNode(value, {\n level: 0,\n block: true,\n compact: true,\n isKey: false\n });\n if (string !== null) {\n return `${string}\\n`;\n }\n return \"\";\n }\n}\n//# sourceMappingURL=_dumper_state.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAOA,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,uBAAuB;AAC7B,MAA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