From 55cacde599beca94437d5e2b0024e9759f203207 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 13 Oct 2021 06:36:54 +0200 Subject: [PATCH] Fix yaml.dump --- dist/index.js | 1464 +++++++++++++++++++++++------------------------- src/labeler.ts | 2 +- 2 files changed, 707 insertions(+), 759 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7b10b97..59b5739 100644 --- a/dist/index.js +++ b/dist/index.js @@ -359,7 +359,7 @@ class Labeler { description: repoLabel.description }); } - core.info(`👉 Current labels\n${yaml.safeDump(labels).toString()}`); + core.info(`👉 Current labels\n${yaml.dump(labels).toString()}`); }); } logInfo(message) { @@ -5943,62 +5943,55 @@ function sync (path, options) { -var yaml = __webpack_require__(916); +var loader = __webpack_require__(1161); +var dumper = __webpack_require__(8866); -module.exports = yaml; - - -/***/ }), - -/***/ 916: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - - -var loader = __webpack_require__(5190); -var dumper = __webpack_require__(3034); - - -function deprecated(name) { +function renamed(from, to) { return function () { - throw new Error('Function ' + name + ' is deprecated and cannot be used.'); + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); }; } -module.exports.Type = __webpack_require__(967); -module.exports.Schema = __webpack_require__(6514); -module.exports.FAILSAFE_SCHEMA = __webpack_require__(6037); -module.exports.JSON_SCHEMA = __webpack_require__(1571); -module.exports.CORE_SCHEMA = __webpack_require__(2183); -module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); -module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(6874); +module.exports.Type = __webpack_require__(6073); +module.exports.Schema = __webpack_require__(1082); +module.exports.FAILSAFE_SCHEMA = __webpack_require__(8562); +module.exports.JSON_SCHEMA = __webpack_require__(1035); +module.exports.CORE_SCHEMA = __webpack_require__(2011); +module.exports.DEFAULT_SCHEMA = __webpack_require__(8759); module.exports.load = loader.load; module.exports.loadAll = loader.loadAll; -module.exports.safeLoad = loader.safeLoad; -module.exports.safeLoadAll = loader.safeLoadAll; module.exports.dump = dumper.dump; -module.exports.safeDump = dumper.safeDump; -module.exports.YAMLException = __webpack_require__(5199); - -// Deprecated schema names from JS-YAML 2.0.x -module.exports.MINIMAL_SCHEMA = __webpack_require__(6037); -module.exports.SAFE_SCHEMA = __webpack_require__(8949); -module.exports.DEFAULT_SCHEMA = __webpack_require__(6874); +module.exports.YAMLException = __webpack_require__(8179); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: __webpack_require__(7900), + float: __webpack_require__(2705), + map: __webpack_require__(6150), + null: __webpack_require__(721), + pairs: __webpack_require__(6860), + set: __webpack_require__(9548), + timestamp: __webpack_require__(9212), + bool: __webpack_require__(4993), + int: __webpack_require__(1615), + merge: __webpack_require__(6104), + omap: __webpack_require__(9046), + seq: __webpack_require__(7283), + str: __webpack_require__(3619) +}; -// Deprecated functions from JS-YAML 1.x.x -module.exports.scan = deprecated('scan'); -module.exports.parse = deprecated('parse'); -module.exports.compose = deprecated('compose'); -module.exports.addConstructor = deprecated('addConstructor'); +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); /***/ }), -/***/ 9136: +/***/ 6829: /***/ ((module) => { "use strict"; @@ -6065,7 +6058,7 @@ module.exports.extend = extend; /***/ }), -/***/ 3034: +/***/ 8866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -6073,14 +6066,14 @@ module.exports.extend = extend; /*eslint-disable no-use-before-define*/ -var common = __webpack_require__(9136); -var YAMLException = __webpack_require__(5199); -var DEFAULT_FULL_SCHEMA = __webpack_require__(6874); -var DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); +var common = __webpack_require__(6829); +var YAMLException = __webpack_require__(8179); +var DEFAULT_SCHEMA = __webpack_require__(8759); var _toString = Object.prototype.toString; var _hasOwnProperty = Object.prototype.hasOwnProperty; +var CHAR_BOM = 0xFEFF; var CHAR_TAB = 0x09; /* Tab */ var CHAR_LINE_FEED = 0x0A; /* LF */ var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ @@ -6129,6 +6122,8 @@ var DEPRECATED_BOOLEANS_SYNTAX = [ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' ]; +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; @@ -6177,8 +6172,12 @@ function encodeHex(character) { return '\\' + handle + common.repeat('0', length - string.length) + string; } + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.schema = options['schema'] || DEFAULT_SCHEMA; this.indent = Math.max(1, (options['indent'] || 2)); this.noArrayIndent = options['noArrayIndent'] || false; this.skipInvalid = options['skipInvalid'] || false; @@ -6189,6 +6188,9 @@ function State(options) { this.noRefs = options['noRefs'] || false; this.noCompatMode = options['noCompatMode'] || false; this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; @@ -6257,47 +6259,60 @@ function isWhitespace(c) { function isPrintable(c) { return (0x00020 <= c && c <= 0x00007E) || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) || (0x10000 <= c && c <= 0x10FFFF); } // [34] ns-char ::= nb-char - s-white // [27] nb-char ::= c-printable - b-char - c-byte-order-mark // [26] b-char ::= b-line-feed | b-carriage-return -// [24] b-line-feed ::= #xA /* LF */ -// [25] b-carriage-return ::= #xD /* CR */ -// [3] c-byte-order-mark ::= #xFEFF -function isNsChar(c) { - return isPrintable(c) && !isWhitespace(c) - // byte-order-mark - && c !== 0xFEFF - // b-char +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; } -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c, prev) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - // /* An ns-char preceding */ "#" - && c !== CHAR_COLON - && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' } // Simplified test for values allowed as the first character in plain style. function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” @@ -6325,6 +6340,25 @@ function isPlainSafeFirst(c) { && c !== CHAR_GRAVE_ACCENT; } +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + // Determines whether block indentation indicator is required. function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; @@ -6344,31 +6378,34 @@ var STYLE_PLAIN = 1, // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { + var i; - var char, prev_char; + var char = 0; + var prevChar = null; var hasLineBreak = false; var hasFoldableLine = false; // only checked if shouldTrackWidth var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); - if (singleLineOnly) { + if (singleLineOnly || forceQuotes) { // Case: no block styles. // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); if (!isPrintable(char)) { return STYLE_DOUBLE; } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; } } else { // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); if (char === CHAR_LINE_FEED) { hasLineBreak = true; // Check if any line can be folded. @@ -6382,8 +6419,8 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te } else if (!isPrintable(char)) { return STYLE_DOUBLE; } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; } // in case the end is missing a \n hasFoldableLine = hasFoldableLine || (shouldTrackWidth && @@ -6396,8 +6433,10 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te if (!hasLineBreak && !hasFoldableLine) { // Strings interpretable as another type have to be quoted; // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; } // Edge case: block indentation indicator can only have one digit. if (indentPerLevel > 9 && needIndentIndicator(string)) { @@ -6405,7 +6444,10 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te } // At this point we know block styles are valid. // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; } // Note: line breaking/folding is implemented for only the folded style. @@ -6414,14 +6456,15 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te // • No ending newline => unaffected; already using strip "-" chomping. // • Ending newline => removed then restored. // Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { +function writeScalar(state, string, level, iskey, inblock) { state.dump = (function () { if (string.length === 0) { - return "''"; + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } } var indent = state.indent * Math.max(1, level); // no 0-indent scalars @@ -6443,7 +6486,9 @@ function writeScalar(state, string, level, iskey) { return testImplicitResolving(state, string); } - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + case STYLE_PLAIN: return string; case STYLE_SINGLE: @@ -6560,25 +6605,19 @@ function foldLine(line, width) { // Escapes a double-quoted string. function escapeString(string) { var result = ''; - var char, nextChar; + var char = 0; var escapeSeq; - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } } return result; @@ -6588,12 +6627,22 @@ function writeFlowSequence(state, level, object) { var _result = '', _tag = state.tag, index, - length; + length, + value; for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); _result += state.dump; } } @@ -6606,12 +6655,22 @@ function writeBlockSequence(state, level, object, compact) { var _result = '', _tag = state.tag, index, - length; + length, + value; for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { _result += generateNextLine(state, level); } @@ -6642,13 +6701,17 @@ function writeFlowMapping(state, level, object) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (index !== 0) pairBuffer += ', '; + if (_result !== '') pairBuffer += ', '; if (state.condenseFlow) pairBuffer += '"'; objectKey = objectKeyList[index]; objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode(state, level, objectKey, false, false)) { continue; // Skip this pair because of invalid key; } @@ -6697,13 +6760,17 @@ function writeBlockMapping(state, level, object, compact) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (!compact || index !== 0) { + if (!compact || _result !== '') { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } @@ -6757,7 +6824,15 @@ function detectType(state, object, explicit) { (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { - state.tag = explicit ? type.tag : '?'; + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; @@ -6783,7 +6858,7 @@ function detectType(state, object, explicit) { // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // -function writeNode(state, level, object, block, compact, iskey) { +function writeNode(state, level, object, block, compact, iskey, isblockseq) { state.tag = null; state.dump = object; @@ -6792,6 +6867,8 @@ function writeNode(state, level, object, block, compact, iskey) { } var type = _toString.call(state.dump); + var inblock = block; + var tagStr; if (block) { block = (state.flowLevel < 0 || state.flowLevel > level); @@ -6829,29 +6906,59 @@ function writeNode(state, level, object, block, compact, iskey) { } } } else if (type === '[object Array]') { - var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, arrayLevel, state.dump, compact); + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { - writeFlowSequence(state, arrayLevel, state.dump); + writeFlowSequence(state, level, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object String]') { if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); + writeScalar(state, state.dump, level, iskey, inblock); } + } else if (type === '[object Undefined]') { + return false; } else { if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + state.dump; } } @@ -6908,22 +7015,23 @@ function dump(input, options) { if (!state.noRefs) getDuplicateReferences(input, state); - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + var value = input; - return ''; -} + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + return ''; } -module.exports.dump = dump; -module.exports.safeDump = safeDump; +module.exports.dump = dump; /***/ }), -/***/ 5199: +/***/ 8179: /***/ ((module) => { "use strict"; @@ -6931,6 +7039,26 @@ module.exports.safeDump = safeDump; // + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; +} + + function YAMLException(reason, mark) { // Super constructor Error.call(this); @@ -6938,7 +7066,7 @@ function YAMLException(reason, mark) { this.name = 'YAMLException'; this.reason = reason; this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + this.message = formatError(this, false); // Include stack trace in error object if (Error.captureStackTrace) { @@ -6957,15 +7085,7 @@ YAMLException.prototype.constructor = YAMLException; YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; + return this.name + ': ' + formatError(this, compact); }; @@ -6974,7 +7094,7 @@ module.exports = YAMLException; /***/ }), -/***/ 5190: +/***/ 1161: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -6982,11 +7102,10 @@ module.exports = YAMLException; /*eslint-disable max-len,no-use-before-define*/ -var common = __webpack_require__(9136); -var YAMLException = __webpack_require__(5199); -var Mark = __webpack_require__(5426); -var DEFAULT_SAFE_SCHEMA = __webpack_require__(8949); -var DEFAULT_FULL_SCHEMA = __webpack_require__(6874); +var common = __webpack_require__(6829); +var YAMLException = __webpack_require__(8179); +var makeSnippet = __webpack_require__(6975); +var DEFAULT_SCHEMA = __webpack_require__(8759); var _hasOwnProperty = Object.prototype.hasOwnProperty; @@ -7113,9 +7232,12 @@ function State(input, options) { this.input = input; this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.schema = options['schema'] || DEFAULT_SCHEMA; this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive this.legacy = options['legacy'] || false; + this.json = options['json'] || false; this.listener = options['listener'] || null; @@ -7128,6 +7250,10 @@ function State(input, options) { this.lineStart = 0; this.lineIndent = 0; + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + this.documents = []; /* @@ -7144,9 +7270,17 @@ function State(input, options) { function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = makeSnippet(mark); + + return new YAMLException(message, mark); } function throwError(state, message) { @@ -7218,6 +7352,12 @@ var directiveHandlers = { throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + state.tagMap[handle] = prefix; } }; @@ -7264,7 +7404,9 @@ function mergeMappings(state, destination, source, overridableKeys) { } } -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + var index, quantity; // The output is a plain object here, so keys can only be strings. @@ -7311,10 +7453,22 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; state.position = startPos || state.position; throwError(state, 'duplicated mapping key'); } - _result[keyNode] = valueNode; + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } delete overridableKeys[keyNode]; } @@ -7339,6 +7493,7 @@ function readLineBreak(state) { state.line += 1; state.lineStart = state.position; + state.firstTabInLine = -1; } function skipSeparationSpace(state, allowComments, checkIndent) { @@ -7347,6 +7502,9 @@ function skipSeparationSpace(state, allowComments, checkIndent) { while (ch !== 0) { while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } ch = state.input.charCodeAt(++state.position); } @@ -7648,6 +7806,8 @@ function readDoubleQuotedScalar(state, nodeIndent) { function readFlowCollection(state, nodeIndent) { var readNext = true, _line, + _lineStart, + _pos, _tag = state.tag, _result, _anchor = state.anchor, @@ -7656,7 +7816,7 @@ function readFlowCollection(state, nodeIndent) { isPair, isExplicitPair, isMapping, - overridableKeys = {}, + overridableKeys = Object.create(null), keyNode, keyTag, valueNode, @@ -7696,6 +7856,9 @@ function readFlowCollection(state, nodeIndent) { return true; } else if (!readNext) { throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); } keyTag = keyNode = valueNode = null; @@ -7711,7 +7874,9 @@ function readFlowCollection(state, nodeIndent) { } } - _line = state.line; + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); keyTag = state.tag; keyNode = state.result; @@ -7728,9 +7893,9 @@ function readFlowCollection(state, nodeIndent) { } if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); } else { _result.push(keyNode); } @@ -7902,6 +8067,10 @@ function readBlockSequence(state, nodeIndent) { detected = false, ch; + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } @@ -7909,6 +8078,10 @@ function readBlockSequence(state, nodeIndent) { ch = state.input.charCodeAt(state.position); while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } if (ch !== 0x2D/* - */) { break; @@ -7959,11 +8132,13 @@ function readBlockMapping(state, nodeIndent, flowIndent) { var following, allowCompact, _line, - _pos, + _keyLine, + _keyLineStart, + _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, - overridableKeys = {}, + overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, @@ -7971,6 +8146,10 @@ function readBlockMapping(state, nodeIndent, flowIndent) { detected = false, ch; + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } @@ -7978,9 +8157,13 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(state.position); while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. - _pos = state.position; // // Explicit notation case. There are two separate blocks: @@ -7990,7 +8173,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { if (ch === 0x3F/* ? */) { if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } @@ -8013,7 +8196,16 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // // Implicit notation case. Flow-style node as the key first, then ":", and the value. // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } if (state.line === _line) { ch = state.input.charCodeAt(state.position); @@ -8030,7 +8222,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } @@ -8057,15 +8249,18 @@ function readBlockMapping(state, nodeIndent, flowIndent) { state.anchor = _anchor; return true; // Keep the result of `composeNode`. } - - } else { - break; // Reading is done. Go to the epilogue. } // // Common reading code for both explicit and implicit notations. // if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { keyNode = state.result; @@ -8075,7 +8270,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } @@ -8083,7 +8278,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(state.position); } - if (state.lineIndent > nodeIndent && (ch !== 0)) { + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; @@ -8096,7 +8291,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); } // Expose the resulting mapping. @@ -8185,6 +8380,12 @@ function readTagProperty(state) { throwError(state, 'tag name cannot contain such characters: ' + tagName); } + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + if (isVerbatim) { state.tag = tagName; @@ -8270,6 +8471,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact hasContent = false, typeIndex, typeQuantity, + typeList, type, flowIndent, blockIndent; @@ -8371,48 +8573,66 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } } - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only automatically assigned to plain scalars. - // - // We only need to check kind conformity in case user explicitly assigns '?' - // tag, for example like this: "! [0]" - // - if (state.result !== null && state.kind !== 'scalar') { - throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); - } - - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); + state.tag = type.tag; if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } + break; } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { throwError(state, 'unknown tag !<' + state.tag + '>'); } + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } } if (state.listener !== null) { @@ -8431,8 +8651,8 @@ function readDocument(state) { state.version = null; state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); @@ -8603,114 +8823,13 @@ function load(input, options) { } -function safeLoadAll(input, iterator, options) { - if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; +module.exports.loadAll = loadAll; +module.exports.load = load; /***/ }), -/***/ 5426: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - - -var common = __webpack_require__(9136); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - - -/***/ }), - -/***/ 6514: +/***/ 1082: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -8718,31 +8837,29 @@ module.exports = Mark; /*eslint-disable max-len*/ -var common = __webpack_require__(9136); -var YAMLException = __webpack_require__(5199); -var Type = __webpack_require__(967); +var YAMLException = __webpack_require__(8179); +var Type = __webpack_require__(6073); -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); +function compileList(schema, name) { + var result = []; schema[name].forEach(function (currentType) { + var newIndex = result.length; + result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; } }); - result.push(currentType); + result[newIndex] = currentType; }); - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); + return result; } @@ -8751,11 +8868,22 @@ function compileMap(/* lists... */) { scalar: {}, sequence: {}, mapping: {}, - fallback: {} + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } }, index, length; function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } } for (index = 0, length = arguments.length; index < length; index += 1) { @@ -8766,58 +8894,62 @@ function compileMap(/* lists... */) { function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); + return this.extend(definition); } -Schema.DEFAULT = null; - +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; -Schema.create = function createSchema() { - var schemas, types; + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); } - schemas = common.toArray(schemas); - types = common.toArray(types); + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); - return new Schema({ - include: schemas, - explicit: types + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } }); + + var result = Object.create(Schema.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; }; @@ -8826,7 +8958,7 @@ module.exports = Schema; /***/ }), -/***/ 2183: +/***/ 2011: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -8840,160 +8972,219 @@ module.exports = Schema; -var Schema = __webpack_require__(6514); - - -module.exports = new Schema({ - include: [ - __webpack_require__(1571) - ] -}); +module.exports = __webpack_require__(1035); /***/ }), -/***/ 6874: +/***/ 8759: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -// JS-YAML's default schema for `load` function. +// JS-YAML's default schema for `safeLoad` function. // It is not described in the YAML specification. // -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) -var Schema = __webpack_require__(6514); -module.exports = Schema.DEFAULT = new Schema({ - include: [ - __webpack_require__(8949) +module.exports = __webpack_require__(2011).extend({ + implicit: [ + __webpack_require__(9212), + __webpack_require__(6104) ], explicit: [ - __webpack_require__(5914), - __webpack_require__(9242), - __webpack_require__(7278) + __webpack_require__(7900), + __webpack_require__(9046), + __webpack_require__(6860), + __webpack_require__(9548) ] }); /***/ }), -/***/ 8949: +/***/ 8562: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 -var Schema = __webpack_require__(6514); +var Schema = __webpack_require__(1082); module.exports = new Schema({ - include: [ - __webpack_require__(2183) - ], - implicit: [ - __webpack_require__(3714), - __webpack_require__(1393) - ], explicit: [ - __webpack_require__(2551), - __webpack_require__(6668), - __webpack_require__(6039), - __webpack_require__(9237) + __webpack_require__(3619), + __webpack_require__(7283), + __webpack_require__(6150) ] }); /***/ }), -/***/ 6037: +/***/ 1035: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. -var Schema = __webpack_require__(6514); -module.exports = new Schema({ - explicit: [ - __webpack_require__(2672), - __webpack_require__(5490), - __webpack_require__(1173) +module.exports = __webpack_require__(8562).extend({ + implicit: [ + __webpack_require__(721), + __webpack_require__(4993), + __webpack_require__(1615), + __webpack_require__(2705) ] }); /***/ }), -/***/ 1571: +/***/ 6975: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. +var common = __webpack_require__(6829); -var Schema = __webpack_require__(6514); +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } -module.exports = new Schema({ - include: [ - __webpack_require__(6037) - ], - implicit: [ - __webpack_require__(2671), - __webpack_require__(4675), - __webpack_require__(9963), - __webpack_require__(5564) - ] -}); + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +module.exports = makeSnippet; /***/ }), -/***/ 967: +/***/ 6073: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var YAMLException = __webpack_require__(5199); +var YAMLException = __webpack_require__(8179); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', + 'multi', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', + 'representName', 'defaultStyle', 'styleAliases' ]; @@ -9028,15 +9219,18 @@ function Type(tag, options) { }); // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); @@ -9048,7 +9242,7 @@ module.exports = Type; /***/ }), -/***/ 2551: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -9056,15 +9250,8 @@ module.exports = Type; /*eslint-disable no-bitwise*/ -var NodeBuffer; -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); // [ 64, 65, 66 ] -> [ padding, CR, LF ] @@ -9128,13 +9315,7 @@ function constructYamlBinary(data) { result.push((bits >> 4) & 0xFF); } - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; + return new Uint8Array(result); } function representYamlBinary(object /*, style*/) { @@ -9179,8 +9360,8 @@ function representYamlBinary(object /*, style*/) { return result; } -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; } module.exports = new Type('tag:yaml.org,2002:binary', { @@ -9194,13 +9375,13 @@ module.exports = new Type('tag:yaml.org,2002:binary', { /***/ }), -/***/ 4675: +/***/ 4993: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); function resolveYamlBoolean(data) { if (data === null) return false; @@ -9237,23 +9418,21 @@ module.exports = new Type('tag:yaml.org,2002:bool', { /***/ }), -/***/ 5564: +/***/ 2705: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var common = __webpack_require__(9136); -var Type = __webpack_require__(967); +var common = __webpack_require__(6829); +var Type = __webpack_require__(6073); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + // .2e4, .2 // special case, seems not from spec '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + // .inf '|[-+]?\\.(?:inf|Inf|INF)' + // .nan @@ -9273,11 +9452,10 @@ function resolveYamlFloat(data) { } function constructYamlFloat(data) { - var value, sign, base, digits; + var value, sign; value = data.replace(/_/g, '').toLowerCase(); sign = value[0] === '-' ? -1 : 1; - digits = []; if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); @@ -9288,22 +9466,6 @@ function constructYamlFloat(data) { } else if (value === '.nan') { return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - } return sign * parseFloat(value, 10); } @@ -9361,14 +9523,14 @@ module.exports = new Type('tag:yaml.org,2002:float', { /***/ }), -/***/ 9963: +/***/ 1615: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var common = __webpack_require__(9136); -var Type = __webpack_require__(967); +var common = __webpack_require__(6829); +var Type = __webpack_require__(6073); function isHexCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || @@ -9435,17 +9597,22 @@ function resolveYamlInteger(data) { return hasDigits && ch !== '_'; } - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; + + if (ch === 'o') { + // base 8 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; } - return hasDigits && ch !== '_'; } - // base 10 (except 0) or base 60 + // base 10 (except 0) // value should not start with `_`; if (ch === '_') return false; @@ -9453,7 +9620,6 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; - if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } @@ -9463,15 +9629,11 @@ function resolveYamlInteger(data) { // Should have digits and should not end with `_` if (!hasDigits || ch === '_') return false; - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); + return true; } function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; + var value = data, sign = 1, ch; if (value.indexOf('_') !== -1) { value = value.replace(/_/g, ''); @@ -9489,25 +9651,8 @@ function constructYamlInteger(data) { if (ch === '0') { if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); } return sign * parseInt(value, 10); @@ -9525,7 +9670,7 @@ module.exports = new Type('tag:yaml.org,2002:int', { predicate: isInteger, represent: { binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, decimal: function (obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } @@ -9542,218 +9687,13 @@ module.exports = new Type('tag:yaml.org,2002:int', { /***/ }), -/***/ 7278: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /* eslint-disable no-redeclare */ - /* global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = __webpack_require__(967); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - - -/***/ }), - -/***/ 9242: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Type = __webpack_require__(967); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - - -/***/ }), - -/***/ 5914: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Type = __webpack_require__(967); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - - -/***/ }), - -/***/ 1173: +/***/ 6150: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', @@ -9763,13 +9703,13 @@ module.exports = new Type('tag:yaml.org,2002:map', { /***/ }), -/***/ 1393: +/***/ 6104: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); function resolveYamlMerge(data) { return data === '<<' || data === null; @@ -9783,13 +9723,13 @@ module.exports = new Type('tag:yaml.org,2002:merge', { /***/ }), -/***/ 2671: +/***/ 721: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); function resolveYamlNull(data) { if (data === null) return true; @@ -9817,7 +9757,8 @@ module.exports = new Type('tag:yaml.org,2002:null', { canonical: function () { return '~'; }, lowercase: function () { return 'null'; }, uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } }, defaultStyle: 'lowercase' }); @@ -9825,13 +9766,13 @@ module.exports = new Type('tag:yaml.org,2002:null', { /***/ }), -/***/ 6668: +/***/ 9046: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; @@ -9877,13 +9818,13 @@ module.exports = new Type('tag:yaml.org,2002:omap', { /***/ }), -/***/ 6039: +/***/ 6860: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); var _toString = Object.prototype.toString; @@ -9938,13 +9879,13 @@ module.exports = new Type('tag:yaml.org,2002:pairs', { /***/ }), -/***/ 5490: +/***/ 7283: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', @@ -9954,13 +9895,13 @@ module.exports = new Type('tag:yaml.org,2002:seq', { /***/ }), -/***/ 9237: +/***/ 9548: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); var _hasOwnProperty = Object.prototype.hasOwnProperty; @@ -9991,13 +9932,13 @@ module.exports = new Type('tag:yaml.org,2002:set', { /***/ }), -/***/ 2672: +/***/ 3619: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', @@ -10007,13 +9948,13 @@ module.exports = new Type('tag:yaml.org,2002:str', { /***/ }), -/***/ 3714: +/***/ 9212: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var Type = __webpack_require__(967); +var Type = __webpack_require__(6073); var YAML_DATE_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year @@ -10718,6 +10659,12 @@ function convertBody(buffer, headers) { // html4 if (!res && str) { res = /