@midscene/cli 1.17.6 → 1.17.8-beta-20261106101231.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.mjs +2385 -1952
- package/dist/es/index.mjs.LICENSE.txt +0 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/index.js +2376 -1943
- package/dist/lib/index.js.LICENSE.txt +0 -2
- package/dist/lib/index.js.map +1 -1
- package/package.json +10 -10
package/dist/es/index.mjs
CHANGED
|
@@ -2800,9 +2800,7 @@ var __webpack_modules__ = {
|
|
|
2800
2800
|
module.exports = (string, columns, options)=>String(string).normalize().replace(/\r\n/g, '\n').split('\n').map((line)=>exec(line, columns, options)).join('\n');
|
|
2801
2801
|
},
|
|
2802
2802
|
"./src/index.ts" (__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
2803
|
-
var package_namespaceObject = {
|
|
2804
|
-
rE: "1.17.6"
|
|
2805
|
-
};
|
|
2803
|
+
var package_namespaceObject = JSON.parse('{"rE":"1.17.8-beta-20261106101231.0"}');
|
|
2806
2804
|
var brace_expansion = __webpack_require__("../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js");
|
|
2807
2805
|
const MAX_PATTERN_LENGTH = 65536;
|
|
2808
2806
|
const assertValidPattern = (pattern)=>{
|
|
@@ -8475,7 +8473,7 @@ Usage:
|
|
|
8475
8473
|
type: 'boolean',
|
|
8476
8474
|
description: 'Whether to dismiss the HarmonyOS keyboard after text input'
|
|
8477
8475
|
}
|
|
8478
|
-
}).version('version', 'Show version number', "1.17.
|
|
8476
|
+
}).version('version', 'Show version number', "1.17.8-beta-20261106101231.0").help().epilogue(`For complete list of configuration options, please visit:
|
|
8479
8477
|
• Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
|
|
8480
8478
|
• Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
|
|
8481
8479
|
• HarmonyOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-harmony-part
|
|
@@ -8526,2085 +8524,2520 @@ Native cases/steps Test projects use the midscene-test command.`).wrap(yargs().t
|
|
|
8526
8524
|
});
|
|
8527
8525
|
return files.filter((file)=>file.endsWith('.yml') || file.endsWith('.yaml')).sort();
|
|
8528
8526
|
}
|
|
8529
|
-
|
|
8530
|
-
return
|
|
8531
|
-
}
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
}
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
if (
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8527
|
+
function getDefaultExportFromCjs(x) {
|
|
8528
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
8529
|
+
}
|
|
8530
|
+
var jsYaml = {};
|
|
8531
|
+
var loader = {};
|
|
8532
|
+
var common = {};
|
|
8533
|
+
var hasRequiredCommon;
|
|
8534
|
+
function requireCommon() {
|
|
8535
|
+
if (hasRequiredCommon) return common;
|
|
8536
|
+
hasRequiredCommon = 1;
|
|
8537
|
+
function isNothing(subject) {
|
|
8538
|
+
return null == subject;
|
|
8539
|
+
}
|
|
8540
|
+
function isObject(subject) {
|
|
8541
|
+
return "object" == typeof subject && null !== subject;
|
|
8542
|
+
}
|
|
8543
|
+
function toArray(sequence) {
|
|
8544
|
+
if (Array.isArray(sequence)) return sequence;
|
|
8545
|
+
if (isNothing(sequence)) return [];
|
|
8546
|
+
return [
|
|
8547
|
+
sequence
|
|
8548
|
+
];
|
|
8549
|
+
}
|
|
8550
|
+
function extend(target, source) {
|
|
8551
|
+
if (source) {
|
|
8552
|
+
const sourceKeys = Object.keys(source);
|
|
8553
|
+
for(let index = 0, length = sourceKeys.length; index < length; index += 1){
|
|
8554
|
+
const key = sourceKeys[index];
|
|
8555
|
+
target[key] = source[key];
|
|
8556
|
+
}
|
|
8549
8557
|
}
|
|
8558
|
+
return target;
|
|
8550
8559
|
}
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
for(cycle = 0; cycle < count; cycle += 1)result += string;
|
|
8556
|
-
return result;
|
|
8557
|
-
}
|
|
8558
|
-
function isNegativeZero(number) {
|
|
8559
|
-
return 0 === number && -1 / 0 === 1 / number;
|
|
8560
|
-
}
|
|
8561
|
-
var isNothing_1 = isNothing;
|
|
8562
|
-
var isObject_1 = js_yaml_isObject;
|
|
8563
|
-
var toArray_1 = toArray;
|
|
8564
|
-
var repeat_1 = repeat;
|
|
8565
|
-
var isNegativeZero_1 = isNegativeZero;
|
|
8566
|
-
var extend_1 = js_yaml_extend;
|
|
8567
|
-
var common = {
|
|
8568
|
-
isNothing: isNothing_1,
|
|
8569
|
-
isObject: isObject_1,
|
|
8570
|
-
toArray: toArray_1,
|
|
8571
|
-
repeat: repeat_1,
|
|
8572
|
-
isNegativeZero: isNegativeZero_1,
|
|
8573
|
-
extend: extend_1
|
|
8574
|
-
};
|
|
8575
|
-
function formatError(exception, compact) {
|
|
8576
|
-
var where = '', message = exception.reason || '(unknown reason)';
|
|
8577
|
-
if (!exception.mark) return message;
|
|
8578
|
-
if (exception.mark.name) where += 'in "' + exception.mark.name + '" ';
|
|
8579
|
-
where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
|
|
8580
|
-
if (!compact && exception.mark.snippet) where += '\n\n' + exception.mark.snippet;
|
|
8581
|
-
return message + ' ' + where;
|
|
8582
|
-
}
|
|
8583
|
-
function YAMLException$1(reason, mark) {
|
|
8584
|
-
Error.call(this);
|
|
8585
|
-
this.name = 'YAMLException';
|
|
8586
|
-
this.reason = reason;
|
|
8587
|
-
this.mark = mark;
|
|
8588
|
-
this.message = formatError(this, false);
|
|
8589
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
|
|
8590
|
-
else this.stack = new Error().stack || '';
|
|
8591
|
-
}
|
|
8592
|
-
YAMLException$1.prototype = Object.create(Error.prototype);
|
|
8593
|
-
YAMLException$1.prototype.constructor = YAMLException$1;
|
|
8594
|
-
YAMLException$1.prototype.toString = function(compact) {
|
|
8595
|
-
return this.name + ': ' + formatError(this, compact);
|
|
8596
|
-
};
|
|
8597
|
-
var js_yaml_exception = YAMLException$1;
|
|
8598
|
-
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
8599
|
-
var head = '';
|
|
8600
|
-
var tail = '';
|
|
8601
|
-
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
8602
|
-
if (position - lineStart > maxHalfLength) {
|
|
8603
|
-
head = ' ... ';
|
|
8604
|
-
lineStart = position - maxHalfLength + head.length;
|
|
8605
|
-
}
|
|
8606
|
-
if (lineEnd - position > maxHalfLength) {
|
|
8607
|
-
tail = ' ...';
|
|
8608
|
-
lineEnd = position + maxHalfLength - tail.length;
|
|
8560
|
+
function repeat(string, count) {
|
|
8561
|
+
let result = "";
|
|
8562
|
+
for(let cycle = 0; cycle < count; cycle += 1)result += string;
|
|
8563
|
+
return result;
|
|
8609
8564
|
}
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8565
|
+
function isNegativeZero(number) {
|
|
8566
|
+
return 0 === number && -1 / 0 === 1 / number;
|
|
8567
|
+
}
|
|
8568
|
+
common.isNothing = isNothing;
|
|
8569
|
+
common.isObject = isObject;
|
|
8570
|
+
common.toArray = toArray;
|
|
8571
|
+
common.repeat = repeat;
|
|
8572
|
+
common.isNegativeZero = isNegativeZero;
|
|
8573
|
+
common.extend = extend;
|
|
8574
|
+
return common;
|
|
8575
|
+
}
|
|
8576
|
+
var exception;
|
|
8577
|
+
var hasRequiredException;
|
|
8578
|
+
function requireException() {
|
|
8579
|
+
if (hasRequiredException) return exception;
|
|
8580
|
+
hasRequiredException = 1;
|
|
8581
|
+
function formatError(exception2, compact) {
|
|
8582
|
+
let where = "";
|
|
8583
|
+
const message = exception2.reason || "(unknown reason)";
|
|
8584
|
+
if (!exception2.mark) return message;
|
|
8585
|
+
if (exception2.mark.name) where += 'in "' + exception2.mark.name + '" ';
|
|
8586
|
+
where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
|
|
8587
|
+
if (!compact && exception2.mark.snippet) where += "\n\n" + exception2.mark.snippet;
|
|
8588
|
+
return message + " " + where;
|
|
8589
|
+
}
|
|
8590
|
+
function YAMLException2(reason, mark) {
|
|
8591
|
+
Error.call(this);
|
|
8592
|
+
this.name = "YAMLException";
|
|
8593
|
+
this.reason = reason;
|
|
8594
|
+
this.mark = mark;
|
|
8595
|
+
this.message = formatError(this, false);
|
|
8596
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
|
|
8597
|
+
else this.stack = new Error().stack || "";
|
|
8598
|
+
}
|
|
8599
|
+
YAMLException2.prototype = Object.create(Error.prototype);
|
|
8600
|
+
YAMLException2.prototype.constructor = YAMLException2;
|
|
8601
|
+
YAMLException2.prototype.toString = function(compact) {
|
|
8602
|
+
return this.name + ": " + formatError(this, compact);
|
|
8613
8603
|
};
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
if (
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8604
|
+
exception = YAMLException2;
|
|
8605
|
+
return exception;
|
|
8606
|
+
}
|
|
8607
|
+
var snippet;
|
|
8608
|
+
var hasRequiredSnippet;
|
|
8609
|
+
function requireSnippet() {
|
|
8610
|
+
if (hasRequiredSnippet) return snippet;
|
|
8611
|
+
hasRequiredSnippet = 1;
|
|
8612
|
+
const common2 = requireCommon();
|
|
8613
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
8614
|
+
let head = "";
|
|
8615
|
+
let tail = "";
|
|
8616
|
+
const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
8617
|
+
if (position - lineStart > maxHalfLength) {
|
|
8618
|
+
head = " ... ";
|
|
8619
|
+
lineStart = position - maxHalfLength + head.length;
|
|
8620
|
+
}
|
|
8621
|
+
if (lineEnd - position > maxHalfLength) {
|
|
8622
|
+
tail = " ...";
|
|
8623
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
8624
|
+
}
|
|
8625
|
+
return {
|
|
8626
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
|
|
8627
|
+
pos: position - lineStart + head.length
|
|
8628
|
+
};
|
|
8629
|
+
}
|
|
8630
|
+
function padStart(string, max) {
|
|
8631
|
+
return common2.repeat(" ", max - string.length) + string;
|
|
8632
|
+
}
|
|
8633
|
+
function makeSnippet(mark, options) {
|
|
8634
|
+
options = Object.create(options || null);
|
|
8635
|
+
if (!mark.buffer) return null;
|
|
8636
|
+
if (!options.maxLength) options.maxLength = 79;
|
|
8637
|
+
if ("number" != typeof options.indent) options.indent = 1;
|
|
8638
|
+
if ("number" != typeof options.linesBefore) options.linesBefore = 3;
|
|
8639
|
+
if ("number" != typeof options.linesAfter) options.linesAfter = 2;
|
|
8640
|
+
const re = /\r?\n|\r|\0/g;
|
|
8641
|
+
const lineStarts = [
|
|
8642
|
+
0
|
|
8643
|
+
];
|
|
8644
|
+
const lineEnds = [];
|
|
8645
|
+
let match;
|
|
8646
|
+
let foundLineNo = -1;
|
|
8647
|
+
while(match = re.exec(mark.buffer)){
|
|
8648
|
+
lineEnds.push(match.index);
|
|
8649
|
+
lineStarts.push(match.index + match[0].length);
|
|
8650
|
+
if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
|
|
8651
|
+
}
|
|
8652
|
+
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
8653
|
+
let result = "";
|
|
8654
|
+
const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
8655
|
+
const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
8656
|
+
for(let i = 1; i <= options.linesBefore; i++){
|
|
8657
|
+
if (foundLineNo - i < 0) break;
|
|
8658
|
+
const line2 = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
8659
|
+
result = common2.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
|
|
8660
|
+
}
|
|
8661
|
+
const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
8662
|
+
result += common2.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
8663
|
+
result += common2.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
8664
|
+
for(let i = 1; i <= options.linesAfter; i++){
|
|
8665
|
+
if (foundLineNo + i >= lineEnds.length) break;
|
|
8666
|
+
const line2 = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
8667
|
+
result += common2.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
|
|
8668
|
+
}
|
|
8669
|
+
return result.replace(/\n$/, "");
|
|
8670
|
+
}
|
|
8671
|
+
snippet = makeSnippet;
|
|
8672
|
+
return snippet;
|
|
8673
|
+
}
|
|
8674
|
+
var js_yaml_type;
|
|
8675
|
+
var hasRequiredType;
|
|
8676
|
+
function requireType() {
|
|
8677
|
+
if (hasRequiredType) return js_yaml_type;
|
|
8678
|
+
hasRequiredType = 1;
|
|
8679
|
+
const YAMLException2 = requireException();
|
|
8680
|
+
const TYPE_CONSTRUCTOR_OPTIONS = [
|
|
8681
|
+
"kind",
|
|
8682
|
+
"multi",
|
|
8683
|
+
"resolve",
|
|
8684
|
+
"construct",
|
|
8685
|
+
"instanceOf",
|
|
8686
|
+
"predicate",
|
|
8687
|
+
"represent",
|
|
8688
|
+
"representName",
|
|
8689
|
+
"defaultStyle",
|
|
8690
|
+
"styleAliases"
|
|
8628
8691
|
];
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
8641
|
-
for(i = 1; i <= options.linesBefore; i++){
|
|
8642
|
-
if (foundLineNo - i < 0) break;
|
|
8643
|
-
line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
8644
|
-
result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + ' | ' + line.str + '\n' + result;
|
|
8645
|
-
}
|
|
8646
|
-
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
8647
|
-
result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + ' | ' + line.str + '\n';
|
|
8648
|
-
result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
8649
|
-
for(i = 1; i <= options.linesAfter; i++){
|
|
8650
|
-
if (foundLineNo + i >= lineEnds.length) break;
|
|
8651
|
-
line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
8652
|
-
result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + ' | ' + line.str + '\n';
|
|
8653
|
-
}
|
|
8654
|
-
return result.replace(/\n$/, '');
|
|
8655
|
-
}
|
|
8656
|
-
var snippet = makeSnippet;
|
|
8657
|
-
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
8658
|
-
'kind',
|
|
8659
|
-
'multi',
|
|
8660
|
-
'resolve',
|
|
8661
|
-
'construct',
|
|
8662
|
-
'instanceOf',
|
|
8663
|
-
'predicate',
|
|
8664
|
-
'represent',
|
|
8665
|
-
'representName',
|
|
8666
|
-
'defaultStyle',
|
|
8667
|
-
'styleAliases'
|
|
8668
|
-
];
|
|
8669
|
-
var YAML_NODE_KINDS = [
|
|
8670
|
-
'scalar',
|
|
8671
|
-
'sequence',
|
|
8672
|
-
'mapping'
|
|
8673
|
-
];
|
|
8674
|
-
function compileStyleAliases(map) {
|
|
8675
|
-
var result = {};
|
|
8676
|
-
if (null !== map) Object.keys(map).forEach(function(style) {
|
|
8677
|
-
map[style].forEach(function(alias) {
|
|
8678
|
-
result[String(alias)] = style;
|
|
8692
|
+
const YAML_NODE_KINDS = [
|
|
8693
|
+
"scalar",
|
|
8694
|
+
"sequence",
|
|
8695
|
+
"mapping"
|
|
8696
|
+
];
|
|
8697
|
+
function compileStyleAliases(map2) {
|
|
8698
|
+
const result = {};
|
|
8699
|
+
if (null !== map2) Object.keys(map2).forEach(function(style) {
|
|
8700
|
+
map2[style].forEach(function(alias) {
|
|
8701
|
+
result[String(alias)] = style;
|
|
8702
|
+
});
|
|
8679
8703
|
});
|
|
8680
|
-
|
|
8681
|
-
return result;
|
|
8682
|
-
}
|
|
8683
|
-
function Type$1(tag, options) {
|
|
8684
|
-
options = options || {};
|
|
8685
|
-
Object.keys(options).forEach(function(name) {
|
|
8686
|
-
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new js_yaml_exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
8687
|
-
});
|
|
8688
|
-
this.options = options;
|
|
8689
|
-
this.tag = tag;
|
|
8690
|
-
this.kind = options['kind'] || null;
|
|
8691
|
-
this.resolve = options['resolve'] || function() {
|
|
8692
|
-
return true;
|
|
8693
|
-
};
|
|
8694
|
-
this.construct = options['construct'] || function(data) {
|
|
8695
|
-
return data;
|
|
8696
|
-
};
|
|
8697
|
-
this.instanceOf = options['instanceOf'] || null;
|
|
8698
|
-
this.predicate = options['predicate'] || null;
|
|
8699
|
-
this.represent = options['represent'] || null;
|
|
8700
|
-
this.representName = options['representName'] || null;
|
|
8701
|
-
this.defaultStyle = options['defaultStyle'] || null;
|
|
8702
|
-
this.multi = options['multi'] || false;
|
|
8703
|
-
this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
|
|
8704
|
-
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new js_yaml_exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
8705
|
-
}
|
|
8706
|
-
var js_yaml_type = Type$1;
|
|
8707
|
-
function compileList(schema, name) {
|
|
8708
|
-
var result = [];
|
|
8709
|
-
schema[name].forEach(function(currentType) {
|
|
8710
|
-
var newIndex = result.length;
|
|
8711
|
-
result.forEach(function(previousType, previousIndex) {
|
|
8712
|
-
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
|
|
8713
|
-
});
|
|
8714
|
-
result[newIndex] = currentType;
|
|
8715
|
-
});
|
|
8716
|
-
return result;
|
|
8717
|
-
}
|
|
8718
|
-
function compileMap() {
|
|
8719
|
-
var result = {
|
|
8720
|
-
scalar: {},
|
|
8721
|
-
sequence: {},
|
|
8722
|
-
mapping: {},
|
|
8723
|
-
fallback: {},
|
|
8724
|
-
multi: {
|
|
8725
|
-
scalar: [],
|
|
8726
|
-
sequence: [],
|
|
8727
|
-
mapping: [],
|
|
8728
|
-
fallback: []
|
|
8729
|
-
}
|
|
8730
|
-
}, index, length;
|
|
8731
|
-
function collectType(type) {
|
|
8732
|
-
if (type.multi) {
|
|
8733
|
-
result.multi[type.kind].push(type);
|
|
8734
|
-
result.multi['fallback'].push(type);
|
|
8735
|
-
} else result[type.kind][type.tag] = result['fallback'][type.tag] = type;
|
|
8736
|
-
}
|
|
8737
|
-
for(index = 0, length = arguments.length; index < length; index += 1)arguments[index].forEach(collectType);
|
|
8738
|
-
return result;
|
|
8739
|
-
}
|
|
8740
|
-
function Schema$1(definition) {
|
|
8741
|
-
return this.extend(definition);
|
|
8742
|
-
}
|
|
8743
|
-
Schema$1.prototype.extend = function(definition) {
|
|
8744
|
-
var implicit = [];
|
|
8745
|
-
var explicit = [];
|
|
8746
|
-
if (definition instanceof js_yaml_type) explicit.push(definition);
|
|
8747
|
-
else if (Array.isArray(definition)) explicit = explicit.concat(definition);
|
|
8748
|
-
else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
8749
|
-
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
8750
|
-
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
8751
|
-
} else throw new js_yaml_exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
8752
|
-
implicit.forEach(function(type$1) {
|
|
8753
|
-
if (!(type$1 instanceof js_yaml_type)) throw new js_yaml_exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
|
|
8754
|
-
if (type$1.loadKind && 'scalar' !== type$1.loadKind) throw new js_yaml_exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
|
|
8755
|
-
if (type$1.multi) throw new js_yaml_exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
|
|
8756
|
-
});
|
|
8757
|
-
explicit.forEach(function(type$1) {
|
|
8758
|
-
if (!(type$1 instanceof js_yaml_type)) throw new js_yaml_exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
|
|
8759
|
-
});
|
|
8760
|
-
var result = Object.create(Schema$1.prototype);
|
|
8761
|
-
result.implicit = (this.implicit || []).concat(implicit);
|
|
8762
|
-
result.explicit = (this.explicit || []).concat(explicit);
|
|
8763
|
-
result.compiledImplicit = compileList(result, 'implicit');
|
|
8764
|
-
result.compiledExplicit = compileList(result, 'explicit');
|
|
8765
|
-
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
8766
|
-
return result;
|
|
8767
|
-
};
|
|
8768
|
-
var js_yaml_schema = Schema$1;
|
|
8769
|
-
var js_yaml_str = new js_yaml_type('tag:yaml.org,2002:str', {
|
|
8770
|
-
kind: 'scalar',
|
|
8771
|
-
construct: function(data) {
|
|
8772
|
-
return null !== data ? data : '';
|
|
8704
|
+
return result;
|
|
8773
8705
|
}
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8706
|
+
function Type2(tag, options) {
|
|
8707
|
+
options = options || {};
|
|
8708
|
+
Object.keys(options).forEach(function(name) {
|
|
8709
|
+
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
8710
|
+
});
|
|
8711
|
+
this.options = options;
|
|
8712
|
+
this.tag = tag;
|
|
8713
|
+
this.kind = options["kind"] || null;
|
|
8714
|
+
this.resolve = options["resolve"] || function() {
|
|
8715
|
+
return true;
|
|
8716
|
+
};
|
|
8717
|
+
this.construct = options["construct"] || function(data) {
|
|
8718
|
+
return data;
|
|
8719
|
+
};
|
|
8720
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
8721
|
+
this.predicate = options["predicate"] || null;
|
|
8722
|
+
this.represent = options["represent"] || null;
|
|
8723
|
+
this.representName = options["representName"] || null;
|
|
8724
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
8725
|
+
this.multi = options["multi"] || false;
|
|
8726
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
8727
|
+
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
8728
|
+
}
|
|
8729
|
+
js_yaml_type = Type2;
|
|
8730
|
+
return js_yaml_type;
|
|
8731
|
+
}
|
|
8732
|
+
var schema;
|
|
8733
|
+
var hasRequiredSchema;
|
|
8734
|
+
function requireSchema() {
|
|
8735
|
+
if (hasRequiredSchema) return schema;
|
|
8736
|
+
hasRequiredSchema = 1;
|
|
8737
|
+
const YAMLException2 = requireException();
|
|
8738
|
+
const Type2 = requireType();
|
|
8739
|
+
function compileList(schema2, name) {
|
|
8740
|
+
const result = [];
|
|
8741
|
+
schema2[name].forEach(function(currentType) {
|
|
8742
|
+
let newIndex = result.length;
|
|
8743
|
+
result.forEach(function(previousType, previousIndex) {
|
|
8744
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
|
|
8745
|
+
});
|
|
8746
|
+
result[newIndex] = currentType;
|
|
8747
|
+
});
|
|
8748
|
+
return result;
|
|
8779
8749
|
}
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8750
|
+
function compileMap() {
|
|
8751
|
+
const result = {
|
|
8752
|
+
scalar: {},
|
|
8753
|
+
sequence: {},
|
|
8754
|
+
mapping: {},
|
|
8755
|
+
fallback: {},
|
|
8756
|
+
multi: {
|
|
8757
|
+
scalar: [],
|
|
8758
|
+
sequence: [],
|
|
8759
|
+
mapping: [],
|
|
8760
|
+
fallback: []
|
|
8761
|
+
}
|
|
8762
|
+
};
|
|
8763
|
+
function collectType(type2) {
|
|
8764
|
+
if (type2.multi) {
|
|
8765
|
+
result.multi[type2.kind].push(type2);
|
|
8766
|
+
result.multi["fallback"].push(type2);
|
|
8767
|
+
} else result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
|
8768
|
+
}
|
|
8769
|
+
for(let index = 0, length = arguments.length; index < length; index += 1)arguments[index].forEach(collectType);
|
|
8770
|
+
return result;
|
|
8785
8771
|
}
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8772
|
+
function Schema2(definition) {
|
|
8773
|
+
return this.extend(definition);
|
|
8774
|
+
}
|
|
8775
|
+
Schema2.prototype.extend = function(definition) {
|
|
8776
|
+
let implicit = [];
|
|
8777
|
+
let explicit = [];
|
|
8778
|
+
if (definition instanceof Type2) explicit.push(definition);
|
|
8779
|
+
else if (Array.isArray(definition)) explicit = explicit.concat(definition);
|
|
8780
|
+
else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
8781
|
+
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
8782
|
+
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
8783
|
+
} else throw new YAMLException2("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
8784
|
+
implicit.forEach(function(type2) {
|
|
8785
|
+
if (!(type2 instanceof Type2)) throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
8786
|
+
if (type2.loadKind && "scalar" !== type2.loadKind) throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
8787
|
+
if (type2.multi) throw new YAMLException2("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
8788
|
+
});
|
|
8789
|
+
explicit.forEach(function(type2) {
|
|
8790
|
+
if (!(type2 instanceof Type2)) throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
8791
|
+
});
|
|
8792
|
+
const result = Object.create(Schema2.prototype);
|
|
8793
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
8794
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
8795
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
8796
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
8797
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
8798
|
+
return result;
|
|
8799
|
+
};
|
|
8800
|
+
schema = Schema2;
|
|
8801
|
+
return schema;
|
|
8802
|
+
}
|
|
8803
|
+
var js_yaml_str;
|
|
8804
|
+
var hasRequiredStr;
|
|
8805
|
+
function requireStr() {
|
|
8806
|
+
if (hasRequiredStr) return js_yaml_str;
|
|
8807
|
+
hasRequiredStr = 1;
|
|
8808
|
+
const Type2 = requireType();
|
|
8809
|
+
js_yaml_str = new Type2("tag:yaml.org,2002:str", {
|
|
8810
|
+
kind: "scalar",
|
|
8811
|
+
construct: function(data) {
|
|
8812
|
+
return null !== data ? data : "";
|
|
8825
8813
|
}
|
|
8826
|
-
}
|
|
8827
|
-
|
|
8828
|
-
}
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8814
|
+
});
|
|
8815
|
+
return js_yaml_str;
|
|
8816
|
+
}
|
|
8817
|
+
var seq;
|
|
8818
|
+
var hasRequiredSeq;
|
|
8819
|
+
function requireSeq() {
|
|
8820
|
+
if (hasRequiredSeq) return seq;
|
|
8821
|
+
hasRequiredSeq = 1;
|
|
8822
|
+
const Type2 = requireType();
|
|
8823
|
+
seq = new Type2("tag:yaml.org,2002:seq", {
|
|
8824
|
+
kind: "sequence",
|
|
8825
|
+
construct: function(data) {
|
|
8826
|
+
return null !== data ? data : [];
|
|
8827
|
+
}
|
|
8828
|
+
});
|
|
8829
|
+
return seq;
|
|
8830
|
+
}
|
|
8831
|
+
var map;
|
|
8832
|
+
var hasRequiredMap;
|
|
8833
|
+
function requireMap() {
|
|
8834
|
+
if (hasRequiredMap) return map;
|
|
8835
|
+
hasRequiredMap = 1;
|
|
8836
|
+
const Type2 = requireType();
|
|
8837
|
+
map = new Type2("tag:yaml.org,2002:map", {
|
|
8838
|
+
kind: "mapping",
|
|
8839
|
+
construct: function(data) {
|
|
8840
|
+
return null !== data ? data : {};
|
|
8841
|
+
}
|
|
8842
|
+
});
|
|
8843
|
+
return map;
|
|
8844
|
+
}
|
|
8845
|
+
var failsafe;
|
|
8846
|
+
var hasRequiredFailsafe;
|
|
8847
|
+
function requireFailsafe() {
|
|
8848
|
+
if (hasRequiredFailsafe) return failsafe;
|
|
8849
|
+
hasRequiredFailsafe = 1;
|
|
8850
|
+
const Schema2 = requireSchema();
|
|
8851
|
+
failsafe = new Schema2({
|
|
8852
|
+
explicit: [
|
|
8853
|
+
requireStr(),
|
|
8854
|
+
requireSeq(),
|
|
8855
|
+
requireMap()
|
|
8856
|
+
]
|
|
8857
|
+
});
|
|
8858
|
+
return failsafe;
|
|
8859
|
+
}
|
|
8860
|
+
var _null;
|
|
8861
|
+
var hasRequired_null;
|
|
8862
|
+
function require_null() {
|
|
8863
|
+
if (hasRequired_null) return _null;
|
|
8864
|
+
hasRequired_null = 1;
|
|
8865
|
+
const Type2 = requireType();
|
|
8866
|
+
function resolveYamlNull(data) {
|
|
8867
|
+
if (null === data) return true;
|
|
8868
|
+
const max = data.length;
|
|
8869
|
+
return 1 === max && "~" === data || 4 === max && ("null" === data || "Null" === data || "NULL" === data);
|
|
8870
|
+
}
|
|
8871
|
+
function constructYamlNull() {
|
|
8872
|
+
return null;
|
|
8873
|
+
}
|
|
8874
|
+
function isNull(object) {
|
|
8875
|
+
return null === object;
|
|
8876
|
+
}
|
|
8877
|
+
_null = new Type2("tag:yaml.org,2002:null", {
|
|
8878
|
+
kind: "scalar",
|
|
8879
|
+
resolve: resolveYamlNull,
|
|
8880
|
+
construct: constructYamlNull,
|
|
8881
|
+
predicate: isNull,
|
|
8882
|
+
represent: {
|
|
8883
|
+
canonical: function() {
|
|
8884
|
+
return "~";
|
|
8885
|
+
},
|
|
8886
|
+
lowercase: function() {
|
|
8887
|
+
return "null";
|
|
8888
|
+
},
|
|
8889
|
+
uppercase: function() {
|
|
8890
|
+
return "NULL";
|
|
8891
|
+
},
|
|
8892
|
+
camelcase: function() {
|
|
8893
|
+
return "Null";
|
|
8894
|
+
},
|
|
8895
|
+
empty: function() {
|
|
8896
|
+
return "";
|
|
8897
|
+
}
|
|
8848
8898
|
},
|
|
8849
|
-
|
|
8850
|
-
|
|
8899
|
+
defaultStyle: "lowercase"
|
|
8900
|
+
});
|
|
8901
|
+
return _null;
|
|
8902
|
+
}
|
|
8903
|
+
var bool;
|
|
8904
|
+
var hasRequiredBool;
|
|
8905
|
+
function requireBool() {
|
|
8906
|
+
if (hasRequiredBool) return bool;
|
|
8907
|
+
hasRequiredBool = 1;
|
|
8908
|
+
const Type2 = requireType();
|
|
8909
|
+
function resolveYamlBoolean(data) {
|
|
8910
|
+
if (null === data) return false;
|
|
8911
|
+
const max = data.length;
|
|
8912
|
+
return 4 === max && ("true" === data || "True" === data || "TRUE" === data) || 5 === max && ("false" === data || "False" === data || "FALSE" === data);
|
|
8913
|
+
}
|
|
8914
|
+
function constructYamlBoolean(data) {
|
|
8915
|
+
return "true" === data || "True" === data || "TRUE" === data;
|
|
8916
|
+
}
|
|
8917
|
+
function isBoolean(object) {
|
|
8918
|
+
return "[object Boolean]" === Object.prototype.toString.call(object);
|
|
8919
|
+
}
|
|
8920
|
+
bool = new Type2("tag:yaml.org,2002:bool", {
|
|
8921
|
+
kind: "scalar",
|
|
8922
|
+
resolve: resolveYamlBoolean,
|
|
8923
|
+
construct: constructYamlBoolean,
|
|
8924
|
+
predicate: isBoolean,
|
|
8925
|
+
represent: {
|
|
8926
|
+
lowercase: function(object) {
|
|
8927
|
+
return object ? "true" : "false";
|
|
8928
|
+
},
|
|
8929
|
+
uppercase: function(object) {
|
|
8930
|
+
return object ? "TRUE" : "FALSE";
|
|
8931
|
+
},
|
|
8932
|
+
camelcase: function(object) {
|
|
8933
|
+
return object ? "True" : "False";
|
|
8934
|
+
}
|
|
8851
8935
|
},
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
function
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8936
|
+
defaultStyle: "lowercase"
|
|
8937
|
+
});
|
|
8938
|
+
return bool;
|
|
8939
|
+
}
|
|
8940
|
+
var js_yaml_int;
|
|
8941
|
+
var hasRequiredInt;
|
|
8942
|
+
function requireInt() {
|
|
8943
|
+
if (hasRequiredInt) return js_yaml_int;
|
|
8944
|
+
hasRequiredInt = 1;
|
|
8945
|
+
const common2 = requireCommon();
|
|
8946
|
+
const Type2 = requireType();
|
|
8947
|
+
function isHexCode(c) {
|
|
8948
|
+
return c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102;
|
|
8949
|
+
}
|
|
8950
|
+
function isOctCode(c) {
|
|
8951
|
+
return c >= 48 && c <= 55;
|
|
8952
|
+
}
|
|
8953
|
+
function isDecCode(c) {
|
|
8954
|
+
return c >= 48 && c <= 57;
|
|
8955
|
+
}
|
|
8956
|
+
function resolveYamlInteger(data) {
|
|
8957
|
+
if (null === data) return false;
|
|
8958
|
+
const max = data.length;
|
|
8959
|
+
let index = 0;
|
|
8960
|
+
let hasDigits = false;
|
|
8961
|
+
if (!max) return false;
|
|
8962
|
+
let ch = data[index];
|
|
8963
|
+
if ("-" === ch || "+" === ch) ch = data[++index];
|
|
8964
|
+
if ("0" === ch) {
|
|
8965
|
+
if (index + 1 === max) return true;
|
|
8966
|
+
ch = data[++index];
|
|
8967
|
+
if ("b" === ch) {
|
|
8968
|
+
index++;
|
|
8969
|
+
for(; index < max; index++){
|
|
8970
|
+
ch = data[index];
|
|
8971
|
+
if ("0" !== ch && "1" !== ch) return false;
|
|
8882
8972
|
hasDigits = true;
|
|
8883
8973
|
}
|
|
8974
|
+
return hasDigits && isFinite(parseYamlInteger(data));
|
|
8884
8975
|
}
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
index++;
|
|
8889
|
-
for(; index < max; index++){
|
|
8890
|
-
ch = data[index];
|
|
8891
|
-
if ('_' !== ch) {
|
|
8976
|
+
if ("x" === ch) {
|
|
8977
|
+
index++;
|
|
8978
|
+
for(; index < max; index++){
|
|
8892
8979
|
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
8893
8980
|
hasDigits = true;
|
|
8894
8981
|
}
|
|
8982
|
+
return hasDigits && isFinite(parseYamlInteger(data));
|
|
8895
8983
|
}
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
index++;
|
|
8900
|
-
for(; index < max; index++){
|
|
8901
|
-
ch = data[index];
|
|
8902
|
-
if ('_' !== ch) {
|
|
8984
|
+
if ("o" === ch) {
|
|
8985
|
+
index++;
|
|
8986
|
+
for(; index < max; index++){
|
|
8903
8987
|
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
8904
8988
|
hasDigits = true;
|
|
8905
8989
|
}
|
|
8990
|
+
return hasDigits && isFinite(parseYamlInteger(data));
|
|
8906
8991
|
}
|
|
8907
|
-
return hasDigits && '_' !== ch;
|
|
8908
8992
|
}
|
|
8909
|
-
|
|
8910
|
-
if ('_' === ch) return false;
|
|
8911
|
-
for(; index < max; index++){
|
|
8912
|
-
ch = data[index];
|
|
8913
|
-
if ('_' !== ch) {
|
|
8993
|
+
for(; index < max; index++){
|
|
8914
8994
|
if (!isDecCode(data.charCodeAt(index))) return false;
|
|
8915
8995
|
hasDigits = true;
|
|
8916
8996
|
}
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8997
|
+
if (!hasDigits) return false;
|
|
8998
|
+
return isFinite(parseYamlInteger(data));
|
|
8999
|
+
}
|
|
9000
|
+
function parseYamlInteger(data) {
|
|
9001
|
+
let value = data;
|
|
9002
|
+
let sign = 1;
|
|
9003
|
+
let ch = value[0];
|
|
9004
|
+
if ("-" === ch || "+" === ch) {
|
|
9005
|
+
if ("-" === ch) sign = -1;
|
|
9006
|
+
value = value.slice(1);
|
|
9007
|
+
ch = value[0];
|
|
9008
|
+
}
|
|
9009
|
+
if ("0" === value) return 0;
|
|
9010
|
+
if ("0" === ch) {
|
|
9011
|
+
if ("b" === value[1]) return sign * parseInt(value.slice(2), 2);
|
|
9012
|
+
if ("x" === value[1]) return sign * parseInt(value.slice(2), 16);
|
|
9013
|
+
if ("o" === value[1]) return sign * parseInt(value.slice(2), 8);
|
|
9014
|
+
}
|
|
9015
|
+
return sign * parseInt(value, 10);
|
|
9016
|
+
}
|
|
9017
|
+
function constructYamlInteger(data) {
|
|
9018
|
+
return parseYamlInteger(data);
|
|
9019
|
+
}
|
|
9020
|
+
function isInteger(object) {
|
|
9021
|
+
return "[object Number]" === Object.prototype.toString.call(object) && object % 1 === 0 && !common2.isNegativeZero(object);
|
|
9022
|
+
}
|
|
9023
|
+
js_yaml_int = new Type2("tag:yaml.org,2002:int", {
|
|
9024
|
+
kind: "scalar",
|
|
9025
|
+
resolve: resolveYamlInteger,
|
|
9026
|
+
construct: constructYamlInteger,
|
|
9027
|
+
predicate: isInteger,
|
|
9028
|
+
represent: {
|
|
9029
|
+
binary: function(obj) {
|
|
9030
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
9031
|
+
},
|
|
9032
|
+
octal: function(obj) {
|
|
9033
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
9034
|
+
},
|
|
9035
|
+
decimal: function(obj) {
|
|
9036
|
+
return obj.toString(10);
|
|
9037
|
+
},
|
|
9038
|
+
hexadecimal: function(obj) {
|
|
9039
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
9040
|
+
}
|
|
8955
9041
|
},
|
|
8956
|
-
|
|
8957
|
-
|
|
9042
|
+
defaultStyle: "decimal",
|
|
9043
|
+
styleAliases: {
|
|
9044
|
+
binary: [
|
|
9045
|
+
2,
|
|
9046
|
+
"bin"
|
|
9047
|
+
],
|
|
9048
|
+
octal: [
|
|
9049
|
+
8,
|
|
9050
|
+
"oct"
|
|
9051
|
+
],
|
|
9052
|
+
decimal: [
|
|
9053
|
+
10,
|
|
9054
|
+
"dec"
|
|
9055
|
+
],
|
|
9056
|
+
hexadecimal: [
|
|
9057
|
+
16,
|
|
9058
|
+
"hex"
|
|
9059
|
+
]
|
|
8958
9060
|
}
|
|
8959
|
-
}
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
9061
|
+
});
|
|
9062
|
+
return js_yaml_int;
|
|
9063
|
+
}
|
|
9064
|
+
var js_yaml_float;
|
|
9065
|
+
var hasRequiredFloat;
|
|
9066
|
+
function requireFloat() {
|
|
9067
|
+
if (hasRequiredFloat) return js_yaml_float;
|
|
9068
|
+
hasRequiredFloat = 1;
|
|
9069
|
+
const common2 = requireCommon();
|
|
9070
|
+
const Type2 = requireType();
|
|
9071
|
+
const YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
9072
|
+
const YAML_FLOAT_SPECIAL_PATTERN = new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
9073
|
+
function resolveYamlFloat(data) {
|
|
9074
|
+
if (null === data) return false;
|
|
9075
|
+
if (!YAML_FLOAT_PATTERN.test(data)) return false;
|
|
9076
|
+
if (isFinite(parseFloat(data, 10))) return true;
|
|
9077
|
+
return YAML_FLOAT_SPECIAL_PATTERN.test(data);
|
|
9078
|
+
}
|
|
9079
|
+
function constructYamlFloat(data) {
|
|
9080
|
+
let value = data.toLowerCase();
|
|
9081
|
+
const sign = "-" === value[0] ? -1 : 1;
|
|
9082
|
+
if ("+-".indexOf(value[0]) >= 0) value = value.slice(1);
|
|
9083
|
+
if (".inf" === value) return 1 === sign ? 1 / 0 : -1 / 0;
|
|
9084
|
+
if (".nan" === value) return NaN;
|
|
9085
|
+
return sign * parseFloat(value, 10);
|
|
9086
|
+
}
|
|
9087
|
+
const SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
9088
|
+
function representYamlFloat(object, style) {
|
|
9089
|
+
if (isNaN(object)) switch(style){
|
|
9090
|
+
case "lowercase":
|
|
9091
|
+
return ".nan";
|
|
9092
|
+
case "uppercase":
|
|
9093
|
+
return ".NAN";
|
|
9094
|
+
case "camelcase":
|
|
9095
|
+
return ".NaN";
|
|
9096
|
+
}
|
|
9097
|
+
else if (1 / 0 === object) switch(style){
|
|
9098
|
+
case "lowercase":
|
|
9099
|
+
return ".inf";
|
|
9100
|
+
case "uppercase":
|
|
9101
|
+
return ".INF";
|
|
9102
|
+
case "camelcase":
|
|
9103
|
+
return ".Inf";
|
|
9104
|
+
}
|
|
9105
|
+
else if (-1 / 0 === object) switch(style){
|
|
9106
|
+
case "lowercase":
|
|
9107
|
+
return "-.inf";
|
|
9108
|
+
case "uppercase":
|
|
9109
|
+
return "-.INF";
|
|
9110
|
+
case "camelcase":
|
|
9111
|
+
return "-.Inf";
|
|
9112
|
+
}
|
|
9113
|
+
else if (common2.isNegativeZero(object)) return "-0.0";
|
|
9114
|
+
const res = object.toString(10);
|
|
9115
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
9116
|
+
}
|
|
9117
|
+
function isFloat(object) {
|
|
9118
|
+
return "[object Number]" === Object.prototype.toString.call(object) && (object % 1 !== 0 || common2.isNegativeZero(object));
|
|
9119
|
+
}
|
|
9120
|
+
js_yaml_float = new Type2("tag:yaml.org,2002:float", {
|
|
9121
|
+
kind: "scalar",
|
|
9122
|
+
resolve: resolveYamlFloat,
|
|
9123
|
+
construct: constructYamlFloat,
|
|
9124
|
+
predicate: isFloat,
|
|
9125
|
+
represent: representYamlFloat,
|
|
9126
|
+
defaultStyle: "lowercase"
|
|
9127
|
+
});
|
|
9128
|
+
return js_yaml_float;
|
|
9129
|
+
}
|
|
9130
|
+
var json;
|
|
9131
|
+
var hasRequiredJson;
|
|
9132
|
+
function requireJson() {
|
|
9133
|
+
if (hasRequiredJson) return json;
|
|
9134
|
+
hasRequiredJson = 1;
|
|
9135
|
+
json = requireFailsafe().extend({
|
|
9136
|
+
implicit: [
|
|
9137
|
+
require_null(),
|
|
9138
|
+
requireBool(),
|
|
9139
|
+
requireInt(),
|
|
9140
|
+
requireFloat()
|
|
8977
9141
|
]
|
|
9142
|
+
});
|
|
9143
|
+
return json;
|
|
9144
|
+
}
|
|
9145
|
+
var core;
|
|
9146
|
+
var hasRequiredCore;
|
|
9147
|
+
function requireCore() {
|
|
9148
|
+
if (hasRequiredCore) return core;
|
|
9149
|
+
hasRequiredCore = 1;
|
|
9150
|
+
core = requireJson();
|
|
9151
|
+
return core;
|
|
9152
|
+
}
|
|
9153
|
+
var js_yaml_timestamp;
|
|
9154
|
+
var hasRequiredTimestamp;
|
|
9155
|
+
function requireTimestamp() {
|
|
9156
|
+
if (hasRequiredTimestamp) return js_yaml_timestamp;
|
|
9157
|
+
hasRequiredTimestamp = 1;
|
|
9158
|
+
const Type2 = requireType();
|
|
9159
|
+
const YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
9160
|
+
const YAML_TIMESTAMP_REGEXP = new RegExp("^([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]))?))?$");
|
|
9161
|
+
function resolveYamlTimestamp(data) {
|
|
9162
|
+
if (null === data) return false;
|
|
9163
|
+
if (null !== YAML_DATE_REGEXP.exec(data)) return true;
|
|
9164
|
+
if (null !== YAML_TIMESTAMP_REGEXP.exec(data)) return true;
|
|
9165
|
+
return false;
|
|
8978
9166
|
}
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
9113
|
-
for(idx = 0; idx < max; idx++){
|
|
9114
|
-
if (idx % 4 === 0 && idx) {
|
|
9115
|
-
result.push(bits >> 16 & 0xFF);
|
|
9116
|
-
result.push(bits >> 8 & 0xFF);
|
|
9117
|
-
result.push(0xFF & bits);
|
|
9118
|
-
}
|
|
9119
|
-
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
9120
|
-
}
|
|
9121
|
-
tailbits = max % 4 * 6;
|
|
9122
|
-
if (0 === tailbits) {
|
|
9123
|
-
result.push(bits >> 16 & 0xFF);
|
|
9124
|
-
result.push(bits >> 8 & 0xFF);
|
|
9125
|
-
result.push(0xFF & bits);
|
|
9126
|
-
} else if (18 === tailbits) {
|
|
9127
|
-
result.push(bits >> 10 & 0xFF);
|
|
9128
|
-
result.push(bits >> 2 & 0xFF);
|
|
9129
|
-
} else if (12 === tailbits) result.push(bits >> 4 & 0xFF);
|
|
9130
|
-
return new Uint8Array(result);
|
|
9131
|
-
}
|
|
9132
|
-
function representYamlBinary(object) {
|
|
9133
|
-
var result = '', bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
9134
|
-
for(idx = 0; idx < max; idx++){
|
|
9135
|
-
if (idx % 3 === 0 && idx) {
|
|
9136
|
-
result += map[bits >> 18 & 0x3F];
|
|
9137
|
-
result += map[bits >> 12 & 0x3F];
|
|
9138
|
-
result += map[bits >> 6 & 0x3F];
|
|
9139
|
-
result += map[0x3F & bits];
|
|
9140
|
-
}
|
|
9141
|
-
bits = (bits << 8) + object[idx];
|
|
9142
|
-
}
|
|
9143
|
-
tail = max % 3;
|
|
9144
|
-
if (0 === tail) {
|
|
9145
|
-
result += map[bits >> 18 & 0x3F];
|
|
9146
|
-
result += map[bits >> 12 & 0x3F];
|
|
9147
|
-
result += map[bits >> 6 & 0x3F];
|
|
9148
|
-
result += map[0x3F & bits];
|
|
9149
|
-
} else if (2 === tail) {
|
|
9150
|
-
result += map[bits >> 10 & 0x3F];
|
|
9151
|
-
result += map[bits >> 4 & 0x3F];
|
|
9152
|
-
result += map[bits << 2 & 0x3F];
|
|
9153
|
-
result += map[64];
|
|
9154
|
-
} else if (1 === tail) {
|
|
9155
|
-
result += map[bits >> 2 & 0x3F];
|
|
9156
|
-
result += map[bits << 4 & 0x3F];
|
|
9157
|
-
result += map[64];
|
|
9158
|
-
result += map[64];
|
|
9159
|
-
}
|
|
9160
|
-
return result;
|
|
9161
|
-
}
|
|
9162
|
-
function isBinary(obj) {
|
|
9163
|
-
return '[object Uint8Array]' === Object.prototype.toString.call(obj);
|
|
9164
|
-
}
|
|
9165
|
-
var binary = new js_yaml_type('tag:yaml.org,2002:binary', {
|
|
9166
|
-
kind: 'scalar',
|
|
9167
|
-
resolve: resolveYamlBinary,
|
|
9168
|
-
construct: constructYamlBinary,
|
|
9169
|
-
predicate: isBinary,
|
|
9170
|
-
represent: representYamlBinary
|
|
9171
|
-
});
|
|
9172
|
-
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
9173
|
-
var _toString$2 = Object.prototype.toString;
|
|
9174
|
-
function resolveYamlOmap(data) {
|
|
9175
|
-
if (null === data) return true;
|
|
9176
|
-
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
9177
|
-
for(index = 0, length = object.length; index < length; index += 1){
|
|
9178
|
-
pair = object[index];
|
|
9179
|
-
pairHasKey = false;
|
|
9180
|
-
if ('[object Object]' !== _toString$2.call(pair)) return false;
|
|
9181
|
-
for(pairKey in pair)if (_hasOwnProperty$3.call(pair, pairKey)) if (pairHasKey) return false;
|
|
9182
|
-
else pairHasKey = true;
|
|
9183
|
-
if (!pairHasKey) return false;
|
|
9184
|
-
if (-1 !== objectKeys.indexOf(pairKey)) return false;
|
|
9185
|
-
objectKeys.push(pairKey);
|
|
9186
|
-
}
|
|
9187
|
-
return true;
|
|
9188
|
-
}
|
|
9189
|
-
function constructYamlOmap(data) {
|
|
9190
|
-
return null !== data ? data : [];
|
|
9191
|
-
}
|
|
9192
|
-
var omap = new js_yaml_type('tag:yaml.org,2002:omap', {
|
|
9193
|
-
kind: 'sequence',
|
|
9194
|
-
resolve: resolveYamlOmap,
|
|
9195
|
-
construct: constructYamlOmap
|
|
9196
|
-
});
|
|
9197
|
-
var _toString$1 = Object.prototype.toString;
|
|
9198
|
-
function resolveYamlPairs(data) {
|
|
9199
|
-
if (null === data) return true;
|
|
9200
|
-
var index, length, pair, keys, result, object = data;
|
|
9201
|
-
result = new Array(object.length);
|
|
9202
|
-
for(index = 0, length = object.length; index < length; index += 1){
|
|
9203
|
-
pair = object[index];
|
|
9204
|
-
if ('[object Object]' !== _toString$1.call(pair)) return false;
|
|
9205
|
-
keys = Object.keys(pair);
|
|
9206
|
-
if (1 !== keys.length) return false;
|
|
9207
|
-
result[index] = [
|
|
9208
|
-
keys[0],
|
|
9209
|
-
pair[keys[0]]
|
|
9210
|
-
];
|
|
9167
|
+
function constructYamlTimestamp(data) {
|
|
9168
|
+
let fraction = 0;
|
|
9169
|
+
let delta = null;
|
|
9170
|
+
let match = YAML_DATE_REGEXP.exec(data);
|
|
9171
|
+
if (null === match) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
9172
|
+
if (null === match) throw new Error("Date resolve error");
|
|
9173
|
+
const year = +match[1];
|
|
9174
|
+
const month = match[2] - 1;
|
|
9175
|
+
const day = +match[3];
|
|
9176
|
+
if (!match[4]) return new Date(Date.UTC(year, month, day));
|
|
9177
|
+
const hour = +match[4];
|
|
9178
|
+
const minute = +match[5];
|
|
9179
|
+
const second = +match[6];
|
|
9180
|
+
if (match[7]) {
|
|
9181
|
+
fraction = match[7].slice(0, 3);
|
|
9182
|
+
while(fraction.length < 3)fraction += "0";
|
|
9183
|
+
fraction *= 1;
|
|
9184
|
+
}
|
|
9185
|
+
if (match[9]) {
|
|
9186
|
+
const tzHour = +match[10];
|
|
9187
|
+
const tzMinute = +(match[11] || 0);
|
|
9188
|
+
delta = (60 * tzHour + tzMinute) * 6e4;
|
|
9189
|
+
if ("-" === match[9]) delta = -delta;
|
|
9190
|
+
}
|
|
9191
|
+
const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
9192
|
+
if (delta) date.setTime(date.getTime() - delta);
|
|
9193
|
+
return date;
|
|
9194
|
+
}
|
|
9195
|
+
function representYamlTimestamp(object) {
|
|
9196
|
+
return object.toISOString();
|
|
9197
|
+
}
|
|
9198
|
+
js_yaml_timestamp = new Type2("tag:yaml.org,2002:timestamp", {
|
|
9199
|
+
kind: "scalar",
|
|
9200
|
+
resolve: resolveYamlTimestamp,
|
|
9201
|
+
construct: constructYamlTimestamp,
|
|
9202
|
+
instanceOf: Date,
|
|
9203
|
+
represent: representYamlTimestamp
|
|
9204
|
+
});
|
|
9205
|
+
return js_yaml_timestamp;
|
|
9206
|
+
}
|
|
9207
|
+
var js_yaml_merge;
|
|
9208
|
+
var hasRequiredMerge;
|
|
9209
|
+
function requireMerge() {
|
|
9210
|
+
if (hasRequiredMerge) return js_yaml_merge;
|
|
9211
|
+
hasRequiredMerge = 1;
|
|
9212
|
+
const Type2 = requireType();
|
|
9213
|
+
function resolveYamlMerge(data) {
|
|
9214
|
+
return "<<" === data || null === data;
|
|
9215
|
+
}
|
|
9216
|
+
js_yaml_merge = new Type2("tag:yaml.org,2002:merge", {
|
|
9217
|
+
kind: "scalar",
|
|
9218
|
+
resolve: resolveYamlMerge
|
|
9219
|
+
});
|
|
9220
|
+
return js_yaml_merge;
|
|
9221
|
+
}
|
|
9222
|
+
var binary;
|
|
9223
|
+
var hasRequiredBinary;
|
|
9224
|
+
function requireBinary() {
|
|
9225
|
+
if (hasRequiredBinary) return binary;
|
|
9226
|
+
hasRequiredBinary = 1;
|
|
9227
|
+
const Type2 = requireType();
|
|
9228
|
+
const BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
9229
|
+
function resolveYamlBinary(data) {
|
|
9230
|
+
if (null === data) return false;
|
|
9231
|
+
let bitlen = 0;
|
|
9232
|
+
const max = data.length;
|
|
9233
|
+
const map2 = BASE64_MAP;
|
|
9234
|
+
for(let idx = 0; idx < max; idx++){
|
|
9235
|
+
const code = map2.indexOf(data.charAt(idx));
|
|
9236
|
+
if (!(code > 64)) {
|
|
9237
|
+
if (code < 0) return false;
|
|
9238
|
+
bitlen += 6;
|
|
9239
|
+
}
|
|
9240
|
+
}
|
|
9241
|
+
return bitlen % 8 === 0;
|
|
9242
|
+
}
|
|
9243
|
+
function constructYamlBinary(data) {
|
|
9244
|
+
const input = data.replace(/[\r\n=]/g, "");
|
|
9245
|
+
const max = input.length;
|
|
9246
|
+
const map2 = BASE64_MAP;
|
|
9247
|
+
let bits = 0;
|
|
9248
|
+
const result = [];
|
|
9249
|
+
for(let idx = 0; idx < max; idx++){
|
|
9250
|
+
if (idx % 4 === 0 && idx) {
|
|
9251
|
+
result.push(bits >> 16 & 255);
|
|
9252
|
+
result.push(bits >> 8 & 255);
|
|
9253
|
+
result.push(255 & bits);
|
|
9254
|
+
}
|
|
9255
|
+
bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
|
9256
|
+
}
|
|
9257
|
+
const tailbits = max % 4 * 6;
|
|
9258
|
+
if (0 === tailbits) {
|
|
9259
|
+
result.push(bits >> 16 & 255);
|
|
9260
|
+
result.push(bits >> 8 & 255);
|
|
9261
|
+
result.push(255 & bits);
|
|
9262
|
+
} else if (18 === tailbits) {
|
|
9263
|
+
result.push(bits >> 10 & 255);
|
|
9264
|
+
result.push(bits >> 2 & 255);
|
|
9265
|
+
} else if (12 === tailbits) result.push(bits >> 4 & 255);
|
|
9266
|
+
return new Uint8Array(result);
|
|
9267
|
+
}
|
|
9268
|
+
function representYamlBinary(object) {
|
|
9269
|
+
let result = "";
|
|
9270
|
+
let bits = 0;
|
|
9271
|
+
const max = object.length;
|
|
9272
|
+
const map2 = BASE64_MAP;
|
|
9273
|
+
for(let idx = 0; idx < max; idx++){
|
|
9274
|
+
if (idx % 3 === 0 && idx) {
|
|
9275
|
+
result += map2[bits >> 18 & 63];
|
|
9276
|
+
result += map2[bits >> 12 & 63];
|
|
9277
|
+
result += map2[bits >> 6 & 63];
|
|
9278
|
+
result += map2[63 & bits];
|
|
9279
|
+
}
|
|
9280
|
+
bits = (bits << 8) + object[idx];
|
|
9281
|
+
}
|
|
9282
|
+
const tail = max % 3;
|
|
9283
|
+
if (0 === tail) {
|
|
9284
|
+
result += map2[bits >> 18 & 63];
|
|
9285
|
+
result += map2[bits >> 12 & 63];
|
|
9286
|
+
result += map2[bits >> 6 & 63];
|
|
9287
|
+
result += map2[63 & bits];
|
|
9288
|
+
} else if (2 === tail) {
|
|
9289
|
+
result += map2[bits >> 10 & 63];
|
|
9290
|
+
result += map2[bits >> 4 & 63];
|
|
9291
|
+
result += map2[bits << 2 & 63];
|
|
9292
|
+
result += map2[64];
|
|
9293
|
+
} else if (1 === tail) {
|
|
9294
|
+
result += map2[bits >> 2 & 63];
|
|
9295
|
+
result += map2[bits << 4 & 63];
|
|
9296
|
+
result += map2[64];
|
|
9297
|
+
result += map2[64];
|
|
9298
|
+
}
|
|
9299
|
+
return result;
|
|
9211
9300
|
}
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
function constructYamlPairs(data) {
|
|
9215
|
-
if (null === data) return [];
|
|
9216
|
-
var index, length, pair, keys, result, object = data;
|
|
9217
|
-
result = new Array(object.length);
|
|
9218
|
-
for(index = 0, length = object.length; index < length; index += 1){
|
|
9219
|
-
pair = object[index];
|
|
9220
|
-
keys = Object.keys(pair);
|
|
9221
|
-
result[index] = [
|
|
9222
|
-
keys[0],
|
|
9223
|
-
pair[keys[0]]
|
|
9224
|
-
];
|
|
9301
|
+
function isBinary(obj) {
|
|
9302
|
+
return "[object Uint8Array]" === Object.prototype.toString.call(obj);
|
|
9225
9303
|
}
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
js_yaml_set
|
|
9260
|
-
]
|
|
9261
|
-
});
|
|
9262
|
-
var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
9263
|
-
var CONTEXT_FLOW_IN = 1;
|
|
9264
|
-
var CONTEXT_FLOW_OUT = 2;
|
|
9265
|
-
var CONTEXT_BLOCK_IN = 3;
|
|
9266
|
-
var CONTEXT_BLOCK_OUT = 4;
|
|
9267
|
-
var CHOMPING_CLIP = 1;
|
|
9268
|
-
var CHOMPING_STRIP = 2;
|
|
9269
|
-
var CHOMPING_KEEP = 3;
|
|
9270
|
-
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
9271
|
-
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
9272
|
-
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
9273
|
-
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
9274
|
-
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
9275
|
-
function _class(obj) {
|
|
9276
|
-
return Object.prototype.toString.call(obj);
|
|
9277
|
-
}
|
|
9278
|
-
function is_EOL(c) {
|
|
9279
|
-
return 0x0A === c || 0x0D === c;
|
|
9280
|
-
}
|
|
9281
|
-
function is_WHITE_SPACE(c) {
|
|
9282
|
-
return 0x09 === c || 0x20 === c;
|
|
9283
|
-
}
|
|
9284
|
-
function is_WS_OR_EOL(c) {
|
|
9285
|
-
return 0x09 === c || 0x20 === c || 0x0A === c || 0x0D === c;
|
|
9286
|
-
}
|
|
9287
|
-
function is_FLOW_INDICATOR(c) {
|
|
9288
|
-
return 0x2C === c || 0x5B === c || 0x5D === c || 0x7B === c || 0x7D === c;
|
|
9289
|
-
}
|
|
9290
|
-
function fromHexCode(c) {
|
|
9291
|
-
var lc;
|
|
9292
|
-
if (0x30 <= c && c <= 0x39) return c - 0x30;
|
|
9293
|
-
lc = 0x20 | c;
|
|
9294
|
-
if (0x61 <= lc && lc <= 0x66) return lc - 0x61 + 10;
|
|
9295
|
-
return -1;
|
|
9296
|
-
}
|
|
9297
|
-
function escapedHexLen(c) {
|
|
9298
|
-
if (0x78 === c) return 2;
|
|
9299
|
-
if (0x75 === c) return 4;
|
|
9300
|
-
if (0x55 === c) return 8;
|
|
9301
|
-
return 0;
|
|
9302
|
-
}
|
|
9303
|
-
function fromDecimalCode(c) {
|
|
9304
|
-
if (0x30 <= c && c <= 0x39) return c - 0x30;
|
|
9305
|
-
return -1;
|
|
9306
|
-
}
|
|
9307
|
-
function simpleEscapeSequence(c) {
|
|
9308
|
-
return 0x30 === c ? '\x00' : 0x61 === c ? '\x07' : 0x62 === c ? '\x08' : 0x74 === c ? '\x09' : 0x09 === c ? '\x09' : 0x6E === c ? '\x0A' : 0x76 === c ? '\x0B' : 0x66 === c ? '\x0C' : 0x72 === c ? '\x0D' : 0x65 === c ? '\x1B' : 0x20 === c ? ' ' : 0x22 === c ? '\x22' : 0x2F === c ? '/' : 0x5C === c ? '\x5C' : 0x4E === c ? '\x85' : 0x5F === c ? '\xA0' : 0x4C === c ? '\u2028' : 0x50 === c ? '\u2029' : '';
|
|
9309
|
-
}
|
|
9310
|
-
function charFromCodepoint(c) {
|
|
9311
|
-
if (c <= 0xFFFF) return String.fromCharCode(c);
|
|
9312
|
-
return String.fromCharCode((c - 0x010000 >> 10) + 0xD800, (c - 0x010000 & 0x03FF) + 0xDC00);
|
|
9313
|
-
}
|
|
9314
|
-
var simpleEscapeCheck = new Array(256);
|
|
9315
|
-
var simpleEscapeMap = new Array(256);
|
|
9316
|
-
for(var js_yaml_i = 0; js_yaml_i < 256; js_yaml_i++){
|
|
9317
|
-
simpleEscapeCheck[js_yaml_i] = simpleEscapeSequence(js_yaml_i) ? 1 : 0;
|
|
9318
|
-
simpleEscapeMap[js_yaml_i] = simpleEscapeSequence(js_yaml_i);
|
|
9319
|
-
}
|
|
9320
|
-
function State$1(input, options) {
|
|
9321
|
-
this.input = input;
|
|
9322
|
-
this.filename = options['filename'] || null;
|
|
9323
|
-
this.schema = options['schema'] || _default;
|
|
9324
|
-
this.onWarning = options['onWarning'] || null;
|
|
9325
|
-
this.legacy = options['legacy'] || false;
|
|
9326
|
-
this.json = options['json'] || false;
|
|
9327
|
-
this.listener = options['listener'] || null;
|
|
9328
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
9329
|
-
this.typeMap = this.schema.compiledTypeMap;
|
|
9330
|
-
this.length = input.length;
|
|
9331
|
-
this.position = 0;
|
|
9332
|
-
this.line = 0;
|
|
9333
|
-
this.lineStart = 0;
|
|
9334
|
-
this.lineIndent = 0;
|
|
9335
|
-
this.firstTabInLine = -1;
|
|
9336
|
-
this.documents = [];
|
|
9337
|
-
}
|
|
9338
|
-
function generateError(state, message) {
|
|
9339
|
-
var mark = {
|
|
9340
|
-
name: state.filename,
|
|
9341
|
-
buffer: state.input.slice(0, -1),
|
|
9342
|
-
position: state.position,
|
|
9343
|
-
line: state.line,
|
|
9344
|
-
column: state.position - state.lineStart
|
|
9345
|
-
};
|
|
9346
|
-
mark.snippet = snippet(mark);
|
|
9347
|
-
return new js_yaml_exception(message, mark);
|
|
9348
|
-
}
|
|
9349
|
-
function throwError(state, message) {
|
|
9350
|
-
throw generateError(state, message);
|
|
9351
|
-
}
|
|
9352
|
-
function throwWarning(state, message) {
|
|
9353
|
-
if (state.onWarning) state.onWarning.call(null, generateError(state, message));
|
|
9354
|
-
}
|
|
9355
|
-
var directiveHandlers = {
|
|
9356
|
-
YAML: function(state, name, args) {
|
|
9357
|
-
var match, major, minor;
|
|
9358
|
-
if (null !== state.version) throwError(state, 'duplication of %YAML directive');
|
|
9359
|
-
if (1 !== args.length) throwError(state, 'YAML directive accepts exactly one argument');
|
|
9360
|
-
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
9361
|
-
if (null === match) throwError(state, 'ill-formed argument of the YAML directive');
|
|
9362
|
-
major = parseInt(match[1], 10);
|
|
9363
|
-
minor = parseInt(match[2], 10);
|
|
9364
|
-
if (1 !== major) throwError(state, 'unacceptable YAML version of the document');
|
|
9365
|
-
state.version = args[0];
|
|
9366
|
-
state.checkLineBreaks = minor < 2;
|
|
9367
|
-
if (1 !== minor && 2 !== minor) throwWarning(state, 'unsupported YAML version of the document');
|
|
9368
|
-
},
|
|
9369
|
-
TAG: function(state, name, args) {
|
|
9370
|
-
var handle, prefix;
|
|
9371
|
-
if (2 !== args.length) throwError(state, 'TAG directive accepts exactly two arguments');
|
|
9372
|
-
handle = args[0];
|
|
9373
|
-
prefix = args[1];
|
|
9374
|
-
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
|
|
9375
|
-
if (_hasOwnProperty$1.call(state.tagMap, handle)) throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
9376
|
-
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
|
|
9377
|
-
try {
|
|
9378
|
-
prefix = decodeURIComponent(prefix);
|
|
9379
|
-
} catch (err) {
|
|
9380
|
-
throwError(state, 'tag prefix is malformed: ' + prefix);
|
|
9304
|
+
binary = new Type2("tag:yaml.org,2002:binary", {
|
|
9305
|
+
kind: "scalar",
|
|
9306
|
+
resolve: resolveYamlBinary,
|
|
9307
|
+
construct: constructYamlBinary,
|
|
9308
|
+
predicate: isBinary,
|
|
9309
|
+
represent: representYamlBinary
|
|
9310
|
+
});
|
|
9311
|
+
return binary;
|
|
9312
|
+
}
|
|
9313
|
+
var omap;
|
|
9314
|
+
var hasRequiredOmap;
|
|
9315
|
+
function requireOmap() {
|
|
9316
|
+
if (hasRequiredOmap) return omap;
|
|
9317
|
+
hasRequiredOmap = 1;
|
|
9318
|
+
const Type2 = requireType();
|
|
9319
|
+
const _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
9320
|
+
const _toString = Object.prototype.toString;
|
|
9321
|
+
function resolveYamlOmap(data) {
|
|
9322
|
+
if (null === data) return true;
|
|
9323
|
+
const objectKeys = {};
|
|
9324
|
+
const object = data;
|
|
9325
|
+
for(let index = 0, length = object.length; index < length; index += 1){
|
|
9326
|
+
const pair = object[index];
|
|
9327
|
+
let pairHasKey = false;
|
|
9328
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
9329
|
+
let pairKey;
|
|
9330
|
+
for(pairKey in pair)if (_hasOwnProperty.call(pair, pairKey)) if (pairHasKey) return false;
|
|
9331
|
+
else pairHasKey = true;
|
|
9332
|
+
if (!pairHasKey) return false;
|
|
9333
|
+
if (_hasOwnProperty.call(objectKeys, pairKey)) return false;
|
|
9334
|
+
Object.defineProperty(objectKeys, pairKey, {
|
|
9335
|
+
value: true
|
|
9336
|
+
});
|
|
9381
9337
|
}
|
|
9382
|
-
|
|
9338
|
+
return true;
|
|
9383
9339
|
}
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9340
|
+
function constructYamlOmap(data) {
|
|
9341
|
+
return null !== data ? data : [];
|
|
9342
|
+
}
|
|
9343
|
+
omap = new Type2("tag:yaml.org,2002:omap", {
|
|
9344
|
+
kind: "sequence",
|
|
9345
|
+
resolve: resolveYamlOmap,
|
|
9346
|
+
construct: constructYamlOmap
|
|
9347
|
+
});
|
|
9348
|
+
return omap;
|
|
9349
|
+
}
|
|
9350
|
+
var pairs;
|
|
9351
|
+
var hasRequiredPairs;
|
|
9352
|
+
function requirePairs() {
|
|
9353
|
+
if (hasRequiredPairs) return pairs;
|
|
9354
|
+
hasRequiredPairs = 1;
|
|
9355
|
+
const Type2 = requireType();
|
|
9356
|
+
const _toString = Object.prototype.toString;
|
|
9357
|
+
function resolveYamlPairs(data) {
|
|
9358
|
+
if (null === data) return true;
|
|
9359
|
+
const object = data;
|
|
9360
|
+
const result = new Array(object.length);
|
|
9361
|
+
for(let index = 0, length = object.length; index < length; index += 1){
|
|
9362
|
+
const pair = object[index];
|
|
9363
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
9364
|
+
const keys = Object.keys(pair);
|
|
9365
|
+
if (1 !== keys.length) return false;
|
|
9366
|
+
result[index] = [
|
|
9367
|
+
keys[0],
|
|
9368
|
+
pair[keys[0]]
|
|
9369
|
+
];
|
|
9392
9370
|
}
|
|
9393
|
-
|
|
9394
|
-
state.result += _result;
|
|
9371
|
+
return true;
|
|
9395
9372
|
}
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9373
|
+
function constructYamlPairs(data) {
|
|
9374
|
+
if (null === data) return [];
|
|
9375
|
+
const object = data;
|
|
9376
|
+
const result = new Array(object.length);
|
|
9377
|
+
for(let index = 0, length = object.length; index < length; index += 1){
|
|
9378
|
+
const pair = object[index];
|
|
9379
|
+
const keys = Object.keys(pair);
|
|
9380
|
+
result[index] = [
|
|
9381
|
+
keys[0],
|
|
9382
|
+
pair[keys[0]]
|
|
9383
|
+
];
|
|
9406
9384
|
}
|
|
9385
|
+
return result;
|
|
9407
9386
|
}
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9387
|
+
pairs = new Type2("tag:yaml.org,2002:pairs", {
|
|
9388
|
+
kind: "sequence",
|
|
9389
|
+
resolve: resolveYamlPairs,
|
|
9390
|
+
construct: constructYamlPairs
|
|
9391
|
+
});
|
|
9392
|
+
return pairs;
|
|
9393
|
+
}
|
|
9394
|
+
var js_yaml_set;
|
|
9395
|
+
var hasRequiredSet;
|
|
9396
|
+
function requireSet() {
|
|
9397
|
+
if (hasRequiredSet) return js_yaml_set;
|
|
9398
|
+
hasRequiredSet = 1;
|
|
9399
|
+
const Type2 = requireType();
|
|
9400
|
+
const _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
9401
|
+
function resolveYamlSet(data) {
|
|
9402
|
+
if (null === data) return true;
|
|
9403
|
+
const object = data;
|
|
9404
|
+
for(const key in object)if (_hasOwnProperty.call(object, key)) {
|
|
9405
|
+
if (null !== object[key]) return false;
|
|
9416
9406
|
}
|
|
9407
|
+
return true;
|
|
9417
9408
|
}
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9409
|
+
function constructYamlSet(data) {
|
|
9410
|
+
return null !== data ? data : {};
|
|
9411
|
+
}
|
|
9412
|
+
js_yaml_set = new Type2("tag:yaml.org,2002:set", {
|
|
9413
|
+
kind: "mapping",
|
|
9414
|
+
resolve: resolveYamlSet,
|
|
9415
|
+
construct: constructYamlSet
|
|
9416
|
+
});
|
|
9417
|
+
return js_yaml_set;
|
|
9418
|
+
}
|
|
9419
|
+
var _default;
|
|
9420
|
+
var hasRequired_default;
|
|
9421
|
+
function require_default() {
|
|
9422
|
+
if (hasRequired_default) return _default;
|
|
9423
|
+
hasRequired_default = 1;
|
|
9424
|
+
_default = requireCore().extend({
|
|
9425
|
+
implicit: [
|
|
9426
|
+
requireTimestamp(),
|
|
9427
|
+
requireMerge()
|
|
9428
|
+
],
|
|
9429
|
+
explicit: [
|
|
9430
|
+
requireBinary(),
|
|
9431
|
+
requireOmap(),
|
|
9432
|
+
requirePairs(),
|
|
9433
|
+
requireSet()
|
|
9434
|
+
]
|
|
9435
|
+
});
|
|
9436
|
+
return _default;
|
|
9437
|
+
}
|
|
9438
|
+
var hasRequiredLoader;
|
|
9439
|
+
function requireLoader() {
|
|
9440
|
+
if (hasRequiredLoader) return loader;
|
|
9441
|
+
hasRequiredLoader = 1;
|
|
9442
|
+
const common2 = requireCommon();
|
|
9443
|
+
const YAMLException2 = requireException();
|
|
9444
|
+
const makeSnippet = requireSnippet();
|
|
9445
|
+
const DEFAULT_SCHEMA2 = require_default();
|
|
9446
|
+
const _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
9447
|
+
const CONTEXT_FLOW_IN = 1;
|
|
9448
|
+
const CONTEXT_FLOW_OUT = 2;
|
|
9449
|
+
const CONTEXT_BLOCK_IN = 3;
|
|
9450
|
+
const CONTEXT_BLOCK_OUT = 4;
|
|
9451
|
+
const CHOMPING_CLIP = 1;
|
|
9452
|
+
const CHOMPING_STRIP = 2;
|
|
9453
|
+
const CHOMPING_KEEP = 3;
|
|
9454
|
+
const PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
9455
|
+
const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
9456
|
+
const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
|
|
9457
|
+
const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
|
|
9458
|
+
const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
|
|
9459
|
+
function _class(obj) {
|
|
9460
|
+
return Object.prototype.toString.call(obj);
|
|
9461
|
+
}
|
|
9462
|
+
function isEol(c) {
|
|
9463
|
+
return 10 === c || 13 === c;
|
|
9464
|
+
}
|
|
9465
|
+
function isWhiteSpace(c) {
|
|
9466
|
+
return 9 === c || 32 === c;
|
|
9467
|
+
}
|
|
9468
|
+
function isWsOrEol(c) {
|
|
9469
|
+
return 9 === c || 32 === c || 10 === c || 13 === c;
|
|
9470
|
+
}
|
|
9471
|
+
function isFlowIndicator(c) {
|
|
9472
|
+
return 44 === c || 91 === c || 93 === c || 123 === c || 125 === c;
|
|
9473
|
+
}
|
|
9474
|
+
function fromHexCode(c) {
|
|
9475
|
+
if (c >= 48 && c <= 57) return c - 48;
|
|
9476
|
+
const lc = 32 | c;
|
|
9477
|
+
if (lc >= 97 && lc <= 102) return lc - 97 + 10;
|
|
9478
|
+
return -1;
|
|
9479
|
+
}
|
|
9480
|
+
function escapedHexLen(c) {
|
|
9481
|
+
if (120 === c) return 2;
|
|
9482
|
+
if (117 === c) return 4;
|
|
9483
|
+
if (85 === c) return 8;
|
|
9484
|
+
return 0;
|
|
9485
|
+
}
|
|
9486
|
+
function fromDecimalCode(c) {
|
|
9487
|
+
if (c >= 48 && c <= 57) return c - 48;
|
|
9488
|
+
return -1;
|
|
9489
|
+
}
|
|
9490
|
+
function simpleEscapeSequence(c) {
|
|
9491
|
+
switch(c){
|
|
9492
|
+
case 48:
|
|
9493
|
+
return "\0";
|
|
9494
|
+
case 97:
|
|
9495
|
+
return "\x07";
|
|
9496
|
+
case 98:
|
|
9497
|
+
return "\b";
|
|
9498
|
+
case 116:
|
|
9499
|
+
return " ";
|
|
9500
|
+
case 9:
|
|
9501
|
+
return " ";
|
|
9502
|
+
case 110:
|
|
9503
|
+
return "\n";
|
|
9504
|
+
case 118:
|
|
9505
|
+
return "\v";
|
|
9506
|
+
case 102:
|
|
9507
|
+
return "\f";
|
|
9508
|
+
case 114:
|
|
9509
|
+
return "\r";
|
|
9510
|
+
case 101:
|
|
9511
|
+
return "\x1B";
|
|
9512
|
+
case 32:
|
|
9513
|
+
return " ";
|
|
9514
|
+
case 34:
|
|
9515
|
+
return '"';
|
|
9516
|
+
case 47:
|
|
9517
|
+
return "/";
|
|
9518
|
+
case 92:
|
|
9519
|
+
return "\\";
|
|
9520
|
+
case 78:
|
|
9521
|
+
return "
";
|
|
9522
|
+
case 95:
|
|
9523
|
+
return " ";
|
|
9524
|
+
case 76:
|
|
9525
|
+
return "\u2028";
|
|
9526
|
+
case 80:
|
|
9527
|
+
return "\u2029";
|
|
9528
|
+
default:
|
|
9529
|
+
return "";
|
|
9429
9530
|
}
|
|
9430
|
-
|
|
9531
|
+
}
|
|
9532
|
+
function charFromCodepoint(c) {
|
|
9533
|
+
if (c <= 65535) return String.fromCharCode(c);
|
|
9534
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
9535
|
+
}
|
|
9536
|
+
function setProperty(object, key, value) {
|
|
9537
|
+
if ("__proto__" === key) Object.defineProperty(object, key, {
|
|
9431
9538
|
configurable: true,
|
|
9432
9539
|
enumerable: true,
|
|
9433
9540
|
writable: true,
|
|
9434
|
-
value
|
|
9541
|
+
value
|
|
9435
9542
|
});
|
|
9436
|
-
else
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9543
|
+
else object[key] = value;
|
|
9544
|
+
}
|
|
9545
|
+
const simpleEscapeCheck = new Array(256);
|
|
9546
|
+
const simpleEscapeMap = new Array(256);
|
|
9547
|
+
for(let i = 0; i < 256; i++){
|
|
9548
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
9549
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
9550
|
+
}
|
|
9551
|
+
function State(input, options) {
|
|
9552
|
+
this.input = input;
|
|
9553
|
+
this.filename = options["filename"] || null;
|
|
9554
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA2;
|
|
9555
|
+
this.onWarning = options["onWarning"] || null;
|
|
9556
|
+
this.legacy = options["legacy"] || false;
|
|
9557
|
+
this.json = options["json"] || false;
|
|
9558
|
+
this.listener = options["listener"] || null;
|
|
9559
|
+
this.maxDepth = "number" == typeof options["maxDepth"] ? options["maxDepth"] : 100;
|
|
9560
|
+
this.maxTotalMergeKeys = "number" == typeof options["maxTotalMergeKeys"] ? options["maxTotalMergeKeys"] : 1e4;
|
|
9561
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
9562
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
9563
|
+
this.length = input.length;
|
|
9564
|
+
this.position = 0;
|
|
9565
|
+
this.line = 0;
|
|
9566
|
+
this.lineStart = 0;
|
|
9567
|
+
this.lineIndent = 0;
|
|
9568
|
+
this.depth = 0;
|
|
9569
|
+
this.totalMergeKeys = 0;
|
|
9570
|
+
this.firstTabInLine = -1;
|
|
9571
|
+
this.documents = [];
|
|
9572
|
+
this.anchorMapTransactions = [];
|
|
9573
|
+
}
|
|
9574
|
+
function generateError(state, message) {
|
|
9575
|
+
const mark = {
|
|
9576
|
+
name: state.filename,
|
|
9577
|
+
buffer: state.input.slice(0, -1),
|
|
9578
|
+
position: state.position,
|
|
9579
|
+
line: state.line,
|
|
9580
|
+
column: state.position - state.lineStart
|
|
9581
|
+
};
|
|
9582
|
+
mark.snippet = makeSnippet(mark);
|
|
9583
|
+
return new YAMLException2(message, mark);
|
|
9584
|
+
}
|
|
9585
|
+
function throwError(state, message) {
|
|
9586
|
+
throw generateError(state, message);
|
|
9587
|
+
}
|
|
9588
|
+
function throwWarning(state, message) {
|
|
9589
|
+
if (state.onWarning) state.onWarning.call(null, generateError(state, message));
|
|
9590
|
+
}
|
|
9591
|
+
function storeAnchor(state, name, value) {
|
|
9592
|
+
const transactions = state.anchorMapTransactions;
|
|
9593
|
+
if (0 !== transactions.length) {
|
|
9594
|
+
const transaction = transactions[transactions.length - 1];
|
|
9595
|
+
if (!_hasOwnProperty.call(transaction, name)) transaction[name] = {
|
|
9596
|
+
existed: _hasOwnProperty.call(state.anchorMap, name),
|
|
9597
|
+
value: state.anchorMap[name]
|
|
9598
|
+
};
|
|
9459
9599
|
}
|
|
9460
|
-
|
|
9461
|
-
while (0x0A !== ch && 0x0D !== ch && 0 !== ch);
|
|
9462
|
-
if (is_EOL(ch)) {
|
|
9463
|
-
readLineBreak(state);
|
|
9464
|
-
ch = state.input.charCodeAt(state.position);
|
|
9465
|
-
lineBreaks++;
|
|
9466
|
-
state.lineIndent = 0;
|
|
9467
|
-
while(0x20 === ch){
|
|
9468
|
-
state.lineIndent++;
|
|
9469
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9470
|
-
}
|
|
9471
|
-
} else break;
|
|
9600
|
+
state.anchorMap[name] = value;
|
|
9472
9601
|
}
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
}
|
|
9476
|
-
function testDocumentSeparator(state) {
|
|
9477
|
-
var _position = state.position, ch;
|
|
9478
|
-
ch = state.input.charCodeAt(_position);
|
|
9479
|
-
if ((0x2D === ch || 0x2E === ch) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
9480
|
-
_position += 3;
|
|
9481
|
-
ch = state.input.charCodeAt(_position);
|
|
9482
|
-
if (0 === ch || is_WS_OR_EOL(ch)) return true;
|
|
9602
|
+
function beginAnchorTransaction(state) {
|
|
9603
|
+
state.anchorMapTransactions.push(/* @__PURE__ */ Object.create(null));
|
|
9483
9604
|
}
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || 0x23 === ch || 0x26 === ch || 0x2A === ch || 0x21 === ch || 0x7C === ch || 0x3E === ch || 0x27 === ch || 0x22 === ch || 0x25 === ch || 0x40 === ch || 0x60 === ch) return false;
|
|
9494
|
-
if (0x3F === ch || 0x2D === ch) {
|
|
9495
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
9496
|
-
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false;
|
|
9497
|
-
}
|
|
9498
|
-
state.kind = 'scalar';
|
|
9499
|
-
state.result = '';
|
|
9500
|
-
captureStart = captureEnd = state.position;
|
|
9501
|
-
hasPendingContent = false;
|
|
9502
|
-
while(0 !== ch){
|
|
9503
|
-
if (0x3A === ch) {
|
|
9504
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
9505
|
-
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break;
|
|
9506
|
-
} else if (0x23 === ch) {
|
|
9507
|
-
preceding = state.input.charCodeAt(state.position - 1);
|
|
9508
|
-
if (is_WS_OR_EOL(preceding)) break;
|
|
9509
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break;
|
|
9510
|
-
else if (is_EOL(ch)) {
|
|
9511
|
-
_line = state.line;
|
|
9512
|
-
_lineStart = state.lineStart;
|
|
9513
|
-
_lineIndent = state.lineIndent;
|
|
9514
|
-
skipSeparationSpace(state, false, -1);
|
|
9515
|
-
if (state.lineIndent >= nodeIndent) {
|
|
9516
|
-
hasPendingContent = true;
|
|
9517
|
-
ch = state.input.charCodeAt(state.position);
|
|
9518
|
-
continue;
|
|
9519
|
-
}
|
|
9520
|
-
state.position = captureEnd;
|
|
9521
|
-
state.line = _line;
|
|
9522
|
-
state.lineStart = _lineStart;
|
|
9523
|
-
state.lineIndent = _lineIndent;
|
|
9524
|
-
break;
|
|
9605
|
+
function commitAnchorTransaction(state) {
|
|
9606
|
+
const transaction = state.anchorMapTransactions.pop();
|
|
9607
|
+
const transactions = state.anchorMapTransactions;
|
|
9608
|
+
if (0 === transactions.length) return;
|
|
9609
|
+
const parent = transactions[transactions.length - 1];
|
|
9610
|
+
const names = Object.keys(transaction);
|
|
9611
|
+
for(let index = 0, length = names.length; index < length; index += 1){
|
|
9612
|
+
const name = names[index];
|
|
9613
|
+
if (!_hasOwnProperty.call(parent, name)) parent[name] = transaction[name];
|
|
9525
9614
|
}
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9615
|
+
}
|
|
9616
|
+
function rollbackAnchorTransaction(state) {
|
|
9617
|
+
const transaction = state.anchorMapTransactions.pop();
|
|
9618
|
+
const names = Object.keys(transaction);
|
|
9619
|
+
for(let index = names.length - 1; index >= 0; index -= 1){
|
|
9620
|
+
const entry = transaction[names[index]];
|
|
9621
|
+
if (entry.existed) state.anchorMap[names[index]] = entry.value;
|
|
9622
|
+
else delete state.anchorMap[names[index]];
|
|
9531
9623
|
}
|
|
9532
|
-
if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1;
|
|
9533
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9534
9624
|
}
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
state.position++;
|
|
9548
|
-
captureStart = captureEnd = state.position;
|
|
9549
|
-
while(0 !== (ch = state.input.charCodeAt(state.position)))if (0x27 === ch) {
|
|
9550
|
-
captureSegment(state, captureStart, state.position, true);
|
|
9551
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9552
|
-
if (0x27 !== ch) return true;
|
|
9553
|
-
captureStart = state.position;
|
|
9554
|
-
state.position++;
|
|
9555
|
-
captureEnd = state.position;
|
|
9556
|
-
} else if (is_EOL(ch)) {
|
|
9557
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
9558
|
-
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
9559
|
-
captureStart = captureEnd = state.position;
|
|
9560
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, 'unexpected end of the document within a single quoted scalar');
|
|
9561
|
-
else {
|
|
9562
|
-
state.position++;
|
|
9563
|
-
captureEnd = state.position;
|
|
9564
|
-
}
|
|
9565
|
-
throwError(state, 'unexpected end of the stream within a single quoted scalar');
|
|
9566
|
-
}
|
|
9567
|
-
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
9568
|
-
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
9569
|
-
ch = state.input.charCodeAt(state.position);
|
|
9570
|
-
if (0x22 !== ch) return false;
|
|
9571
|
-
state.kind = 'scalar';
|
|
9572
|
-
state.result = '';
|
|
9573
|
-
state.position++;
|
|
9574
|
-
captureStart = captureEnd = state.position;
|
|
9575
|
-
while(0 !== (ch = state.input.charCodeAt(state.position)))if (0x22 === ch) {
|
|
9576
|
-
captureSegment(state, captureStart, state.position, true);
|
|
9577
|
-
state.position++;
|
|
9578
|
-
return true;
|
|
9579
|
-
} else if (0x5C === ch) {
|
|
9580
|
-
captureSegment(state, captureStart, state.position, true);
|
|
9581
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9582
|
-
if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent);
|
|
9583
|
-
else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
9584
|
-
state.result += simpleEscapeMap[ch];
|
|
9585
|
-
state.position++;
|
|
9586
|
-
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
9587
|
-
hexLength = tmp;
|
|
9588
|
-
hexResult = 0;
|
|
9589
|
-
for(; hexLength > 0; hexLength--){
|
|
9590
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9591
|
-
if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
|
|
9592
|
-
else throwError(state, 'expected hexadecimal character');
|
|
9593
|
-
}
|
|
9594
|
-
state.result += charFromCodepoint(hexResult);
|
|
9595
|
-
state.position++;
|
|
9596
|
-
} else throwError(state, 'unknown escape sequence');
|
|
9597
|
-
captureStart = captureEnd = state.position;
|
|
9598
|
-
} else if (is_EOL(ch)) {
|
|
9599
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
9600
|
-
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
9601
|
-
captureStart = captureEnd = state.position;
|
|
9602
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, 'unexpected end of the document within a double quoted scalar');
|
|
9603
|
-
else {
|
|
9604
|
-
state.position++;
|
|
9605
|
-
captureEnd = state.position;
|
|
9625
|
+
function snapshotState(state) {
|
|
9626
|
+
return {
|
|
9627
|
+
position: state.position,
|
|
9628
|
+
line: state.line,
|
|
9629
|
+
lineStart: state.lineStart,
|
|
9630
|
+
lineIndent: state.lineIndent,
|
|
9631
|
+
firstTabInLine: state.firstTabInLine,
|
|
9632
|
+
tag: state.tag,
|
|
9633
|
+
anchor: state.anchor,
|
|
9634
|
+
kind: state.kind,
|
|
9635
|
+
result: state.result
|
|
9636
|
+
};
|
|
9606
9637
|
}
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
state.
|
|
9629
|
-
state
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9638
|
+
function restoreState(state, snapshot) {
|
|
9639
|
+
state.position = snapshot.position;
|
|
9640
|
+
state.line = snapshot.line;
|
|
9641
|
+
state.lineStart = snapshot.lineStart;
|
|
9642
|
+
state.lineIndent = snapshot.lineIndent;
|
|
9643
|
+
state.firstTabInLine = snapshot.firstTabInLine;
|
|
9644
|
+
state.tag = snapshot.tag;
|
|
9645
|
+
state.anchor = snapshot.anchor;
|
|
9646
|
+
state.kind = snapshot.kind;
|
|
9647
|
+
state.result = snapshot.result;
|
|
9648
|
+
}
|
|
9649
|
+
const directiveHandlers = {
|
|
9650
|
+
YAML: function(state, name, args) {
|
|
9651
|
+
if (null !== state.version) throwError(state, "duplication of %YAML directive");
|
|
9652
|
+
if (1 !== args.length) throwError(state, "YAML directive accepts exactly one argument");
|
|
9653
|
+
const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
9654
|
+
if (null === match) throwError(state, "ill-formed argument of the YAML directive");
|
|
9655
|
+
const major = parseInt(match[1], 10);
|
|
9656
|
+
const minor = parseInt(match[2], 10);
|
|
9657
|
+
if (1 !== major) throwError(state, "unacceptable YAML version of the document");
|
|
9658
|
+
state.version = args[0];
|
|
9659
|
+
state.checkLineBreaks = minor < 2;
|
|
9660
|
+
if (1 !== minor && 2 !== minor) throwWarning(state, "unsupported YAML version of the document");
|
|
9661
|
+
},
|
|
9662
|
+
TAG: function(state, name, args) {
|
|
9663
|
+
let prefix;
|
|
9664
|
+
if (2 !== args.length) throwError(state, "TAG directive accepts exactly two arguments");
|
|
9665
|
+
const handle = args[0];
|
|
9666
|
+
prefix = args[1];
|
|
9667
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
9668
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
9669
|
+
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
9670
|
+
try {
|
|
9671
|
+
prefix = decodeURIComponent(prefix);
|
|
9672
|
+
} catch (err) {
|
|
9673
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
9674
|
+
}
|
|
9675
|
+
state.tagMap[handle] = prefix;
|
|
9634
9676
|
}
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9677
|
+
};
|
|
9678
|
+
function captureSegment(state, start, end, checkJson) {
|
|
9679
|
+
if (start < end) {
|
|
9680
|
+
const _result = state.input.slice(start, end);
|
|
9681
|
+
if (checkJson) for(let _position = 0, _length = _result.length; _position < _length; _position += 1){
|
|
9682
|
+
const _character = _result.charCodeAt(_position);
|
|
9683
|
+
if (!(9 === _character || _character >= 32 && _character <= 1114111)) throwError(state, "expected valid JSON character");
|
|
9684
|
+
}
|
|
9685
|
+
else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
|
|
9686
|
+
state.result += _result;
|
|
9687
|
+
}
|
|
9688
|
+
}
|
|
9689
|
+
function chargeMergeWork(state) {
|
|
9690
|
+
state.totalMergeKeys++;
|
|
9691
|
+
if (-1 !== state.maxTotalMergeKeys && state.totalMergeKeys > state.maxTotalMergeKeys) throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
9692
|
+
}
|
|
9693
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
9694
|
+
if (!common2.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
9695
|
+
chargeMergeWork(state);
|
|
9696
|
+
const sourceKeys = Object.keys(source);
|
|
9697
|
+
for(let index = 0, quantity = sourceKeys.length; index < quantity; index += 1){
|
|
9698
|
+
const key = sourceKeys[index];
|
|
9699
|
+
chargeMergeWork(state);
|
|
9700
|
+
if (!_hasOwnProperty.call(destination, key)) {
|
|
9701
|
+
setProperty(destination, key, source[key]);
|
|
9702
|
+
overridableKeys[key] = true;
|
|
9646
9703
|
}
|
|
9647
9704
|
}
|
|
9648
|
-
_line = state.line;
|
|
9649
|
-
_lineStart = state.lineStart;
|
|
9650
|
-
_pos = state.position;
|
|
9651
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
9652
|
-
keyTag = state.tag;
|
|
9653
|
-
keyNode = state.result;
|
|
9654
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
9655
|
-
ch = state.input.charCodeAt(state.position);
|
|
9656
|
-
if ((isExplicitPair || state.line === _line) && 0x3A === ch) {
|
|
9657
|
-
isPair = true;
|
|
9658
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9659
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
9660
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
9661
|
-
valueNode = state.result;
|
|
9662
|
-
}
|
|
9663
|
-
if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
9664
|
-
else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
9665
|
-
else _result.push(keyNode);
|
|
9666
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
9667
|
-
ch = state.input.charCodeAt(state.position);
|
|
9668
|
-
if (0x2C === ch) {
|
|
9669
|
-
readNext = true;
|
|
9670
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9671
|
-
} else readNext = false;
|
|
9672
|
-
}
|
|
9673
|
-
throwError(state, 'unexpected end of the stream within a flow collection');
|
|
9674
|
-
}
|
|
9675
|
-
function readBlockScalar(state, nodeIndent) {
|
|
9676
|
-
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
9677
|
-
ch = state.input.charCodeAt(state.position);
|
|
9678
|
-
if (0x7C === ch) folding = false;
|
|
9679
|
-
else {
|
|
9680
|
-
if (0x3E !== ch) return false;
|
|
9681
|
-
folding = true;
|
|
9682
9705
|
}
|
|
9683
|
-
state
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9706
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
9707
|
+
if (Array.isArray(keyNode)) {
|
|
9708
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
9709
|
+
for(let index = 0, quantity = keyNode.length; index < quantity; index += 1){
|
|
9710
|
+
if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys");
|
|
9711
|
+
if ("object" == typeof keyNode && "[object Object]" === _class(keyNode[index])) keyNode[index] = "[object Object]";
|
|
9712
|
+
}
|
|
9713
|
+
}
|
|
9714
|
+
if ("object" == typeof keyNode && "[object Object]" === _class(keyNode)) keyNode = "[object Object]";
|
|
9715
|
+
keyNode = String(keyNode);
|
|
9716
|
+
if (null === _result) _result = {};
|
|
9717
|
+
if ("tag:yaml.org,2002:merge" === keyTag) if (Array.isArray(valueNode)) {
|
|
9718
|
+
if (valueNode.length > 100) throwError(state, "abnormal merge sequence size");
|
|
9719
|
+
for(let index = 0, quantity = valueNode.length; index < quantity; index += 1)mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
9720
|
+
} else mergeMappings(state, _result, valueNode, overridableKeys);
|
|
9691
9721
|
else {
|
|
9692
|
-
|
|
9693
|
-
|
|
9722
|
+
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
9723
|
+
state.line = startLine || state.line;
|
|
9724
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
9725
|
+
state.position = startPos || state.position;
|
|
9726
|
+
throwError(state, "duplicated mapping key");
|
|
9727
|
+
}
|
|
9728
|
+
setProperty(_result, keyNode, valueNode);
|
|
9729
|
+
delete overridableKeys[keyNode];
|
|
9694
9730
|
}
|
|
9695
|
-
|
|
9696
|
-
}
|
|
9697
|
-
if (is_WHITE_SPACE(ch)) {
|
|
9698
|
-
do ch = state.input.charCodeAt(++state.position);
|
|
9699
|
-
while (is_WHITE_SPACE(ch));
|
|
9700
|
-
if (0x23 === ch) do ch = state.input.charCodeAt(++state.position);
|
|
9701
|
-
while (!is_EOL(ch) && 0 !== ch);
|
|
9731
|
+
return _result;
|
|
9702
9732
|
}
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
state.
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
state.
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9733
|
+
function readLineBreak(state) {
|
|
9734
|
+
const ch = state.input.charCodeAt(state.position);
|
|
9735
|
+
if (10 === ch) state.position++;
|
|
9736
|
+
else if (13 === ch) {
|
|
9737
|
+
state.position++;
|
|
9738
|
+
if (10 === state.input.charCodeAt(state.position)) state.position++;
|
|
9739
|
+
} else throwError(state, "a line break is expected");
|
|
9740
|
+
state.line += 1;
|
|
9741
|
+
state.lineStart = state.position;
|
|
9742
|
+
state.firstTabInLine = -1;
|
|
9743
|
+
}
|
|
9744
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
9745
|
+
let lineBreaks = 0;
|
|
9746
|
+
let ch = state.input.charCodeAt(state.position);
|
|
9747
|
+
while(0 !== ch){
|
|
9748
|
+
while(isWhiteSpace(ch)){
|
|
9749
|
+
if (9 === ch && -1 === state.firstTabInLine) state.firstTabInLine = state.position;
|
|
9750
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9751
|
+
}
|
|
9752
|
+
if (allowComments && 35 === ch) do ch = state.input.charCodeAt(++state.position);
|
|
9753
|
+
while (10 !== ch && 13 !== ch && 0 !== ch);
|
|
9754
|
+
if (isEol(ch)) {
|
|
9755
|
+
readLineBreak(state);
|
|
9756
|
+
ch = state.input.charCodeAt(state.position);
|
|
9757
|
+
lineBreaks++;
|
|
9758
|
+
state.lineIndent = 0;
|
|
9759
|
+
while(32 === ch){
|
|
9760
|
+
state.lineIndent++;
|
|
9761
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9762
|
+
}
|
|
9763
|
+
} else break;
|
|
9764
|
+
}
|
|
9765
|
+
if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
|
|
9766
|
+
return lineBreaks;
|
|
9767
|
+
}
|
|
9768
|
+
function testDocumentSeparator(state) {
|
|
9769
|
+
let _position = state.position;
|
|
9770
|
+
let ch = state.input.charCodeAt(_position);
|
|
9771
|
+
if ((45 === ch || 46 === ch) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
9772
|
+
_position += 3;
|
|
9773
|
+
ch = state.input.charCodeAt(_position);
|
|
9774
|
+
if (0 === ch || isWsOrEol(ch)) return true;
|
|
9715
9775
|
}
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9776
|
+
return false;
|
|
9777
|
+
}
|
|
9778
|
+
function writeFoldedLines(state, count) {
|
|
9779
|
+
if (1 === count) state.result += " ";
|
|
9780
|
+
else if (count > 1) state.result += common2.repeat("\n", count - 1);
|
|
9781
|
+
}
|
|
9782
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
9783
|
+
let captureStart;
|
|
9784
|
+
let captureEnd;
|
|
9785
|
+
let hasPendingContent;
|
|
9786
|
+
let _line;
|
|
9787
|
+
let _lineStart;
|
|
9788
|
+
let _lineIndent;
|
|
9789
|
+
const _kind = state.kind;
|
|
9790
|
+
const _result = state.result;
|
|
9791
|
+
let ch = state.input.charCodeAt(state.position);
|
|
9792
|
+
if (isWsOrEol(ch) || isFlowIndicator(ch) || 35 === ch || 38 === ch || 42 === ch || 33 === ch || 124 === ch || 62 === ch || 39 === ch || 34 === ch || 37 === ch || 64 === ch || 96 === ch) return false;
|
|
9793
|
+
if (63 === ch || 45 === ch) {
|
|
9794
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
9795
|
+
if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) return false;
|
|
9796
|
+
}
|
|
9797
|
+
state.kind = "scalar";
|
|
9798
|
+
state.result = "";
|
|
9799
|
+
captureStart = captureEnd = state.position;
|
|
9800
|
+
hasPendingContent = false;
|
|
9801
|
+
while(0 !== ch){
|
|
9802
|
+
if (58 === ch) {
|
|
9803
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
9804
|
+
if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) break;
|
|
9805
|
+
} else if (35 === ch) {
|
|
9806
|
+
const preceding = state.input.charCodeAt(state.position - 1);
|
|
9807
|
+
if (isWsOrEol(preceding)) break;
|
|
9808
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && isFlowIndicator(ch)) break;
|
|
9809
|
+
else if (isEol(ch)) {
|
|
9810
|
+
_line = state.line;
|
|
9811
|
+
_lineStart = state.lineStart;
|
|
9812
|
+
_lineIndent = state.lineIndent;
|
|
9813
|
+
skipSeparationSpace(state, false, -1);
|
|
9814
|
+
if (state.lineIndent >= nodeIndent) {
|
|
9815
|
+
hasPendingContent = true;
|
|
9816
|
+
ch = state.input.charCodeAt(state.position);
|
|
9817
|
+
continue;
|
|
9818
|
+
}
|
|
9819
|
+
state.position = captureEnd;
|
|
9820
|
+
state.line = _line;
|
|
9821
|
+
state.lineStart = _lineStart;
|
|
9822
|
+
state.lineIndent = _lineIndent;
|
|
9823
|
+
break;
|
|
9720
9824
|
}
|
|
9721
|
-
|
|
9825
|
+
if (hasPendingContent) {
|
|
9826
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
9827
|
+
writeFoldedLines(state, state.line - _line);
|
|
9828
|
+
captureStart = captureEnd = state.position;
|
|
9829
|
+
hasPendingContent = false;
|
|
9830
|
+
}
|
|
9831
|
+
if (!isWhiteSpace(ch)) captureEnd = state.position + 1;
|
|
9832
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9722
9833
|
}
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
captureStart = state.position;
|
|
9737
|
-
while(!is_EOL(ch) && 0 !== ch)ch = state.input.charCodeAt(++state.position);
|
|
9738
|
-
captureSegment(state, captureStart, state.position, false);
|
|
9739
|
-
}
|
|
9740
|
-
return true;
|
|
9741
|
-
}
|
|
9742
|
-
function readBlockSequence(state, nodeIndent) {
|
|
9743
|
-
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
9744
|
-
if (-1 !== state.firstTabInLine) return false;
|
|
9745
|
-
if (null !== state.anchor) state.anchorMap[state.anchor] = _result;
|
|
9746
|
-
ch = state.input.charCodeAt(state.position);
|
|
9747
|
-
while(0 !== ch){
|
|
9748
|
-
if (-1 !== state.firstTabInLine) {
|
|
9749
|
-
state.position = state.firstTabInLine;
|
|
9750
|
-
throwError(state, 'tab characters must not be used in indentation');
|
|
9751
|
-
}
|
|
9752
|
-
if (0x2D !== ch) break;
|
|
9753
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
9754
|
-
if (!is_WS_OR_EOL(following)) break;
|
|
9755
|
-
detected = true;
|
|
9834
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
9835
|
+
if (state.result) return true;
|
|
9836
|
+
state.kind = _kind;
|
|
9837
|
+
state.result = _result;
|
|
9838
|
+
return false;
|
|
9839
|
+
}
|
|
9840
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
9841
|
+
let captureStart;
|
|
9842
|
+
let captureEnd;
|
|
9843
|
+
let ch = state.input.charCodeAt(state.position);
|
|
9844
|
+
if (39 !== ch) return false;
|
|
9845
|
+
state.kind = "scalar";
|
|
9846
|
+
state.result = "";
|
|
9756
9847
|
state.position++;
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9848
|
+
captureStart = captureEnd = state.position;
|
|
9849
|
+
while(0 !== (ch = state.input.charCodeAt(state.position)))if (39 === ch) {
|
|
9850
|
+
captureSegment(state, captureStart, state.position, true);
|
|
9851
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9852
|
+
if (39 !== ch) return true;
|
|
9853
|
+
captureStart = state.position;
|
|
9854
|
+
state.position++;
|
|
9855
|
+
captureEnd = state.position;
|
|
9856
|
+
} else if (isEol(ch)) {
|
|
9857
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
9858
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
9859
|
+
captureStart = captureEnd = state.position;
|
|
9860
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
9861
|
+
else {
|
|
9862
|
+
state.position++;
|
|
9863
|
+
if (!isWhiteSpace(ch)) captureEnd = state.position;
|
|
9864
|
+
}
|
|
9865
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
9866
|
+
}
|
|
9867
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
9868
|
+
let captureStart;
|
|
9869
|
+
let captureEnd;
|
|
9870
|
+
let tmp;
|
|
9871
|
+
let ch = state.input.charCodeAt(state.position);
|
|
9872
|
+
if (34 !== ch) return false;
|
|
9873
|
+
state.kind = "scalar";
|
|
9874
|
+
state.result = "";
|
|
9875
|
+
state.position++;
|
|
9876
|
+
captureStart = captureEnd = state.position;
|
|
9877
|
+
while(0 !== (ch = state.input.charCodeAt(state.position)))if (34 === ch) {
|
|
9878
|
+
captureSegment(state, captureStart, state.position, true);
|
|
9879
|
+
state.position++;
|
|
9880
|
+
return true;
|
|
9881
|
+
} else if (92 === ch) {
|
|
9882
|
+
captureSegment(state, captureStart, state.position, true);
|
|
9883
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9884
|
+
if (isEol(ch)) skipSeparationSpace(state, false, nodeIndent);
|
|
9885
|
+
else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
9886
|
+
state.result += simpleEscapeMap[ch];
|
|
9887
|
+
state.position++;
|
|
9888
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
9889
|
+
let hexLength = tmp;
|
|
9890
|
+
let hexResult = 0;
|
|
9891
|
+
for(; hexLength > 0; hexLength--){
|
|
9892
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9893
|
+
if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
|
|
9894
|
+
else throwError(state, "expected hexadecimal character");
|
|
9895
|
+
}
|
|
9896
|
+
state.result += charFromCodepoint(hexResult);
|
|
9897
|
+
state.position++;
|
|
9898
|
+
} else throwError(state, "unknown escape sequence");
|
|
9899
|
+
captureStart = captureEnd = state.position;
|
|
9900
|
+
} else if (isEol(ch)) {
|
|
9901
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
9902
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
9903
|
+
captureStart = captureEnd = state.position;
|
|
9904
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
9905
|
+
else {
|
|
9906
|
+
state.position++;
|
|
9907
|
+
if (!isWhiteSpace(ch)) captureEnd = state.position;
|
|
9908
|
+
}
|
|
9909
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
9910
|
+
}
|
|
9911
|
+
function readFlowCollection(state, nodeIndent) {
|
|
9912
|
+
let readNext = true;
|
|
9913
|
+
let _line;
|
|
9914
|
+
let _lineStart;
|
|
9915
|
+
let _pos;
|
|
9916
|
+
const _tag = state.tag;
|
|
9917
|
+
let _result;
|
|
9918
|
+
const _anchor = state.anchor;
|
|
9919
|
+
let terminator;
|
|
9920
|
+
let isPair;
|
|
9921
|
+
let isExplicitPair;
|
|
9922
|
+
let isMapping;
|
|
9923
|
+
const overridableKeys = /* @__PURE__ */ Object.create(null);
|
|
9924
|
+
let keyNode;
|
|
9925
|
+
let keyTag;
|
|
9926
|
+
let valueNode;
|
|
9927
|
+
let ch = state.input.charCodeAt(state.position);
|
|
9928
|
+
if (91 === ch) {
|
|
9929
|
+
terminator = 93;
|
|
9930
|
+
isMapping = false;
|
|
9931
|
+
_result = [];
|
|
9932
|
+
} else {
|
|
9933
|
+
if (123 !== ch) return false;
|
|
9934
|
+
terminator = 125;
|
|
9935
|
+
isMapping = true;
|
|
9936
|
+
_result = {};
|
|
9937
|
+
}
|
|
9938
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
|
|
9939
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9940
|
+
while(0 !== ch){
|
|
9941
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
9942
|
+
ch = state.input.charCodeAt(state.position);
|
|
9943
|
+
if (ch === terminator) {
|
|
9944
|
+
state.position++;
|
|
9945
|
+
state.tag = _tag;
|
|
9946
|
+
state.anchor = _anchor;
|
|
9947
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
9948
|
+
state.result = _result;
|
|
9949
|
+
return true;
|
|
9950
|
+
}
|
|
9951
|
+
if (readNext) {
|
|
9952
|
+
if (44 === ch) throwError(state, "expected the node content, but found ','");
|
|
9953
|
+
} else throwError(state, "missed comma between flow collection entries");
|
|
9954
|
+
keyTag = keyNode = valueNode = null;
|
|
9955
|
+
isPair = isExplicitPair = false;
|
|
9956
|
+
if (63 === ch) {
|
|
9957
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
9958
|
+
if (isWsOrEol(following)) {
|
|
9959
|
+
isPair = isExplicitPair = true;
|
|
9960
|
+
state.position++;
|
|
9961
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
_line = state.line;
|
|
9965
|
+
_lineStart = state.lineStart;
|
|
9966
|
+
_pos = state.position;
|
|
9967
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
9968
|
+
keyTag = state.tag;
|
|
9969
|
+
keyNode = state.result;
|
|
9970
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
9971
|
+
ch = state.input.charCodeAt(state.position);
|
|
9972
|
+
if ((isExplicitPair || state.line === _line) && 58 === ch) {
|
|
9973
|
+
isPair = true;
|
|
9974
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9975
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
9976
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
9977
|
+
valueNode = state.result;
|
|
9978
|
+
}
|
|
9979
|
+
if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
9980
|
+
else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
9981
|
+
else _result.push(keyNode);
|
|
9982
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
9983
|
+
ch = state.input.charCodeAt(state.position);
|
|
9984
|
+
if (44 === ch) {
|
|
9985
|
+
readNext = true;
|
|
9986
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9987
|
+
} else readNext = false;
|
|
9988
|
+
}
|
|
9989
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
9990
|
+
}
|
|
9991
|
+
function readBlockScalar(state, nodeIndent) {
|
|
9992
|
+
let folding;
|
|
9993
|
+
let chomping = CHOMPING_CLIP;
|
|
9994
|
+
let didReadContent = false;
|
|
9995
|
+
let detectedIndent = false;
|
|
9996
|
+
let textIndent = nodeIndent;
|
|
9997
|
+
let emptyLines = 0;
|
|
9998
|
+
let atMoreIndented = false;
|
|
9999
|
+
let tmp;
|
|
10000
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10001
|
+
if (124 === ch) folding = false;
|
|
10002
|
+
else {
|
|
10003
|
+
if (62 !== ch) return false;
|
|
10004
|
+
folding = true;
|
|
10005
|
+
}
|
|
10006
|
+
state.kind = "scalar";
|
|
10007
|
+
state.result = "";
|
|
10008
|
+
while(0 !== ch){
|
|
10009
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10010
|
+
if (43 === ch || 45 === ch) if (CHOMPING_CLIP === chomping) chomping = 43 === ch ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
10011
|
+
else throwError(state, "repeat of a chomping mode identifier");
|
|
10012
|
+
else if ((tmp = fromDecimalCode(ch)) >= 0) if (0 === tmp) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
10013
|
+
else if (detectedIndent) throwError(state, "repeat of an indentation width identifier");
|
|
10014
|
+
else {
|
|
10015
|
+
textIndent = nodeIndent + tmp - 1;
|
|
10016
|
+
detectedIndent = true;
|
|
10017
|
+
}
|
|
10018
|
+
else break;
|
|
10019
|
+
}
|
|
10020
|
+
if (isWhiteSpace(ch)) {
|
|
10021
|
+
do ch = state.input.charCodeAt(++state.position);
|
|
10022
|
+
while (isWhiteSpace(ch));
|
|
10023
|
+
if (35 === ch) do ch = state.input.charCodeAt(++state.position);
|
|
10024
|
+
while (!isEol(ch) && 0 !== ch);
|
|
10025
|
+
}
|
|
10026
|
+
while(0 !== ch){
|
|
10027
|
+
readLineBreak(state);
|
|
10028
|
+
state.lineIndent = 0;
|
|
10029
|
+
ch = state.input.charCodeAt(state.position);
|
|
10030
|
+
while((!detectedIndent || state.lineIndent < textIndent) && 32 === ch){
|
|
10031
|
+
state.lineIndent++;
|
|
10032
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10033
|
+
}
|
|
10034
|
+
if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
|
|
10035
|
+
if (isEol(ch)) {
|
|
10036
|
+
emptyLines++;
|
|
9761
10037
|
continue;
|
|
9762
10038
|
}
|
|
10039
|
+
if (!detectedIndent && 0 === textIndent) throwError(state, "missing indentation for block scalar");
|
|
10040
|
+
if (state.lineIndent < textIndent) {
|
|
10041
|
+
if (chomping === CHOMPING_KEEP) state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
10042
|
+
else if (chomping === CHOMPING_CLIP) {
|
|
10043
|
+
if (didReadContent) state.result += "\n";
|
|
10044
|
+
}
|
|
10045
|
+
break;
|
|
10046
|
+
}
|
|
10047
|
+
if (folding) if (isWhiteSpace(ch)) {
|
|
10048
|
+
atMoreIndented = true;
|
|
10049
|
+
state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
10050
|
+
} else if (atMoreIndented) {
|
|
10051
|
+
atMoreIndented = false;
|
|
10052
|
+
state.result += common2.repeat("\n", emptyLines + 1);
|
|
10053
|
+
} else if (0 === emptyLines) {
|
|
10054
|
+
if (didReadContent) state.result += " ";
|
|
10055
|
+
} else state.result += common2.repeat("\n", emptyLines);
|
|
10056
|
+
else state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
10057
|
+
didReadContent = true;
|
|
10058
|
+
detectedIndent = true;
|
|
10059
|
+
emptyLines = 0;
|
|
10060
|
+
const captureStart = state.position;
|
|
10061
|
+
while(!isEol(ch) && 0 !== ch)ch = state.input.charCodeAt(++state.position);
|
|
10062
|
+
captureSegment(state, captureStart, state.position, false);
|
|
9763
10063
|
}
|
|
9764
|
-
_line = state.line;
|
|
9765
|
-
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
9766
|
-
_result.push(state.result);
|
|
9767
|
-
skipSeparationSpace(state, true, -1);
|
|
9768
|
-
ch = state.input.charCodeAt(state.position);
|
|
9769
|
-
if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, 'bad indentation of a sequence entry');
|
|
9770
|
-
else if (state.lineIndent < nodeIndent) break;
|
|
9771
|
-
}
|
|
9772
|
-
if (detected) {
|
|
9773
|
-
state.tag = _tag;
|
|
9774
|
-
state.anchor = _anchor;
|
|
9775
|
-
state.kind = 'sequence';
|
|
9776
|
-
state.result = _result;
|
|
9777
10064
|
return true;
|
|
9778
10065
|
}
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
if (
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
10066
|
+
function readBlockSequence(state, nodeIndent) {
|
|
10067
|
+
const _tag = state.tag;
|
|
10068
|
+
const _anchor = state.anchor;
|
|
10069
|
+
const _result = [];
|
|
10070
|
+
let detected = false;
|
|
10071
|
+
if (-1 !== state.firstTabInLine) return false;
|
|
10072
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
|
|
10073
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10074
|
+
while(0 !== ch){
|
|
10075
|
+
if (-1 !== state.firstTabInLine) {
|
|
10076
|
+
state.position = state.firstTabInLine;
|
|
10077
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
10078
|
+
}
|
|
10079
|
+
if (45 !== ch) break;
|
|
10080
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
10081
|
+
if (!isWsOrEol(following)) break;
|
|
10082
|
+
detected = true;
|
|
10083
|
+
state.position++;
|
|
10084
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
10085
|
+
if (state.lineIndent <= nodeIndent) {
|
|
10086
|
+
_result.push(null);
|
|
10087
|
+
ch = state.input.charCodeAt(state.position);
|
|
10088
|
+
continue;
|
|
9798
10089
|
}
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
state.
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
10090
|
+
}
|
|
10091
|
+
const _line = state.line;
|
|
10092
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
10093
|
+
_result.push(state.result);
|
|
10094
|
+
skipSeparationSpace(state, true, -1);
|
|
10095
|
+
ch = state.input.charCodeAt(state.position);
|
|
10096
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, "bad indentation of a sequence entry");
|
|
10097
|
+
else if (state.lineIndent < nodeIndent) break;
|
|
10098
|
+
}
|
|
10099
|
+
if (detected) {
|
|
10100
|
+
state.tag = _tag;
|
|
10101
|
+
state.anchor = _anchor;
|
|
10102
|
+
state.kind = "sequence";
|
|
10103
|
+
state.result = _result;
|
|
10104
|
+
return true;
|
|
10105
|
+
}
|
|
10106
|
+
return false;
|
|
10107
|
+
}
|
|
10108
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
10109
|
+
let allowCompact;
|
|
10110
|
+
let _keyLine;
|
|
10111
|
+
let _keyLineStart;
|
|
10112
|
+
let _keyPos;
|
|
10113
|
+
const _tag = state.tag;
|
|
10114
|
+
const _anchor = state.anchor;
|
|
10115
|
+
const _result = {};
|
|
10116
|
+
const overridableKeys = /* @__PURE__ */ Object.create(null);
|
|
10117
|
+
let keyTag = null;
|
|
10118
|
+
let keyNode = null;
|
|
10119
|
+
let valueNode = null;
|
|
10120
|
+
let atExplicitKey = false;
|
|
10121
|
+
let detected = false;
|
|
10122
|
+
if (-1 !== state.firstTabInLine) return false;
|
|
10123
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
|
|
10124
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10125
|
+
while(0 !== ch){
|
|
10126
|
+
if (!atExplicitKey && -1 !== state.firstTabInLine) {
|
|
10127
|
+
state.position = state.firstTabInLine;
|
|
10128
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
10129
|
+
}
|
|
10130
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
10131
|
+
const _line = state.line;
|
|
10132
|
+
if ((63 === ch || 58 === ch) && isWsOrEol(following)) {
|
|
10133
|
+
if (63 === ch) {
|
|
9819
10134
|
if (atExplicitKey) {
|
|
9820
10135
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
9821
10136
|
keyTag = keyNode = valueNode = null;
|
|
9822
10137
|
}
|
|
9823
10138
|
detected = true;
|
|
10139
|
+
atExplicitKey = true;
|
|
10140
|
+
allowCompact = true;
|
|
10141
|
+
} else if (atExplicitKey) {
|
|
9824
10142
|
atExplicitKey = false;
|
|
9825
|
-
allowCompact =
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
10143
|
+
allowCompact = true;
|
|
10144
|
+
} else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
10145
|
+
state.position += 1;
|
|
10146
|
+
ch = following;
|
|
10147
|
+
} else {
|
|
10148
|
+
_keyLine = state.line;
|
|
10149
|
+
_keyLineStart = state.lineStart;
|
|
10150
|
+
_keyPos = state.position;
|
|
10151
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
|
|
10152
|
+
if (state.line === _line) {
|
|
10153
|
+
ch = state.input.charCodeAt(state.position);
|
|
10154
|
+
while(isWhiteSpace(ch))ch = state.input.charCodeAt(++state.position);
|
|
10155
|
+
if (58 === ch) {
|
|
10156
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10157
|
+
if (!isWsOrEol(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
10158
|
+
if (atExplicitKey) {
|
|
10159
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
10160
|
+
keyTag = keyNode = valueNode = null;
|
|
10161
|
+
}
|
|
10162
|
+
detected = true;
|
|
10163
|
+
atExplicitKey = false;
|
|
10164
|
+
allowCompact = false;
|
|
10165
|
+
keyTag = state.tag;
|
|
10166
|
+
keyNode = state.result;
|
|
10167
|
+
} else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
10168
|
+
else {
|
|
10169
|
+
state.tag = _tag;
|
|
10170
|
+
state.anchor = _anchor;
|
|
10171
|
+
return true;
|
|
10172
|
+
}
|
|
10173
|
+
} else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
9829
10174
|
else {
|
|
9830
10175
|
state.tag = _tag;
|
|
9831
10176
|
state.anchor = _anchor;
|
|
9832
10177
|
return true;
|
|
9833
10178
|
}
|
|
9834
|
-
} else if (detected) throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
|
|
9835
|
-
else {
|
|
9836
|
-
state.tag = _tag;
|
|
9837
|
-
state.anchor = _anchor;
|
|
9838
|
-
return true;
|
|
9839
10179
|
}
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
10180
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
10181
|
+
if (atExplicitKey) {
|
|
10182
|
+
_keyLine = state.line;
|
|
10183
|
+
_keyLineStart = state.lineStart;
|
|
10184
|
+
_keyPos = state.position;
|
|
10185
|
+
}
|
|
10186
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
|
|
10187
|
+
else valueNode = state.result;
|
|
10188
|
+
if (!atExplicitKey) {
|
|
10189
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
10190
|
+
keyTag = keyNode = valueNode = null;
|
|
10191
|
+
}
|
|
10192
|
+
skipSeparationSpace(state, true, -1);
|
|
10193
|
+
ch = state.input.charCodeAt(state.position);
|
|
9852
10194
|
}
|
|
9853
|
-
|
|
9854
|
-
|
|
10195
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, "bad indentation of a mapping entry");
|
|
10196
|
+
else if (state.lineIndent < nodeIndent) break;
|
|
9855
10197
|
}
|
|
9856
|
-
if ((state
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
state.result = _result;
|
|
10198
|
+
if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
10199
|
+
if (detected) {
|
|
10200
|
+
state.tag = _tag;
|
|
10201
|
+
state.anchor = _anchor;
|
|
10202
|
+
state.kind = "mapping";
|
|
10203
|
+
state.result = _result;
|
|
10204
|
+
}
|
|
10205
|
+
return detected;
|
|
9865
10206
|
}
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
if (0x3C === ch) {
|
|
9875
|
-
isVerbatim = true;
|
|
9876
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9877
|
-
} else if (0x21 === ch) {
|
|
9878
|
-
isNamed = true;
|
|
9879
|
-
tagHandle = '!!';
|
|
10207
|
+
function readTagProperty(state) {
|
|
10208
|
+
let isVerbatim = false;
|
|
10209
|
+
let isNamed = false;
|
|
10210
|
+
let tagHandle;
|
|
10211
|
+
let tagName;
|
|
10212
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10213
|
+
if (33 !== ch) return false;
|
|
10214
|
+
if (null !== state.tag) throwError(state, "duplication of a tag property");
|
|
9880
10215
|
ch = state.input.charCodeAt(++state.position);
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
if (isVerbatim) {
|
|
9884
|
-
do ch = state.input.charCodeAt(++state.position);
|
|
9885
|
-
while (0 !== ch && 0x3E !== ch);
|
|
9886
|
-
if (state.position < state.length) {
|
|
9887
|
-
tagName = state.input.slice(_position, state.position);
|
|
10216
|
+
if (60 === ch) {
|
|
10217
|
+
isVerbatim = true;
|
|
9888
10218
|
ch = state.input.charCodeAt(++state.position);
|
|
9889
|
-
} else
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
if (0x21 === ch) if (isNamed) throwError(state, 'tag suffix cannot contain exclamation marks');
|
|
9893
|
-
else {
|
|
9894
|
-
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
9895
|
-
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, 'named tag handle cannot contain such characters');
|
|
9896
|
-
isNamed = true;
|
|
9897
|
-
_position = state.position + 1;
|
|
9898
|
-
}
|
|
10219
|
+
} else if (33 === ch) {
|
|
10220
|
+
isNamed = true;
|
|
10221
|
+
tagHandle = "!!";
|
|
9899
10222
|
ch = state.input.charCodeAt(++state.position);
|
|
9900
|
-
}
|
|
9901
|
-
|
|
9902
|
-
if (
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
ch = state.input.charCodeAt(state.position);
|
|
9920
|
-
if (0x26 !== ch) return false;
|
|
9921
|
-
if (null !== state.anchor) throwError(state, 'duplication of an anchor property');
|
|
9922
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9923
|
-
_position = state.position;
|
|
9924
|
-
while(0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch))ch = state.input.charCodeAt(++state.position);
|
|
9925
|
-
if (state.position === _position) throwError(state, 'name of an anchor node must contain at least one character');
|
|
9926
|
-
state.anchor = state.input.slice(_position, state.position);
|
|
9927
|
-
return true;
|
|
9928
|
-
}
|
|
9929
|
-
function readAlias(state) {
|
|
9930
|
-
var _position, alias, ch;
|
|
9931
|
-
ch = state.input.charCodeAt(state.position);
|
|
9932
|
-
if (0x2A !== ch) return false;
|
|
9933
|
-
ch = state.input.charCodeAt(++state.position);
|
|
9934
|
-
_position = state.position;
|
|
9935
|
-
while(0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch))ch = state.input.charCodeAt(++state.position);
|
|
9936
|
-
if (state.position === _position) throwError(state, 'name of an alias node must contain at least one character');
|
|
9937
|
-
alias = state.input.slice(_position, state.position);
|
|
9938
|
-
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) throwError(state, 'unidentified alias "' + alias + '"');
|
|
9939
|
-
state.result = state.anchorMap[alias];
|
|
9940
|
-
skipSeparationSpace(state, true, -1);
|
|
9941
|
-
return true;
|
|
9942
|
-
}
|
|
9943
|
-
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
9944
|
-
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
|
|
9945
|
-
if (null !== state.listener) state.listener('open', state);
|
|
9946
|
-
state.tag = null;
|
|
9947
|
-
state.anchor = null;
|
|
9948
|
-
state.kind = null;
|
|
9949
|
-
state.result = null;
|
|
9950
|
-
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
9951
|
-
if (allowToSeek) {
|
|
9952
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
9953
|
-
atNewLine = true;
|
|
9954
|
-
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
9955
|
-
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
9956
|
-
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
9957
|
-
}
|
|
9958
|
-
}
|
|
9959
|
-
if (1 === indentStatus) while(readTagProperty(state) || readAnchorProperty(state))if (skipSeparationSpace(state, true, -1)) {
|
|
9960
|
-
atNewLine = true;
|
|
9961
|
-
allowBlockCollections = allowBlockStyles;
|
|
9962
|
-
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
9963
|
-
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
9964
|
-
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
9965
|
-
} else allowBlockCollections = false;
|
|
9966
|
-
if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
|
|
9967
|
-
if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
9968
|
-
flowIndent = CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext ? parentIndent : parentIndent + 1;
|
|
9969
|
-
blockIndent = state.position - state.lineStart;
|
|
9970
|
-
if (1 === indentStatus) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
|
|
9971
|
-
else {
|
|
9972
|
-
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
|
|
9973
|
-
else if (readAlias(state)) {
|
|
9974
|
-
hasContent = true;
|
|
9975
|
-
if (null !== state.tag || null !== state.anchor) throwError(state, 'alias node should not have any properties');
|
|
9976
|
-
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
9977
|
-
hasContent = true;
|
|
9978
|
-
if (null === state.tag) state.tag = '?';
|
|
9979
|
-
}
|
|
9980
|
-
if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
|
|
9981
|
-
}
|
|
9982
|
-
else if (0 === indentStatus) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
9983
|
-
}
|
|
9984
|
-
if (null === state.tag) {
|
|
9985
|
-
if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
|
|
9986
|
-
} else if ('?' === state.tag) {
|
|
9987
|
-
if (null !== state.result && 'scalar' !== state.kind) throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
9988
|
-
for(typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1){
|
|
9989
|
-
type = state.implicitTypes[typeIndex];
|
|
9990
|
-
if (type.resolve(state.result)) {
|
|
9991
|
-
state.result = type.construct(state.result);
|
|
9992
|
-
state.tag = type.tag;
|
|
9993
|
-
if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
|
|
9994
|
-
break;
|
|
10223
|
+
} else tagHandle = "!";
|
|
10224
|
+
let _position = state.position;
|
|
10225
|
+
if (isVerbatim) {
|
|
10226
|
+
do ch = state.input.charCodeAt(++state.position);
|
|
10227
|
+
while (0 !== ch && 62 !== ch);
|
|
10228
|
+
if (state.position < state.length) {
|
|
10229
|
+
tagName = state.input.slice(_position, state.position);
|
|
10230
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10231
|
+
} else throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
10232
|
+
} else {
|
|
10233
|
+
while(0 !== ch && !isWsOrEol(ch)){
|
|
10234
|
+
if (33 === ch) if (isNamed) throwError(state, "tag suffix cannot contain exclamation marks");
|
|
10235
|
+
else {
|
|
10236
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
10237
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
|
|
10238
|
+
isNamed = true;
|
|
10239
|
+
_position = state.position + 1;
|
|
10240
|
+
}
|
|
10241
|
+
ch = state.input.charCodeAt(++state.position);
|
|
9995
10242
|
}
|
|
10243
|
+
tagName = state.input.slice(_position, state.position);
|
|
10244
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
9996
10245
|
}
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
for(typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1)if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
10003
|
-
type = typeList[typeIndex];
|
|
10004
|
-
break;
|
|
10005
|
-
}
|
|
10246
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
10247
|
+
try {
|
|
10248
|
+
tagName = decodeURIComponent(tagName);
|
|
10249
|
+
} catch (err) {
|
|
10250
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
10006
10251
|
}
|
|
10007
|
-
if (
|
|
10008
|
-
if (
|
|
10009
|
-
if (
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10252
|
+
if (isVerbatim) state.tag = tagName;
|
|
10253
|
+
else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
|
|
10254
|
+
else if ("!" === tagHandle) state.tag = "!" + tagName;
|
|
10255
|
+
else if ("!!" === tagHandle) state.tag = "tag:yaml.org,2002:" + tagName;
|
|
10256
|
+
else throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
10257
|
+
return true;
|
|
10013
10258
|
}
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
10019
|
-
state.version = null;
|
|
10020
|
-
state.checkLineBreaks = state.legacy;
|
|
10021
|
-
state.tagMap = Object.create(null);
|
|
10022
|
-
state.anchorMap = Object.create(null);
|
|
10023
|
-
while(0 !== (ch = state.input.charCodeAt(state.position))){
|
|
10024
|
-
skipSeparationSpace(state, true, -1);
|
|
10025
|
-
ch = state.input.charCodeAt(state.position);
|
|
10026
|
-
if (state.lineIndent > 0 || 0x25 !== ch) break;
|
|
10027
|
-
hasDirectives = true;
|
|
10259
|
+
function readAnchorProperty(state) {
|
|
10260
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10261
|
+
if (38 !== ch) return false;
|
|
10262
|
+
if (null !== state.anchor) throwError(state, "duplication of an anchor property");
|
|
10028
10263
|
ch = state.input.charCodeAt(++state.position);
|
|
10029
|
-
_position = state.position;
|
|
10030
|
-
while(0 !== ch && !
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10264
|
+
const _position = state.position;
|
|
10265
|
+
while(0 !== ch && !isWsOrEol(ch) && !isFlowIndicator(ch))ch = state.input.charCodeAt(++state.position);
|
|
10266
|
+
if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
|
|
10267
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
10268
|
+
return true;
|
|
10269
|
+
}
|
|
10270
|
+
function readAlias(state) {
|
|
10271
|
+
let ch = state.input.charCodeAt(state.position);
|
|
10272
|
+
if (42 !== ch) return false;
|
|
10273
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10274
|
+
const _position = state.position;
|
|
10275
|
+
while(0 !== ch && !isWsOrEol(ch) && !isFlowIndicator(ch))ch = state.input.charCodeAt(++state.position);
|
|
10276
|
+
if (state.position === _position) throwError(state, "name of an alias node must contain at least one character");
|
|
10277
|
+
const alias = state.input.slice(_position, state.position);
|
|
10278
|
+
if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, 'unidentified alias "' + alias + '"');
|
|
10279
|
+
state.result = state.anchorMap[alias];
|
|
10280
|
+
skipSeparationSpace(state, true, -1);
|
|
10281
|
+
return true;
|
|
10282
|
+
}
|
|
10283
|
+
function tryReadBlockMappingFromProperty(state, propertyStart, nodeIndent, flowIndent) {
|
|
10284
|
+
const fallbackState = snapshotState(state);
|
|
10285
|
+
beginAnchorTransaction(state);
|
|
10286
|
+
restoreState(state, propertyStart);
|
|
10287
|
+
state.tag = null;
|
|
10288
|
+
state.anchor = null;
|
|
10289
|
+
state.kind = null;
|
|
10290
|
+
state.result = null;
|
|
10291
|
+
if (readBlockMapping(state, nodeIndent, flowIndent) && "mapping" === state.kind) {
|
|
10292
|
+
commitAnchorTransaction(state);
|
|
10293
|
+
return true;
|
|
10045
10294
|
}
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10295
|
+
rollbackAnchorTransaction(state);
|
|
10296
|
+
restoreState(state, fallbackState);
|
|
10297
|
+
return false;
|
|
10049
10298
|
}
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10299
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
10300
|
+
let allowBlockScalars;
|
|
10301
|
+
let allowBlockCollections;
|
|
10302
|
+
let indentStatus = 1;
|
|
10303
|
+
let atNewLine = false;
|
|
10304
|
+
let hasContent = false;
|
|
10305
|
+
let propertyStart = null;
|
|
10306
|
+
let type2;
|
|
10307
|
+
let flowIndent;
|
|
10308
|
+
let blockIndent;
|
|
10309
|
+
if (state.depth >= state.maxDepth) throwError(state, "nesting exceeded maxDepth (" + state.maxDepth + ")");
|
|
10310
|
+
state.depth += 1;
|
|
10311
|
+
if (null !== state.listener) state.listener("open", state);
|
|
10312
|
+
state.tag = null;
|
|
10313
|
+
state.anchor = null;
|
|
10314
|
+
state.kind = null;
|
|
10315
|
+
state.result = null;
|
|
10316
|
+
const allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
10317
|
+
if (allowToSeek) {
|
|
10318
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
10319
|
+
atNewLine = true;
|
|
10320
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
10321
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
10322
|
+
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
10323
|
+
}
|
|
10324
|
+
}
|
|
10325
|
+
if (1 === indentStatus) while(true){
|
|
10326
|
+
const ch = state.input.charCodeAt(state.position);
|
|
10327
|
+
const propertyState = snapshotState(state);
|
|
10328
|
+
if (atNewLine && (33 === ch && null !== state.tag || 38 === ch && null !== state.anchor)) break;
|
|
10329
|
+
if (!readTagProperty(state) && !readAnchorProperty(state)) break;
|
|
10330
|
+
if (null === propertyStart) propertyStart = propertyState;
|
|
10331
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
10332
|
+
atNewLine = true;
|
|
10333
|
+
allowBlockCollections = allowBlockStyles;
|
|
10334
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
10335
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
10336
|
+
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
10337
|
+
} else allowBlockCollections = false;
|
|
10338
|
+
}
|
|
10339
|
+
if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
|
|
10340
|
+
if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
10341
|
+
flowIndent = CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext ? parentIndent : parentIndent + 1;
|
|
10342
|
+
blockIndent = state.position - state.lineStart;
|
|
10343
|
+
if (1 === indentStatus) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
|
|
10344
|
+
else {
|
|
10345
|
+
const ch = state.input.charCodeAt(state.position);
|
|
10346
|
+
if (null !== propertyStart && allowBlockStyles && !allowBlockCollections && 124 !== ch && 62 !== ch && tryReadBlockMappingFromProperty(state, propertyStart, propertyStart.position - propertyStart.lineStart, flowIndent)) hasContent = true;
|
|
10347
|
+
else if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
|
|
10348
|
+
else if (readAlias(state)) {
|
|
10349
|
+
hasContent = true;
|
|
10350
|
+
if (null !== state.tag || null !== state.anchor) throwError(state, "alias node should not have any properties");
|
|
10351
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
10352
|
+
hasContent = true;
|
|
10353
|
+
if (null === state.tag) state.tag = "?";
|
|
10354
|
+
}
|
|
10355
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
|
|
10356
|
+
}
|
|
10357
|
+
else if (0 === indentStatus) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
10358
|
+
}
|
|
10359
|
+
if (null === state.tag) {
|
|
10360
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
|
|
10361
|
+
} else if ("?" === state.tag) {
|
|
10362
|
+
if (null !== state.result && "scalar" !== state.kind) throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
10363
|
+
for(let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1){
|
|
10364
|
+
type2 = state.implicitTypes[typeIndex];
|
|
10365
|
+
if (type2.resolve(state.result)) {
|
|
10366
|
+
state.result = type2.construct(state.result);
|
|
10367
|
+
state.tag = type2.tag;
|
|
10368
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
|
|
10369
|
+
break;
|
|
10370
|
+
}
|
|
10371
|
+
}
|
|
10372
|
+
} else if ("!" !== state.tag) {
|
|
10373
|
+
if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) type2 = state.typeMap[state.kind || "fallback"][state.tag];
|
|
10374
|
+
else {
|
|
10375
|
+
type2 = null;
|
|
10376
|
+
const typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
10377
|
+
for(let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1)if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
10378
|
+
type2 = typeList[typeIndex];
|
|
10379
|
+
break;
|
|
10380
|
+
}
|
|
10381
|
+
}
|
|
10382
|
+
if (!type2) throwError(state, "unknown tag !<" + state.tag + ">");
|
|
10383
|
+
if (null !== state.result && type2.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
|
|
10384
|
+
if (type2.resolve(state.result, state.tag)) {
|
|
10385
|
+
state.result = type2.construct(state.result, state.tag);
|
|
10386
|
+
if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
|
|
10387
|
+
} else throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
10388
|
+
}
|
|
10389
|
+
if (null !== state.listener) state.listener("close", state);
|
|
10390
|
+
state.depth -= 1;
|
|
10391
|
+
return null !== state.tag || null !== state.anchor || hasContent;
|
|
10392
|
+
}
|
|
10393
|
+
function readDocument(state) {
|
|
10394
|
+
const documentStart = state.position;
|
|
10395
|
+
let hasDirectives = false;
|
|
10396
|
+
let ch;
|
|
10397
|
+
state.version = null;
|
|
10398
|
+
state.checkLineBreaks = state.legacy;
|
|
10399
|
+
state.tagMap = /* @__PURE__ */ Object.create(null);
|
|
10400
|
+
state.anchorMap = /* @__PURE__ */ Object.create(null);
|
|
10401
|
+
while(0 !== (ch = state.input.charCodeAt(state.position))){
|
|
10402
|
+
skipSeparationSpace(state, true, -1);
|
|
10403
|
+
ch = state.input.charCodeAt(state.position);
|
|
10404
|
+
if (state.lineIndent > 0 || 37 !== ch) break;
|
|
10405
|
+
hasDirectives = true;
|
|
10406
|
+
ch = state.input.charCodeAt(++state.position);
|
|
10407
|
+
let _position = state.position;
|
|
10408
|
+
while(0 !== ch && !isWsOrEol(ch))ch = state.input.charCodeAt(++state.position);
|
|
10409
|
+
const directiveName = state.input.slice(_position, state.position);
|
|
10410
|
+
const directiveArgs = [];
|
|
10411
|
+
if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
|
|
10412
|
+
while(0 !== ch){
|
|
10413
|
+
while(isWhiteSpace(ch))ch = state.input.charCodeAt(++state.position);
|
|
10414
|
+
if (35 === ch) {
|
|
10415
|
+
do ch = state.input.charCodeAt(++state.position);
|
|
10416
|
+
while (0 !== ch && !isEol(ch));
|
|
10417
|
+
break;
|
|
10418
|
+
}
|
|
10419
|
+
if (isEol(ch)) break;
|
|
10420
|
+
_position = state.position;
|
|
10421
|
+
while(0 !== ch && !isWsOrEol(ch))ch = state.input.charCodeAt(++state.position);
|
|
10422
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
10423
|
+
}
|
|
10424
|
+
if (0 !== ch) readLineBreak(state);
|
|
10425
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
10426
|
+
else throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
10427
|
+
}
|
|
10053
10428
|
skipSeparationSpace(state, true, -1);
|
|
10054
|
-
|
|
10055
|
-
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
10056
|
-
skipSeparationSpace(state, true, -1);
|
|
10057
|
-
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, 'non-ASCII line breaks are interpreted as content');
|
|
10058
|
-
state.documents.push(state.result);
|
|
10059
|
-
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
10060
|
-
if (0x2E === state.input.charCodeAt(state.position)) {
|
|
10429
|
+
if (0 === state.lineIndent && 45 === state.input.charCodeAt(state.position) && 45 === state.input.charCodeAt(state.position + 1) && 45 === state.input.charCodeAt(state.position + 2)) {
|
|
10061
10430
|
state.position += 3;
|
|
10062
10431
|
skipSeparationSpace(state, true, -1);
|
|
10432
|
+
} else if (hasDirectives) throwError(state, "directives end mark is expected");
|
|
10433
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
10434
|
+
skipSeparationSpace(state, true, -1);
|
|
10435
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
10436
|
+
state.documents.push(state.result);
|
|
10437
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
10438
|
+
if (46 === state.input.charCodeAt(state.position)) {
|
|
10439
|
+
state.position += 3;
|
|
10440
|
+
skipSeparationSpace(state, true, -1);
|
|
10441
|
+
}
|
|
10442
|
+
return;
|
|
10063
10443
|
}
|
|
10064
|
-
|
|
10444
|
+
if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
|
|
10065
10445
|
}
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
state.
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
state.
|
|
10085
|
-
state.
|
|
10086
|
-
}
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
iterator
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
var
|
|
10107
|
-
var
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10446
|
+
function loadDocuments(input, options) {
|
|
10447
|
+
input = String(input);
|
|
10448
|
+
options = options || {};
|
|
10449
|
+
if (0 !== input.length) {
|
|
10450
|
+
if (10 !== input.charCodeAt(input.length - 1) && 13 !== input.charCodeAt(input.length - 1)) input += "\n";
|
|
10451
|
+
if (65279 === input.charCodeAt(0)) input = input.slice(1);
|
|
10452
|
+
}
|
|
10453
|
+
const state = new State(input, options);
|
|
10454
|
+
const nullpos = input.indexOf("\0");
|
|
10455
|
+
if (-1 !== nullpos) {
|
|
10456
|
+
state.position = nullpos;
|
|
10457
|
+
throwError(state, "null byte is not allowed in input");
|
|
10458
|
+
}
|
|
10459
|
+
state.input += "\0";
|
|
10460
|
+
while(32 === state.input.charCodeAt(state.position)){
|
|
10461
|
+
state.lineIndent += 1;
|
|
10462
|
+
state.position += 1;
|
|
10463
|
+
}
|
|
10464
|
+
while(state.position < state.length - 1)readDocument(state);
|
|
10465
|
+
return state.documents;
|
|
10466
|
+
}
|
|
10467
|
+
function loadAll2(input, iterator, options) {
|
|
10468
|
+
if (null !== iterator && "object" == typeof iterator && void 0 === options) {
|
|
10469
|
+
options = iterator;
|
|
10470
|
+
iterator = null;
|
|
10471
|
+
}
|
|
10472
|
+
const documents = loadDocuments(input, options);
|
|
10473
|
+
if ("function" != typeof iterator) return documents;
|
|
10474
|
+
for(let index = 0, length = documents.length; index < length; index += 1)iterator(documents[index]);
|
|
10475
|
+
}
|
|
10476
|
+
function load2(input, options) {
|
|
10477
|
+
const documents = loadDocuments(input, options);
|
|
10478
|
+
if (0 === documents.length) return;
|
|
10479
|
+
if (1 === documents.length) return documents[0];
|
|
10480
|
+
throw new YAMLException2("expected a single document in the stream, but found more");
|
|
10481
|
+
}
|
|
10482
|
+
loader.loadAll = loadAll2;
|
|
10483
|
+
loader.load = load2;
|
|
10484
|
+
return loader;
|
|
10485
|
+
}
|
|
10486
|
+
var dumper = {};
|
|
10487
|
+
var hasRequiredDumper;
|
|
10488
|
+
function requireDumper() {
|
|
10489
|
+
if (hasRequiredDumper) return dumper;
|
|
10490
|
+
hasRequiredDumper = 1;
|
|
10491
|
+
const common2 = requireCommon();
|
|
10492
|
+
const YAMLException2 = requireException();
|
|
10493
|
+
const DEFAULT_SCHEMA2 = require_default();
|
|
10494
|
+
const _toString = Object.prototype.toString;
|
|
10495
|
+
const _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
10496
|
+
const CHAR_BOM = 65279;
|
|
10497
|
+
const CHAR_TAB = 9;
|
|
10498
|
+
const CHAR_LINE_FEED = 10;
|
|
10499
|
+
const CHAR_CARRIAGE_RETURN = 13;
|
|
10500
|
+
const CHAR_SPACE = 32;
|
|
10501
|
+
const CHAR_EXCLAMATION = 33;
|
|
10502
|
+
const CHAR_DOUBLE_QUOTE = 34;
|
|
10503
|
+
const CHAR_SHARP = 35;
|
|
10504
|
+
const CHAR_PERCENT = 37;
|
|
10505
|
+
const CHAR_AMPERSAND = 38;
|
|
10506
|
+
const CHAR_SINGLE_QUOTE = 39;
|
|
10507
|
+
const CHAR_ASTERISK = 42;
|
|
10508
|
+
const CHAR_COMMA = 44;
|
|
10509
|
+
const CHAR_MINUS = 45;
|
|
10510
|
+
const CHAR_COLON = 58;
|
|
10511
|
+
const CHAR_EQUALS = 61;
|
|
10512
|
+
const CHAR_GREATER_THAN = 62;
|
|
10513
|
+
const CHAR_QUESTION = 63;
|
|
10514
|
+
const CHAR_COMMERCIAL_AT = 64;
|
|
10515
|
+
const CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
10516
|
+
const CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
10517
|
+
const CHAR_GRAVE_ACCENT = 96;
|
|
10518
|
+
const CHAR_LEFT_CURLY_BRACKET = 123;
|
|
10519
|
+
const CHAR_VERTICAL_LINE = 124;
|
|
10520
|
+
const CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
10521
|
+
const ESCAPE_SEQUENCES = {};
|
|
10522
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
10523
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
10524
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
10525
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
10526
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
10527
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
10528
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
10529
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
10530
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
10531
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
10532
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
10533
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
10534
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
10535
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
10536
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
10537
|
+
const DEPRECATED_BOOLEANS_SYNTAX = [
|
|
10538
|
+
"y",
|
|
10539
|
+
"Y",
|
|
10540
|
+
"yes",
|
|
10541
|
+
"Yes",
|
|
10542
|
+
"YES",
|
|
10543
|
+
"on",
|
|
10544
|
+
"On",
|
|
10545
|
+
"ON",
|
|
10546
|
+
"n",
|
|
10547
|
+
"N",
|
|
10548
|
+
"no",
|
|
10549
|
+
"No",
|
|
10550
|
+
"NO",
|
|
10551
|
+
"off",
|
|
10552
|
+
"Off",
|
|
10553
|
+
"OFF"
|
|
10554
|
+
];
|
|
10555
|
+
const DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
10556
|
+
function compileStyleMap(schema2, map2) {
|
|
10557
|
+
if (null === map2) return {};
|
|
10558
|
+
const result = {};
|
|
10559
|
+
const keys = Object.keys(map2);
|
|
10560
|
+
for(let index = 0, length = keys.length; index < length; index += 1){
|
|
10561
|
+
let tag = keys[index];
|
|
10562
|
+
let style = String(map2[tag]);
|
|
10563
|
+
if ("!!" === tag.slice(0, 2)) tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
10564
|
+
const type2 = schema2.compiledTypeMap["fallback"][tag];
|
|
10565
|
+
if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) style = type2.styleAliases[style];
|
|
10566
|
+
result[tag] = style;
|
|
10567
|
+
}
|
|
10568
|
+
return result;
|
|
10185
10569
|
}
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10570
|
+
function encodeHex(character) {
|
|
10571
|
+
let handle;
|
|
10572
|
+
let length;
|
|
10573
|
+
const string = character.toString(16).toUpperCase();
|
|
10574
|
+
if (character <= 255) {
|
|
10575
|
+
handle = "x";
|
|
10576
|
+
length = 2;
|
|
10577
|
+
} else if (character <= 65535) {
|
|
10578
|
+
handle = "u";
|
|
10579
|
+
length = 4;
|
|
10580
|
+
} else if (character <= 4294967295) {
|
|
10581
|
+
handle = "U";
|
|
10582
|
+
length = 8;
|
|
10583
|
+
} else throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
|
|
10584
|
+
return "\\" + handle + common2.repeat("0", length - string.length) + string;
|
|
10585
|
+
}
|
|
10586
|
+
const QUOTING_TYPE_SINGLE = 1;
|
|
10587
|
+
const QUOTING_TYPE_DOUBLE = 2;
|
|
10588
|
+
function State(options) {
|
|
10589
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA2;
|
|
10590
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
10591
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
10592
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
10593
|
+
this.flowLevel = common2.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
10594
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
10595
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
10596
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
10597
|
+
this.noRefs = options["noRefs"] || false;
|
|
10598
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
10599
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
10600
|
+
this.quotingType = '"' === options["quotingType"] ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
10601
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
10602
|
+
this.replacer = "function" == typeof options["replacer"] ? options["replacer"] : null;
|
|
10603
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
10604
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
10605
|
+
this.tag = null;
|
|
10606
|
+
this.result = "";
|
|
10607
|
+
this.duplicates = [];
|
|
10608
|
+
this.usedDuplicates = null;
|
|
10609
|
+
}
|
|
10610
|
+
function indentString(string, spaces) {
|
|
10611
|
+
const ind = common2.repeat(" ", spaces);
|
|
10612
|
+
let position = 0;
|
|
10613
|
+
let result = "";
|
|
10614
|
+
const length = string.length;
|
|
10615
|
+
while(position < length){
|
|
10616
|
+
let line;
|
|
10617
|
+
const next = string.indexOf("\n", position);
|
|
10618
|
+
if (-1 === next) {
|
|
10619
|
+
line = string.slice(position);
|
|
10620
|
+
position = length;
|
|
10621
|
+
} else {
|
|
10622
|
+
line = string.slice(position, next + 1);
|
|
10623
|
+
position = next + 1;
|
|
10624
|
+
}
|
|
10625
|
+
if (line.length && "\n" !== line) result += ind;
|
|
10626
|
+
result += line;
|
|
10236
10627
|
}
|
|
10237
|
-
|
|
10238
|
-
result += line;
|
|
10628
|
+
return result;
|
|
10239
10629
|
}
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
function generateNextLine(state, level) {
|
|
10243
|
-
return '\n' + common.repeat(' ', state.indent * level);
|
|
10244
|
-
}
|
|
10245
|
-
function testImplicitResolving(state, str) {
|
|
10246
|
-
var index, length, type;
|
|
10247
|
-
for(index = 0, length = state.implicitTypes.length; index < length; index += 1){
|
|
10248
|
-
type = state.implicitTypes[index];
|
|
10249
|
-
if (type.resolve(str)) return true;
|
|
10630
|
+
function generateNextLine(state, level) {
|
|
10631
|
+
return "\n" + common2.repeat(" ", state.indent * level);
|
|
10250
10632
|
}
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
return 0x00020 <= c && c <= 0x00007E || 0x000A1 <= c && c <= 0x00D7FF && 0x2028 !== c && 0x2029 !== c || 0x0E000 <= c && c <= 0x00FFFD && c !== CHAR_BOM || 0x10000 <= c && c <= 0x10FFFF;
|
|
10258
|
-
}
|
|
10259
|
-
function isNsCharOrWhitespace(c) {
|
|
10260
|
-
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
10261
|
-
}
|
|
10262
|
-
function isPlainSafe(c, prev, inblock) {
|
|
10263
|
-
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
10264
|
-
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
10265
|
-
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
10266
|
-
}
|
|
10267
|
-
function isPlainSafeFirst(c) {
|
|
10268
|
-
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
10269
|
-
}
|
|
10270
|
-
function isPlainSafeLast(c) {
|
|
10271
|
-
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
10272
|
-
}
|
|
10273
|
-
function codePointAt(string, pos) {
|
|
10274
|
-
var first = string.charCodeAt(pos), second;
|
|
10275
|
-
if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
|
|
10276
|
-
second = string.charCodeAt(pos + 1);
|
|
10277
|
-
if (second >= 0xDC00 && second <= 0xDFFF) return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
|
10278
|
-
}
|
|
10279
|
-
return first;
|
|
10280
|
-
}
|
|
10281
|
-
function needIndentIndicator(string) {
|
|
10282
|
-
var leadingSpaceRe = /^\n* /;
|
|
10283
|
-
return leadingSpaceRe.test(string);
|
|
10284
|
-
}
|
|
10285
|
-
var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
|
|
10286
|
-
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
10287
|
-
var i;
|
|
10288
|
-
var char = 0;
|
|
10289
|
-
var prevChar = null;
|
|
10290
|
-
var hasLineBreak = false;
|
|
10291
|
-
var hasFoldableLine = false;
|
|
10292
|
-
var shouldTrackWidth = -1 !== lineWidth;
|
|
10293
|
-
var previousLineBreak = -1;
|
|
10294
|
-
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
10295
|
-
if (singleLineOnly || forceQuotes) for(i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++){
|
|
10296
|
-
char = codePointAt(string, i);
|
|
10297
|
-
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
10298
|
-
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
10299
|
-
prevChar = char;
|
|
10633
|
+
function testImplicitResolving(state, str2) {
|
|
10634
|
+
for(let index = 0, length = state.implicitTypes.length; index < length; index += 1){
|
|
10635
|
+
const type2 = state.implicitTypes[index];
|
|
10636
|
+
if (type2.resolve(str2)) return true;
|
|
10637
|
+
}
|
|
10638
|
+
return false;
|
|
10300
10639
|
}
|
|
10301
|
-
|
|
10302
|
-
|
|
10640
|
+
function isWhitespace(c) {
|
|
10641
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
10642
|
+
}
|
|
10643
|
+
function isPrintable(c) {
|
|
10644
|
+
return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && 8232 !== c && 8233 !== c || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111;
|
|
10645
|
+
}
|
|
10646
|
+
function isNsCharOrWhitespace(c) {
|
|
10647
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
10648
|
+
}
|
|
10649
|
+
function isPlainSafe(c, prev, inblock) {
|
|
10650
|
+
const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
10651
|
+
const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
10652
|
+
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
10653
|
+
}
|
|
10654
|
+
function isPlainSafeFirst(c) {
|
|
10655
|
+
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
10656
|
+
}
|
|
10657
|
+
function isPlainSafeLast(c) {
|
|
10658
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
10659
|
+
}
|
|
10660
|
+
function codePointAt(string, pos) {
|
|
10661
|
+
const first = string.charCodeAt(pos);
|
|
10662
|
+
let second;
|
|
10663
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
10664
|
+
second = string.charCodeAt(pos + 1);
|
|
10665
|
+
if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
10666
|
+
}
|
|
10667
|
+
return first;
|
|
10668
|
+
}
|
|
10669
|
+
function needIndentIndicator(string) {
|
|
10670
|
+
const leadingSpaceRe = /^\n* /;
|
|
10671
|
+
return leadingSpaceRe.test(string);
|
|
10672
|
+
}
|
|
10673
|
+
const STYLE_PLAIN = 1;
|
|
10674
|
+
const STYLE_SINGLE = 2;
|
|
10675
|
+
const STYLE_LITERAL = 3;
|
|
10676
|
+
const STYLE_FOLDED = 4;
|
|
10677
|
+
const STYLE_DOUBLE = 5;
|
|
10678
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
10679
|
+
let i;
|
|
10680
|
+
let char = 0;
|
|
10681
|
+
let prevChar = null;
|
|
10682
|
+
let hasLineBreak = false;
|
|
10683
|
+
let hasFoldableLine = false;
|
|
10684
|
+
const shouldTrackWidth = -1 !== lineWidth;
|
|
10685
|
+
let previousLineBreak = -1;
|
|
10686
|
+
let plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
10687
|
+
if (singleLineOnly || forceQuotes) for(i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
|
|
10303
10688
|
char = codePointAt(string, i);
|
|
10304
|
-
if (char
|
|
10305
|
-
hasLineBreak = true;
|
|
10306
|
-
if (shouldTrackWidth) {
|
|
10307
|
-
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && ' ' !== string[previousLineBreak + 1];
|
|
10308
|
-
previousLineBreak = i;
|
|
10309
|
-
}
|
|
10310
|
-
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
10689
|
+
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
10311
10690
|
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
10312
10691
|
prevChar = char;
|
|
10313
10692
|
}
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10693
|
+
else {
|
|
10694
|
+
for(i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
|
|
10695
|
+
char = codePointAt(string, i);
|
|
10696
|
+
if (char === CHAR_LINE_FEED) {
|
|
10697
|
+
hasLineBreak = true;
|
|
10698
|
+
if (shouldTrackWidth) {
|
|
10699
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && " " !== string[previousLineBreak + 1];
|
|
10700
|
+
previousLineBreak = i;
|
|
10701
|
+
}
|
|
10702
|
+
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
10703
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
10704
|
+
prevChar = char;
|
|
10705
|
+
}
|
|
10706
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && " " !== string[previousLineBreak + 1];
|
|
10707
|
+
}
|
|
10708
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
10709
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN;
|
|
10710
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
10711
|
+
}
|
|
10712
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
|
|
10713
|
+
if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
10318
10714
|
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
10319
10715
|
}
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
default:
|
|
10348
|
-
throw new js_yaml_exception('impossible error: invalid scalar style');
|
|
10349
|
-
}
|
|
10350
|
-
}();
|
|
10351
|
-
}
|
|
10352
|
-
function blockHeader(string, indentPerLevel) {
|
|
10353
|
-
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
|
|
10354
|
-
var clip = '\n' === string[string.length - 1];
|
|
10355
|
-
var keep = clip && ('\n' === string[string.length - 2] || '\n' === string);
|
|
10356
|
-
var chomp = keep ? '+' : clip ? '' : '-';
|
|
10357
|
-
return indentIndicator + chomp + '\n';
|
|
10358
|
-
}
|
|
10359
|
-
function dropEndingNewline(string) {
|
|
10360
|
-
return '\n' === string[string.length - 1] ? string.slice(0, -1) : string;
|
|
10361
|
-
}
|
|
10362
|
-
function foldString(string, width) {
|
|
10363
|
-
var lineRe = /(\n+)([^\n]*)/g;
|
|
10364
|
-
var result = function() {
|
|
10365
|
-
var nextLF = string.indexOf('\n');
|
|
10366
|
-
nextLF = -1 !== nextLF ? nextLF : string.length;
|
|
10367
|
-
lineRe.lastIndex = nextLF;
|
|
10368
|
-
return foldLine(string.slice(0, nextLF), width);
|
|
10369
|
-
}();
|
|
10370
|
-
var prevMoreIndented = '\n' === string[0] || ' ' === string[0];
|
|
10371
|
-
var moreIndented;
|
|
10372
|
-
var match;
|
|
10373
|
-
while(match = lineRe.exec(string)){
|
|
10374
|
-
var prefix = match[1], line = match[2];
|
|
10375
|
-
moreIndented = ' ' === line[0];
|
|
10376
|
-
result += prefix + (prevMoreIndented || moreIndented || '' === line ? '' : '\n') + foldLine(line, width);
|
|
10377
|
-
prevMoreIndented = moreIndented;
|
|
10716
|
+
function writeScalar(state, string, level, iskey, inblock) {
|
|
10717
|
+
state.dump = function() {
|
|
10718
|
+
if (0 === string.length) return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
10719
|
+
if (!state.noCompatMode) {
|
|
10720
|
+
if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
|
|
10721
|
+
}
|
|
10722
|
+
const indent = state.indent * Math.max(1, level);
|
|
10723
|
+
const lineWidth = -1 === state.lineWidth ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
10724
|
+
const singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
10725
|
+
function testAmbiguity(string2) {
|
|
10726
|
+
return testImplicitResolving(state, string2);
|
|
10727
|
+
}
|
|
10728
|
+
switch(chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)){
|
|
10729
|
+
case STYLE_PLAIN:
|
|
10730
|
+
return string;
|
|
10731
|
+
case STYLE_SINGLE:
|
|
10732
|
+
return "'" + string.replace(/'/g, "''") + "'";
|
|
10733
|
+
case STYLE_LITERAL:
|
|
10734
|
+
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
10735
|
+
case STYLE_FOLDED:
|
|
10736
|
+
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
10737
|
+
case STYLE_DOUBLE:
|
|
10738
|
+
return '"' + escapeString(string) + '"';
|
|
10739
|
+
default:
|
|
10740
|
+
throw new YAMLException2("impossible error: invalid scalar style");
|
|
10741
|
+
}
|
|
10742
|
+
}();
|
|
10378
10743
|
}
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
if (!escapeSeq && isPrintable(char)) {
|
|
10409
|
-
result += string[i];
|
|
10410
|
-
if (char >= 0x10000) result += string[i + 1];
|
|
10411
|
-
} else result += escapeSeq || encodeHex(char);
|
|
10744
|
+
function blockHeader(string, indentPerLevel) {
|
|
10745
|
+
const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
10746
|
+
const clip = "\n" === string[string.length - 1];
|
|
10747
|
+
const keep = clip && ("\n" === string[string.length - 2] || "\n" === string);
|
|
10748
|
+
const chomp = keep ? "+" : clip ? "" : "-";
|
|
10749
|
+
return indentIndicator + chomp + "\n";
|
|
10750
|
+
}
|
|
10751
|
+
function dropEndingNewline(string) {
|
|
10752
|
+
return "\n" === string[string.length - 1] ? string.slice(0, -1) : string;
|
|
10753
|
+
}
|
|
10754
|
+
function foldString(string, width) {
|
|
10755
|
+
const lineRe = /(\n+)([^\n]*)/g;
|
|
10756
|
+
let result = function() {
|
|
10757
|
+
let nextLF = string.indexOf("\n");
|
|
10758
|
+
nextLF = -1 !== nextLF ? nextLF : string.length;
|
|
10759
|
+
lineRe.lastIndex = nextLF;
|
|
10760
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
10761
|
+
}();
|
|
10762
|
+
let prevMoreIndented = "\n" === string[0] || " " === string[0];
|
|
10763
|
+
let moreIndented;
|
|
10764
|
+
let match;
|
|
10765
|
+
while(match = lineRe.exec(string)){
|
|
10766
|
+
const prefix = match[1];
|
|
10767
|
+
const line = match[2];
|
|
10768
|
+
moreIndented = " " === line[0];
|
|
10769
|
+
result += prefix + (prevMoreIndented || moreIndented || "" === line ? "" : "\n") + foldLine(line, width);
|
|
10770
|
+
prevMoreIndented = moreIndented;
|
|
10771
|
+
}
|
|
10772
|
+
return result;
|
|
10412
10773
|
}
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
function writeBlockSequence(state, level, object, compact) {
|
|
10429
|
-
var _result = '', _tag = state.tag, index, length, value;
|
|
10430
|
-
for(index = 0, length = object.length; index < length; index += 1){
|
|
10431
|
-
value = object[index];
|
|
10432
|
-
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
10433
|
-
if (writeNode(state, level + 1, value, true, true, false, true) || void 0 === value && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
10434
|
-
if (!compact || '' !== _result) _result += generateNextLine(state, level);
|
|
10435
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += '-';
|
|
10436
|
-
else _result += '- ';
|
|
10437
|
-
_result += state.dump;
|
|
10438
|
-
}
|
|
10439
|
-
}
|
|
10440
|
-
state.tag = _tag;
|
|
10441
|
-
state.dump = _result || '[]';
|
|
10442
|
-
}
|
|
10443
|
-
function writeFlowMapping(state, level, object) {
|
|
10444
|
-
var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
10445
|
-
for(index = 0, length = objectKeyList.length; index < length; index += 1){
|
|
10446
|
-
pairBuffer = '';
|
|
10447
|
-
if ('' !== _result) pairBuffer += ', ';
|
|
10448
|
-
if (state.condenseFlow) pairBuffer += '"';
|
|
10449
|
-
objectKey = objectKeyList[index];
|
|
10450
|
-
objectValue = object[objectKey];
|
|
10451
|
-
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
10452
|
-
if (writeNode(state, level, objectKey, false, false)) {
|
|
10453
|
-
if (state.dump.length > 1024) pairBuffer += '? ';
|
|
10454
|
-
pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
|
|
10455
|
-
if (writeNode(state, level, objectValue, false, false)) {
|
|
10456
|
-
pairBuffer += state.dump;
|
|
10457
|
-
_result += pairBuffer;
|
|
10774
|
+
function foldLine(line, width) {
|
|
10775
|
+
if ("" === line || " " === line[0]) return line;
|
|
10776
|
+
const breakRe = / [^ ]/g;
|
|
10777
|
+
let match;
|
|
10778
|
+
let start = 0;
|
|
10779
|
+
let end;
|
|
10780
|
+
let curr = 0;
|
|
10781
|
+
let next = 0;
|
|
10782
|
+
let result = "";
|
|
10783
|
+
while(match = breakRe.exec(line)){
|
|
10784
|
+
next = match.index;
|
|
10785
|
+
if (next - start > width) {
|
|
10786
|
+
end = curr > start ? curr : next;
|
|
10787
|
+
result += "\n" + line.slice(start, end);
|
|
10788
|
+
start = end + 1;
|
|
10458
10789
|
}
|
|
10790
|
+
curr = next;
|
|
10791
|
+
}
|
|
10792
|
+
result += "\n";
|
|
10793
|
+
if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
10794
|
+
else result += line.slice(start);
|
|
10795
|
+
return result.slice(1);
|
|
10796
|
+
}
|
|
10797
|
+
function escapeString(string) {
|
|
10798
|
+
let result = "";
|
|
10799
|
+
let char = 0;
|
|
10800
|
+
for(let i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
|
|
10801
|
+
char = codePointAt(string, i);
|
|
10802
|
+
const escapeSeq = ESCAPE_SEQUENCES[char];
|
|
10803
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
10804
|
+
result += string[i];
|
|
10805
|
+
if (char >= 65536) result += string[i + 1];
|
|
10806
|
+
} else result += escapeSeq || encodeHex(char);
|
|
10459
10807
|
}
|
|
10808
|
+
return result;
|
|
10460
10809
|
}
|
|
10461
|
-
state
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10810
|
+
function writeFlowSequence(state, level, object) {
|
|
10811
|
+
let _result = "";
|
|
10812
|
+
const _tag = state.tag;
|
|
10813
|
+
for(let index = 0, length = object.length; index < length; index += 1){
|
|
10814
|
+
let value = object[index];
|
|
10815
|
+
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
10816
|
+
if (writeNode(state, level, value, false, false) || void 0 === value && writeNode(state, level, null, false, false)) {
|
|
10817
|
+
if ("" !== _result) _result += "," + (state.condenseFlow ? "" : " ");
|
|
10818
|
+
_result += state.dump;
|
|
10819
|
+
}
|
|
10820
|
+
}
|
|
10821
|
+
state.tag = _tag;
|
|
10822
|
+
state.dump = "[" + _result + "]";
|
|
10823
|
+
}
|
|
10824
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
10825
|
+
let _result = "";
|
|
10826
|
+
const _tag = state.tag;
|
|
10827
|
+
for(let index = 0, length = object.length; index < length; index += 1){
|
|
10828
|
+
let value = object[index];
|
|
10829
|
+
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
10830
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || void 0 === value && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
10831
|
+
if (!compact || "" !== _result) _result += generateNextLine(state, level);
|
|
10832
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
|
|
10833
|
+
else _result += "- ";
|
|
10834
|
+
_result += state.dump;
|
|
10835
|
+
}
|
|
10836
|
+
}
|
|
10837
|
+
state.tag = _tag;
|
|
10838
|
+
state.dump = _result || "[]";
|
|
10839
|
+
}
|
|
10840
|
+
function writeFlowMapping(state, level, object) {
|
|
10841
|
+
let _result = "";
|
|
10842
|
+
const _tag = state.tag;
|
|
10843
|
+
const objectKeyList = Object.keys(object);
|
|
10844
|
+
for(let index = 0, length = objectKeyList.length; index < length; index += 1){
|
|
10845
|
+
let pairBuffer = "";
|
|
10846
|
+
if ("" !== _result) pairBuffer += ", ";
|
|
10847
|
+
if (state.condenseFlow) pairBuffer += '"';
|
|
10848
|
+
const objectKey = objectKeyList[index];
|
|
10849
|
+
let objectValue = object[objectKey];
|
|
10850
|
+
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
10851
|
+
if (writeNode(state, level, objectKey, false, false)) {
|
|
10852
|
+
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
10853
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
10854
|
+
if (writeNode(state, level, objectValue, false, false)) {
|
|
10855
|
+
pairBuffer += state.dump;
|
|
10856
|
+
_result += pairBuffer;
|
|
10857
|
+
}
|
|
10858
|
+
}
|
|
10859
|
+
}
|
|
10860
|
+
state.tag = _tag;
|
|
10861
|
+
state.dump = "{" + _result + "}";
|
|
10862
|
+
}
|
|
10863
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
10864
|
+
let _result = "";
|
|
10865
|
+
const _tag = state.tag;
|
|
10866
|
+
const objectKeyList = Object.keys(object);
|
|
10867
|
+
if (true === state.sortKeys) objectKeyList.sort();
|
|
10868
|
+
else if ("function" == typeof state.sortKeys) objectKeyList.sort(state.sortKeys);
|
|
10869
|
+
else if (state.sortKeys) throw new YAMLException2("sortKeys must be a boolean or a function");
|
|
10870
|
+
for(let index = 0, length = objectKeyList.length; index < length; index += 1){
|
|
10871
|
+
let pairBuffer = "";
|
|
10872
|
+
if (!compact || "" !== _result) pairBuffer += generateNextLine(state, level);
|
|
10873
|
+
const objectKey = objectKeyList[index];
|
|
10874
|
+
let objectValue = object[objectKey];
|
|
10875
|
+
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
10876
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) continue;
|
|
10877
|
+
const explicitPair = null !== state.tag && "?" !== state.tag || state.dump && state.dump.length > 1024;
|
|
10878
|
+
if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
|
|
10879
|
+
else pairBuffer += "? ";
|
|
10479
10880
|
pairBuffer += state.dump;
|
|
10480
10881
|
if (explicitPair) pairBuffer += generateNextLine(state, level);
|
|
10481
10882
|
if (writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
10482
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer +=
|
|
10483
|
-
else pairBuffer +=
|
|
10883
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
|
|
10884
|
+
else pairBuffer += ": ";
|
|
10484
10885
|
pairBuffer += state.dump;
|
|
10485
10886
|
_result += pairBuffer;
|
|
10486
10887
|
}
|
|
10487
10888
|
}
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10889
|
+
state.tag = _tag;
|
|
10890
|
+
state.dump = _result || "{}";
|
|
10891
|
+
}
|
|
10892
|
+
function detectType(state, object, explicit) {
|
|
10893
|
+
const typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
10894
|
+
for(let index = 0, length = typeList.length; index < length; index += 1){
|
|
10895
|
+
const type2 = typeList[index];
|
|
10896
|
+
if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || "object" == typeof object && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
|
|
10897
|
+
if (explicit) if (type2.multi && type2.representName) state.tag = type2.representName(object);
|
|
10898
|
+
else state.tag = type2.tag;
|
|
10899
|
+
else state.tag = "?";
|
|
10900
|
+
if (type2.represent) {
|
|
10901
|
+
const style = state.styleMap[type2.tag] || type2.defaultStyle;
|
|
10902
|
+
let _result;
|
|
10903
|
+
if ("[object Function]" === _toString.call(type2.represent)) _result = type2.represent(object, style);
|
|
10904
|
+
else if (_hasOwnProperty.call(type2.represent, style)) _result = type2.represent[style](object, style);
|
|
10905
|
+
else throw new YAMLException2("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
|
|
10906
|
+
state.dump = _result;
|
|
10907
|
+
}
|
|
10908
|
+
return true;
|
|
10507
10909
|
}
|
|
10508
|
-
return true;
|
|
10509
10910
|
}
|
|
10911
|
+
return false;
|
|
10510
10912
|
}
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10913
|
+
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
10914
|
+
state.tag = null;
|
|
10915
|
+
state.dump = object;
|
|
10916
|
+
if (!detectType(state, object, false)) detectType(state, object, true);
|
|
10917
|
+
const type2 = _toString.call(state.dump);
|
|
10918
|
+
const inblock = block;
|
|
10919
|
+
if (block) block = state.flowLevel < 0 || state.flowLevel > level;
|
|
10920
|
+
const objectOrArray = "[object Object]" === type2 || "[object Array]" === type2;
|
|
10921
|
+
let duplicateIndex;
|
|
10922
|
+
let duplicate;
|
|
10923
|
+
if (objectOrArray) {
|
|
10924
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
10925
|
+
duplicate = -1 !== duplicateIndex;
|
|
10926
|
+
}
|
|
10927
|
+
if (null !== state.tag && "?" !== state.tag || duplicate || 2 !== state.indent && level > 0) compact = false;
|
|
10928
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
|
|
10929
|
+
else {
|
|
10930
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
|
|
10931
|
+
if ("[object Object]" === type2) if (block && 0 !== Object.keys(state.dump).length) {
|
|
10932
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
10933
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
10934
|
+
} else {
|
|
10935
|
+
writeFlowMapping(state, level, state.dump);
|
|
10936
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
10937
|
+
}
|
|
10938
|
+
else if ("[object Array]" === type2) if (block && 0 !== state.dump.length) {
|
|
10939
|
+
state.noArrayIndent && !isblockseq && level > 0 ? writeBlockSequence(state, level - 1, state.dump, compact) : writeBlockSequence(state, level, state.dump, compact);
|
|
10940
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
10941
|
+
} else {
|
|
10942
|
+
writeFlowSequence(state, level, state.dump);
|
|
10943
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
10944
|
+
}
|
|
10945
|
+
else if ("[object String]" === type2) {
|
|
10946
|
+
if ("?" !== state.tag) writeScalar(state, state.dump, level, iskey, inblock);
|
|
10947
|
+
} else {
|
|
10948
|
+
if ("[object Undefined]" === type2) return false;
|
|
10949
|
+
if (state.skipInvalid) return false;
|
|
10950
|
+
throw new YAMLException2("unacceptable kind of an object to dump " + type2);
|
|
10951
|
+
}
|
|
10952
|
+
if (null !== state.tag && "?" !== state.tag) {
|
|
10953
|
+
let tagStr = encodeURI("!" === state.tag[0] ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
10954
|
+
tagStr = "!" === state.tag[0] ? "!" + tagStr : "tag:yaml.org,2002:" === tagStr.slice(0, 18) ? "!!" + tagStr.slice(18) : "!<" + tagStr + ">";
|
|
10955
|
+
state.dump = tagStr + " " + state.dump;
|
|
10956
|
+
}
|
|
10543
10957
|
}
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
var objectKeyList, index, length;
|
|
10567
|
-
if (null !== object && 'object' == typeof object) {
|
|
10568
|
-
index = objects.indexOf(object);
|
|
10569
|
-
if (-1 !== index) {
|
|
10570
|
-
if (-1 === duplicatesIndexes.indexOf(index)) duplicatesIndexes.push(index);
|
|
10571
|
-
} else {
|
|
10572
|
-
objects.push(object);
|
|
10573
|
-
if (Array.isArray(object)) for(index = 0, length = object.length; index < length; index += 1)inspectNode(object[index], objects, duplicatesIndexes);
|
|
10574
|
-
else {
|
|
10575
|
-
objectKeyList = Object.keys(object);
|
|
10576
|
-
for(index = 0, length = objectKeyList.length; index < length; index += 1)inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
10958
|
+
return true;
|
|
10959
|
+
}
|
|
10960
|
+
function getDuplicateReferences(object, state) {
|
|
10961
|
+
const objects = [];
|
|
10962
|
+
const duplicatesIndexes = [];
|
|
10963
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
10964
|
+
const length = duplicatesIndexes.length;
|
|
10965
|
+
for(let index = 0; index < length; index += 1)state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
10966
|
+
state.usedDuplicates = new Array(length);
|
|
10967
|
+
}
|
|
10968
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
10969
|
+
if (null !== object && "object" == typeof object) {
|
|
10970
|
+
const index = objects.indexOf(object);
|
|
10971
|
+
if (-1 !== index) {
|
|
10972
|
+
if (-1 === duplicatesIndexes.indexOf(index)) duplicatesIndexes.push(index);
|
|
10973
|
+
} else {
|
|
10974
|
+
objects.push(object);
|
|
10975
|
+
if (Array.isArray(object)) for(let i = 0, length = object.length; i < length; i += 1)inspectNode(object[i], objects, duplicatesIndexes);
|
|
10976
|
+
else {
|
|
10977
|
+
const objectKeyList = Object.keys(object);
|
|
10978
|
+
for(let i = 0, length = objectKeyList.length; i < length; i += 1)inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes);
|
|
10979
|
+
}
|
|
10577
10980
|
}
|
|
10578
10981
|
}
|
|
10579
10982
|
}
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10983
|
+
function dump2(input, options) {
|
|
10984
|
+
options = options || {};
|
|
10985
|
+
const state = new State(options);
|
|
10986
|
+
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
10987
|
+
let value = input;
|
|
10988
|
+
if (state.replacer) value = state.replacer.call({
|
|
10989
|
+
"": value
|
|
10990
|
+
}, "", value);
|
|
10991
|
+
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
|
|
10992
|
+
return "";
|
|
10993
|
+
}
|
|
10994
|
+
dumper.dump = dump2;
|
|
10995
|
+
return dumper;
|
|
10996
|
+
}
|
|
10997
|
+
var hasRequiredJsYaml;
|
|
10998
|
+
function requireJsYaml() {
|
|
10999
|
+
if (hasRequiredJsYaml) return jsYaml;
|
|
11000
|
+
hasRequiredJsYaml = 1;
|
|
11001
|
+
const loader2 = requireLoader();
|
|
11002
|
+
const dumper2 = requireDumper();
|
|
11003
|
+
function renamed(from, to) {
|
|
11004
|
+
return function() {
|
|
11005
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
11006
|
+
};
|
|
11007
|
+
}
|
|
11008
|
+
jsYaml.Type = requireType();
|
|
11009
|
+
jsYaml.Schema = requireSchema();
|
|
11010
|
+
jsYaml.FAILSAFE_SCHEMA = requireFailsafe();
|
|
11011
|
+
jsYaml.JSON_SCHEMA = requireJson();
|
|
11012
|
+
jsYaml.CORE_SCHEMA = requireCore();
|
|
11013
|
+
jsYaml.DEFAULT_SCHEMA = require_default();
|
|
11014
|
+
jsYaml.load = loader2.load;
|
|
11015
|
+
jsYaml.loadAll = loader2.loadAll;
|
|
11016
|
+
jsYaml.dump = dumper2.dump;
|
|
11017
|
+
jsYaml.YAMLException = requireException();
|
|
11018
|
+
jsYaml.types = {
|
|
11019
|
+
binary: requireBinary(),
|
|
11020
|
+
float: requireFloat(),
|
|
11021
|
+
map: requireMap(),
|
|
11022
|
+
null: require_null(),
|
|
11023
|
+
pairs: requirePairs(),
|
|
11024
|
+
set: requireSet(),
|
|
11025
|
+
timestamp: requireTimestamp(),
|
|
11026
|
+
bool: requireBool(),
|
|
11027
|
+
int: requireInt(),
|
|
11028
|
+
merge: requireMerge(),
|
|
11029
|
+
omap: requireOmap(),
|
|
11030
|
+
seq: requireSeq(),
|
|
11031
|
+
str: requireStr()
|
|
10599
11032
|
};
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
11033
|
+
jsYaml.safeLoad = renamed("safeLoad", "load");
|
|
11034
|
+
jsYaml.safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
11035
|
+
jsYaml.safeDump = renamed("safeDump", "dump");
|
|
11036
|
+
return jsYaml;
|
|
11037
|
+
}
|
|
11038
|
+
var jsYamlExports = requireJsYaml();
|
|
11039
|
+
const yaml = /* @__PURE__ */ getDefaultExportFromCjs(jsYamlExports);
|
|
11040
|
+
const { Type, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load, loadAll, dump, YAMLException, types: js_yaml_types, safeLoad, safeLoadAll, safeDump } = yaml;
|
|
10608
11041
|
async function expandFilePatterns(patterns, basePath) {
|
|
10609
11042
|
const allFiles = [];
|
|
10610
11043
|
for (const pattern of patterns)try {
|