astro-md-editor 0.0.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/.output/nitro.json +17 -0
- package/.output/public/assets/index-Cc7yKB0o.js +19 -0
- package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/.output/public/assets/main-DDBjVFnt.js +17 -0
- package/.output/public/assets/styles-ggfdUHMo.css +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo192.png +0 -0
- package/.output/public/logo512.png +0 -0
- package/.output/public/manifest.json +25 -0
- package/.output/public/robots.txt +3 -0
- package/.output/server/__root-C09LBXMv.mjs +40 -0
- package/.output/server/_chunks/ssr-renderer.mjs +21 -0
- package/.output/server/_libs/ajv-formats.mjs +330 -0
- package/.output/server/_libs/ajv.mjs +5484 -0
- package/.output/server/_libs/base-ui__react.mjs +8712 -0
- package/.output/server/_libs/base-ui__utils.mjs +980 -0
- package/.output/server/_libs/class-variance-authority.mjs +44 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/cookie-es.mjs +58 -0
- package/.output/server/_libs/croner.mjs +1 -0
- package/.output/server/_libs/crossws.mjs +1 -0
- package/.output/server/_libs/date-fns.mjs +1716 -0
- package/.output/server/_libs/date-fns__tz.mjs +217 -0
- package/.output/server/_libs/extend-shallow.mjs +35 -0
- package/.output/server/_libs/fast-deep-equal.mjs +38 -0
- package/.output/server/_libs/fast-uri.mjs +725 -0
- package/.output/server/_libs/floating-ui__core.mjs +663 -0
- package/.output/server/_libs/floating-ui__dom.mjs +624 -0
- package/.output/server/_libs/floating-ui__react-dom.mjs +279 -0
- package/.output/server/_libs/floating-ui__utils.mjs +322 -0
- package/.output/server/_libs/gray-matter.mjs +393 -0
- package/.output/server/_libs/h3-v2.mjs +276 -0
- package/.output/server/_libs/h3.mjs +400 -0
- package/.output/server/_libs/hookable.mjs +1 -0
- package/.output/server/_libs/is-extendable.mjs +13 -0
- package/.output/server/_libs/isbot.mjs +20 -0
- package/.output/server/_libs/js-yaml.mjs +2822 -0
- package/.output/server/_libs/json-schema-traverse.mjs +91 -0
- package/.output/server/_libs/kind-of.mjs +125 -0
- package/.output/server/_libs/lucide-react.mjs +177 -0
- package/.output/server/_libs/ohash.mjs +1 -0
- package/.output/server/_libs/react-day-picker.mjs +2216 -0
- package/.output/server/_libs/react-dom.mjs +10779 -0
- package/.output/server/_libs/react-resizable-panels.mjs +2024 -0
- package/.output/server/_libs/react.mjs +513 -0
- package/.output/server/_libs/reselect.mjs +326 -0
- package/.output/server/_libs/rou3.mjs +8 -0
- package/.output/server/_libs/section-matter.mjs +112 -0
- package/.output/server/_libs/seroval-plugins.mjs +58 -0
- package/.output/server/_libs/seroval.mjs +1765 -0
- package/.output/server/_libs/srvx.mjs +736 -0
- package/.output/server/_libs/strip-bom-string.mjs +16 -0
- package/.output/server/_libs/tabbable.mjs +342 -0
- package/.output/server/_libs/tailwind-merge.mjs +3175 -0
- package/.output/server/_libs/tanstack__history.mjs +217 -0
- package/.output/server/_libs/tanstack__react-router.mjs +1464 -0
- package/.output/server/_libs/tanstack__react-store.mjs +1 -0
- package/.output/server/_libs/tanstack__router-core.mjs +4912 -0
- package/.output/server/_libs/tanstack__store.mjs +1 -0
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/ufo.mjs +54 -0
- package/.output/server/_libs/unctx.mjs +1 -0
- package/.output/server/_libs/unstorage.mjs +1 -0
- package/.output/server/_libs/use-sync-external-store.mjs +139 -0
- package/.output/server/_libs/zod.mjs +3634 -0
- package/.output/server/_libs/zustand.mjs +43 -0
- package/.output/server/_ssr/RightSidebar-RSY9M7XF.mjs +218 -0
- package/.output/server/_ssr/collections.server-D6U2tEsT.mjs +120 -0
- package/.output/server/_ssr/createServerRpc-29xaFZcb.mjs +12 -0
- package/.output/server/_ssr/index-BaqV4cZC.mjs +2083 -0
- package/.output/server/_ssr/index-sQBM6rwN.mjs +115 -0
- package/.output/server/_ssr/index.mjs +1448 -0
- package/.output/server/_ssr/router-D4G1DGr3.mjs +155 -0
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-CYEHh_qB.mjs +4 -0
- package/.output/server/index.mjs +451 -0
- package/README.md +118 -0
- package/index.mjs +21 -0
- package/package.json +86 -0
- package/scripts/bootstrap-collections.mjs +1201 -0
|
@@ -0,0 +1,2822 @@
|
|
|
1
|
+
var jsYaml$1 = {};
|
|
2
|
+
var loader = {};
|
|
3
|
+
var common = {};
|
|
4
|
+
var hasRequiredCommon;
|
|
5
|
+
function requireCommon() {
|
|
6
|
+
if (hasRequiredCommon) return common;
|
|
7
|
+
hasRequiredCommon = 1;
|
|
8
|
+
function isNothing(subject) {
|
|
9
|
+
return typeof subject === "undefined" || subject === null;
|
|
10
|
+
}
|
|
11
|
+
function isObject(subject) {
|
|
12
|
+
return typeof subject === "object" && subject !== null;
|
|
13
|
+
}
|
|
14
|
+
function toArray(sequence) {
|
|
15
|
+
if (Array.isArray(sequence)) return sequence;
|
|
16
|
+
else if (isNothing(sequence)) return [];
|
|
17
|
+
return [sequence];
|
|
18
|
+
}
|
|
19
|
+
function extend(target, source) {
|
|
20
|
+
var index, length, key, sourceKeys;
|
|
21
|
+
if (source) {
|
|
22
|
+
sourceKeys = Object.keys(source);
|
|
23
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
24
|
+
key = sourceKeys[index];
|
|
25
|
+
target[key] = source[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function repeat(string, count) {
|
|
31
|
+
var result = "", cycle;
|
|
32
|
+
for (cycle = 0; cycle < count; cycle += 1) {
|
|
33
|
+
result += string;
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
function isNegativeZero(number) {
|
|
38
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
39
|
+
}
|
|
40
|
+
common.isNothing = isNothing;
|
|
41
|
+
common.isObject = isObject;
|
|
42
|
+
common.toArray = toArray;
|
|
43
|
+
common.repeat = repeat;
|
|
44
|
+
common.isNegativeZero = isNegativeZero;
|
|
45
|
+
common.extend = extend;
|
|
46
|
+
return common;
|
|
47
|
+
}
|
|
48
|
+
var exception;
|
|
49
|
+
var hasRequiredException;
|
|
50
|
+
function requireException() {
|
|
51
|
+
if (hasRequiredException) return exception;
|
|
52
|
+
hasRequiredException = 1;
|
|
53
|
+
function YAMLException(reason, mark2) {
|
|
54
|
+
Error.call(this);
|
|
55
|
+
this.name = "YAMLException";
|
|
56
|
+
this.reason = reason;
|
|
57
|
+
this.mark = mark2;
|
|
58
|
+
this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
|
|
59
|
+
if (Error.captureStackTrace) {
|
|
60
|
+
Error.captureStackTrace(this, this.constructor);
|
|
61
|
+
} else {
|
|
62
|
+
this.stack = new Error().stack || "";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
YAMLException.prototype = Object.create(Error.prototype);
|
|
66
|
+
YAMLException.prototype.constructor = YAMLException;
|
|
67
|
+
YAMLException.prototype.toString = function toString(compact) {
|
|
68
|
+
var result = this.name + ": ";
|
|
69
|
+
result += this.reason || "(unknown reason)";
|
|
70
|
+
if (!compact && this.mark) {
|
|
71
|
+
result += " " + this.mark.toString();
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
exception = YAMLException;
|
|
76
|
+
return exception;
|
|
77
|
+
}
|
|
78
|
+
var mark;
|
|
79
|
+
var hasRequiredMark;
|
|
80
|
+
function requireMark() {
|
|
81
|
+
if (hasRequiredMark) return mark;
|
|
82
|
+
hasRequiredMark = 1;
|
|
83
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
84
|
+
function Mark(name, buffer, position, line, column) {
|
|
85
|
+
this.name = name;
|
|
86
|
+
this.buffer = buffer;
|
|
87
|
+
this.position = position;
|
|
88
|
+
this.line = line;
|
|
89
|
+
this.column = column;
|
|
90
|
+
}
|
|
91
|
+
Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
|
|
92
|
+
var head, start, tail, end, snippet;
|
|
93
|
+
if (!this.buffer) return null;
|
|
94
|
+
indent = indent || 4;
|
|
95
|
+
maxLength = maxLength || 75;
|
|
96
|
+
head = "";
|
|
97
|
+
start = this.position;
|
|
98
|
+
while (start > 0 && "\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
|
|
99
|
+
start -= 1;
|
|
100
|
+
if (this.position - start > maxLength / 2 - 1) {
|
|
101
|
+
head = " ... ";
|
|
102
|
+
start += 5;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
tail = "";
|
|
107
|
+
end = this.position;
|
|
108
|
+
while (end < this.buffer.length && "\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
|
|
109
|
+
end += 1;
|
|
110
|
+
if (end - this.position > maxLength / 2 - 1) {
|
|
111
|
+
tail = " ... ";
|
|
112
|
+
end -= 5;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
snippet = this.buffer.slice(start, end);
|
|
117
|
+
return common2.repeat(" ", indent) + head + snippet + tail + "\n" + common2.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
118
|
+
};
|
|
119
|
+
Mark.prototype.toString = function toString(compact) {
|
|
120
|
+
var snippet, where = "";
|
|
121
|
+
if (this.name) {
|
|
122
|
+
where += 'in "' + this.name + '" ';
|
|
123
|
+
}
|
|
124
|
+
where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
|
|
125
|
+
if (!compact) {
|
|
126
|
+
snippet = this.getSnippet();
|
|
127
|
+
if (snippet) {
|
|
128
|
+
where += ":\n" + snippet;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return where;
|
|
132
|
+
};
|
|
133
|
+
mark = Mark;
|
|
134
|
+
return mark;
|
|
135
|
+
}
|
|
136
|
+
var type;
|
|
137
|
+
var hasRequiredType;
|
|
138
|
+
function requireType() {
|
|
139
|
+
if (hasRequiredType) return type;
|
|
140
|
+
hasRequiredType = 1;
|
|
141
|
+
var YAMLException = /* @__PURE__ */ requireException();
|
|
142
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
143
|
+
"kind",
|
|
144
|
+
"resolve",
|
|
145
|
+
"construct",
|
|
146
|
+
"instanceOf",
|
|
147
|
+
"predicate",
|
|
148
|
+
"represent",
|
|
149
|
+
"defaultStyle",
|
|
150
|
+
"styleAliases"
|
|
151
|
+
];
|
|
152
|
+
var YAML_NODE_KINDS = [
|
|
153
|
+
"scalar",
|
|
154
|
+
"sequence",
|
|
155
|
+
"mapping"
|
|
156
|
+
];
|
|
157
|
+
function compileStyleAliases(map2) {
|
|
158
|
+
var result = {};
|
|
159
|
+
if (map2 !== null) {
|
|
160
|
+
Object.keys(map2).forEach(function(style) {
|
|
161
|
+
map2[style].forEach(function(alias) {
|
|
162
|
+
result[String(alias)] = style;
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
function Type(tag, options) {
|
|
169
|
+
options = options || {};
|
|
170
|
+
Object.keys(options).forEach(function(name) {
|
|
171
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
172
|
+
throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
this.tag = tag;
|
|
176
|
+
this.kind = options["kind"] || null;
|
|
177
|
+
this.resolve = options["resolve"] || function() {
|
|
178
|
+
return true;
|
|
179
|
+
};
|
|
180
|
+
this.construct = options["construct"] || function(data) {
|
|
181
|
+
return data;
|
|
182
|
+
};
|
|
183
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
184
|
+
this.predicate = options["predicate"] || null;
|
|
185
|
+
this.represent = options["represent"] || null;
|
|
186
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
187
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
188
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
189
|
+
throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
type = Type;
|
|
193
|
+
return type;
|
|
194
|
+
}
|
|
195
|
+
var schema;
|
|
196
|
+
var hasRequiredSchema;
|
|
197
|
+
function requireSchema() {
|
|
198
|
+
if (hasRequiredSchema) return schema;
|
|
199
|
+
hasRequiredSchema = 1;
|
|
200
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
201
|
+
var YAMLException = /* @__PURE__ */ requireException();
|
|
202
|
+
var Type = /* @__PURE__ */ requireType();
|
|
203
|
+
function compileList(schema2, name, result) {
|
|
204
|
+
var exclude = [];
|
|
205
|
+
schema2.include.forEach(function(includedSchema) {
|
|
206
|
+
result = compileList(includedSchema, name, result);
|
|
207
|
+
});
|
|
208
|
+
schema2[name].forEach(function(currentType) {
|
|
209
|
+
result.forEach(function(previousType, previousIndex) {
|
|
210
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
211
|
+
exclude.push(previousIndex);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
result.push(currentType);
|
|
215
|
+
});
|
|
216
|
+
return result.filter(function(type2, index) {
|
|
217
|
+
return exclude.indexOf(index) === -1;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function compileMap() {
|
|
221
|
+
var result = {
|
|
222
|
+
scalar: {},
|
|
223
|
+
sequence: {},
|
|
224
|
+
mapping: {},
|
|
225
|
+
fallback: {}
|
|
226
|
+
}, index, length;
|
|
227
|
+
function collectType(type2) {
|
|
228
|
+
result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
|
229
|
+
}
|
|
230
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
231
|
+
arguments[index].forEach(collectType);
|
|
232
|
+
}
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
function Schema(definition) {
|
|
236
|
+
this.include = definition.include || [];
|
|
237
|
+
this.implicit = definition.implicit || [];
|
|
238
|
+
this.explicit = definition.explicit || [];
|
|
239
|
+
this.implicit.forEach(function(type2) {
|
|
240
|
+
if (type2.loadKind && type2.loadKind !== "scalar") {
|
|
241
|
+
throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
this.compiledImplicit = compileList(this, "implicit", []);
|
|
245
|
+
this.compiledExplicit = compileList(this, "explicit", []);
|
|
246
|
+
this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
|
247
|
+
}
|
|
248
|
+
Schema.DEFAULT = null;
|
|
249
|
+
Schema.create = function createSchema() {
|
|
250
|
+
var schemas, types;
|
|
251
|
+
switch (arguments.length) {
|
|
252
|
+
case 1:
|
|
253
|
+
schemas = Schema.DEFAULT;
|
|
254
|
+
types = arguments[0];
|
|
255
|
+
break;
|
|
256
|
+
case 2:
|
|
257
|
+
schemas = arguments[0];
|
|
258
|
+
types = arguments[1];
|
|
259
|
+
break;
|
|
260
|
+
default:
|
|
261
|
+
throw new YAMLException("Wrong number of arguments for Schema.create function");
|
|
262
|
+
}
|
|
263
|
+
schemas = common2.toArray(schemas);
|
|
264
|
+
types = common2.toArray(types);
|
|
265
|
+
if (!schemas.every(function(schema2) {
|
|
266
|
+
return schema2 instanceof Schema;
|
|
267
|
+
})) {
|
|
268
|
+
throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
269
|
+
}
|
|
270
|
+
if (!types.every(function(type2) {
|
|
271
|
+
return type2 instanceof Type;
|
|
272
|
+
})) {
|
|
273
|
+
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
274
|
+
}
|
|
275
|
+
return new Schema({
|
|
276
|
+
include: schemas,
|
|
277
|
+
explicit: types
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
schema = Schema;
|
|
281
|
+
return schema;
|
|
282
|
+
}
|
|
283
|
+
var str;
|
|
284
|
+
var hasRequiredStr;
|
|
285
|
+
function requireStr() {
|
|
286
|
+
if (hasRequiredStr) return str;
|
|
287
|
+
hasRequiredStr = 1;
|
|
288
|
+
var Type = /* @__PURE__ */ requireType();
|
|
289
|
+
str = new Type("tag:yaml.org,2002:str", {
|
|
290
|
+
kind: "scalar",
|
|
291
|
+
construct: function(data) {
|
|
292
|
+
return data !== null ? data : "";
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return str;
|
|
296
|
+
}
|
|
297
|
+
var seq;
|
|
298
|
+
var hasRequiredSeq;
|
|
299
|
+
function requireSeq() {
|
|
300
|
+
if (hasRequiredSeq) return seq;
|
|
301
|
+
hasRequiredSeq = 1;
|
|
302
|
+
var Type = /* @__PURE__ */ requireType();
|
|
303
|
+
seq = new Type("tag:yaml.org,2002:seq", {
|
|
304
|
+
kind: "sequence",
|
|
305
|
+
construct: function(data) {
|
|
306
|
+
return data !== null ? data : [];
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
return seq;
|
|
310
|
+
}
|
|
311
|
+
var map;
|
|
312
|
+
var hasRequiredMap;
|
|
313
|
+
function requireMap() {
|
|
314
|
+
if (hasRequiredMap) return map;
|
|
315
|
+
hasRequiredMap = 1;
|
|
316
|
+
var Type = /* @__PURE__ */ requireType();
|
|
317
|
+
map = new Type("tag:yaml.org,2002:map", {
|
|
318
|
+
kind: "mapping",
|
|
319
|
+
construct: function(data) {
|
|
320
|
+
return data !== null ? data : {};
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
return map;
|
|
324
|
+
}
|
|
325
|
+
var failsafe;
|
|
326
|
+
var hasRequiredFailsafe;
|
|
327
|
+
function requireFailsafe() {
|
|
328
|
+
if (hasRequiredFailsafe) return failsafe;
|
|
329
|
+
hasRequiredFailsafe = 1;
|
|
330
|
+
var Schema = /* @__PURE__ */ requireSchema();
|
|
331
|
+
failsafe = new Schema({
|
|
332
|
+
explicit: [
|
|
333
|
+
/* @__PURE__ */ requireStr(),
|
|
334
|
+
/* @__PURE__ */ requireSeq(),
|
|
335
|
+
/* @__PURE__ */ requireMap()
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
return failsafe;
|
|
339
|
+
}
|
|
340
|
+
var _null;
|
|
341
|
+
var hasRequired_null;
|
|
342
|
+
function require_null() {
|
|
343
|
+
if (hasRequired_null) return _null;
|
|
344
|
+
hasRequired_null = 1;
|
|
345
|
+
var Type = /* @__PURE__ */ requireType();
|
|
346
|
+
function resolveYamlNull(data) {
|
|
347
|
+
if (data === null) return true;
|
|
348
|
+
var max = data.length;
|
|
349
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
350
|
+
}
|
|
351
|
+
function constructYamlNull() {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
function isNull(object) {
|
|
355
|
+
return object === null;
|
|
356
|
+
}
|
|
357
|
+
_null = new Type("tag:yaml.org,2002:null", {
|
|
358
|
+
kind: "scalar",
|
|
359
|
+
resolve: resolveYamlNull,
|
|
360
|
+
construct: constructYamlNull,
|
|
361
|
+
predicate: isNull,
|
|
362
|
+
represent: {
|
|
363
|
+
canonical: function() {
|
|
364
|
+
return "~";
|
|
365
|
+
},
|
|
366
|
+
lowercase: function() {
|
|
367
|
+
return "null";
|
|
368
|
+
},
|
|
369
|
+
uppercase: function() {
|
|
370
|
+
return "NULL";
|
|
371
|
+
},
|
|
372
|
+
camelcase: function() {
|
|
373
|
+
return "Null";
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
defaultStyle: "lowercase"
|
|
377
|
+
});
|
|
378
|
+
return _null;
|
|
379
|
+
}
|
|
380
|
+
var bool;
|
|
381
|
+
var hasRequiredBool;
|
|
382
|
+
function requireBool() {
|
|
383
|
+
if (hasRequiredBool) return bool;
|
|
384
|
+
hasRequiredBool = 1;
|
|
385
|
+
var Type = /* @__PURE__ */ requireType();
|
|
386
|
+
function resolveYamlBoolean(data) {
|
|
387
|
+
if (data === null) return false;
|
|
388
|
+
var max = data.length;
|
|
389
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
390
|
+
}
|
|
391
|
+
function constructYamlBoolean(data) {
|
|
392
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
393
|
+
}
|
|
394
|
+
function isBoolean(object) {
|
|
395
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
396
|
+
}
|
|
397
|
+
bool = new Type("tag:yaml.org,2002:bool", {
|
|
398
|
+
kind: "scalar",
|
|
399
|
+
resolve: resolveYamlBoolean,
|
|
400
|
+
construct: constructYamlBoolean,
|
|
401
|
+
predicate: isBoolean,
|
|
402
|
+
represent: {
|
|
403
|
+
lowercase: function(object) {
|
|
404
|
+
return object ? "true" : "false";
|
|
405
|
+
},
|
|
406
|
+
uppercase: function(object) {
|
|
407
|
+
return object ? "TRUE" : "FALSE";
|
|
408
|
+
},
|
|
409
|
+
camelcase: function(object) {
|
|
410
|
+
return object ? "True" : "False";
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
defaultStyle: "lowercase"
|
|
414
|
+
});
|
|
415
|
+
return bool;
|
|
416
|
+
}
|
|
417
|
+
var int;
|
|
418
|
+
var hasRequiredInt;
|
|
419
|
+
function requireInt() {
|
|
420
|
+
if (hasRequiredInt) return int;
|
|
421
|
+
hasRequiredInt = 1;
|
|
422
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
423
|
+
var Type = /* @__PURE__ */ requireType();
|
|
424
|
+
function isHexCode(c) {
|
|
425
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
426
|
+
}
|
|
427
|
+
function isOctCode(c) {
|
|
428
|
+
return 48 <= c && c <= 55;
|
|
429
|
+
}
|
|
430
|
+
function isDecCode(c) {
|
|
431
|
+
return 48 <= c && c <= 57;
|
|
432
|
+
}
|
|
433
|
+
function resolveYamlInteger(data) {
|
|
434
|
+
if (data === null) return false;
|
|
435
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
436
|
+
if (!max) return false;
|
|
437
|
+
ch = data[index];
|
|
438
|
+
if (ch === "-" || ch === "+") {
|
|
439
|
+
ch = data[++index];
|
|
440
|
+
}
|
|
441
|
+
if (ch === "0") {
|
|
442
|
+
if (index + 1 === max) return true;
|
|
443
|
+
ch = data[++index];
|
|
444
|
+
if (ch === "b") {
|
|
445
|
+
index++;
|
|
446
|
+
for (; index < max; index++) {
|
|
447
|
+
ch = data[index];
|
|
448
|
+
if (ch === "_") continue;
|
|
449
|
+
if (ch !== "0" && ch !== "1") return false;
|
|
450
|
+
hasDigits = true;
|
|
451
|
+
}
|
|
452
|
+
return hasDigits && ch !== "_";
|
|
453
|
+
}
|
|
454
|
+
if (ch === "x") {
|
|
455
|
+
index++;
|
|
456
|
+
for (; index < max; index++) {
|
|
457
|
+
ch = data[index];
|
|
458
|
+
if (ch === "_") continue;
|
|
459
|
+
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
460
|
+
hasDigits = true;
|
|
461
|
+
}
|
|
462
|
+
return hasDigits && ch !== "_";
|
|
463
|
+
}
|
|
464
|
+
for (; index < max; index++) {
|
|
465
|
+
ch = data[index];
|
|
466
|
+
if (ch === "_") continue;
|
|
467
|
+
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
468
|
+
hasDigits = true;
|
|
469
|
+
}
|
|
470
|
+
return hasDigits && ch !== "_";
|
|
471
|
+
}
|
|
472
|
+
if (ch === "_") return false;
|
|
473
|
+
for (; index < max; index++) {
|
|
474
|
+
ch = data[index];
|
|
475
|
+
if (ch === "_") continue;
|
|
476
|
+
if (ch === ":") break;
|
|
477
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
hasDigits = true;
|
|
481
|
+
}
|
|
482
|
+
if (!hasDigits || ch === "_") return false;
|
|
483
|
+
if (ch !== ":") return true;
|
|
484
|
+
return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
|
|
485
|
+
}
|
|
486
|
+
function constructYamlInteger(data) {
|
|
487
|
+
var value = data, sign = 1, ch, base, digits = [];
|
|
488
|
+
if (value.indexOf("_") !== -1) {
|
|
489
|
+
value = value.replace(/_/g, "");
|
|
490
|
+
}
|
|
491
|
+
ch = value[0];
|
|
492
|
+
if (ch === "-" || ch === "+") {
|
|
493
|
+
if (ch === "-") sign = -1;
|
|
494
|
+
value = value.slice(1);
|
|
495
|
+
ch = value[0];
|
|
496
|
+
}
|
|
497
|
+
if (value === "0") return 0;
|
|
498
|
+
if (ch === "0") {
|
|
499
|
+
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
500
|
+
if (value[1] === "x") return sign * parseInt(value, 16);
|
|
501
|
+
return sign * parseInt(value, 8);
|
|
502
|
+
}
|
|
503
|
+
if (value.indexOf(":") !== -1) {
|
|
504
|
+
value.split(":").forEach(function(v) {
|
|
505
|
+
digits.unshift(parseInt(v, 10));
|
|
506
|
+
});
|
|
507
|
+
value = 0;
|
|
508
|
+
base = 1;
|
|
509
|
+
digits.forEach(function(d) {
|
|
510
|
+
value += d * base;
|
|
511
|
+
base *= 60;
|
|
512
|
+
});
|
|
513
|
+
return sign * value;
|
|
514
|
+
}
|
|
515
|
+
return sign * parseInt(value, 10);
|
|
516
|
+
}
|
|
517
|
+
function isInteger(object) {
|
|
518
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common2.isNegativeZero(object));
|
|
519
|
+
}
|
|
520
|
+
int = new Type("tag:yaml.org,2002:int", {
|
|
521
|
+
kind: "scalar",
|
|
522
|
+
resolve: resolveYamlInteger,
|
|
523
|
+
construct: constructYamlInteger,
|
|
524
|
+
predicate: isInteger,
|
|
525
|
+
represent: {
|
|
526
|
+
binary: function(obj) {
|
|
527
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
528
|
+
},
|
|
529
|
+
octal: function(obj) {
|
|
530
|
+
return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
|
|
531
|
+
},
|
|
532
|
+
decimal: function(obj) {
|
|
533
|
+
return obj.toString(10);
|
|
534
|
+
},
|
|
535
|
+
/* eslint-disable max-len */
|
|
536
|
+
hexadecimal: function(obj) {
|
|
537
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
defaultStyle: "decimal",
|
|
541
|
+
styleAliases: {
|
|
542
|
+
binary: [2, "bin"],
|
|
543
|
+
octal: [8, "oct"],
|
|
544
|
+
decimal: [10, "dec"],
|
|
545
|
+
hexadecimal: [16, "hex"]
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
return int;
|
|
549
|
+
}
|
|
550
|
+
var float;
|
|
551
|
+
var hasRequiredFloat;
|
|
552
|
+
function requireFloat() {
|
|
553
|
+
if (hasRequiredFloat) return float;
|
|
554
|
+
hasRequiredFloat = 1;
|
|
555
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
556
|
+
var Type = /* @__PURE__ */ requireType();
|
|
557
|
+
var YAML_FLOAT_PATTERN = new RegExp(
|
|
558
|
+
// 2.5e4, 2.5 and integers
|
|
559
|
+
"^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
560
|
+
);
|
|
561
|
+
function resolveYamlFloat(data) {
|
|
562
|
+
if (data === null) return false;
|
|
563
|
+
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
|
|
564
|
+
// Probably should update regexp & check speed
|
|
565
|
+
data[data.length - 1] === "_") {
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
return true;
|
|
569
|
+
}
|
|
570
|
+
function constructYamlFloat(data) {
|
|
571
|
+
var value, sign, base, digits;
|
|
572
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
573
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
574
|
+
digits = [];
|
|
575
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
576
|
+
value = value.slice(1);
|
|
577
|
+
}
|
|
578
|
+
if (value === ".inf") {
|
|
579
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
580
|
+
} else if (value === ".nan") {
|
|
581
|
+
return NaN;
|
|
582
|
+
} else if (value.indexOf(":") >= 0) {
|
|
583
|
+
value.split(":").forEach(function(v) {
|
|
584
|
+
digits.unshift(parseFloat(v, 10));
|
|
585
|
+
});
|
|
586
|
+
value = 0;
|
|
587
|
+
base = 1;
|
|
588
|
+
digits.forEach(function(d) {
|
|
589
|
+
value += d * base;
|
|
590
|
+
base *= 60;
|
|
591
|
+
});
|
|
592
|
+
return sign * value;
|
|
593
|
+
}
|
|
594
|
+
return sign * parseFloat(value, 10);
|
|
595
|
+
}
|
|
596
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
597
|
+
function representYamlFloat(object, style) {
|
|
598
|
+
var res;
|
|
599
|
+
if (isNaN(object)) {
|
|
600
|
+
switch (style) {
|
|
601
|
+
case "lowercase":
|
|
602
|
+
return ".nan";
|
|
603
|
+
case "uppercase":
|
|
604
|
+
return ".NAN";
|
|
605
|
+
case "camelcase":
|
|
606
|
+
return ".NaN";
|
|
607
|
+
}
|
|
608
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
609
|
+
switch (style) {
|
|
610
|
+
case "lowercase":
|
|
611
|
+
return ".inf";
|
|
612
|
+
case "uppercase":
|
|
613
|
+
return ".INF";
|
|
614
|
+
case "camelcase":
|
|
615
|
+
return ".Inf";
|
|
616
|
+
}
|
|
617
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
618
|
+
switch (style) {
|
|
619
|
+
case "lowercase":
|
|
620
|
+
return "-.inf";
|
|
621
|
+
case "uppercase":
|
|
622
|
+
return "-.INF";
|
|
623
|
+
case "camelcase":
|
|
624
|
+
return "-.Inf";
|
|
625
|
+
}
|
|
626
|
+
} else if (common2.isNegativeZero(object)) {
|
|
627
|
+
return "-0.0";
|
|
628
|
+
}
|
|
629
|
+
res = object.toString(10);
|
|
630
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
631
|
+
}
|
|
632
|
+
function isFloat(object) {
|
|
633
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common2.isNegativeZero(object));
|
|
634
|
+
}
|
|
635
|
+
float = new Type("tag:yaml.org,2002:float", {
|
|
636
|
+
kind: "scalar",
|
|
637
|
+
resolve: resolveYamlFloat,
|
|
638
|
+
construct: constructYamlFloat,
|
|
639
|
+
predicate: isFloat,
|
|
640
|
+
represent: representYamlFloat,
|
|
641
|
+
defaultStyle: "lowercase"
|
|
642
|
+
});
|
|
643
|
+
return float;
|
|
644
|
+
}
|
|
645
|
+
var json;
|
|
646
|
+
var hasRequiredJson;
|
|
647
|
+
function requireJson() {
|
|
648
|
+
if (hasRequiredJson) return json;
|
|
649
|
+
hasRequiredJson = 1;
|
|
650
|
+
var Schema = /* @__PURE__ */ requireSchema();
|
|
651
|
+
json = new Schema({
|
|
652
|
+
include: [
|
|
653
|
+
/* @__PURE__ */ requireFailsafe()
|
|
654
|
+
],
|
|
655
|
+
implicit: [
|
|
656
|
+
/* @__PURE__ */ require_null(),
|
|
657
|
+
/* @__PURE__ */ requireBool(),
|
|
658
|
+
/* @__PURE__ */ requireInt(),
|
|
659
|
+
/* @__PURE__ */ requireFloat()
|
|
660
|
+
]
|
|
661
|
+
});
|
|
662
|
+
return json;
|
|
663
|
+
}
|
|
664
|
+
var core;
|
|
665
|
+
var hasRequiredCore;
|
|
666
|
+
function requireCore() {
|
|
667
|
+
if (hasRequiredCore) return core;
|
|
668
|
+
hasRequiredCore = 1;
|
|
669
|
+
var Schema = /* @__PURE__ */ requireSchema();
|
|
670
|
+
core = new Schema({
|
|
671
|
+
include: [
|
|
672
|
+
/* @__PURE__ */ requireJson()
|
|
673
|
+
]
|
|
674
|
+
});
|
|
675
|
+
return core;
|
|
676
|
+
}
|
|
677
|
+
var timestamp;
|
|
678
|
+
var hasRequiredTimestamp;
|
|
679
|
+
function requireTimestamp() {
|
|
680
|
+
if (hasRequiredTimestamp) return timestamp;
|
|
681
|
+
hasRequiredTimestamp = 1;
|
|
682
|
+
var Type = /* @__PURE__ */ requireType();
|
|
683
|
+
var YAML_DATE_REGEXP = new RegExp(
|
|
684
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
685
|
+
);
|
|
686
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp(
|
|
687
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
688
|
+
);
|
|
689
|
+
function resolveYamlTimestamp(data) {
|
|
690
|
+
if (data === null) return false;
|
|
691
|
+
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
692
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
function constructYamlTimestamp(data) {
|
|
696
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
697
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
698
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
699
|
+
if (match === null) throw new Error("Date resolve error");
|
|
700
|
+
year = +match[1];
|
|
701
|
+
month = +match[2] - 1;
|
|
702
|
+
day = +match[3];
|
|
703
|
+
if (!match[4]) {
|
|
704
|
+
return new Date(Date.UTC(year, month, day));
|
|
705
|
+
}
|
|
706
|
+
hour = +match[4];
|
|
707
|
+
minute = +match[5];
|
|
708
|
+
second = +match[6];
|
|
709
|
+
if (match[7]) {
|
|
710
|
+
fraction = match[7].slice(0, 3);
|
|
711
|
+
while (fraction.length < 3) {
|
|
712
|
+
fraction += "0";
|
|
713
|
+
}
|
|
714
|
+
fraction = +fraction;
|
|
715
|
+
}
|
|
716
|
+
if (match[9]) {
|
|
717
|
+
tz_hour = +match[10];
|
|
718
|
+
tz_minute = +(match[11] || 0);
|
|
719
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
720
|
+
if (match[9] === "-") delta = -delta;
|
|
721
|
+
}
|
|
722
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
723
|
+
if (delta) date.setTime(date.getTime() - delta);
|
|
724
|
+
return date;
|
|
725
|
+
}
|
|
726
|
+
function representYamlTimestamp(object) {
|
|
727
|
+
return object.toISOString();
|
|
728
|
+
}
|
|
729
|
+
timestamp = new Type("tag:yaml.org,2002:timestamp", {
|
|
730
|
+
kind: "scalar",
|
|
731
|
+
resolve: resolveYamlTimestamp,
|
|
732
|
+
construct: constructYamlTimestamp,
|
|
733
|
+
instanceOf: Date,
|
|
734
|
+
represent: representYamlTimestamp
|
|
735
|
+
});
|
|
736
|
+
return timestamp;
|
|
737
|
+
}
|
|
738
|
+
var merge;
|
|
739
|
+
var hasRequiredMerge;
|
|
740
|
+
function requireMerge() {
|
|
741
|
+
if (hasRequiredMerge) return merge;
|
|
742
|
+
hasRequiredMerge = 1;
|
|
743
|
+
var Type = /* @__PURE__ */ requireType();
|
|
744
|
+
function resolveYamlMerge(data) {
|
|
745
|
+
return data === "<<" || data === null;
|
|
746
|
+
}
|
|
747
|
+
merge = new Type("tag:yaml.org,2002:merge", {
|
|
748
|
+
kind: "scalar",
|
|
749
|
+
resolve: resolveYamlMerge
|
|
750
|
+
});
|
|
751
|
+
return merge;
|
|
752
|
+
}
|
|
753
|
+
function commonjsRequire(path) {
|
|
754
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
755
|
+
}
|
|
756
|
+
var binary;
|
|
757
|
+
var hasRequiredBinary;
|
|
758
|
+
function requireBinary() {
|
|
759
|
+
if (hasRequiredBinary) return binary;
|
|
760
|
+
hasRequiredBinary = 1;
|
|
761
|
+
var NodeBuffer;
|
|
762
|
+
try {
|
|
763
|
+
var _require = commonjsRequire;
|
|
764
|
+
NodeBuffer = _require("buffer").Buffer;
|
|
765
|
+
} catch (__) {
|
|
766
|
+
}
|
|
767
|
+
var Type = /* @__PURE__ */ requireType();
|
|
768
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
769
|
+
function resolveYamlBinary(data) {
|
|
770
|
+
if (data === null) return false;
|
|
771
|
+
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
|
|
772
|
+
for (idx = 0; idx < max; idx++) {
|
|
773
|
+
code = map2.indexOf(data.charAt(idx));
|
|
774
|
+
if (code > 64) continue;
|
|
775
|
+
if (code < 0) return false;
|
|
776
|
+
bitlen += 6;
|
|
777
|
+
}
|
|
778
|
+
return bitlen % 8 === 0;
|
|
779
|
+
}
|
|
780
|
+
function constructYamlBinary(data) {
|
|
781
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
|
782
|
+
for (idx = 0; idx < max; idx++) {
|
|
783
|
+
if (idx % 4 === 0 && idx) {
|
|
784
|
+
result.push(bits >> 16 & 255);
|
|
785
|
+
result.push(bits >> 8 & 255);
|
|
786
|
+
result.push(bits & 255);
|
|
787
|
+
}
|
|
788
|
+
bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
|
789
|
+
}
|
|
790
|
+
tailbits = max % 4 * 6;
|
|
791
|
+
if (tailbits === 0) {
|
|
792
|
+
result.push(bits >> 16 & 255);
|
|
793
|
+
result.push(bits >> 8 & 255);
|
|
794
|
+
result.push(bits & 255);
|
|
795
|
+
} else if (tailbits === 18) {
|
|
796
|
+
result.push(bits >> 10 & 255);
|
|
797
|
+
result.push(bits >> 2 & 255);
|
|
798
|
+
} else if (tailbits === 12) {
|
|
799
|
+
result.push(bits >> 4 & 255);
|
|
800
|
+
}
|
|
801
|
+
if (NodeBuffer) {
|
|
802
|
+
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
|
803
|
+
}
|
|
804
|
+
return result;
|
|
805
|
+
}
|
|
806
|
+
function representYamlBinary(object) {
|
|
807
|
+
var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
|
|
808
|
+
for (idx = 0; idx < max; idx++) {
|
|
809
|
+
if (idx % 3 === 0 && idx) {
|
|
810
|
+
result += map2[bits >> 18 & 63];
|
|
811
|
+
result += map2[bits >> 12 & 63];
|
|
812
|
+
result += map2[bits >> 6 & 63];
|
|
813
|
+
result += map2[bits & 63];
|
|
814
|
+
}
|
|
815
|
+
bits = (bits << 8) + object[idx];
|
|
816
|
+
}
|
|
817
|
+
tail = max % 3;
|
|
818
|
+
if (tail === 0) {
|
|
819
|
+
result += map2[bits >> 18 & 63];
|
|
820
|
+
result += map2[bits >> 12 & 63];
|
|
821
|
+
result += map2[bits >> 6 & 63];
|
|
822
|
+
result += map2[bits & 63];
|
|
823
|
+
} else if (tail === 2) {
|
|
824
|
+
result += map2[bits >> 10 & 63];
|
|
825
|
+
result += map2[bits >> 4 & 63];
|
|
826
|
+
result += map2[bits << 2 & 63];
|
|
827
|
+
result += map2[64];
|
|
828
|
+
} else if (tail === 1) {
|
|
829
|
+
result += map2[bits >> 2 & 63];
|
|
830
|
+
result += map2[bits << 4 & 63];
|
|
831
|
+
result += map2[64];
|
|
832
|
+
result += map2[64];
|
|
833
|
+
}
|
|
834
|
+
return result;
|
|
835
|
+
}
|
|
836
|
+
function isBinary(object) {
|
|
837
|
+
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
838
|
+
}
|
|
839
|
+
binary = new Type("tag:yaml.org,2002:binary", {
|
|
840
|
+
kind: "scalar",
|
|
841
|
+
resolve: resolveYamlBinary,
|
|
842
|
+
construct: constructYamlBinary,
|
|
843
|
+
predicate: isBinary,
|
|
844
|
+
represent: representYamlBinary
|
|
845
|
+
});
|
|
846
|
+
return binary;
|
|
847
|
+
}
|
|
848
|
+
var omap;
|
|
849
|
+
var hasRequiredOmap;
|
|
850
|
+
function requireOmap() {
|
|
851
|
+
if (hasRequiredOmap) return omap;
|
|
852
|
+
hasRequiredOmap = 1;
|
|
853
|
+
var Type = /* @__PURE__ */ requireType();
|
|
854
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
855
|
+
var _toString = Object.prototype.toString;
|
|
856
|
+
function resolveYamlOmap(data) {
|
|
857
|
+
if (data === null) return true;
|
|
858
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
859
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
860
|
+
pair = object[index];
|
|
861
|
+
pairHasKey = false;
|
|
862
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
863
|
+
for (pairKey in pair) {
|
|
864
|
+
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
865
|
+
if (!pairHasKey) pairHasKey = true;
|
|
866
|
+
else return false;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (!pairHasKey) return false;
|
|
870
|
+
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
871
|
+
else return false;
|
|
872
|
+
}
|
|
873
|
+
return true;
|
|
874
|
+
}
|
|
875
|
+
function constructYamlOmap(data) {
|
|
876
|
+
return data !== null ? data : [];
|
|
877
|
+
}
|
|
878
|
+
omap = new Type("tag:yaml.org,2002:omap", {
|
|
879
|
+
kind: "sequence",
|
|
880
|
+
resolve: resolveYamlOmap,
|
|
881
|
+
construct: constructYamlOmap
|
|
882
|
+
});
|
|
883
|
+
return omap;
|
|
884
|
+
}
|
|
885
|
+
var pairs;
|
|
886
|
+
var hasRequiredPairs;
|
|
887
|
+
function requirePairs() {
|
|
888
|
+
if (hasRequiredPairs) return pairs;
|
|
889
|
+
hasRequiredPairs = 1;
|
|
890
|
+
var Type = /* @__PURE__ */ requireType();
|
|
891
|
+
var _toString = Object.prototype.toString;
|
|
892
|
+
function resolveYamlPairs(data) {
|
|
893
|
+
if (data === null) return true;
|
|
894
|
+
var index, length, pair, keys, result, object = data;
|
|
895
|
+
result = new Array(object.length);
|
|
896
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
897
|
+
pair = object[index];
|
|
898
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
899
|
+
keys = Object.keys(pair);
|
|
900
|
+
if (keys.length !== 1) return false;
|
|
901
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
902
|
+
}
|
|
903
|
+
return true;
|
|
904
|
+
}
|
|
905
|
+
function constructYamlPairs(data) {
|
|
906
|
+
if (data === null) return [];
|
|
907
|
+
var index, length, pair, keys, result, object = data;
|
|
908
|
+
result = new Array(object.length);
|
|
909
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
910
|
+
pair = object[index];
|
|
911
|
+
keys = Object.keys(pair);
|
|
912
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
913
|
+
}
|
|
914
|
+
return result;
|
|
915
|
+
}
|
|
916
|
+
pairs = new Type("tag:yaml.org,2002:pairs", {
|
|
917
|
+
kind: "sequence",
|
|
918
|
+
resolve: resolveYamlPairs,
|
|
919
|
+
construct: constructYamlPairs
|
|
920
|
+
});
|
|
921
|
+
return pairs;
|
|
922
|
+
}
|
|
923
|
+
var set;
|
|
924
|
+
var hasRequiredSet;
|
|
925
|
+
function requireSet() {
|
|
926
|
+
if (hasRequiredSet) return set;
|
|
927
|
+
hasRequiredSet = 1;
|
|
928
|
+
var Type = /* @__PURE__ */ requireType();
|
|
929
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
930
|
+
function resolveYamlSet(data) {
|
|
931
|
+
if (data === null) return true;
|
|
932
|
+
var key, object = data;
|
|
933
|
+
for (key in object) {
|
|
934
|
+
if (_hasOwnProperty.call(object, key)) {
|
|
935
|
+
if (object[key] !== null) return false;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
return true;
|
|
939
|
+
}
|
|
940
|
+
function constructYamlSet(data) {
|
|
941
|
+
return data !== null ? data : {};
|
|
942
|
+
}
|
|
943
|
+
set = new Type("tag:yaml.org,2002:set", {
|
|
944
|
+
kind: "mapping",
|
|
945
|
+
resolve: resolveYamlSet,
|
|
946
|
+
construct: constructYamlSet
|
|
947
|
+
});
|
|
948
|
+
return set;
|
|
949
|
+
}
|
|
950
|
+
var default_safe;
|
|
951
|
+
var hasRequiredDefault_safe;
|
|
952
|
+
function requireDefault_safe() {
|
|
953
|
+
if (hasRequiredDefault_safe) return default_safe;
|
|
954
|
+
hasRequiredDefault_safe = 1;
|
|
955
|
+
var Schema = /* @__PURE__ */ requireSchema();
|
|
956
|
+
default_safe = new Schema({
|
|
957
|
+
include: [
|
|
958
|
+
/* @__PURE__ */ requireCore()
|
|
959
|
+
],
|
|
960
|
+
implicit: [
|
|
961
|
+
/* @__PURE__ */ requireTimestamp(),
|
|
962
|
+
/* @__PURE__ */ requireMerge()
|
|
963
|
+
],
|
|
964
|
+
explicit: [
|
|
965
|
+
/* @__PURE__ */ requireBinary(),
|
|
966
|
+
/* @__PURE__ */ requireOmap(),
|
|
967
|
+
/* @__PURE__ */ requirePairs(),
|
|
968
|
+
/* @__PURE__ */ requireSet()
|
|
969
|
+
]
|
|
970
|
+
});
|
|
971
|
+
return default_safe;
|
|
972
|
+
}
|
|
973
|
+
var _undefined;
|
|
974
|
+
var hasRequired_undefined;
|
|
975
|
+
function require_undefined() {
|
|
976
|
+
if (hasRequired_undefined) return _undefined;
|
|
977
|
+
hasRequired_undefined = 1;
|
|
978
|
+
var Type = /* @__PURE__ */ requireType();
|
|
979
|
+
function resolveJavascriptUndefined() {
|
|
980
|
+
return true;
|
|
981
|
+
}
|
|
982
|
+
function constructJavascriptUndefined() {
|
|
983
|
+
return void 0;
|
|
984
|
+
}
|
|
985
|
+
function representJavascriptUndefined() {
|
|
986
|
+
return "";
|
|
987
|
+
}
|
|
988
|
+
function isUndefined(object) {
|
|
989
|
+
return typeof object === "undefined";
|
|
990
|
+
}
|
|
991
|
+
_undefined = new Type("tag:yaml.org,2002:js/undefined", {
|
|
992
|
+
kind: "scalar",
|
|
993
|
+
resolve: resolveJavascriptUndefined,
|
|
994
|
+
construct: constructJavascriptUndefined,
|
|
995
|
+
predicate: isUndefined,
|
|
996
|
+
represent: representJavascriptUndefined
|
|
997
|
+
});
|
|
998
|
+
return _undefined;
|
|
999
|
+
}
|
|
1000
|
+
var regexp;
|
|
1001
|
+
var hasRequiredRegexp;
|
|
1002
|
+
function requireRegexp() {
|
|
1003
|
+
if (hasRequiredRegexp) return regexp;
|
|
1004
|
+
hasRequiredRegexp = 1;
|
|
1005
|
+
var Type = /* @__PURE__ */ requireType();
|
|
1006
|
+
function resolveJavascriptRegExp(data) {
|
|
1007
|
+
if (data === null) return false;
|
|
1008
|
+
if (data.length === 0) return false;
|
|
1009
|
+
var regexp2 = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
1010
|
+
if (regexp2[0] === "/") {
|
|
1011
|
+
if (tail) modifiers = tail[1];
|
|
1012
|
+
if (modifiers.length > 3) return false;
|
|
1013
|
+
if (regexp2[regexp2.length - modifiers.length - 1] !== "/") return false;
|
|
1014
|
+
}
|
|
1015
|
+
return true;
|
|
1016
|
+
}
|
|
1017
|
+
function constructJavascriptRegExp(data) {
|
|
1018
|
+
var regexp2 = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
1019
|
+
if (regexp2[0] === "/") {
|
|
1020
|
+
if (tail) modifiers = tail[1];
|
|
1021
|
+
regexp2 = regexp2.slice(1, regexp2.length - modifiers.length - 1);
|
|
1022
|
+
}
|
|
1023
|
+
return new RegExp(regexp2, modifiers);
|
|
1024
|
+
}
|
|
1025
|
+
function representJavascriptRegExp(object) {
|
|
1026
|
+
var result = "/" + object.source + "/";
|
|
1027
|
+
if (object.global) result += "g";
|
|
1028
|
+
if (object.multiline) result += "m";
|
|
1029
|
+
if (object.ignoreCase) result += "i";
|
|
1030
|
+
return result;
|
|
1031
|
+
}
|
|
1032
|
+
function isRegExp(object) {
|
|
1033
|
+
return Object.prototype.toString.call(object) === "[object RegExp]";
|
|
1034
|
+
}
|
|
1035
|
+
regexp = new Type("tag:yaml.org,2002:js/regexp", {
|
|
1036
|
+
kind: "scalar",
|
|
1037
|
+
resolve: resolveJavascriptRegExp,
|
|
1038
|
+
construct: constructJavascriptRegExp,
|
|
1039
|
+
predicate: isRegExp,
|
|
1040
|
+
represent: representJavascriptRegExp
|
|
1041
|
+
});
|
|
1042
|
+
return regexp;
|
|
1043
|
+
}
|
|
1044
|
+
var _function;
|
|
1045
|
+
var hasRequired_function;
|
|
1046
|
+
function require_function() {
|
|
1047
|
+
if (hasRequired_function) return _function;
|
|
1048
|
+
hasRequired_function = 1;
|
|
1049
|
+
var esprima;
|
|
1050
|
+
try {
|
|
1051
|
+
var _require = commonjsRequire;
|
|
1052
|
+
esprima = _require("esprima");
|
|
1053
|
+
} catch (_) {
|
|
1054
|
+
if (typeof window !== "undefined") esprima = window.esprima;
|
|
1055
|
+
}
|
|
1056
|
+
var Type = /* @__PURE__ */ requireType();
|
|
1057
|
+
function resolveJavascriptFunction(data) {
|
|
1058
|
+
if (data === null) return false;
|
|
1059
|
+
try {
|
|
1060
|
+
var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
|
|
1061
|
+
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
1062
|
+
return false;
|
|
1063
|
+
}
|
|
1064
|
+
return true;
|
|
1065
|
+
} catch (err) {
|
|
1066
|
+
return false;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
function constructJavascriptFunction(data) {
|
|
1070
|
+
var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
|
|
1071
|
+
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
1072
|
+
throw new Error("Failed to resolve function");
|
|
1073
|
+
}
|
|
1074
|
+
ast.body[0].expression.params.forEach(function(param) {
|
|
1075
|
+
params.push(param.name);
|
|
1076
|
+
});
|
|
1077
|
+
body = ast.body[0].expression.body.range;
|
|
1078
|
+
if (ast.body[0].expression.body.type === "BlockStatement") {
|
|
1079
|
+
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
|
1080
|
+
}
|
|
1081
|
+
return new Function(params, "return " + source.slice(body[0], body[1]));
|
|
1082
|
+
}
|
|
1083
|
+
function representJavascriptFunction(object) {
|
|
1084
|
+
return object.toString();
|
|
1085
|
+
}
|
|
1086
|
+
function isFunction(object) {
|
|
1087
|
+
return Object.prototype.toString.call(object) === "[object Function]";
|
|
1088
|
+
}
|
|
1089
|
+
_function = new Type("tag:yaml.org,2002:js/function", {
|
|
1090
|
+
kind: "scalar",
|
|
1091
|
+
resolve: resolveJavascriptFunction,
|
|
1092
|
+
construct: constructJavascriptFunction,
|
|
1093
|
+
predicate: isFunction,
|
|
1094
|
+
represent: representJavascriptFunction
|
|
1095
|
+
});
|
|
1096
|
+
return _function;
|
|
1097
|
+
}
|
|
1098
|
+
var default_full;
|
|
1099
|
+
var hasRequiredDefault_full;
|
|
1100
|
+
function requireDefault_full() {
|
|
1101
|
+
if (hasRequiredDefault_full) return default_full;
|
|
1102
|
+
hasRequiredDefault_full = 1;
|
|
1103
|
+
var Schema = /* @__PURE__ */ requireSchema();
|
|
1104
|
+
default_full = Schema.DEFAULT = new Schema({
|
|
1105
|
+
include: [
|
|
1106
|
+
/* @__PURE__ */ requireDefault_safe()
|
|
1107
|
+
],
|
|
1108
|
+
explicit: [
|
|
1109
|
+
/* @__PURE__ */ require_undefined(),
|
|
1110
|
+
/* @__PURE__ */ requireRegexp(),
|
|
1111
|
+
/* @__PURE__ */ require_function()
|
|
1112
|
+
]
|
|
1113
|
+
});
|
|
1114
|
+
return default_full;
|
|
1115
|
+
}
|
|
1116
|
+
var hasRequiredLoader;
|
|
1117
|
+
function requireLoader() {
|
|
1118
|
+
if (hasRequiredLoader) return loader;
|
|
1119
|
+
hasRequiredLoader = 1;
|
|
1120
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
1121
|
+
var YAMLException = /* @__PURE__ */ requireException();
|
|
1122
|
+
var Mark = /* @__PURE__ */ requireMark();
|
|
1123
|
+
var DEFAULT_SAFE_SCHEMA = /* @__PURE__ */ requireDefault_safe();
|
|
1124
|
+
var DEFAULT_FULL_SCHEMA = /* @__PURE__ */ requireDefault_full();
|
|
1125
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1126
|
+
var CONTEXT_FLOW_IN = 1;
|
|
1127
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
1128
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
1129
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
1130
|
+
var CHOMPING_CLIP = 1;
|
|
1131
|
+
var CHOMPING_STRIP = 2;
|
|
1132
|
+
var CHOMPING_KEEP = 3;
|
|
1133
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
1134
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
1135
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
1136
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
1137
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1138
|
+
function _class(obj) {
|
|
1139
|
+
return Object.prototype.toString.call(obj);
|
|
1140
|
+
}
|
|
1141
|
+
function is_EOL(c) {
|
|
1142
|
+
return c === 10 || c === 13;
|
|
1143
|
+
}
|
|
1144
|
+
function is_WHITE_SPACE(c) {
|
|
1145
|
+
return c === 9 || c === 32;
|
|
1146
|
+
}
|
|
1147
|
+
function is_WS_OR_EOL(c) {
|
|
1148
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
1149
|
+
}
|
|
1150
|
+
function is_FLOW_INDICATOR(c) {
|
|
1151
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
1152
|
+
}
|
|
1153
|
+
function fromHexCode(c) {
|
|
1154
|
+
var lc;
|
|
1155
|
+
if (48 <= c && c <= 57) {
|
|
1156
|
+
return c - 48;
|
|
1157
|
+
}
|
|
1158
|
+
lc = c | 32;
|
|
1159
|
+
if (97 <= lc && lc <= 102) {
|
|
1160
|
+
return lc - 97 + 10;
|
|
1161
|
+
}
|
|
1162
|
+
return -1;
|
|
1163
|
+
}
|
|
1164
|
+
function escapedHexLen(c) {
|
|
1165
|
+
if (c === 120) {
|
|
1166
|
+
return 2;
|
|
1167
|
+
}
|
|
1168
|
+
if (c === 117) {
|
|
1169
|
+
return 4;
|
|
1170
|
+
}
|
|
1171
|
+
if (c === 85) {
|
|
1172
|
+
return 8;
|
|
1173
|
+
}
|
|
1174
|
+
return 0;
|
|
1175
|
+
}
|
|
1176
|
+
function fromDecimalCode(c) {
|
|
1177
|
+
if (48 <= c && c <= 57) {
|
|
1178
|
+
return c - 48;
|
|
1179
|
+
}
|
|
1180
|
+
return -1;
|
|
1181
|
+
}
|
|
1182
|
+
function simpleEscapeSequence(c) {
|
|
1183
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "
" : c === 95 ? " " : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
1184
|
+
}
|
|
1185
|
+
function charFromCodepoint(c) {
|
|
1186
|
+
if (c <= 65535) {
|
|
1187
|
+
return String.fromCharCode(c);
|
|
1188
|
+
}
|
|
1189
|
+
return String.fromCharCode(
|
|
1190
|
+
(c - 65536 >> 10) + 55296,
|
|
1191
|
+
(c - 65536 & 1023) + 56320
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
function setProperty(object, key, value) {
|
|
1195
|
+
if (key === "__proto__") {
|
|
1196
|
+
Object.defineProperty(object, key, {
|
|
1197
|
+
configurable: true,
|
|
1198
|
+
enumerable: true,
|
|
1199
|
+
writable: true,
|
|
1200
|
+
value
|
|
1201
|
+
});
|
|
1202
|
+
} else {
|
|
1203
|
+
object[key] = value;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
var simpleEscapeCheck = new Array(256);
|
|
1207
|
+
var simpleEscapeMap = new Array(256);
|
|
1208
|
+
for (var i = 0; i < 256; i++) {
|
|
1209
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
1210
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
1211
|
+
}
|
|
1212
|
+
function State(input, options) {
|
|
1213
|
+
this.input = input;
|
|
1214
|
+
this.filename = options["filename"] || null;
|
|
1215
|
+
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
|
|
1216
|
+
this.onWarning = options["onWarning"] || null;
|
|
1217
|
+
this.legacy = options["legacy"] || false;
|
|
1218
|
+
this.json = options["json"] || false;
|
|
1219
|
+
this.listener = options["listener"] || null;
|
|
1220
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
1221
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
1222
|
+
this.length = input.length;
|
|
1223
|
+
this.position = 0;
|
|
1224
|
+
this.line = 0;
|
|
1225
|
+
this.lineStart = 0;
|
|
1226
|
+
this.lineIndent = 0;
|
|
1227
|
+
this.documents = [];
|
|
1228
|
+
}
|
|
1229
|
+
function generateError(state, message) {
|
|
1230
|
+
return new YAMLException(
|
|
1231
|
+
message,
|
|
1232
|
+
new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
|
|
1233
|
+
);
|
|
1234
|
+
}
|
|
1235
|
+
function throwError(state, message) {
|
|
1236
|
+
throw generateError(state, message);
|
|
1237
|
+
}
|
|
1238
|
+
function throwWarning(state, message) {
|
|
1239
|
+
if (state.onWarning) {
|
|
1240
|
+
state.onWarning.call(null, generateError(state, message));
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
var directiveHandlers = {
|
|
1244
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
1245
|
+
var match, major, minor;
|
|
1246
|
+
if (state.version !== null) {
|
|
1247
|
+
throwError(state, "duplication of %YAML directive");
|
|
1248
|
+
}
|
|
1249
|
+
if (args.length !== 1) {
|
|
1250
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
1251
|
+
}
|
|
1252
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
1253
|
+
if (match === null) {
|
|
1254
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
1255
|
+
}
|
|
1256
|
+
major = parseInt(match[1], 10);
|
|
1257
|
+
minor = parseInt(match[2], 10);
|
|
1258
|
+
if (major !== 1) {
|
|
1259
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
1260
|
+
}
|
|
1261
|
+
state.version = args[0];
|
|
1262
|
+
state.checkLineBreaks = minor < 2;
|
|
1263
|
+
if (minor !== 1 && minor !== 2) {
|
|
1264
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
1268
|
+
var handle, prefix;
|
|
1269
|
+
if (args.length !== 2) {
|
|
1270
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
1271
|
+
}
|
|
1272
|
+
handle = args[0];
|
|
1273
|
+
prefix = args[1];
|
|
1274
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
1275
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1276
|
+
}
|
|
1277
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
1278
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
1279
|
+
}
|
|
1280
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
1281
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1282
|
+
}
|
|
1283
|
+
state.tagMap[handle] = prefix;
|
|
1284
|
+
}
|
|
1285
|
+
};
|
|
1286
|
+
function captureSegment(state, start, end, checkJson) {
|
|
1287
|
+
var _position, _length, _character, _result;
|
|
1288
|
+
if (start < end) {
|
|
1289
|
+
_result = state.input.slice(start, end);
|
|
1290
|
+
if (checkJson) {
|
|
1291
|
+
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
1292
|
+
_character = _result.charCodeAt(_position);
|
|
1293
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
1294
|
+
throwError(state, "expected valid JSON character");
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
1298
|
+
throwError(state, "the stream contains non-printable characters");
|
|
1299
|
+
}
|
|
1300
|
+
state.result += _result;
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
1304
|
+
var sourceKeys, key, index, quantity;
|
|
1305
|
+
if (!common2.isObject(source)) {
|
|
1306
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1307
|
+
}
|
|
1308
|
+
sourceKeys = Object.keys(source);
|
|
1309
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
1310
|
+
key = sourceKeys[index];
|
|
1311
|
+
if (!_hasOwnProperty.call(destination, key)) {
|
|
1312
|
+
setProperty(destination, key, source[key]);
|
|
1313
|
+
overridableKeys[key] = true;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
|
1318
|
+
var index, quantity;
|
|
1319
|
+
if (Array.isArray(keyNode)) {
|
|
1320
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
1321
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
1322
|
+
if (Array.isArray(keyNode[index])) {
|
|
1323
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
1324
|
+
}
|
|
1325
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
1326
|
+
keyNode[index] = "[object Object]";
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
1331
|
+
keyNode = "[object Object]";
|
|
1332
|
+
}
|
|
1333
|
+
keyNode = String(keyNode);
|
|
1334
|
+
if (_result === null) {
|
|
1335
|
+
_result = {};
|
|
1336
|
+
}
|
|
1337
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
1338
|
+
if (Array.isArray(valueNode)) {
|
|
1339
|
+
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
1340
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
1341
|
+
}
|
|
1342
|
+
} else {
|
|
1343
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
1344
|
+
}
|
|
1345
|
+
} else {
|
|
1346
|
+
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
1347
|
+
state.line = startLine || state.line;
|
|
1348
|
+
state.position = startPos || state.position;
|
|
1349
|
+
throwError(state, "duplicated mapping key");
|
|
1350
|
+
}
|
|
1351
|
+
setProperty(_result, keyNode, valueNode);
|
|
1352
|
+
delete overridableKeys[keyNode];
|
|
1353
|
+
}
|
|
1354
|
+
return _result;
|
|
1355
|
+
}
|
|
1356
|
+
function readLineBreak(state) {
|
|
1357
|
+
var ch;
|
|
1358
|
+
ch = state.input.charCodeAt(state.position);
|
|
1359
|
+
if (ch === 10) {
|
|
1360
|
+
state.position++;
|
|
1361
|
+
} else if (ch === 13) {
|
|
1362
|
+
state.position++;
|
|
1363
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
1364
|
+
state.position++;
|
|
1365
|
+
}
|
|
1366
|
+
} else {
|
|
1367
|
+
throwError(state, "a line break is expected");
|
|
1368
|
+
}
|
|
1369
|
+
state.line += 1;
|
|
1370
|
+
state.lineStart = state.position;
|
|
1371
|
+
}
|
|
1372
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
1373
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
1374
|
+
while (ch !== 0) {
|
|
1375
|
+
while (is_WHITE_SPACE(ch)) {
|
|
1376
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1377
|
+
}
|
|
1378
|
+
if (allowComments && ch === 35) {
|
|
1379
|
+
do {
|
|
1380
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1381
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
1382
|
+
}
|
|
1383
|
+
if (is_EOL(ch)) {
|
|
1384
|
+
readLineBreak(state);
|
|
1385
|
+
ch = state.input.charCodeAt(state.position);
|
|
1386
|
+
lineBreaks++;
|
|
1387
|
+
state.lineIndent = 0;
|
|
1388
|
+
while (ch === 32) {
|
|
1389
|
+
state.lineIndent++;
|
|
1390
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1391
|
+
}
|
|
1392
|
+
} else {
|
|
1393
|
+
break;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
1397
|
+
throwWarning(state, "deficient indentation");
|
|
1398
|
+
}
|
|
1399
|
+
return lineBreaks;
|
|
1400
|
+
}
|
|
1401
|
+
function testDocumentSeparator(state) {
|
|
1402
|
+
var _position = state.position, ch;
|
|
1403
|
+
ch = state.input.charCodeAt(_position);
|
|
1404
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
1405
|
+
_position += 3;
|
|
1406
|
+
ch = state.input.charCodeAt(_position);
|
|
1407
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
1408
|
+
return true;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
return false;
|
|
1412
|
+
}
|
|
1413
|
+
function writeFoldedLines(state, count) {
|
|
1414
|
+
if (count === 1) {
|
|
1415
|
+
state.result += " ";
|
|
1416
|
+
} else if (count > 1) {
|
|
1417
|
+
state.result += common2.repeat("\n", count - 1);
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
1421
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
1422
|
+
ch = state.input.charCodeAt(state.position);
|
|
1423
|
+
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
1424
|
+
return false;
|
|
1425
|
+
}
|
|
1426
|
+
if (ch === 63 || ch === 45) {
|
|
1427
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1428
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
1429
|
+
return false;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
state.kind = "scalar";
|
|
1433
|
+
state.result = "";
|
|
1434
|
+
captureStart = captureEnd = state.position;
|
|
1435
|
+
hasPendingContent = false;
|
|
1436
|
+
while (ch !== 0) {
|
|
1437
|
+
if (ch === 58) {
|
|
1438
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1439
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
} else if (ch === 35) {
|
|
1443
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
1444
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
1448
|
+
break;
|
|
1449
|
+
} else if (is_EOL(ch)) {
|
|
1450
|
+
_line = state.line;
|
|
1451
|
+
_lineStart = state.lineStart;
|
|
1452
|
+
_lineIndent = state.lineIndent;
|
|
1453
|
+
skipSeparationSpace(state, false, -1);
|
|
1454
|
+
if (state.lineIndent >= nodeIndent) {
|
|
1455
|
+
hasPendingContent = true;
|
|
1456
|
+
ch = state.input.charCodeAt(state.position);
|
|
1457
|
+
continue;
|
|
1458
|
+
} else {
|
|
1459
|
+
state.position = captureEnd;
|
|
1460
|
+
state.line = _line;
|
|
1461
|
+
state.lineStart = _lineStart;
|
|
1462
|
+
state.lineIndent = _lineIndent;
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
if (hasPendingContent) {
|
|
1467
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
1468
|
+
writeFoldedLines(state, state.line - _line);
|
|
1469
|
+
captureStart = captureEnd = state.position;
|
|
1470
|
+
hasPendingContent = false;
|
|
1471
|
+
}
|
|
1472
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
1473
|
+
captureEnd = state.position + 1;
|
|
1474
|
+
}
|
|
1475
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1476
|
+
}
|
|
1477
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
1478
|
+
if (state.result) {
|
|
1479
|
+
return true;
|
|
1480
|
+
}
|
|
1481
|
+
state.kind = _kind;
|
|
1482
|
+
state.result = _result;
|
|
1483
|
+
return false;
|
|
1484
|
+
}
|
|
1485
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
1486
|
+
var ch, captureStart, captureEnd;
|
|
1487
|
+
ch = state.input.charCodeAt(state.position);
|
|
1488
|
+
if (ch !== 39) {
|
|
1489
|
+
return false;
|
|
1490
|
+
}
|
|
1491
|
+
state.kind = "scalar";
|
|
1492
|
+
state.result = "";
|
|
1493
|
+
state.position++;
|
|
1494
|
+
captureStart = captureEnd = state.position;
|
|
1495
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1496
|
+
if (ch === 39) {
|
|
1497
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1498
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1499
|
+
if (ch === 39) {
|
|
1500
|
+
captureStart = state.position;
|
|
1501
|
+
state.position++;
|
|
1502
|
+
captureEnd = state.position;
|
|
1503
|
+
} else {
|
|
1504
|
+
return true;
|
|
1505
|
+
}
|
|
1506
|
+
} else if (is_EOL(ch)) {
|
|
1507
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
1508
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
1509
|
+
captureStart = captureEnd = state.position;
|
|
1510
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1511
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
1512
|
+
} else {
|
|
1513
|
+
state.position++;
|
|
1514
|
+
captureEnd = state.position;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
1518
|
+
}
|
|
1519
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
1520
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
1521
|
+
ch = state.input.charCodeAt(state.position);
|
|
1522
|
+
if (ch !== 34) {
|
|
1523
|
+
return false;
|
|
1524
|
+
}
|
|
1525
|
+
state.kind = "scalar";
|
|
1526
|
+
state.result = "";
|
|
1527
|
+
state.position++;
|
|
1528
|
+
captureStart = captureEnd = state.position;
|
|
1529
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1530
|
+
if (ch === 34) {
|
|
1531
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1532
|
+
state.position++;
|
|
1533
|
+
return true;
|
|
1534
|
+
} else if (ch === 92) {
|
|
1535
|
+
captureSegment(state, captureStart, state.position, true);
|
|
1536
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1537
|
+
if (is_EOL(ch)) {
|
|
1538
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
1539
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
1540
|
+
state.result += simpleEscapeMap[ch];
|
|
1541
|
+
state.position++;
|
|
1542
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
1543
|
+
hexLength = tmp;
|
|
1544
|
+
hexResult = 0;
|
|
1545
|
+
for (; hexLength > 0; hexLength--) {
|
|
1546
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1547
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
1548
|
+
hexResult = (hexResult << 4) + tmp;
|
|
1549
|
+
} else {
|
|
1550
|
+
throwError(state, "expected hexadecimal character");
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
state.result += charFromCodepoint(hexResult);
|
|
1554
|
+
state.position++;
|
|
1555
|
+
} else {
|
|
1556
|
+
throwError(state, "unknown escape sequence");
|
|
1557
|
+
}
|
|
1558
|
+
captureStart = captureEnd = state.position;
|
|
1559
|
+
} else if (is_EOL(ch)) {
|
|
1560
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
1561
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
1562
|
+
captureStart = captureEnd = state.position;
|
|
1563
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1564
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
1565
|
+
} else {
|
|
1566
|
+
state.position++;
|
|
1567
|
+
captureEnd = state.position;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
1571
|
+
}
|
|
1572
|
+
function readFlowCollection(state, nodeIndent) {
|
|
1573
|
+
var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
|
|
1574
|
+
ch = state.input.charCodeAt(state.position);
|
|
1575
|
+
if (ch === 91) {
|
|
1576
|
+
terminator = 93;
|
|
1577
|
+
isMapping = false;
|
|
1578
|
+
_result = [];
|
|
1579
|
+
} else if (ch === 123) {
|
|
1580
|
+
terminator = 125;
|
|
1581
|
+
isMapping = true;
|
|
1582
|
+
_result = {};
|
|
1583
|
+
} else {
|
|
1584
|
+
return false;
|
|
1585
|
+
}
|
|
1586
|
+
if (state.anchor !== null) {
|
|
1587
|
+
state.anchorMap[state.anchor] = _result;
|
|
1588
|
+
}
|
|
1589
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1590
|
+
while (ch !== 0) {
|
|
1591
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1592
|
+
ch = state.input.charCodeAt(state.position);
|
|
1593
|
+
if (ch === terminator) {
|
|
1594
|
+
state.position++;
|
|
1595
|
+
state.tag = _tag;
|
|
1596
|
+
state.anchor = _anchor;
|
|
1597
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
1598
|
+
state.result = _result;
|
|
1599
|
+
return true;
|
|
1600
|
+
} else if (!readNext) {
|
|
1601
|
+
throwError(state, "missed comma between flow collection entries");
|
|
1602
|
+
}
|
|
1603
|
+
keyTag = keyNode = valueNode = null;
|
|
1604
|
+
isPair = isExplicitPair = false;
|
|
1605
|
+
if (ch === 63) {
|
|
1606
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1607
|
+
if (is_WS_OR_EOL(following)) {
|
|
1608
|
+
isPair = isExplicitPair = true;
|
|
1609
|
+
state.position++;
|
|
1610
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
_line = state.line;
|
|
1614
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
1615
|
+
keyTag = state.tag;
|
|
1616
|
+
keyNode = state.result;
|
|
1617
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1618
|
+
ch = state.input.charCodeAt(state.position);
|
|
1619
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
1620
|
+
isPair = true;
|
|
1621
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1622
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1623
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
1624
|
+
valueNode = state.result;
|
|
1625
|
+
}
|
|
1626
|
+
if (isMapping) {
|
|
1627
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
|
1628
|
+
} else if (isPair) {
|
|
1629
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
|
|
1630
|
+
} else {
|
|
1631
|
+
_result.push(keyNode);
|
|
1632
|
+
}
|
|
1633
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
1634
|
+
ch = state.input.charCodeAt(state.position);
|
|
1635
|
+
if (ch === 44) {
|
|
1636
|
+
readNext = true;
|
|
1637
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1638
|
+
} else {
|
|
1639
|
+
readNext = false;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
1643
|
+
}
|
|
1644
|
+
function readBlockScalar(state, nodeIndent) {
|
|
1645
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
1646
|
+
ch = state.input.charCodeAt(state.position);
|
|
1647
|
+
if (ch === 124) {
|
|
1648
|
+
folding = false;
|
|
1649
|
+
} else if (ch === 62) {
|
|
1650
|
+
folding = true;
|
|
1651
|
+
} else {
|
|
1652
|
+
return false;
|
|
1653
|
+
}
|
|
1654
|
+
state.kind = "scalar";
|
|
1655
|
+
state.result = "";
|
|
1656
|
+
while (ch !== 0) {
|
|
1657
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1658
|
+
if (ch === 43 || ch === 45) {
|
|
1659
|
+
if (CHOMPING_CLIP === chomping) {
|
|
1660
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
1661
|
+
} else {
|
|
1662
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
1663
|
+
}
|
|
1664
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
1665
|
+
if (tmp === 0) {
|
|
1666
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
1667
|
+
} else if (!detectedIndent) {
|
|
1668
|
+
textIndent = nodeIndent + tmp - 1;
|
|
1669
|
+
detectedIndent = true;
|
|
1670
|
+
} else {
|
|
1671
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
1672
|
+
}
|
|
1673
|
+
} else {
|
|
1674
|
+
break;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
if (is_WHITE_SPACE(ch)) {
|
|
1678
|
+
do {
|
|
1679
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1680
|
+
} while (is_WHITE_SPACE(ch));
|
|
1681
|
+
if (ch === 35) {
|
|
1682
|
+
do {
|
|
1683
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1684
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
while (ch !== 0) {
|
|
1688
|
+
readLineBreak(state);
|
|
1689
|
+
state.lineIndent = 0;
|
|
1690
|
+
ch = state.input.charCodeAt(state.position);
|
|
1691
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
1692
|
+
state.lineIndent++;
|
|
1693
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1694
|
+
}
|
|
1695
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
1696
|
+
textIndent = state.lineIndent;
|
|
1697
|
+
}
|
|
1698
|
+
if (is_EOL(ch)) {
|
|
1699
|
+
emptyLines++;
|
|
1700
|
+
continue;
|
|
1701
|
+
}
|
|
1702
|
+
if (state.lineIndent < textIndent) {
|
|
1703
|
+
if (chomping === CHOMPING_KEEP) {
|
|
1704
|
+
state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1705
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
1706
|
+
if (didReadContent) {
|
|
1707
|
+
state.result += "\n";
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1712
|
+
if (folding) {
|
|
1713
|
+
if (is_WHITE_SPACE(ch)) {
|
|
1714
|
+
atMoreIndented = true;
|
|
1715
|
+
state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1716
|
+
} else if (atMoreIndented) {
|
|
1717
|
+
atMoreIndented = false;
|
|
1718
|
+
state.result += common2.repeat("\n", emptyLines + 1);
|
|
1719
|
+
} else if (emptyLines === 0) {
|
|
1720
|
+
if (didReadContent) {
|
|
1721
|
+
state.result += " ";
|
|
1722
|
+
}
|
|
1723
|
+
} else {
|
|
1724
|
+
state.result += common2.repeat("\n", emptyLines);
|
|
1725
|
+
}
|
|
1726
|
+
} else {
|
|
1727
|
+
state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
1728
|
+
}
|
|
1729
|
+
didReadContent = true;
|
|
1730
|
+
detectedIndent = true;
|
|
1731
|
+
emptyLines = 0;
|
|
1732
|
+
captureStart = state.position;
|
|
1733
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
1734
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1735
|
+
}
|
|
1736
|
+
captureSegment(state, captureStart, state.position, false);
|
|
1737
|
+
}
|
|
1738
|
+
return true;
|
|
1739
|
+
}
|
|
1740
|
+
function readBlockSequence(state, nodeIndent) {
|
|
1741
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
1742
|
+
if (state.anchor !== null) {
|
|
1743
|
+
state.anchorMap[state.anchor] = _result;
|
|
1744
|
+
}
|
|
1745
|
+
ch = state.input.charCodeAt(state.position);
|
|
1746
|
+
while (ch !== 0) {
|
|
1747
|
+
if (ch !== 45) {
|
|
1748
|
+
break;
|
|
1749
|
+
}
|
|
1750
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1751
|
+
if (!is_WS_OR_EOL(following)) {
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
detected = true;
|
|
1755
|
+
state.position++;
|
|
1756
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
1757
|
+
if (state.lineIndent <= nodeIndent) {
|
|
1758
|
+
_result.push(null);
|
|
1759
|
+
ch = state.input.charCodeAt(state.position);
|
|
1760
|
+
continue;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
_line = state.line;
|
|
1764
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
1765
|
+
_result.push(state.result);
|
|
1766
|
+
skipSeparationSpace(state, true, -1);
|
|
1767
|
+
ch = state.input.charCodeAt(state.position);
|
|
1768
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
1769
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
1770
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
1771
|
+
break;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
if (detected) {
|
|
1775
|
+
state.tag = _tag;
|
|
1776
|
+
state.anchor = _anchor;
|
|
1777
|
+
state.kind = "sequence";
|
|
1778
|
+
state.result = _result;
|
|
1779
|
+
return true;
|
|
1780
|
+
}
|
|
1781
|
+
return false;
|
|
1782
|
+
}
|
|
1783
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
1784
|
+
var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
1785
|
+
if (state.anchor !== null) {
|
|
1786
|
+
state.anchorMap[state.anchor] = _result;
|
|
1787
|
+
}
|
|
1788
|
+
ch = state.input.charCodeAt(state.position);
|
|
1789
|
+
while (ch !== 0) {
|
|
1790
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
1791
|
+
_line = state.line;
|
|
1792
|
+
_pos = state.position;
|
|
1793
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
1794
|
+
if (ch === 63) {
|
|
1795
|
+
if (atExplicitKey) {
|
|
1796
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
1797
|
+
keyTag = keyNode = valueNode = null;
|
|
1798
|
+
}
|
|
1799
|
+
detected = true;
|
|
1800
|
+
atExplicitKey = true;
|
|
1801
|
+
allowCompact = true;
|
|
1802
|
+
} else if (atExplicitKey) {
|
|
1803
|
+
atExplicitKey = false;
|
|
1804
|
+
allowCompact = true;
|
|
1805
|
+
} else {
|
|
1806
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
1807
|
+
}
|
|
1808
|
+
state.position += 1;
|
|
1809
|
+
ch = following;
|
|
1810
|
+
} else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
1811
|
+
if (state.line === _line) {
|
|
1812
|
+
ch = state.input.charCodeAt(state.position);
|
|
1813
|
+
while (is_WHITE_SPACE(ch)) {
|
|
1814
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1815
|
+
}
|
|
1816
|
+
if (ch === 58) {
|
|
1817
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1818
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
1819
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
1820
|
+
}
|
|
1821
|
+
if (atExplicitKey) {
|
|
1822
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
1823
|
+
keyTag = keyNode = valueNode = null;
|
|
1824
|
+
}
|
|
1825
|
+
detected = true;
|
|
1826
|
+
atExplicitKey = false;
|
|
1827
|
+
allowCompact = false;
|
|
1828
|
+
keyTag = state.tag;
|
|
1829
|
+
keyNode = state.result;
|
|
1830
|
+
} else if (detected) {
|
|
1831
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
1832
|
+
} else {
|
|
1833
|
+
state.tag = _tag;
|
|
1834
|
+
state.anchor = _anchor;
|
|
1835
|
+
return true;
|
|
1836
|
+
}
|
|
1837
|
+
} else if (detected) {
|
|
1838
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1839
|
+
} else {
|
|
1840
|
+
state.tag = _tag;
|
|
1841
|
+
state.anchor = _anchor;
|
|
1842
|
+
return true;
|
|
1843
|
+
}
|
|
1844
|
+
} else {
|
|
1845
|
+
break;
|
|
1846
|
+
}
|
|
1847
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
1848
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
1849
|
+
if (atExplicitKey) {
|
|
1850
|
+
keyNode = state.result;
|
|
1851
|
+
} else {
|
|
1852
|
+
valueNode = state.result;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
if (!atExplicitKey) {
|
|
1856
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
|
1857
|
+
keyTag = keyNode = valueNode = null;
|
|
1858
|
+
}
|
|
1859
|
+
skipSeparationSpace(state, true, -1);
|
|
1860
|
+
ch = state.input.charCodeAt(state.position);
|
|
1861
|
+
}
|
|
1862
|
+
if (state.lineIndent > nodeIndent && ch !== 0) {
|
|
1863
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
1864
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
if (atExplicitKey) {
|
|
1869
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
1870
|
+
}
|
|
1871
|
+
if (detected) {
|
|
1872
|
+
state.tag = _tag;
|
|
1873
|
+
state.anchor = _anchor;
|
|
1874
|
+
state.kind = "mapping";
|
|
1875
|
+
state.result = _result;
|
|
1876
|
+
}
|
|
1877
|
+
return detected;
|
|
1878
|
+
}
|
|
1879
|
+
function readTagProperty(state) {
|
|
1880
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
1881
|
+
ch = state.input.charCodeAt(state.position);
|
|
1882
|
+
if (ch !== 33) return false;
|
|
1883
|
+
if (state.tag !== null) {
|
|
1884
|
+
throwError(state, "duplication of a tag property");
|
|
1885
|
+
}
|
|
1886
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1887
|
+
if (ch === 60) {
|
|
1888
|
+
isVerbatim = true;
|
|
1889
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1890
|
+
} else if (ch === 33) {
|
|
1891
|
+
isNamed = true;
|
|
1892
|
+
tagHandle = "!!";
|
|
1893
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1894
|
+
} else {
|
|
1895
|
+
tagHandle = "!";
|
|
1896
|
+
}
|
|
1897
|
+
_position = state.position;
|
|
1898
|
+
if (isVerbatim) {
|
|
1899
|
+
do {
|
|
1900
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1901
|
+
} while (ch !== 0 && ch !== 62);
|
|
1902
|
+
if (state.position < state.length) {
|
|
1903
|
+
tagName = state.input.slice(_position, state.position);
|
|
1904
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1905
|
+
} else {
|
|
1906
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
1907
|
+
}
|
|
1908
|
+
} else {
|
|
1909
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
1910
|
+
if (ch === 33) {
|
|
1911
|
+
if (!isNamed) {
|
|
1912
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
1913
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
1914
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
1915
|
+
}
|
|
1916
|
+
isNamed = true;
|
|
1917
|
+
_position = state.position + 1;
|
|
1918
|
+
} else {
|
|
1919
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1923
|
+
}
|
|
1924
|
+
tagName = state.input.slice(_position, state.position);
|
|
1925
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
1926
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
1930
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
1931
|
+
}
|
|
1932
|
+
if (isVerbatim) {
|
|
1933
|
+
state.tag = tagName;
|
|
1934
|
+
} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
1935
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
1936
|
+
} else if (tagHandle === "!") {
|
|
1937
|
+
state.tag = "!" + tagName;
|
|
1938
|
+
} else if (tagHandle === "!!") {
|
|
1939
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
1940
|
+
} else {
|
|
1941
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
1942
|
+
}
|
|
1943
|
+
return true;
|
|
1944
|
+
}
|
|
1945
|
+
function readAnchorProperty(state) {
|
|
1946
|
+
var _position, ch;
|
|
1947
|
+
ch = state.input.charCodeAt(state.position);
|
|
1948
|
+
if (ch !== 38) return false;
|
|
1949
|
+
if (state.anchor !== null) {
|
|
1950
|
+
throwError(state, "duplication of an anchor property");
|
|
1951
|
+
}
|
|
1952
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1953
|
+
_position = state.position;
|
|
1954
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1955
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1956
|
+
}
|
|
1957
|
+
if (state.position === _position) {
|
|
1958
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
1959
|
+
}
|
|
1960
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
1961
|
+
return true;
|
|
1962
|
+
}
|
|
1963
|
+
function readAlias(state) {
|
|
1964
|
+
var _position, alias, ch;
|
|
1965
|
+
ch = state.input.charCodeAt(state.position);
|
|
1966
|
+
if (ch !== 42) return false;
|
|
1967
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1968
|
+
_position = state.position;
|
|
1969
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1970
|
+
ch = state.input.charCodeAt(++state.position);
|
|
1971
|
+
}
|
|
1972
|
+
if (state.position === _position) {
|
|
1973
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
1974
|
+
}
|
|
1975
|
+
alias = state.input.slice(_position, state.position);
|
|
1976
|
+
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
1977
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
1978
|
+
}
|
|
1979
|
+
state.result = state.anchorMap[alias];
|
|
1980
|
+
skipSeparationSpace(state, true, -1);
|
|
1981
|
+
return true;
|
|
1982
|
+
}
|
|
1983
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
1984
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type2, flowIndent, blockIndent;
|
|
1985
|
+
if (state.listener !== null) {
|
|
1986
|
+
state.listener("open", state);
|
|
1987
|
+
}
|
|
1988
|
+
state.tag = null;
|
|
1989
|
+
state.anchor = null;
|
|
1990
|
+
state.kind = null;
|
|
1991
|
+
state.result = null;
|
|
1992
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
1993
|
+
if (allowToSeek) {
|
|
1994
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
1995
|
+
atNewLine = true;
|
|
1996
|
+
if (state.lineIndent > parentIndent) {
|
|
1997
|
+
indentStatus = 1;
|
|
1998
|
+
} else if (state.lineIndent === parentIndent) {
|
|
1999
|
+
indentStatus = 0;
|
|
2000
|
+
} else if (state.lineIndent < parentIndent) {
|
|
2001
|
+
indentStatus = -1;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
if (indentStatus === 1) {
|
|
2006
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
2007
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
2008
|
+
atNewLine = true;
|
|
2009
|
+
allowBlockCollections = allowBlockStyles;
|
|
2010
|
+
if (state.lineIndent > parentIndent) {
|
|
2011
|
+
indentStatus = 1;
|
|
2012
|
+
} else if (state.lineIndent === parentIndent) {
|
|
2013
|
+
indentStatus = 0;
|
|
2014
|
+
} else if (state.lineIndent < parentIndent) {
|
|
2015
|
+
indentStatus = -1;
|
|
2016
|
+
}
|
|
2017
|
+
} else {
|
|
2018
|
+
allowBlockCollections = false;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
if (allowBlockCollections) {
|
|
2023
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
2024
|
+
}
|
|
2025
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
2026
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
2027
|
+
flowIndent = parentIndent;
|
|
2028
|
+
} else {
|
|
2029
|
+
flowIndent = parentIndent + 1;
|
|
2030
|
+
}
|
|
2031
|
+
blockIndent = state.position - state.lineStart;
|
|
2032
|
+
if (indentStatus === 1) {
|
|
2033
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
2034
|
+
hasContent = true;
|
|
2035
|
+
} else {
|
|
2036
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
2037
|
+
hasContent = true;
|
|
2038
|
+
} else if (readAlias(state)) {
|
|
2039
|
+
hasContent = true;
|
|
2040
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
2041
|
+
throwError(state, "alias node should not have any properties");
|
|
2042
|
+
}
|
|
2043
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
2044
|
+
hasContent = true;
|
|
2045
|
+
if (state.tag === null) {
|
|
2046
|
+
state.tag = "?";
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
if (state.anchor !== null) {
|
|
2050
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
} else if (indentStatus === 0) {
|
|
2054
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
if (state.tag !== null && state.tag !== "!") {
|
|
2058
|
+
if (state.tag === "?") {
|
|
2059
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
2060
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
2061
|
+
}
|
|
2062
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
2063
|
+
type2 = state.implicitTypes[typeIndex];
|
|
2064
|
+
if (type2.resolve(state.result)) {
|
|
2065
|
+
state.result = type2.construct(state.result);
|
|
2066
|
+
state.tag = type2.tag;
|
|
2067
|
+
if (state.anchor !== null) {
|
|
2068
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2069
|
+
}
|
|
2070
|
+
break;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
} else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
2074
|
+
type2 = state.typeMap[state.kind || "fallback"][state.tag];
|
|
2075
|
+
if (state.result !== null && type2.kind !== state.kind) {
|
|
2076
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
|
|
2077
|
+
}
|
|
2078
|
+
if (!type2.resolve(state.result)) {
|
|
2079
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
2080
|
+
} else {
|
|
2081
|
+
state.result = type2.construct(state.result);
|
|
2082
|
+
if (state.anchor !== null) {
|
|
2083
|
+
state.anchorMap[state.anchor] = state.result;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
} else {
|
|
2087
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
if (state.listener !== null) {
|
|
2091
|
+
state.listener("close", state);
|
|
2092
|
+
}
|
|
2093
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
2094
|
+
}
|
|
2095
|
+
function readDocument(state) {
|
|
2096
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
2097
|
+
state.version = null;
|
|
2098
|
+
state.checkLineBreaks = state.legacy;
|
|
2099
|
+
state.tagMap = {};
|
|
2100
|
+
state.anchorMap = {};
|
|
2101
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
2102
|
+
skipSeparationSpace(state, true, -1);
|
|
2103
|
+
ch = state.input.charCodeAt(state.position);
|
|
2104
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
2105
|
+
break;
|
|
2106
|
+
}
|
|
2107
|
+
hasDirectives = true;
|
|
2108
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2109
|
+
_position = state.position;
|
|
2110
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2111
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2112
|
+
}
|
|
2113
|
+
directiveName = state.input.slice(_position, state.position);
|
|
2114
|
+
directiveArgs = [];
|
|
2115
|
+
if (directiveName.length < 1) {
|
|
2116
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
2117
|
+
}
|
|
2118
|
+
while (ch !== 0) {
|
|
2119
|
+
while (is_WHITE_SPACE(ch)) {
|
|
2120
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2121
|
+
}
|
|
2122
|
+
if (ch === 35) {
|
|
2123
|
+
do {
|
|
2124
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2125
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
if (is_EOL(ch)) break;
|
|
2129
|
+
_position = state.position;
|
|
2130
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2131
|
+
ch = state.input.charCodeAt(++state.position);
|
|
2132
|
+
}
|
|
2133
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
2134
|
+
}
|
|
2135
|
+
if (ch !== 0) readLineBreak(state);
|
|
2136
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
2137
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
2138
|
+
} else {
|
|
2139
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
skipSeparationSpace(state, true, -1);
|
|
2143
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
2144
|
+
state.position += 3;
|
|
2145
|
+
skipSeparationSpace(state, true, -1);
|
|
2146
|
+
} else if (hasDirectives) {
|
|
2147
|
+
throwError(state, "directives end mark is expected");
|
|
2148
|
+
}
|
|
2149
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
2150
|
+
skipSeparationSpace(state, true, -1);
|
|
2151
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
2152
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
2153
|
+
}
|
|
2154
|
+
state.documents.push(state.result);
|
|
2155
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
2156
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
2157
|
+
state.position += 3;
|
|
2158
|
+
skipSeparationSpace(state, true, -1);
|
|
2159
|
+
}
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2162
|
+
if (state.position < state.length - 1) {
|
|
2163
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
2164
|
+
} else {
|
|
2165
|
+
return;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
function loadDocuments(input, options) {
|
|
2169
|
+
input = String(input);
|
|
2170
|
+
options = options || {};
|
|
2171
|
+
if (input.length !== 0) {
|
|
2172
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
2173
|
+
input += "\n";
|
|
2174
|
+
}
|
|
2175
|
+
if (input.charCodeAt(0) === 65279) {
|
|
2176
|
+
input = input.slice(1);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
var state = new State(input, options);
|
|
2180
|
+
var nullpos = input.indexOf("\0");
|
|
2181
|
+
if (nullpos !== -1) {
|
|
2182
|
+
state.position = nullpos;
|
|
2183
|
+
throwError(state, "null byte is not allowed in input");
|
|
2184
|
+
}
|
|
2185
|
+
state.input += "\0";
|
|
2186
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
2187
|
+
state.lineIndent += 1;
|
|
2188
|
+
state.position += 1;
|
|
2189
|
+
}
|
|
2190
|
+
while (state.position < state.length - 1) {
|
|
2191
|
+
readDocument(state);
|
|
2192
|
+
}
|
|
2193
|
+
return state.documents;
|
|
2194
|
+
}
|
|
2195
|
+
function loadAll(input, iterator, options) {
|
|
2196
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
2197
|
+
options = iterator;
|
|
2198
|
+
iterator = null;
|
|
2199
|
+
}
|
|
2200
|
+
var documents = loadDocuments(input, options);
|
|
2201
|
+
if (typeof iterator !== "function") {
|
|
2202
|
+
return documents;
|
|
2203
|
+
}
|
|
2204
|
+
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
2205
|
+
iterator(documents[index]);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
function load(input, options) {
|
|
2209
|
+
var documents = loadDocuments(input, options);
|
|
2210
|
+
if (documents.length === 0) {
|
|
2211
|
+
return void 0;
|
|
2212
|
+
} else if (documents.length === 1) {
|
|
2213
|
+
return documents[0];
|
|
2214
|
+
}
|
|
2215
|
+
throw new YAMLException("expected a single document in the stream, but found more");
|
|
2216
|
+
}
|
|
2217
|
+
function safeLoadAll(input, iterator, options) {
|
|
2218
|
+
if (typeof iterator === "object" && iterator !== null && typeof options === "undefined") {
|
|
2219
|
+
options = iterator;
|
|
2220
|
+
iterator = null;
|
|
2221
|
+
}
|
|
2222
|
+
return loadAll(input, iterator, common2.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2223
|
+
}
|
|
2224
|
+
function safeLoad(input, options) {
|
|
2225
|
+
return load(input, common2.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2226
|
+
}
|
|
2227
|
+
loader.loadAll = loadAll;
|
|
2228
|
+
loader.load = load;
|
|
2229
|
+
loader.safeLoadAll = safeLoadAll;
|
|
2230
|
+
loader.safeLoad = safeLoad;
|
|
2231
|
+
return loader;
|
|
2232
|
+
}
|
|
2233
|
+
var dumper = {};
|
|
2234
|
+
var hasRequiredDumper;
|
|
2235
|
+
function requireDumper() {
|
|
2236
|
+
if (hasRequiredDumper) return dumper;
|
|
2237
|
+
hasRequiredDumper = 1;
|
|
2238
|
+
var common2 = /* @__PURE__ */ requireCommon();
|
|
2239
|
+
var YAMLException = /* @__PURE__ */ requireException();
|
|
2240
|
+
var DEFAULT_FULL_SCHEMA = /* @__PURE__ */ requireDefault_full();
|
|
2241
|
+
var DEFAULT_SAFE_SCHEMA = /* @__PURE__ */ requireDefault_safe();
|
|
2242
|
+
var _toString = Object.prototype.toString;
|
|
2243
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2244
|
+
var CHAR_TAB = 9;
|
|
2245
|
+
var CHAR_LINE_FEED = 10;
|
|
2246
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
2247
|
+
var CHAR_SPACE = 32;
|
|
2248
|
+
var CHAR_EXCLAMATION = 33;
|
|
2249
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
2250
|
+
var CHAR_SHARP = 35;
|
|
2251
|
+
var CHAR_PERCENT = 37;
|
|
2252
|
+
var CHAR_AMPERSAND = 38;
|
|
2253
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
2254
|
+
var CHAR_ASTERISK = 42;
|
|
2255
|
+
var CHAR_COMMA = 44;
|
|
2256
|
+
var CHAR_MINUS = 45;
|
|
2257
|
+
var CHAR_COLON = 58;
|
|
2258
|
+
var CHAR_EQUALS = 61;
|
|
2259
|
+
var CHAR_GREATER_THAN = 62;
|
|
2260
|
+
var CHAR_QUESTION = 63;
|
|
2261
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
2262
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
2263
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
2264
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
2265
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
2266
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
2267
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
2268
|
+
var ESCAPE_SEQUENCES = {};
|
|
2269
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
2270
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
2271
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
2272
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
2273
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
2274
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
2275
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
2276
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
2277
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
2278
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
2279
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
2280
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
2281
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
2282
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
2283
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
2284
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
2285
|
+
"y",
|
|
2286
|
+
"Y",
|
|
2287
|
+
"yes",
|
|
2288
|
+
"Yes",
|
|
2289
|
+
"YES",
|
|
2290
|
+
"on",
|
|
2291
|
+
"On",
|
|
2292
|
+
"ON",
|
|
2293
|
+
"n",
|
|
2294
|
+
"N",
|
|
2295
|
+
"no",
|
|
2296
|
+
"No",
|
|
2297
|
+
"NO",
|
|
2298
|
+
"off",
|
|
2299
|
+
"Off",
|
|
2300
|
+
"OFF"
|
|
2301
|
+
];
|
|
2302
|
+
function compileStyleMap(schema2, map2) {
|
|
2303
|
+
var result, keys, index, length, tag, style, type2;
|
|
2304
|
+
if (map2 === null) return {};
|
|
2305
|
+
result = {};
|
|
2306
|
+
keys = Object.keys(map2);
|
|
2307
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
2308
|
+
tag = keys[index];
|
|
2309
|
+
style = String(map2[tag]);
|
|
2310
|
+
if (tag.slice(0, 2) === "!!") {
|
|
2311
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
2312
|
+
}
|
|
2313
|
+
type2 = schema2.compiledTypeMap["fallback"][tag];
|
|
2314
|
+
if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
|
|
2315
|
+
style = type2.styleAliases[style];
|
|
2316
|
+
}
|
|
2317
|
+
result[tag] = style;
|
|
2318
|
+
}
|
|
2319
|
+
return result;
|
|
2320
|
+
}
|
|
2321
|
+
function encodeHex(character) {
|
|
2322
|
+
var string, handle, length;
|
|
2323
|
+
string = character.toString(16).toUpperCase();
|
|
2324
|
+
if (character <= 255) {
|
|
2325
|
+
handle = "x";
|
|
2326
|
+
length = 2;
|
|
2327
|
+
} else if (character <= 65535) {
|
|
2328
|
+
handle = "u";
|
|
2329
|
+
length = 4;
|
|
2330
|
+
} else if (character <= 4294967295) {
|
|
2331
|
+
handle = "U";
|
|
2332
|
+
length = 8;
|
|
2333
|
+
} else {
|
|
2334
|
+
throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
|
|
2335
|
+
}
|
|
2336
|
+
return "\\" + handle + common2.repeat("0", length - string.length) + string;
|
|
2337
|
+
}
|
|
2338
|
+
function State(options) {
|
|
2339
|
+
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
|
|
2340
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
2341
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
2342
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
2343
|
+
this.flowLevel = common2.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
2344
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
2345
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
2346
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
2347
|
+
this.noRefs = options["noRefs"] || false;
|
|
2348
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
2349
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
2350
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
2351
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
2352
|
+
this.tag = null;
|
|
2353
|
+
this.result = "";
|
|
2354
|
+
this.duplicates = [];
|
|
2355
|
+
this.usedDuplicates = null;
|
|
2356
|
+
}
|
|
2357
|
+
function indentString(string, spaces) {
|
|
2358
|
+
var ind = common2.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
2359
|
+
while (position < length) {
|
|
2360
|
+
next = string.indexOf("\n", position);
|
|
2361
|
+
if (next === -1) {
|
|
2362
|
+
line = string.slice(position);
|
|
2363
|
+
position = length;
|
|
2364
|
+
} else {
|
|
2365
|
+
line = string.slice(position, next + 1);
|
|
2366
|
+
position = next + 1;
|
|
2367
|
+
}
|
|
2368
|
+
if (line.length && line !== "\n") result += ind;
|
|
2369
|
+
result += line;
|
|
2370
|
+
}
|
|
2371
|
+
return result;
|
|
2372
|
+
}
|
|
2373
|
+
function generateNextLine(state, level) {
|
|
2374
|
+
return "\n" + common2.repeat(" ", state.indent * level);
|
|
2375
|
+
}
|
|
2376
|
+
function testImplicitResolving(state, str2) {
|
|
2377
|
+
var index, length, type2;
|
|
2378
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
2379
|
+
type2 = state.implicitTypes[index];
|
|
2380
|
+
if (type2.resolve(str2)) {
|
|
2381
|
+
return true;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
return false;
|
|
2385
|
+
}
|
|
2386
|
+
function isWhitespace(c) {
|
|
2387
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
2388
|
+
}
|
|
2389
|
+
function isPrintable(c) {
|
|
2390
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
|
|
2391
|
+
}
|
|
2392
|
+
function isNsChar(c) {
|
|
2393
|
+
return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
2394
|
+
}
|
|
2395
|
+
function isPlainSafe(c, prev) {
|
|
2396
|
+
return isPrintable(c) && c !== 65279 && 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_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
|
|
2397
|
+
}
|
|
2398
|
+
function isPlainSafeFirst(c) {
|
|
2399
|
+
return isPrintable(c) && c !== 65279 && !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;
|
|
2400
|
+
}
|
|
2401
|
+
function needIndentIndicator(string) {
|
|
2402
|
+
var leadingSpaceRe = /^\n* /;
|
|
2403
|
+
return leadingSpaceRe.test(string);
|
|
2404
|
+
}
|
|
2405
|
+
var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
|
|
2406
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
|
2407
|
+
var i;
|
|
2408
|
+
var char, prev_char;
|
|
2409
|
+
var hasLineBreak = false;
|
|
2410
|
+
var hasFoldableLine = false;
|
|
2411
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
2412
|
+
var previousLineBreak = -1;
|
|
2413
|
+
var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
|
|
2414
|
+
if (singleLineOnly) {
|
|
2415
|
+
for (i = 0; i < string.length; i++) {
|
|
2416
|
+
char = string.charCodeAt(i);
|
|
2417
|
+
if (!isPrintable(char)) {
|
|
2418
|
+
return STYLE_DOUBLE;
|
|
2419
|
+
}
|
|
2420
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2421
|
+
plain = plain && isPlainSafe(char, prev_char);
|
|
2422
|
+
}
|
|
2423
|
+
} else {
|
|
2424
|
+
for (i = 0; i < string.length; i++) {
|
|
2425
|
+
char = string.charCodeAt(i);
|
|
2426
|
+
if (char === CHAR_LINE_FEED) {
|
|
2427
|
+
hasLineBreak = true;
|
|
2428
|
+
if (shouldTrackWidth) {
|
|
2429
|
+
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
|
|
2430
|
+
i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2431
|
+
previousLineBreak = i;
|
|
2432
|
+
}
|
|
2433
|
+
} else if (!isPrintable(char)) {
|
|
2434
|
+
return STYLE_DOUBLE;
|
|
2435
|
+
}
|
|
2436
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2437
|
+
plain = plain && isPlainSafe(char, prev_char);
|
|
2438
|
+
}
|
|
2439
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
2440
|
+
}
|
|
2441
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
2442
|
+
return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
|
|
2443
|
+
}
|
|
2444
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
2445
|
+
return STYLE_DOUBLE;
|
|
2446
|
+
}
|
|
2447
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
2448
|
+
}
|
|
2449
|
+
function writeScalar(state, string, level, iskey) {
|
|
2450
|
+
state.dump = (function() {
|
|
2451
|
+
if (string.length === 0) {
|
|
2452
|
+
return "''";
|
|
2453
|
+
}
|
|
2454
|
+
if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
|
|
2455
|
+
return "'" + string + "'";
|
|
2456
|
+
}
|
|
2457
|
+
var indent = state.indent * Math.max(1, level);
|
|
2458
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
2459
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
2460
|
+
function testAmbiguity(string2) {
|
|
2461
|
+
return testImplicitResolving(state, string2);
|
|
2462
|
+
}
|
|
2463
|
+
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
|
|
2464
|
+
case STYLE_PLAIN:
|
|
2465
|
+
return string;
|
|
2466
|
+
case STYLE_SINGLE:
|
|
2467
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
2468
|
+
case STYLE_LITERAL:
|
|
2469
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
2470
|
+
case STYLE_FOLDED:
|
|
2471
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
2472
|
+
case STYLE_DOUBLE:
|
|
2473
|
+
return '"' + escapeString(string) + '"';
|
|
2474
|
+
default:
|
|
2475
|
+
throw new YAMLException("impossible error: invalid scalar style");
|
|
2476
|
+
}
|
|
2477
|
+
})();
|
|
2478
|
+
}
|
|
2479
|
+
function blockHeader(string, indentPerLevel) {
|
|
2480
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
2481
|
+
var clip = string[string.length - 1] === "\n";
|
|
2482
|
+
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
2483
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
2484
|
+
return indentIndicator + chomp + "\n";
|
|
2485
|
+
}
|
|
2486
|
+
function dropEndingNewline(string) {
|
|
2487
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
2488
|
+
}
|
|
2489
|
+
function foldString(string, width) {
|
|
2490
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
2491
|
+
var result = (function() {
|
|
2492
|
+
var nextLF = string.indexOf("\n");
|
|
2493
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
2494
|
+
lineRe.lastIndex = nextLF;
|
|
2495
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
2496
|
+
})();
|
|
2497
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
2498
|
+
var moreIndented;
|
|
2499
|
+
var match;
|
|
2500
|
+
while (match = lineRe.exec(string)) {
|
|
2501
|
+
var prefix = match[1], line = match[2];
|
|
2502
|
+
moreIndented = line[0] === " ";
|
|
2503
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
2504
|
+
prevMoreIndented = moreIndented;
|
|
2505
|
+
}
|
|
2506
|
+
return result;
|
|
2507
|
+
}
|
|
2508
|
+
function foldLine(line, width) {
|
|
2509
|
+
if (line === "" || line[0] === " ") return line;
|
|
2510
|
+
var breakRe = / [^ ]/g;
|
|
2511
|
+
var match;
|
|
2512
|
+
var start = 0, end, curr = 0, next = 0;
|
|
2513
|
+
var result = "";
|
|
2514
|
+
while (match = breakRe.exec(line)) {
|
|
2515
|
+
next = match.index;
|
|
2516
|
+
if (next - start > width) {
|
|
2517
|
+
end = curr > start ? curr : next;
|
|
2518
|
+
result += "\n" + line.slice(start, end);
|
|
2519
|
+
start = end + 1;
|
|
2520
|
+
}
|
|
2521
|
+
curr = next;
|
|
2522
|
+
}
|
|
2523
|
+
result += "\n";
|
|
2524
|
+
if (line.length - start > width && curr > start) {
|
|
2525
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
2526
|
+
} else {
|
|
2527
|
+
result += line.slice(start);
|
|
2528
|
+
}
|
|
2529
|
+
return result.slice(1);
|
|
2530
|
+
}
|
|
2531
|
+
function escapeString(string) {
|
|
2532
|
+
var result = "";
|
|
2533
|
+
var char, nextChar;
|
|
2534
|
+
var escapeSeq;
|
|
2535
|
+
for (var i = 0; i < string.length; i++) {
|
|
2536
|
+
char = string.charCodeAt(i);
|
|
2537
|
+
if (char >= 55296 && char <= 56319) {
|
|
2538
|
+
nextChar = string.charCodeAt(i + 1);
|
|
2539
|
+
if (nextChar >= 56320 && nextChar <= 57343) {
|
|
2540
|
+
result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
|
|
2541
|
+
i++;
|
|
2542
|
+
continue;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
2546
|
+
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
2547
|
+
}
|
|
2548
|
+
return result;
|
|
2549
|
+
}
|
|
2550
|
+
function writeFlowSequence(state, level, object) {
|
|
2551
|
+
var _result = "", _tag = state.tag, index, length;
|
|
2552
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
2553
|
+
if (writeNode(state, level, object[index], false, false)) {
|
|
2554
|
+
if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
|
|
2555
|
+
_result += state.dump;
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
state.tag = _tag;
|
|
2559
|
+
state.dump = "[" + _result + "]";
|
|
2560
|
+
}
|
|
2561
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
2562
|
+
var _result = "", _tag = state.tag, index, length;
|
|
2563
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
2564
|
+
if (writeNode(state, level + 1, object[index], true, true)) {
|
|
2565
|
+
if (!compact || index !== 0) {
|
|
2566
|
+
_result += generateNextLine(state, level);
|
|
2567
|
+
}
|
|
2568
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2569
|
+
_result += "-";
|
|
2570
|
+
} else {
|
|
2571
|
+
_result += "- ";
|
|
2572
|
+
}
|
|
2573
|
+
_result += state.dump;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
state.tag = _tag;
|
|
2577
|
+
state.dump = _result || "[]";
|
|
2578
|
+
}
|
|
2579
|
+
function writeFlowMapping(state, level, object) {
|
|
2580
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
2581
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2582
|
+
pairBuffer = "";
|
|
2583
|
+
if (index !== 0) pairBuffer += ", ";
|
|
2584
|
+
if (state.condenseFlow) pairBuffer += '"';
|
|
2585
|
+
objectKey = objectKeyList[index];
|
|
2586
|
+
objectValue = object[objectKey];
|
|
2587
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
2588
|
+
continue;
|
|
2589
|
+
}
|
|
2590
|
+
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
2591
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
2592
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
2593
|
+
continue;
|
|
2594
|
+
}
|
|
2595
|
+
pairBuffer += state.dump;
|
|
2596
|
+
_result += pairBuffer;
|
|
2597
|
+
}
|
|
2598
|
+
state.tag = _tag;
|
|
2599
|
+
state.dump = "{" + _result + "}";
|
|
2600
|
+
}
|
|
2601
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
2602
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
2603
|
+
if (state.sortKeys === true) {
|
|
2604
|
+
objectKeyList.sort();
|
|
2605
|
+
} else if (typeof state.sortKeys === "function") {
|
|
2606
|
+
objectKeyList.sort(state.sortKeys);
|
|
2607
|
+
} else if (state.sortKeys) {
|
|
2608
|
+
throw new YAMLException("sortKeys must be a boolean or a function");
|
|
2609
|
+
}
|
|
2610
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2611
|
+
pairBuffer = "";
|
|
2612
|
+
if (!compact || index !== 0) {
|
|
2613
|
+
pairBuffer += generateNextLine(state, level);
|
|
2614
|
+
}
|
|
2615
|
+
objectKey = objectKeyList[index];
|
|
2616
|
+
objectValue = object[objectKey];
|
|
2617
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
2618
|
+
continue;
|
|
2619
|
+
}
|
|
2620
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
2621
|
+
if (explicitPair) {
|
|
2622
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2623
|
+
pairBuffer += "?";
|
|
2624
|
+
} else {
|
|
2625
|
+
pairBuffer += "? ";
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
pairBuffer += state.dump;
|
|
2629
|
+
if (explicitPair) {
|
|
2630
|
+
pairBuffer += generateNextLine(state, level);
|
|
2631
|
+
}
|
|
2632
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
2633
|
+
continue;
|
|
2634
|
+
}
|
|
2635
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2636
|
+
pairBuffer += ":";
|
|
2637
|
+
} else {
|
|
2638
|
+
pairBuffer += ": ";
|
|
2639
|
+
}
|
|
2640
|
+
pairBuffer += state.dump;
|
|
2641
|
+
_result += pairBuffer;
|
|
2642
|
+
}
|
|
2643
|
+
state.tag = _tag;
|
|
2644
|
+
state.dump = _result || "{}";
|
|
2645
|
+
}
|
|
2646
|
+
function detectType(state, object, explicit) {
|
|
2647
|
+
var _result, typeList, index, length, type2, style;
|
|
2648
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
2649
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
2650
|
+
type2 = typeList[index];
|
|
2651
|
+
if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
|
|
2652
|
+
state.tag = explicit ? type2.tag : "?";
|
|
2653
|
+
if (type2.represent) {
|
|
2654
|
+
style = state.styleMap[type2.tag] || type2.defaultStyle;
|
|
2655
|
+
if (_toString.call(type2.represent) === "[object Function]") {
|
|
2656
|
+
_result = type2.represent(object, style);
|
|
2657
|
+
} else if (_hasOwnProperty.call(type2.represent, style)) {
|
|
2658
|
+
_result = type2.represent[style](object, style);
|
|
2659
|
+
} else {
|
|
2660
|
+
throw new YAMLException("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
|
|
2661
|
+
}
|
|
2662
|
+
state.dump = _result;
|
|
2663
|
+
}
|
|
2664
|
+
return true;
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
return false;
|
|
2668
|
+
}
|
|
2669
|
+
function writeNode(state, level, object, block, compact, iskey) {
|
|
2670
|
+
state.tag = null;
|
|
2671
|
+
state.dump = object;
|
|
2672
|
+
if (!detectType(state, object, false)) {
|
|
2673
|
+
detectType(state, object, true);
|
|
2674
|
+
}
|
|
2675
|
+
var type2 = _toString.call(state.dump);
|
|
2676
|
+
if (block) {
|
|
2677
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
2678
|
+
}
|
|
2679
|
+
var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
|
|
2680
|
+
if (objectOrArray) {
|
|
2681
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
2682
|
+
duplicate = duplicateIndex !== -1;
|
|
2683
|
+
}
|
|
2684
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
2685
|
+
compact = false;
|
|
2686
|
+
}
|
|
2687
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
2688
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
2689
|
+
} else {
|
|
2690
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
2691
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
2692
|
+
}
|
|
2693
|
+
if (type2 === "[object Object]") {
|
|
2694
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
2695
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
2696
|
+
if (duplicate) {
|
|
2697
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
2698
|
+
}
|
|
2699
|
+
} else {
|
|
2700
|
+
writeFlowMapping(state, level, state.dump);
|
|
2701
|
+
if (duplicate) {
|
|
2702
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
} else if (type2 === "[object Array]") {
|
|
2706
|
+
var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
|
|
2707
|
+
if (block && state.dump.length !== 0) {
|
|
2708
|
+
writeBlockSequence(state, arrayLevel, state.dump, compact);
|
|
2709
|
+
if (duplicate) {
|
|
2710
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
2711
|
+
}
|
|
2712
|
+
} else {
|
|
2713
|
+
writeFlowSequence(state, arrayLevel, state.dump);
|
|
2714
|
+
if (duplicate) {
|
|
2715
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
} else if (type2 === "[object String]") {
|
|
2719
|
+
if (state.tag !== "?") {
|
|
2720
|
+
writeScalar(state, state.dump, level, iskey);
|
|
2721
|
+
}
|
|
2722
|
+
} else {
|
|
2723
|
+
if (state.skipInvalid) return false;
|
|
2724
|
+
throw new YAMLException("unacceptable kind of an object to dump " + type2);
|
|
2725
|
+
}
|
|
2726
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
2727
|
+
state.dump = "!<" + state.tag + "> " + state.dump;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
return true;
|
|
2731
|
+
}
|
|
2732
|
+
function getDuplicateReferences(object, state) {
|
|
2733
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
2734
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
2735
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
2736
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
2737
|
+
}
|
|
2738
|
+
state.usedDuplicates = new Array(length);
|
|
2739
|
+
}
|
|
2740
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
2741
|
+
var objectKeyList, index, length;
|
|
2742
|
+
if (object !== null && typeof object === "object") {
|
|
2743
|
+
index = objects.indexOf(object);
|
|
2744
|
+
if (index !== -1) {
|
|
2745
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
2746
|
+
duplicatesIndexes.push(index);
|
|
2747
|
+
}
|
|
2748
|
+
} else {
|
|
2749
|
+
objects.push(object);
|
|
2750
|
+
if (Array.isArray(object)) {
|
|
2751
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
2752
|
+
inspectNode(object[index], objects, duplicatesIndexes);
|
|
2753
|
+
}
|
|
2754
|
+
} else {
|
|
2755
|
+
objectKeyList = Object.keys(object);
|
|
2756
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2757
|
+
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
function dump(input, options) {
|
|
2764
|
+
options = options || {};
|
|
2765
|
+
var state = new State(options);
|
|
2766
|
+
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
2767
|
+
if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
|
|
2768
|
+
return "";
|
|
2769
|
+
}
|
|
2770
|
+
function safeDump(input, options) {
|
|
2771
|
+
return dump(input, common2.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2772
|
+
}
|
|
2773
|
+
dumper.dump = dump;
|
|
2774
|
+
dumper.safeDump = safeDump;
|
|
2775
|
+
return dumper;
|
|
2776
|
+
}
|
|
2777
|
+
var hasRequiredJsYaml$1;
|
|
2778
|
+
function requireJsYaml$1() {
|
|
2779
|
+
if (hasRequiredJsYaml$1) return jsYaml$1;
|
|
2780
|
+
hasRequiredJsYaml$1 = 1;
|
|
2781
|
+
var loader2 = /* @__PURE__ */ requireLoader();
|
|
2782
|
+
var dumper2 = /* @__PURE__ */ requireDumper();
|
|
2783
|
+
function deprecated(name) {
|
|
2784
|
+
return function() {
|
|
2785
|
+
throw new Error("Function " + name + " is deprecated and cannot be used.");
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
jsYaml$1.Type = /* @__PURE__ */ requireType();
|
|
2789
|
+
jsYaml$1.Schema = /* @__PURE__ */ requireSchema();
|
|
2790
|
+
jsYaml$1.FAILSAFE_SCHEMA = /* @__PURE__ */ requireFailsafe();
|
|
2791
|
+
jsYaml$1.JSON_SCHEMA = /* @__PURE__ */ requireJson();
|
|
2792
|
+
jsYaml$1.CORE_SCHEMA = /* @__PURE__ */ requireCore();
|
|
2793
|
+
jsYaml$1.DEFAULT_SAFE_SCHEMA = /* @__PURE__ */ requireDefault_safe();
|
|
2794
|
+
jsYaml$1.DEFAULT_FULL_SCHEMA = /* @__PURE__ */ requireDefault_full();
|
|
2795
|
+
jsYaml$1.load = loader2.load;
|
|
2796
|
+
jsYaml$1.loadAll = loader2.loadAll;
|
|
2797
|
+
jsYaml$1.safeLoad = loader2.safeLoad;
|
|
2798
|
+
jsYaml$1.safeLoadAll = loader2.safeLoadAll;
|
|
2799
|
+
jsYaml$1.dump = dumper2.dump;
|
|
2800
|
+
jsYaml$1.safeDump = dumper2.safeDump;
|
|
2801
|
+
jsYaml$1.YAMLException = /* @__PURE__ */ requireException();
|
|
2802
|
+
jsYaml$1.MINIMAL_SCHEMA = /* @__PURE__ */ requireFailsafe();
|
|
2803
|
+
jsYaml$1.SAFE_SCHEMA = /* @__PURE__ */ requireDefault_safe();
|
|
2804
|
+
jsYaml$1.DEFAULT_SCHEMA = /* @__PURE__ */ requireDefault_full();
|
|
2805
|
+
jsYaml$1.scan = deprecated("scan");
|
|
2806
|
+
jsYaml$1.parse = deprecated("parse");
|
|
2807
|
+
jsYaml$1.compose = deprecated("compose");
|
|
2808
|
+
jsYaml$1.addConstructor = deprecated("addConstructor");
|
|
2809
|
+
return jsYaml$1;
|
|
2810
|
+
}
|
|
2811
|
+
var jsYaml;
|
|
2812
|
+
var hasRequiredJsYaml;
|
|
2813
|
+
function requireJsYaml() {
|
|
2814
|
+
if (hasRequiredJsYaml) return jsYaml;
|
|
2815
|
+
hasRequiredJsYaml = 1;
|
|
2816
|
+
var yaml = /* @__PURE__ */ requireJsYaml$1();
|
|
2817
|
+
jsYaml = yaml;
|
|
2818
|
+
return jsYaml;
|
|
2819
|
+
}
|
|
2820
|
+
export {
|
|
2821
|
+
requireJsYaml as r
|
|
2822
|
+
};
|