react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / dist / js-yaml.js
80684 views/* js-yaml 3.3.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){1'use strict';234var loader = require('./js-yaml/loader');5var dumper = require('./js-yaml/dumper');678function deprecated(name) {9return function () {10throw new Error('Function ' + name + ' is deprecated and cannot be used.');11};12}131415module.exports.Type = require('./js-yaml/type');16module.exports.Schema = require('./js-yaml/schema');17module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');18module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');19module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');20module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');21module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');22module.exports.load = loader.load;23module.exports.loadAll = loader.loadAll;24module.exports.safeLoad = loader.safeLoad;25module.exports.safeLoadAll = loader.safeLoadAll;26module.exports.dump = dumper.dump;27module.exports.safeDump = dumper.safeDump;28module.exports.YAMLException = require('./js-yaml/exception');2930// Deprecared schema names from JS-YAML 2.0.x31module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');32module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');33module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');3435// Deprecated functions from JS-YAML 1.x.x36module.exports.scan = deprecated('scan');37module.exports.parse = deprecated('parse');38module.exports.compose = deprecated('compose');39module.exports.addConstructor = deprecated('addConstructor');4041},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){42'use strict';434445function isNothing(subject) {46return (typeof subject === 'undefined') || (null === subject);47}484950function isObject(subject) {51return (typeof subject === 'object') && (null !== subject);52}535455function toArray(sequence) {56if (Array.isArray(sequence)) {57return sequence;58} else if (isNothing(sequence)) {59return [];60}61return [ sequence ];62}636465function extend(target, source) {66var index, length, key, sourceKeys;6768if (source) {69sourceKeys = Object.keys(source);7071for (index = 0, length = sourceKeys.length; index < length; index += 1) {72key = sourceKeys[index];73target[key] = source[key];74}75}7677return target;78}798081function repeat(string, count) {82var result = '', cycle;8384for (cycle = 0; cycle < count; cycle += 1) {85result += string;86}8788return result;89}909192function isNegativeZero(number) {93return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);94}959697module.exports.isNothing = isNothing;98module.exports.isObject = isObject;99module.exports.toArray = toArray;100module.exports.repeat = repeat;101module.exports.isNegativeZero = isNegativeZero;102module.exports.extend = extend;103104},{}],3:[function(require,module,exports){105'use strict';106107/*eslint-disable no-use-before-define*/108109var common = require('./common');110var YAMLException = require('./exception');111var DEFAULT_FULL_SCHEMA = require('./schema/default_full');112var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');113114var _toString = Object.prototype.toString;115var _hasOwnProperty = Object.prototype.hasOwnProperty;116117var CHAR_TAB = 0x09; /* Tab */118var CHAR_LINE_FEED = 0x0A; /* LF */119var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */120var CHAR_SPACE = 0x20; /* Space */121var CHAR_EXCLAMATION = 0x21; /* ! */122var CHAR_DOUBLE_QUOTE = 0x22; /* " */123var CHAR_SHARP = 0x23; /* # */124var CHAR_PERCENT = 0x25; /* % */125var CHAR_AMPERSAND = 0x26; /* & */126var CHAR_SINGLE_QUOTE = 0x27; /* ' */127var CHAR_ASTERISK = 0x2A; /* * */128var CHAR_COMMA = 0x2C; /* , */129var CHAR_MINUS = 0x2D; /* - */130var CHAR_COLON = 0x3A; /* : */131var CHAR_GREATER_THAN = 0x3E; /* > */132var CHAR_QUESTION = 0x3F; /* ? */133var CHAR_COMMERCIAL_AT = 0x40; /* @ */134var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */135var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */136var CHAR_GRAVE_ACCENT = 0x60; /* ` */137var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */138var CHAR_VERTICAL_LINE = 0x7C; /* | */139var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */140141var ESCAPE_SEQUENCES = {};142143ESCAPE_SEQUENCES[0x00] = '\\0';144ESCAPE_SEQUENCES[0x07] = '\\a';145ESCAPE_SEQUENCES[0x08] = '\\b';146ESCAPE_SEQUENCES[0x09] = '\\t';147ESCAPE_SEQUENCES[0x0A] = '\\n';148ESCAPE_SEQUENCES[0x0B] = '\\v';149ESCAPE_SEQUENCES[0x0C] = '\\f';150ESCAPE_SEQUENCES[0x0D] = '\\r';151ESCAPE_SEQUENCES[0x1B] = '\\e';152ESCAPE_SEQUENCES[0x22] = '\\"';153ESCAPE_SEQUENCES[0x5C] = '\\\\';154ESCAPE_SEQUENCES[0x85] = '\\N';155ESCAPE_SEQUENCES[0xA0] = '\\_';156ESCAPE_SEQUENCES[0x2028] = '\\L';157ESCAPE_SEQUENCES[0x2029] = '\\P';158159var DEPRECATED_BOOLEANS_SYNTAX = [160'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',161'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'162];163164function compileStyleMap(schema, map) {165var result, keys, index, length, tag, style, type;166167if (null === map) {168return {};169}170171result = {};172keys = Object.keys(map);173174for (index = 0, length = keys.length; index < length; index += 1) {175tag = keys[index];176style = String(map[tag]);177178if ('!!' === tag.slice(0, 2)) {179tag = 'tag:yaml.org,2002:' + tag.slice(2);180}181182type = schema.compiledTypeMap[tag];183184if (type && _hasOwnProperty.call(type.styleAliases, style)) {185style = type.styleAliases[style];186}187188result[tag] = style;189}190191return result;192}193194function encodeHex(character) {195var string, handle, length;196197string = character.toString(16).toUpperCase();198199if (character <= 0xFF) {200handle = 'x';201length = 2;202} else if (character <= 0xFFFF) {203handle = 'u';204length = 4;205} else if (character <= 0xFFFFFFFF) {206handle = 'U';207length = 8;208} else {209throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');210}211212return '\\' + handle + common.repeat('0', length - string.length) + string;213}214215function State(options) {216this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;217this.indent = Math.max(1, (options['indent'] || 2));218this.skipInvalid = options['skipInvalid'] || false;219this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);220this.styleMap = compileStyleMap(this.schema, options['styles'] || null);221this.sortKeys = options['sortKeys'] || false;222223this.implicitTypes = this.schema.compiledImplicit;224this.explicitTypes = this.schema.compiledExplicit;225226this.tag = null;227this.result = '';228229this.duplicates = [];230this.usedDuplicates = null;231}232233function indentString(string, spaces) {234var ind = common.repeat(' ', spaces),235position = 0,236next = -1,237result = '',238line,239length = string.length;240241while (position < length) {242next = string.indexOf('\n', position);243if (next === -1) {244line = string.slice(position);245position = length;246} else {247line = string.slice(position, next + 1);248position = next + 1;249}250if (line.length && line !== '\n') {251result += ind;252}253result += line;254}255256return result;257}258259function generateNextLine(state, level) {260return '\n' + common.repeat(' ', state.indent * level);261}262263function testImplicitResolving(state, str) {264var index, length, type;265266for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {267type = state.implicitTypes[index];268269if (type.resolve(str)) {270return true;271}272}273274return false;275}276277function StringBuilder(source) {278this.source = source;279this.result = '';280this.checkpoint = 0;281}282283StringBuilder.prototype.takeUpTo = function (position) {284var er;285286if (position < this.checkpoint) {287er = new Error('position should be > checkpoint');288er.position = position;289er.checkpoint = this.checkpoint;290throw er;291}292293this.result += this.source.slice(this.checkpoint, position);294this.checkpoint = position;295return this;296};297298StringBuilder.prototype.escapeChar = function () {299var character, esc;300301character = this.source.charCodeAt(this.checkpoint);302esc = ESCAPE_SEQUENCES[character] || encodeHex(character);303this.result += esc;304this.checkpoint += 1;305306return this;307};308309StringBuilder.prototype.finish = function () {310if (this.source.length > this.checkpoint) {311this.takeUpTo(this.source.length);312}313};314315function writeScalar(state, object, level) {316var simple, first, spaceWrap, folded, literal, single, double,317sawLineFeed, linePosition, longestLine, indent, max, character,318position, escapeSeq, hexEsc, previous, lineLength, modifier,319trailingLineBreaks, result;320321if (0 === object.length) {322state.dump = "''";323return;324}325326if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {327state.dump = "'" + object + "'";328return;329}330331simple = true;332first = object.length ? object.charCodeAt(0) : 0;333spaceWrap = (CHAR_SPACE === first ||334CHAR_SPACE === object.charCodeAt(object.length - 1));335336// Simplified check for restricted first characters337// http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29338if (CHAR_MINUS === first ||339CHAR_QUESTION === first ||340CHAR_COMMERCIAL_AT === first ||341CHAR_GRAVE_ACCENT === first) {342simple = false;343}344345// can only use > and | if not wrapped in spaces.346if (spaceWrap) {347simple = false;348folded = false;349literal = false;350} else {351folded = true;352literal = true;353}354355single = true;356double = new StringBuilder(object);357358sawLineFeed = false;359linePosition = 0;360longestLine = 0;361362indent = state.indent * level;363max = 80;364if (indent < 40) {365max -= indent;366} else {367max = 40;368}369370for (position = 0; position < object.length; position++) {371character = object.charCodeAt(position);372if (simple) {373// Characters that can never appear in the simple scalar374if (!simpleChar(character)) {375simple = false;376} else {377// Still simple. If we make it all the way through like378// this, then we can just dump the string as-is.379continue;380}381}382383if (single && character === CHAR_SINGLE_QUOTE) {384single = false;385}386387escapeSeq = ESCAPE_SEQUENCES[character];388hexEsc = needsHexEscape(character);389390if (!escapeSeq && !hexEsc) {391continue;392}393394if (character !== CHAR_LINE_FEED &&395character !== CHAR_DOUBLE_QUOTE &&396character !== CHAR_SINGLE_QUOTE) {397folded = false;398literal = false;399} else if (character === CHAR_LINE_FEED) {400sawLineFeed = true;401single = false;402if (position > 0) {403previous = object.charCodeAt(position - 1);404if (previous === CHAR_SPACE) {405literal = false;406folded = false;407}408}409if (folded) {410lineLength = position - linePosition;411linePosition = position;412if (lineLength > longestLine) {413longestLine = lineLength;414}415}416}417418if (character !== CHAR_DOUBLE_QUOTE) {419single = false;420}421422double.takeUpTo(position);423double.escapeChar();424}425426if (simple && testImplicitResolving(state, object)) {427simple = false;428}429430modifier = '';431if (folded || literal) {432trailingLineBreaks = 0;433if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) {434trailingLineBreaks += 1;435if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) {436trailingLineBreaks += 1;437}438}439440if (trailingLineBreaks === 0) {441modifier = '-';442} else if (trailingLineBreaks === 2) {443modifier = '+';444}445}446447if (literal && longestLine < max) {448folded = false;449}450451// If it's literally one line, then don't bother with the literal.452// We may still want to do a fold, though, if it's a super long line.453if (!sawLineFeed) {454literal = false;455}456457if (simple) {458state.dump = object;459} else if (single) {460state.dump = '\'' + object + '\'';461} else if (folded) {462result = fold(object, max);463state.dump = '>' + modifier + '\n' + indentString(result, indent);464} else if (literal) {465if (!modifier) {466object = object.replace(/\n$/, '');467}468state.dump = '|' + modifier + '\n' + indentString(object, indent);469} else if (double) {470double.finish();471state.dump = '"' + double.result + '"';472} else {473throw new Error('Failed to dump scalar value');474}475476return;477}478479// The `trailing` var is a regexp match of any trailing `\n` characters.480//481// There are three cases we care about:482//483// 1. One trailing `\n` on the string. Just use `|` or `>`.484// This is the assumed default. (trailing = null)485// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end.486// 3. More than one trailing `\n` on the string. Use `|+` or `>+`.487//488// In the case of `>+`, these line breaks are *not* doubled (like the line489// breaks within the string), so it's important to only end with the exact490// same number as we started.491function fold(object, max) {492var result = '',493position = 0,494length = object.length,495trailing = /\n+$/.exec(object),496newLine;497498if (trailing) {499length = trailing.index + 1;500}501502while (position < length) {503newLine = object.indexOf('\n', position);504if (newLine > length || newLine === -1) {505if (result) {506result += '\n\n';507}508result += foldLine(object.slice(position, length), max);509position = length;510} else {511if (result) {512result += '\n\n';513}514result += foldLine(object.slice(position, newLine), max);515position = newLine + 1;516}517}518if (trailing && trailing[0] !== '\n') {519result += trailing[0];520}521522return result;523}524525function foldLine(line, max) {526if (line === '') {527return line;528}529530var foldRe = /[^\s] [^\s]/g,531result = '',532prevMatch = 0,533foldStart = 0,534match = foldRe.exec(line),535index,536foldEnd,537folded;538539while (match) {540index = match.index;541542// when we cross the max len, if the previous match would've543// been ok, use that one, and carry on. If there was no previous544// match on this fold section, then just have a long line.545if (index - foldStart > max) {546if (prevMatch !== foldStart) {547foldEnd = prevMatch;548} else {549foldEnd = index;550}551552if (result) {553result += '\n';554}555folded = line.slice(foldStart, foldEnd);556result += folded;557foldStart = foldEnd + 1;558}559prevMatch = index + 1;560match = foldRe.exec(line);561}562563if (result) {564result += '\n';565}566567// if we end up with one last word at the end, then the last bit might568// be slightly bigger than we wanted, because we exited out of the loop.569if (foldStart !== prevMatch && line.length - foldStart > max) {570result += line.slice(foldStart, prevMatch) + '\n' +571line.slice(prevMatch + 1);572} else {573result += line.slice(foldStart);574}575576return result;577}578579// Returns true if character can be found in a simple scalar580function simpleChar(character) {581return CHAR_TAB !== character &&582CHAR_LINE_FEED !== character &&583CHAR_CARRIAGE_RETURN !== character &&584CHAR_COMMA !== character &&585CHAR_LEFT_SQUARE_BRACKET !== character &&586CHAR_RIGHT_SQUARE_BRACKET !== character &&587CHAR_LEFT_CURLY_BRACKET !== character &&588CHAR_RIGHT_CURLY_BRACKET !== character &&589CHAR_SHARP !== character &&590CHAR_AMPERSAND !== character &&591CHAR_ASTERISK !== character &&592CHAR_EXCLAMATION !== character &&593CHAR_VERTICAL_LINE !== character &&594CHAR_GREATER_THAN !== character &&595CHAR_SINGLE_QUOTE !== character &&596CHAR_DOUBLE_QUOTE !== character &&597CHAR_PERCENT !== character &&598CHAR_COLON !== character &&599!ESCAPE_SEQUENCES[character] &&600!needsHexEscape(character);601}602603// Returns true if the character code needs to be escaped.604function needsHexEscape(character) {605return !((0x00020 <= character && character <= 0x00007E) ||606(0x00085 === character) ||607(0x000A0 <= character && character <= 0x00D7FF) ||608(0x0E000 <= character && character <= 0x00FFFD) ||609(0x10000 <= character && character <= 0x10FFFF));610}611612function writeFlowSequence(state, level, object) {613var _result = '',614_tag = state.tag,615index,616length;617618for (index = 0, length = object.length; index < length; index += 1) {619// Write only valid elements.620if (writeNode(state, level, object[index], false, false)) {621if (0 !== index) {622_result += ', ';623}624_result += state.dump;625}626}627628state.tag = _tag;629state.dump = '[' + _result + ']';630}631632function writeBlockSequence(state, level, object, compact) {633var _result = '',634_tag = state.tag,635index,636length;637638for (index = 0, length = object.length; index < length; index += 1) {639// Write only valid elements.640if (writeNode(state, level + 1, object[index], true, true)) {641if (!compact || 0 !== index) {642_result += generateNextLine(state, level);643}644_result += '- ' + state.dump;645}646}647648state.tag = _tag;649state.dump = _result || '[]'; // Empty sequence if no valid values.650}651652function writeFlowMapping(state, level, object) {653var _result = '',654_tag = state.tag,655objectKeyList = Object.keys(object),656index,657length,658objectKey,659objectValue,660pairBuffer;661662for (index = 0, length = objectKeyList.length; index < length; index += 1) {663pairBuffer = '';664665if (0 !== index) {666pairBuffer += ', ';667}668669objectKey = objectKeyList[index];670objectValue = object[objectKey];671672if (!writeNode(state, level, objectKey, false, false)) {673continue; // Skip this pair because of invalid key;674}675676if (state.dump.length > 1024) {677pairBuffer += '? ';678}679680pairBuffer += state.dump + ': ';681682if (!writeNode(state, level, objectValue, false, false)) {683continue; // Skip this pair because of invalid value.684}685686pairBuffer += state.dump;687688// Both key and value are valid.689_result += pairBuffer;690}691692state.tag = _tag;693state.dump = '{' + _result + '}';694}695696function writeBlockMapping(state, level, object, compact) {697var _result = '',698_tag = state.tag,699objectKeyList = Object.keys(object),700index,701length,702objectKey,703objectValue,704explicitPair,705pairBuffer;706707// Allow sorting keys so that the output file is deterministic708if (state.sortKeys === true) {709// Default sorting710objectKeyList.sort();711} else if (typeof state.sortKeys === 'function') {712// Custom sort function713objectKeyList.sort(state.sortKeys);714} else if (state.sortKeys) {715// Something is wrong716throw new YAMLException('sortKeys must be a boolean or a function');717}718719for (index = 0, length = objectKeyList.length; index < length; index += 1) {720pairBuffer = '';721722if (!compact || 0 !== index) {723pairBuffer += generateNextLine(state, level);724}725726objectKey = objectKeyList[index];727objectValue = object[objectKey];728729if (!writeNode(state, level + 1, objectKey, true, true)) {730continue; // Skip this pair because of invalid key.731}732733explicitPair = (null !== state.tag && '?' !== state.tag) ||734(state.dump && state.dump.length > 1024);735736if (explicitPair) {737if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {738pairBuffer += '?';739} else {740pairBuffer += '? ';741}742}743744pairBuffer += state.dump;745746if (explicitPair) {747pairBuffer += generateNextLine(state, level);748}749750if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {751continue; // Skip this pair because of invalid value.752}753754if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {755pairBuffer += ':';756} else {757pairBuffer += ': ';758}759760pairBuffer += state.dump;761762// Both key and value are valid.763_result += pairBuffer;764}765766state.tag = _tag;767state.dump = _result || '{}'; // Empty mapping if no valid pairs.768}769770function detectType(state, object, explicit) {771var _result, typeList, index, length, type, style;772773typeList = explicit ? state.explicitTypes : state.implicitTypes;774775for (index = 0, length = typeList.length; index < length; index += 1) {776type = typeList[index];777778if ((type.instanceOf || type.predicate) &&779(!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&780(!type.predicate || type.predicate(object))) {781782state.tag = explicit ? type.tag : '?';783784if (type.represent) {785style = state.styleMap[type.tag] || type.defaultStyle;786787if ('[object Function]' === _toString.call(type.represent)) {788_result = type.represent(object, style);789} else if (_hasOwnProperty.call(type.represent, style)) {790_result = type.represent[style](object, style);791} else {792throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');793}794795state.dump = _result;796}797798return true;799}800}801802return false;803}804805// Serializes `object` and writes it to global `result`.806// Returns true on success, or false on invalid object.807//808function writeNode(state, level, object, block, compact) {809state.tag = null;810state.dump = object;811812if (!detectType(state, object, false)) {813detectType(state, object, true);814}815816var type = _toString.call(state.dump);817818if (block) {819block = (0 > state.flowLevel || state.flowLevel > level);820}821822if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) {823compact = false;824}825826var objectOrArray = '[object Object]' === type || '[object Array]' === type,827duplicateIndex,828duplicate;829830if (objectOrArray) {831duplicateIndex = state.duplicates.indexOf(object);832duplicate = duplicateIndex !== -1;833}834835if (duplicate && state.usedDuplicates[duplicateIndex]) {836state.dump = '*ref_' + duplicateIndex;837} else {838if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {839state.usedDuplicates[duplicateIndex] = true;840}841if ('[object Object]' === type) {842if (block && (0 !== Object.keys(state.dump).length)) {843writeBlockMapping(state, level, state.dump, compact);844if (duplicate) {845state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;846}847} else {848writeFlowMapping(state, level, state.dump);849if (duplicate) {850state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;851}852}853} else if ('[object Array]' === type) {854if (block && (0 !== state.dump.length)) {855writeBlockSequence(state, level, state.dump, compact);856if (duplicate) {857state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;858}859} else {860writeFlowSequence(state, level, state.dump);861if (duplicate) {862state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;863}864}865} else if ('[object String]' === type) {866if ('?' !== state.tag) {867writeScalar(state, state.dump, level);868}869} else {870if (state.skipInvalid) {871return false;872}873throw new YAMLException('unacceptable kind of an object to dump ' + type);874}875876if (null !== state.tag && '?' !== state.tag) {877state.dump = '!<' + state.tag + '> ' + state.dump;878}879}880881return true;882}883884function getDuplicateReferences(object, state) {885var objects = [],886duplicatesIndexes = [],887index,888length;889890inspectNode(object, objects, duplicatesIndexes);891892for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {893state.duplicates.push(objects[duplicatesIndexes[index]]);894}895state.usedDuplicates = new Array(length);896}897898function inspectNode(object, objects, duplicatesIndexes) {899var type = _toString.call(object),900objectKeyList,901index,902length;903904if (null !== object && 'object' === typeof object) {905index = objects.indexOf(object);906if (-1 !== index) {907if (-1 === duplicatesIndexes.indexOf(index)) {908duplicatesIndexes.push(index);909}910} else {911objects.push(object);912913if (Array.isArray(object)) {914for (index = 0, length = object.length; index < length; index += 1) {915inspectNode(object[index], objects, duplicatesIndexes);916}917} else {918objectKeyList = Object.keys(object);919920for (index = 0, length = objectKeyList.length; index < length; index += 1) {921inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);922}923}924}925}926}927928function dump(input, options) {929options = options || {};930931var state = new State(options);932933getDuplicateReferences(input, state);934935if (writeNode(state, 0, input, true, true)) {936return state.dump + '\n';937}938return '';939}940941function safeDump(input, options) {942return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));943}944945module.exports.dump = dump;946module.exports.safeDump = safeDump;947948},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){949'use strict';950951952function YAMLException(reason, mark) {953this.name = 'YAMLException';954this.reason = reason;955this.mark = mark;956this.message = this.toString(false);957}958959960YAMLException.prototype.toString = function toString(compact) {961var result;962963result = 'JS-YAML: ' + (this.reason || '(unknown reason)');964965if (!compact && this.mark) {966result += ' ' + this.mark.toString();967}968969return result;970};971972973module.exports = YAMLException;974975},{}],5:[function(require,module,exports){976'use strict';977978/*eslint-disable max-len,no-use-before-define*/979980var common = require('./common');981var YAMLException = require('./exception');982var Mark = require('./mark');983var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');984var DEFAULT_FULL_SCHEMA = require('./schema/default_full');985986987var _hasOwnProperty = Object.prototype.hasOwnProperty;988989990var CONTEXT_FLOW_IN = 1;991var CONTEXT_FLOW_OUT = 2;992var CONTEXT_BLOCK_IN = 3;993var CONTEXT_BLOCK_OUT = 4;994995996var CHOMPING_CLIP = 1;997var CHOMPING_STRIP = 2;998var CHOMPING_KEEP = 3;99910001001var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;1002var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;1003var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;1004var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;1005var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;100610071008function is_EOL(c) {1009return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);1010}10111012function is_WHITE_SPACE(c) {1013return (c === 0x09/* Tab */) || (c === 0x20/* Space */);1014}10151016function is_WS_OR_EOL(c) {1017return (c === 0x09/* Tab */) ||1018(c === 0x20/* Space */) ||1019(c === 0x0A/* LF */) ||1020(c === 0x0D/* CR */);1021}10221023function is_FLOW_INDICATOR(c) {1024return 0x2C/* , */ === c ||10250x5B/* [ */ === c ||10260x5D/* ] */ === c ||10270x7B/* { */ === c ||10280x7D/* } */ === c;1029}10301031function fromHexCode(c) {1032var lc;10331034if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {1035return c - 0x30;1036}10371038/*eslint-disable no-bitwise*/1039lc = c | 0x20;10401041if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {1042return lc - 0x61 + 10;1043}10441045return -1;1046}10471048function escapedHexLen(c) {1049if (c === 0x78/* x */) { return 2; }1050if (c === 0x75/* u */) { return 4; }1051if (c === 0x55/* U */) { return 8; }1052return 0;1053}10541055function fromDecimalCode(c) {1056if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {1057return c - 0x30;1058}10591060return -1;1061}10621063function simpleEscapeSequence(c) {1064return (c === 0x30/* 0 */) ? '\x00' :1065(c === 0x61/* a */) ? '\x07' :1066(c === 0x62/* b */) ? '\x08' :1067(c === 0x74/* t */) ? '\x09' :1068(c === 0x09/* Tab */) ? '\x09' :1069(c === 0x6E/* n */) ? '\x0A' :1070(c === 0x76/* v */) ? '\x0B' :1071(c === 0x66/* f */) ? '\x0C' :1072(c === 0x72/* r */) ? '\x0D' :1073(c === 0x65/* e */) ? '\x1B' :1074(c === 0x20/* Space */) ? ' ' :1075(c === 0x22/* " */) ? '\x22' :1076(c === 0x2F/* / */) ? '/' :1077(c === 0x5C/* \ */) ? '\x5C' :1078(c === 0x4E/* N */) ? '\x85' :1079(c === 0x5F/* _ */) ? '\xA0' :1080(c === 0x4C/* L */) ? '\u2028' :1081(c === 0x50/* P */) ? '\u2029' : '';1082}10831084function charFromCodepoint(c) {1085if (c <= 0xFFFF) {1086return String.fromCharCode(c);1087}1088// Encode UTF-16 surrogate pair1089// https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF1090return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,1091((c - 0x010000) & 0x03FF) + 0xDC00);1092}10931094var simpleEscapeCheck = new Array(256); // integer, for fast access1095var simpleEscapeMap = new Array(256);1096for (var i = 0; i < 256; i++) {1097simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;1098simpleEscapeMap[i] = simpleEscapeSequence(i);1099}110011011102function State(input, options) {1103this.input = input;11041105this.filename = options['filename'] || null;1106this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;1107this.onWarning = options['onWarning'] || null;1108this.legacy = options['legacy'] || false;11091110this.implicitTypes = this.schema.compiledImplicit;1111this.typeMap = this.schema.compiledTypeMap;11121113this.length = input.length;1114this.position = 0;1115this.line = 0;1116this.lineStart = 0;1117this.lineIndent = 0;11181119this.documents = [];11201121/*1122this.version;1123this.checkLineBreaks;1124this.tagMap;1125this.anchorMap;1126this.tag;1127this.anchor;1128this.kind;1129this.result;*/11301131}113211331134function generateError(state, message) {1135return new YAMLException(1136message,1137new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));1138}11391140function throwError(state, message) {1141throw generateError(state, message);1142}11431144function throwWarning(state, message) {1145var error = generateError(state, message);11461147if (state.onWarning) {1148state.onWarning.call(null, error);1149} else {1150throw error;1151}1152}115311541155var directiveHandlers = {11561157YAML: function handleYamlDirective(state, name, args) {11581159var match, major, minor;11601161if (null !== state.version) {1162throwError(state, 'duplication of %YAML directive');1163}11641165if (1 !== args.length) {1166throwError(state, 'YAML directive accepts exactly one argument');1167}11681169match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);11701171if (null === match) {1172throwError(state, 'ill-formed argument of the YAML directive');1173}11741175major = parseInt(match[1], 10);1176minor = parseInt(match[2], 10);11771178if (1 !== major) {1179throwError(state, 'unacceptable YAML version of the document');1180}11811182state.version = args[0];1183state.checkLineBreaks = (minor < 2);11841185if (1 !== minor && 2 !== minor) {1186throwWarning(state, 'unsupported YAML version of the document');1187}1188},11891190TAG: function handleTagDirective(state, name, args) {11911192var handle, prefix;11931194if (2 !== args.length) {1195throwError(state, 'TAG directive accepts exactly two arguments');1196}11971198handle = args[0];1199prefix = args[1];12001201if (!PATTERN_TAG_HANDLE.test(handle)) {1202throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');1203}12041205if (_hasOwnProperty.call(state.tagMap, handle)) {1206throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');1207}12081209if (!PATTERN_TAG_URI.test(prefix)) {1210throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');1211}12121213state.tagMap[handle] = prefix;1214}1215};121612171218function captureSegment(state, start, end, checkJson) {1219var _position, _length, _character, _result;12201221if (start < end) {1222_result = state.input.slice(start, end);12231224if (checkJson) {1225for (_position = 0, _length = _result.length;1226_position < _length;1227_position += 1) {1228_character = _result.charCodeAt(_position);1229if (!(0x09 === _character ||12300x20 <= _character && _character <= 0x10FFFF)) {1231throwError(state, 'expected valid JSON character');1232}1233}1234}12351236state.result += _result;1237}1238}12391240function mergeMappings(state, destination, source) {1241var sourceKeys, key, index, quantity;12421243if (!common.isObject(source)) {1244throwError(state, 'cannot merge mappings; the provided source object is unacceptable');1245}12461247sourceKeys = Object.keys(source);12481249for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {1250key = sourceKeys[index];12511252if (!_hasOwnProperty.call(destination, key)) {1253destination[key] = source[key];1254}1255}1256}12571258function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {1259var index, quantity;12601261keyNode = String(keyNode);12621263if (null === _result) {1264_result = {};1265}12661267if ('tag:yaml.org,2002:merge' === keyTag) {1268if (Array.isArray(valueNode)) {1269for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {1270mergeMappings(state, _result, valueNode[index]);1271}1272} else {1273mergeMappings(state, _result, valueNode);1274}1275} else {1276_result[keyNode] = valueNode;1277}12781279return _result;1280}12811282function readLineBreak(state) {1283var ch;12841285ch = state.input.charCodeAt(state.position);12861287if (0x0A/* LF */ === ch) {1288state.position++;1289} else if (0x0D/* CR */ === ch) {1290state.position++;1291if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {1292state.position++;1293}1294} else {1295throwError(state, 'a line break is expected');1296}12971298state.line += 1;1299state.lineStart = state.position;1300}13011302function skipSeparationSpace(state, allowComments, checkIndent) {1303var lineBreaks = 0,1304ch = state.input.charCodeAt(state.position);13051306while (0 !== ch) {1307while (is_WHITE_SPACE(ch)) {1308ch = state.input.charCodeAt(++state.position);1309}13101311if (allowComments && 0x23/* # */ === ch) {1312do {1313ch = state.input.charCodeAt(++state.position);1314} while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);1315}13161317if (is_EOL(ch)) {1318readLineBreak(state);13191320ch = state.input.charCodeAt(state.position);1321lineBreaks++;1322state.lineIndent = 0;13231324while (0x20/* Space */ === ch) {1325state.lineIndent++;1326ch = state.input.charCodeAt(++state.position);1327}1328} else {1329break;1330}1331}13321333if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {1334throwWarning(state, 'deficient indentation');1335}13361337return lineBreaks;1338}13391340function testDocumentSeparator(state) {1341var _position = state.position,1342ch;13431344ch = state.input.charCodeAt(_position);13451346// Condition state.position === state.lineStart is tested1347// in parent on each call, for efficiency. No needs to test here again.1348if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&1349state.input.charCodeAt(_position + 1) === ch &&1350state.input.charCodeAt(_position + 2) === ch) {13511352_position += 3;13531354ch = state.input.charCodeAt(_position);13551356if (ch === 0 || is_WS_OR_EOL(ch)) {1357return true;1358}1359}13601361return false;1362}13631364function writeFoldedLines(state, count) {1365if (1 === count) {1366state.result += ' ';1367} else if (count > 1) {1368state.result += common.repeat('\n', count - 1);1369}1370}137113721373function readPlainScalar(state, nodeIndent, withinFlowCollection) {1374var preceding,1375following,1376captureStart,1377captureEnd,1378hasPendingContent,1379_line,1380_lineStart,1381_lineIndent,1382_kind = state.kind,1383_result = state.result,1384ch;13851386ch = state.input.charCodeAt(state.position);13871388if (is_WS_OR_EOL(ch) ||1389is_FLOW_INDICATOR(ch) ||13900x23/* # */ === ch ||13910x26/* & */ === ch ||13920x2A/* * */ === ch ||13930x21/* ! */ === ch ||13940x7C/* | */ === ch ||13950x3E/* > */ === ch ||13960x27/* ' */ === ch ||13970x22/* " */ === ch ||13980x25/* % */ === ch ||13990x40/* @ */ === ch ||14000x60/* ` */ === ch) {1401return false;1402}14031404if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {1405following = state.input.charCodeAt(state.position + 1);14061407if (is_WS_OR_EOL(following) ||1408withinFlowCollection && is_FLOW_INDICATOR(following)) {1409return false;1410}1411}14121413state.kind = 'scalar';1414state.result = '';1415captureStart = captureEnd = state.position;1416hasPendingContent = false;14171418while (0 !== ch) {1419if (0x3A/* : */ === ch) {1420following = state.input.charCodeAt(state.position + 1);14211422if (is_WS_OR_EOL(following) ||1423withinFlowCollection && is_FLOW_INDICATOR(following)) {1424break;1425}14261427} else if (0x23/* # */ === ch) {1428preceding = state.input.charCodeAt(state.position - 1);14291430if (is_WS_OR_EOL(preceding)) {1431break;1432}14331434} else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||1435withinFlowCollection && is_FLOW_INDICATOR(ch)) {1436break;14371438} else if (is_EOL(ch)) {1439_line = state.line;1440_lineStart = state.lineStart;1441_lineIndent = state.lineIndent;1442skipSeparationSpace(state, false, -1);14431444if (state.lineIndent >= nodeIndent) {1445hasPendingContent = true;1446ch = state.input.charCodeAt(state.position);1447continue;1448} else {1449state.position = captureEnd;1450state.line = _line;1451state.lineStart = _lineStart;1452state.lineIndent = _lineIndent;1453break;1454}1455}14561457if (hasPendingContent) {1458captureSegment(state, captureStart, captureEnd, false);1459writeFoldedLines(state, state.line - _line);1460captureStart = captureEnd = state.position;1461hasPendingContent = false;1462}14631464if (!is_WHITE_SPACE(ch)) {1465captureEnd = state.position + 1;1466}14671468ch = state.input.charCodeAt(++state.position);1469}14701471captureSegment(state, captureStart, captureEnd, false);14721473if (state.result) {1474return true;1475}14761477state.kind = _kind;1478state.result = _result;1479return false;1480}14811482function readSingleQuotedScalar(state, nodeIndent) {1483var ch,1484captureStart, captureEnd;14851486ch = state.input.charCodeAt(state.position);14871488if (0x27/* ' */ !== ch) {1489return false;1490}14911492state.kind = 'scalar';1493state.result = '';1494state.position++;1495captureStart = captureEnd = state.position;14961497while (0 !== (ch = state.input.charCodeAt(state.position))) {1498if (0x27/* ' */ === ch) {1499captureSegment(state, captureStart, state.position, true);1500ch = state.input.charCodeAt(++state.position);15011502if (0x27/* ' */ === ch) {1503captureStart = captureEnd = state.position;1504state.position++;1505} else {1506return true;1507}15081509} else if (is_EOL(ch)) {1510captureSegment(state, captureStart, captureEnd, true);1511writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));1512captureStart = captureEnd = state.position;15131514} else if (state.position === state.lineStart && testDocumentSeparator(state)) {1515throwError(state, 'unexpected end of the document within a single quoted scalar');15161517} else {1518state.position++;1519captureEnd = state.position;1520}1521}15221523throwError(state, 'unexpected end of the stream within a single quoted scalar');1524}15251526function readDoubleQuotedScalar(state, nodeIndent) {1527var captureStart,1528captureEnd,1529hexLength,1530hexResult,1531tmp, tmpEsc,1532ch;15331534ch = state.input.charCodeAt(state.position);15351536if (0x22/* " */ !== ch) {1537return false;1538}15391540state.kind = 'scalar';1541state.result = '';1542state.position++;1543captureStart = captureEnd = state.position;15441545while (0 !== (ch = state.input.charCodeAt(state.position))) {1546if (0x22/* " */ === ch) {1547captureSegment(state, captureStart, state.position, true);1548state.position++;1549return true;15501551} else if (0x5C/* \ */ === ch) {1552captureSegment(state, captureStart, state.position, true);1553ch = state.input.charCodeAt(++state.position);15541555if (is_EOL(ch)) {1556skipSeparationSpace(state, false, nodeIndent);15571558// TODO: rework to inline fn with no type cast?1559} else if (ch < 256 && simpleEscapeCheck[ch]) {1560state.result += simpleEscapeMap[ch];1561state.position++;15621563} else if ((tmp = escapedHexLen(ch)) > 0) {1564hexLength = tmp;1565hexResult = 0;15661567for (; hexLength > 0; hexLength--) {1568ch = state.input.charCodeAt(++state.position);15691570if ((tmp = fromHexCode(ch)) >= 0) {1571hexResult = (hexResult << 4) + tmp;15721573} else {1574throwError(state, 'expected hexadecimal character');1575}1576}15771578state.result += charFromCodepoint(hexResult);15791580state.position++;15811582} else {1583throwError(state, 'unknown escape sequence');1584}15851586captureStart = captureEnd = state.position;15871588} else if (is_EOL(ch)) {1589captureSegment(state, captureStart, captureEnd, true);1590writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));1591captureStart = captureEnd = state.position;15921593} else if (state.position === state.lineStart && testDocumentSeparator(state)) {1594throwError(state, 'unexpected end of the document within a double quoted scalar');15951596} else {1597state.position++;1598captureEnd = state.position;1599}1600}16011602throwError(state, 'unexpected end of the stream within a double quoted scalar');1603}16041605function readFlowCollection(state, nodeIndent) {1606var readNext = true,1607_line,1608_tag = state.tag,1609_result,1610_anchor = state.anchor,1611following,1612terminator,1613isPair,1614isExplicitPair,1615isMapping,1616keyNode,1617keyTag,1618valueNode,1619ch;16201621ch = state.input.charCodeAt(state.position);16221623if (ch === 0x5B/* [ */) {1624terminator = 0x5D;/* ] */1625isMapping = false;1626_result = [];1627} else if (ch === 0x7B/* { */) {1628terminator = 0x7D;/* } */1629isMapping = true;1630_result = {};1631} else {1632return false;1633}16341635if (null !== state.anchor) {1636state.anchorMap[state.anchor] = _result;1637}16381639ch = state.input.charCodeAt(++state.position);16401641while (0 !== ch) {1642skipSeparationSpace(state, true, nodeIndent);16431644ch = state.input.charCodeAt(state.position);16451646if (ch === terminator) {1647state.position++;1648state.tag = _tag;1649state.anchor = _anchor;1650state.kind = isMapping ? 'mapping' : 'sequence';1651state.result = _result;1652return true;1653} else if (!readNext) {1654throwError(state, 'missed comma between flow collection entries');1655}16561657keyTag = keyNode = valueNode = null;1658isPair = isExplicitPair = false;16591660if (0x3F/* ? */ === ch) {1661following = state.input.charCodeAt(state.position + 1);16621663if (is_WS_OR_EOL(following)) {1664isPair = isExplicitPair = true;1665state.position++;1666skipSeparationSpace(state, true, nodeIndent);1667}1668}16691670_line = state.line;1671composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);1672keyTag = state.tag;1673keyNode = state.result;1674skipSeparationSpace(state, true, nodeIndent);16751676ch = state.input.charCodeAt(state.position);16771678if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {1679isPair = true;1680ch = state.input.charCodeAt(++state.position);1681skipSeparationSpace(state, true, nodeIndent);1682composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);1683valueNode = state.result;1684}16851686if (isMapping) {1687storeMappingPair(state, _result, keyTag, keyNode, valueNode);1688} else if (isPair) {1689_result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));1690} else {1691_result.push(keyNode);1692}16931694skipSeparationSpace(state, true, nodeIndent);16951696ch = state.input.charCodeAt(state.position);16971698if (0x2C/* , */ === ch) {1699readNext = true;1700ch = state.input.charCodeAt(++state.position);1701} else {1702readNext = false;1703}1704}17051706throwError(state, 'unexpected end of the stream within a flow collection');1707}17081709function readBlockScalar(state, nodeIndent) {1710var captureStart,1711folding,1712chomping = CHOMPING_CLIP,1713detectedIndent = false,1714textIndent = nodeIndent,1715emptyLines = 0,1716atMoreIndented = false,1717tmp,1718ch;17191720ch = state.input.charCodeAt(state.position);17211722if (ch === 0x7C/* | */) {1723folding = false;1724} else if (ch === 0x3E/* > */) {1725folding = true;1726} else {1727return false;1728}17291730state.kind = 'scalar';1731state.result = '';17321733while (0 !== ch) {1734ch = state.input.charCodeAt(++state.position);17351736if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {1737if (CHOMPING_CLIP === chomping) {1738chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;1739} else {1740throwError(state, 'repeat of a chomping mode identifier');1741}17421743} else if ((tmp = fromDecimalCode(ch)) >= 0) {1744if (tmp === 0) {1745throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');1746} else if (!detectedIndent) {1747textIndent = nodeIndent + tmp - 1;1748detectedIndent = true;1749} else {1750throwError(state, 'repeat of an indentation width identifier');1751}17521753} else {1754break;1755}1756}17571758if (is_WHITE_SPACE(ch)) {1759do { ch = state.input.charCodeAt(++state.position); }1760while (is_WHITE_SPACE(ch));17611762if (0x23/* # */ === ch) {1763do { ch = state.input.charCodeAt(++state.position); }1764while (!is_EOL(ch) && (0 !== ch));1765}1766}17671768while (0 !== ch) {1769readLineBreak(state);1770state.lineIndent = 0;17711772ch = state.input.charCodeAt(state.position);17731774while ((!detectedIndent || state.lineIndent < textIndent) &&1775(0x20/* Space */ === ch)) {1776state.lineIndent++;1777ch = state.input.charCodeAt(++state.position);1778}17791780if (!detectedIndent && state.lineIndent > textIndent) {1781textIndent = state.lineIndent;1782}17831784if (is_EOL(ch)) {1785emptyLines++;1786continue;1787}17881789// End of the scalar.1790if (state.lineIndent < textIndent) {17911792// Perform the chomping.1793if (chomping === CHOMPING_KEEP) {1794state.result += common.repeat('\n', emptyLines);1795} else if (chomping === CHOMPING_CLIP) {1796if (detectedIndent) { // i.e. only if the scalar is not empty.1797state.result += '\n';1798}1799}18001801// Break this `while` cycle and go to the funciton's epilogue.1802break;1803}18041805// Folded style: use fancy rules to handle line breaks.1806if (folding) {18071808// Lines starting with white space characters (more-indented lines) are not folded.1809if (is_WHITE_SPACE(ch)) {1810atMoreIndented = true;1811state.result += common.repeat('\n', emptyLines + 1);18121813// End of more-indented block.1814} else if (atMoreIndented) {1815atMoreIndented = false;1816state.result += common.repeat('\n', emptyLines + 1);18171818// Just one line break - perceive as the same line.1819} else if (0 === emptyLines) {1820if (detectedIndent) { // i.e. only if we have already read some scalar content.1821state.result += ' ';1822}18231824// Several line breaks - perceive as different lines.1825} else {1826state.result += common.repeat('\n', emptyLines);1827}18281829// Literal style: just add exact number of line breaks between content lines.1830} else if (detectedIndent) {1831// If current line isn't the first one - count line break from the last content line.1832state.result += common.repeat('\n', emptyLines + 1);1833} else {1834// In case of the first content line - count only empty lines.1835}18361837detectedIndent = true;1838emptyLines = 0;1839captureStart = state.position;18401841while (!is_EOL(ch) && (0 !== ch)) {1842ch = state.input.charCodeAt(++state.position);1843}18441845captureSegment(state, captureStart, state.position, false);1846}18471848return true;1849}18501851function readBlockSequence(state, nodeIndent) {1852var _line,1853_tag = state.tag,1854_anchor = state.anchor,1855_result = [],1856following,1857detected = false,1858ch;18591860if (null !== state.anchor) {1861state.anchorMap[state.anchor] = _result;1862}18631864ch = state.input.charCodeAt(state.position);18651866while (0 !== ch) {18671868if (0x2D/* - */ !== ch) {1869break;1870}18711872following = state.input.charCodeAt(state.position + 1);18731874if (!is_WS_OR_EOL(following)) {1875break;1876}18771878detected = true;1879state.position++;18801881if (skipSeparationSpace(state, true, -1)) {1882if (state.lineIndent <= nodeIndent) {1883_result.push(null);1884ch = state.input.charCodeAt(state.position);1885continue;1886}1887}18881889_line = state.line;1890composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);1891_result.push(state.result);1892skipSeparationSpace(state, true, -1);18931894ch = state.input.charCodeAt(state.position);18951896if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {1897throwError(state, 'bad indentation of a sequence entry');1898} else if (state.lineIndent < nodeIndent) {1899break;1900}1901}19021903if (detected) {1904state.tag = _tag;1905state.anchor = _anchor;1906state.kind = 'sequence';1907state.result = _result;1908return true;1909}1910return false;1911}19121913function readBlockMapping(state, nodeIndent, flowIndent) {1914var following,1915allowCompact,1916_line,1917_tag = state.tag,1918_anchor = state.anchor,1919_result = {},1920keyTag = null,1921keyNode = null,1922valueNode = null,1923atExplicitKey = false,1924detected = false,1925ch;19261927if (null !== state.anchor) {1928state.anchorMap[state.anchor] = _result;1929}19301931ch = state.input.charCodeAt(state.position);19321933while (0 !== ch) {1934following = state.input.charCodeAt(state.position + 1);1935_line = state.line; // Save the current line.19361937//1938// Explicit notation case. There are two separate blocks:1939// first for the key (denoted by "?") and second for the value (denoted by ":")1940//1941if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) {19421943if (0x3F/* ? */ === ch) {1944if (atExplicitKey) {1945storeMappingPair(state, _result, keyTag, keyNode, null);1946keyTag = keyNode = valueNode = null;1947}19481949detected = true;1950atExplicitKey = true;1951allowCompact = true;19521953} else if (atExplicitKey) {1954// i.e. 0x3A/* : */ === character after the explicit key.1955atExplicitKey = false;1956allowCompact = true;19571958} else {1959throwError(state, 'incomplete explicit mapping pair; a key node is missed');1960}19611962state.position += 1;1963ch = following;19641965//1966// Implicit notation case. Flow-style node as the key first, then ":", and the value.1967//1968} else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {19691970if (state.line === _line) {1971ch = state.input.charCodeAt(state.position);19721973while (is_WHITE_SPACE(ch)) {1974ch = state.input.charCodeAt(++state.position);1975}19761977if (0x3A/* : */ === ch) {1978ch = state.input.charCodeAt(++state.position);19791980if (!is_WS_OR_EOL(ch)) {1981throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');1982}19831984if (atExplicitKey) {1985storeMappingPair(state, _result, keyTag, keyNode, null);1986keyTag = keyNode = valueNode = null;1987}19881989detected = true;1990atExplicitKey = false;1991allowCompact = false;1992keyTag = state.tag;1993keyNode = state.result;19941995} else if (detected) {1996throwError(state, 'can not read an implicit mapping pair; a colon is missed');19971998} else {1999state.tag = _tag;2000state.anchor = _anchor;2001return true; // Keep the result of `composeNode`.2002}20032004} else if (detected) {2005throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');20062007} else {2008state.tag = _tag;2009state.anchor = _anchor;2010return true; // Keep the result of `composeNode`.2011}20122013} else {2014break; // Reading is done. Go to the epilogue.2015}20162017//2018// Common reading code for both explicit and implicit notations.2019//2020if (state.line === _line || state.lineIndent > nodeIndent) {2021if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {2022if (atExplicitKey) {2023keyNode = state.result;2024} else {2025valueNode = state.result;2026}2027}20282029if (!atExplicitKey) {2030storeMappingPair(state, _result, keyTag, keyNode, valueNode);2031keyTag = keyNode = valueNode = null;2032}20332034skipSeparationSpace(state, true, -1);2035ch = state.input.charCodeAt(state.position);2036}20372038if (state.lineIndent > nodeIndent && (0 !== ch)) {2039throwError(state, 'bad indentation of a mapping entry');2040} else if (state.lineIndent < nodeIndent) {2041break;2042}2043}20442045//2046// Epilogue.2047//20482049// Special case: last mapping's node contains only the key in explicit notation.2050if (atExplicitKey) {2051storeMappingPair(state, _result, keyTag, keyNode, null);2052}20532054// Expose the resulting mapping.2055if (detected) {2056state.tag = _tag;2057state.anchor = _anchor;2058state.kind = 'mapping';2059state.result = _result;2060}20612062return detected;2063}20642065function readTagProperty(state) {2066var _position,2067isVerbatim = false,2068isNamed = false,2069tagHandle,2070tagName,2071ch;20722073ch = state.input.charCodeAt(state.position);20742075if (0x21/* ! */ !== ch) {2076return false;2077}20782079if (null !== state.tag) {2080throwError(state, 'duplication of a tag property');2081}20822083ch = state.input.charCodeAt(++state.position);20842085if (0x3C/* < */ === ch) {2086isVerbatim = true;2087ch = state.input.charCodeAt(++state.position);20882089} else if (0x21/* ! */ === ch) {2090isNamed = true;2091tagHandle = '!!';2092ch = state.input.charCodeAt(++state.position);20932094} else {2095tagHandle = '!';2096}20972098_position = state.position;20992100if (isVerbatim) {2101do { ch = state.input.charCodeAt(++state.position); }2102while (0 !== ch && 0x3E/* > */ !== ch);21032104if (state.position < state.length) {2105tagName = state.input.slice(_position, state.position);2106ch = state.input.charCodeAt(++state.position);2107} else {2108throwError(state, 'unexpected end of the stream within a verbatim tag');2109}2110} else {2111while (0 !== ch && !is_WS_OR_EOL(ch)) {21122113if (0x21/* ! */ === ch) {2114if (!isNamed) {2115tagHandle = state.input.slice(_position - 1, state.position + 1);21162117if (!PATTERN_TAG_HANDLE.test(tagHandle)) {2118throwError(state, 'named tag handle cannot contain such characters');2119}21202121isNamed = true;2122_position = state.position + 1;2123} else {2124throwError(state, 'tag suffix cannot contain exclamation marks');2125}2126}21272128ch = state.input.charCodeAt(++state.position);2129}21302131tagName = state.input.slice(_position, state.position);21322133if (PATTERN_FLOW_INDICATORS.test(tagName)) {2134throwError(state, 'tag suffix cannot contain flow indicator characters');2135}2136}21372138if (tagName && !PATTERN_TAG_URI.test(tagName)) {2139throwError(state, 'tag name cannot contain such characters: ' + tagName);2140}21412142if (isVerbatim) {2143state.tag = tagName;21442145} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {2146state.tag = state.tagMap[tagHandle] + tagName;21472148} else if ('!' === tagHandle) {2149state.tag = '!' + tagName;21502151} else if ('!!' === tagHandle) {2152state.tag = 'tag:yaml.org,2002:' + tagName;21532154} else {2155throwError(state, 'undeclared tag handle "' + tagHandle + '"');2156}21572158return true;2159}21602161function readAnchorProperty(state) {2162var _position,2163ch;21642165ch = state.input.charCodeAt(state.position);21662167if (0x26/* & */ !== ch) {2168return false;2169}21702171if (null !== state.anchor) {2172throwError(state, 'duplication of an anchor property');2173}21742175ch = state.input.charCodeAt(++state.position);2176_position = state.position;21772178while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {2179ch = state.input.charCodeAt(++state.position);2180}21812182if (state.position === _position) {2183throwError(state, 'name of an anchor node must contain at least one character');2184}21852186state.anchor = state.input.slice(_position, state.position);2187return true;2188}21892190function readAlias(state) {2191var _position, alias,2192len = state.length,2193input = state.input,2194ch;21952196ch = state.input.charCodeAt(state.position);21972198if (0x2A/* * */ !== ch) {2199return false;2200}22012202ch = state.input.charCodeAt(++state.position);2203_position = state.position;22042205while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {2206ch = state.input.charCodeAt(++state.position);2207}22082209if (state.position === _position) {2210throwError(state, 'name of an alias node must contain at least one character');2211}22122213alias = state.input.slice(_position, state.position);22142215if (!state.anchorMap.hasOwnProperty(alias)) {2216throwError(state, 'unidentified alias "' + alias + '"');2217}22182219state.result = state.anchorMap[alias];2220skipSeparationSpace(state, true, -1);2221return true;2222}22232224function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {2225var allowBlockStyles,2226allowBlockScalars,2227allowBlockCollections,2228indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent2229atNewLine = false,2230hasContent = false,2231typeIndex,2232typeQuantity,2233type,2234flowIndent,2235blockIndent,2236_result;22372238state.tag = null;2239state.anchor = null;2240state.kind = null;2241state.result = null;22422243allowBlockStyles = allowBlockScalars = allowBlockCollections =2244CONTEXT_BLOCK_OUT === nodeContext ||2245CONTEXT_BLOCK_IN === nodeContext;22462247if (allowToSeek) {2248if (skipSeparationSpace(state, true, -1)) {2249atNewLine = true;22502251if (state.lineIndent > parentIndent) {2252indentStatus = 1;2253} else if (state.lineIndent === parentIndent) {2254indentStatus = 0;2255} else if (state.lineIndent < parentIndent) {2256indentStatus = -1;2257}2258}2259}22602261if (1 === indentStatus) {2262while (readTagProperty(state) || readAnchorProperty(state)) {2263if (skipSeparationSpace(state, true, -1)) {2264atNewLine = true;2265allowBlockCollections = allowBlockStyles;22662267if (state.lineIndent > parentIndent) {2268indentStatus = 1;2269} else if (state.lineIndent === parentIndent) {2270indentStatus = 0;2271} else if (state.lineIndent < parentIndent) {2272indentStatus = -1;2273}2274} else {2275allowBlockCollections = false;2276}2277}2278}22792280if (allowBlockCollections) {2281allowBlockCollections = atNewLine || allowCompact;2282}22832284if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {2285if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {2286flowIndent = parentIndent;2287} else {2288flowIndent = parentIndent + 1;2289}22902291blockIndent = state.position - state.lineStart;22922293if (1 === indentStatus) {2294if (allowBlockCollections &&2295(readBlockSequence(state, blockIndent) ||2296readBlockMapping(state, blockIndent, flowIndent)) ||2297readFlowCollection(state, flowIndent)) {2298hasContent = true;2299} else {2300if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||2301readSingleQuotedScalar(state, flowIndent) ||2302readDoubleQuotedScalar(state, flowIndent)) {2303hasContent = true;23042305} else if (readAlias(state)) {2306hasContent = true;23072308if (null !== state.tag || null !== state.anchor) {2309throwError(state, 'alias node should not have any properties');2310}23112312} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {2313hasContent = true;23142315if (null === state.tag) {2316state.tag = '?';2317}2318}23192320if (null !== state.anchor) {2321state.anchorMap[state.anchor] = state.result;2322}2323}2324} else if (0 === indentStatus) {2325// Special case: block sequences are allowed to have same indentation level as the parent.2326// http://www.yaml.org/spec/1.2/spec.html#id27997842327hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);2328}2329}23302331if (null !== state.tag && '!' !== state.tag) {2332if ('?' === state.tag) {2333for (typeIndex = 0, typeQuantity = state.implicitTypes.length;2334typeIndex < typeQuantity;2335typeIndex += 1) {2336type = state.implicitTypes[typeIndex];23372338// Implicit resolving is not allowed for non-scalar types, and '?'2339// non-specific tag is only assigned to plain scalars. So, it isn't2340// needed to check for 'kind' conformity.23412342if (type.resolve(state.result)) { // `state.result` updated in resolver if matched2343state.result = type.construct(state.result);2344state.tag = type.tag;2345if (null !== state.anchor) {2346state.anchorMap[state.anchor] = state.result;2347}2348break;2349}2350}2351} else if (_hasOwnProperty.call(state.typeMap, state.tag)) {2352type = state.typeMap[state.tag];23532354if (null !== state.result && type.kind !== state.kind) {2355throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');2356}23572358if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched2359throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');2360} else {2361state.result = type.construct(state.result);2362if (null !== state.anchor) {2363state.anchorMap[state.anchor] = state.result;2364}2365}2366} else {2367throwWarning(state, 'unknown tag !<' + state.tag + '>');2368}2369}23702371return null !== state.tag || null !== state.anchor || hasContent;2372}23732374function readDocument(state) {2375var documentStart = state.position,2376_position,2377directiveName,2378directiveArgs,2379hasDirectives = false,2380ch;23812382state.version = null;2383state.checkLineBreaks = state.legacy;2384state.tagMap = {};2385state.anchorMap = {};23862387while (0 !== (ch = state.input.charCodeAt(state.position))) {2388skipSeparationSpace(state, true, -1);23892390ch = state.input.charCodeAt(state.position);23912392if (state.lineIndent > 0 || 0x25/* % */ !== ch) {2393break;2394}23952396hasDirectives = true;2397ch = state.input.charCodeAt(++state.position);2398_position = state.position;23992400while (0 !== ch && !is_WS_OR_EOL(ch)) {2401ch = state.input.charCodeAt(++state.position);2402}24032404directiveName = state.input.slice(_position, state.position);2405directiveArgs = [];24062407if (directiveName.length < 1) {2408throwError(state, 'directive name must not be less than one character in length');2409}24102411while (0 !== ch) {2412while (is_WHITE_SPACE(ch)) {2413ch = state.input.charCodeAt(++state.position);2414}24152416if (0x23/* # */ === ch) {2417do { ch = state.input.charCodeAt(++state.position); }2418while (0 !== ch && !is_EOL(ch));2419break;2420}24212422if (is_EOL(ch)) {2423break;2424}24252426_position = state.position;24272428while (0 !== ch && !is_WS_OR_EOL(ch)) {2429ch = state.input.charCodeAt(++state.position);2430}24312432directiveArgs.push(state.input.slice(_position, state.position));2433}24342435if (0 !== ch) {2436readLineBreak(state);2437}24382439if (_hasOwnProperty.call(directiveHandlers, directiveName)) {2440directiveHandlers[directiveName](state, directiveName, directiveArgs);2441} else {2442throwWarning(state, 'unknown document directive "' + directiveName + '"');2443}2444}24452446skipSeparationSpace(state, true, -1);24472448if (0 === state.lineIndent &&24490x2D/* - */ === state.input.charCodeAt(state.position) &&24500x2D/* - */ === state.input.charCodeAt(state.position + 1) &&24510x2D/* - */ === state.input.charCodeAt(state.position + 2)) {2452state.position += 3;2453skipSeparationSpace(state, true, -1);24542455} else if (hasDirectives) {2456throwError(state, 'directives end mark is expected');2457}24582459composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);2460skipSeparationSpace(state, true, -1);24612462if (state.checkLineBreaks &&2463PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {2464throwWarning(state, 'non-ASCII line breaks are interpreted as content');2465}24662467state.documents.push(state.result);24682469if (state.position === state.lineStart && testDocumentSeparator(state)) {24702471if (0x2E/* . */ === state.input.charCodeAt(state.position)) {2472state.position += 3;2473skipSeparationSpace(state, true, -1);2474}2475return;2476}24772478if (state.position < (state.length - 1)) {2479throwError(state, 'end of the stream or a document separator is expected');2480} else {2481return;2482}2483}248424852486function loadDocuments(input, options) {2487input = String(input);2488options = options || {};24892490if (input.length !== 0) {24912492// Add tailing `\n` if not exists2493if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&24940x0D/* CR */ !== input.charCodeAt(input.length - 1)) {2495input += '\n';2496}24972498// Strip BOM2499if (input.charCodeAt(0) === 0xFEFF) {2500input = input.slice(1);2501}2502}25032504var state = new State(input, options);25052506if (PATTERN_NON_PRINTABLE.test(state.input)) {2507throwError(state, 'the stream contains non-printable characters');2508}25092510// Use 0 as string terminator. That significantly simplifies bounds check.2511state.input += '\0';25122513while (0x20/* Space */ === state.input.charCodeAt(state.position)) {2514state.lineIndent += 1;2515state.position += 1;2516}25172518while (state.position < (state.length - 1)) {2519readDocument(state);2520}25212522return state.documents;2523}252425252526function loadAll(input, iterator, options) {2527var documents = loadDocuments(input, options), index, length;25282529for (index = 0, length = documents.length; index < length; index += 1) {2530iterator(documents[index]);2531}2532}253325342535function load(input, options) {2536var documents = loadDocuments(input, options), index, length;25372538if (0 === documents.length) {2539/*eslint-disable no-undefined*/2540return undefined;2541} else if (1 === documents.length) {2542return documents[0];2543}2544throw new YAMLException('expected a single document in the stream, but found more');2545}254625472548function safeLoadAll(input, output, options) {2549loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));2550}255125522553function safeLoad(input, options) {2554return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));2555}255625572558module.exports.loadAll = loadAll;2559module.exports.load = load;2560module.exports.safeLoadAll = safeLoadAll;2561module.exports.safeLoad = safeLoad;25622563},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){2564'use strict';256525662567var common = require('./common');256825692570function Mark(name, buffer, position, line, column) {2571this.name = name;2572this.buffer = buffer;2573this.position = position;2574this.line = line;2575this.column = column;2576}257725782579Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {2580var head, start, tail, end, snippet;25812582if (!this.buffer) {2583return null;2584}25852586indent = indent || 4;2587maxLength = maxLength || 75;25882589head = '';2590start = this.position;25912592while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {2593start -= 1;2594if (this.position - start > (maxLength / 2 - 1)) {2595head = ' ... ';2596start += 5;2597break;2598}2599}26002601tail = '';2602end = this.position;26032604while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {2605end += 1;2606if (end - this.position > (maxLength / 2 - 1)) {2607tail = ' ... ';2608end -= 5;2609break;2610}2611}26122613snippet = this.buffer.slice(start, end);26142615return common.repeat(' ', indent) + head + snippet + tail + '\n' +2616common.repeat(' ', indent + this.position - start + head.length) + '^';2617};261826192620Mark.prototype.toString = function toString(compact) {2621var snippet, where = '';26222623if (this.name) {2624where += 'in "' + this.name + '" ';2625}26262627where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);26282629if (!compact) {2630snippet = this.getSnippet();26312632if (snippet) {2633where += ':\n' + snippet;2634}2635}26362637return where;2638};263926402641module.exports = Mark;26422643},{"./common":2}],7:[function(require,module,exports){2644'use strict';26452646/*eslint-disable max-len*/26472648var common = require('./common');2649var YAMLException = require('./exception');2650var Type = require('./type');265126522653function compileList(schema, name, result) {2654var exclude = [];26552656schema.include.forEach(function (includedSchema) {2657result = compileList(includedSchema, name, result);2658});26592660schema[name].forEach(function (currentType) {2661result.forEach(function (previousType, previousIndex) {2662if (previousType.tag === currentType.tag) {2663exclude.push(previousIndex);2664}2665});26662667result.push(currentType);2668});26692670return result.filter(function (type, index) {2671return -1 === exclude.indexOf(index);2672});2673}267426752676function compileMap(/* lists... */) {2677var result = {}, index, length;26782679function collectType(type) {2680result[type.tag] = type;2681}26822683for (index = 0, length = arguments.length; index < length; index += 1) {2684arguments[index].forEach(collectType);2685}26862687return result;2688}268926902691function Schema(definition) {2692this.include = definition.include || [];2693this.implicit = definition.implicit || [];2694this.explicit = definition.explicit || [];26952696this.implicit.forEach(function (type) {2697if (type.loadKind && 'scalar' !== type.loadKind) {2698throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');2699}2700});27012702this.compiledImplicit = compileList(this, 'implicit', []);2703this.compiledExplicit = compileList(this, 'explicit', []);2704this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);2705}270627072708Schema.DEFAULT = null;270927102711Schema.create = function createSchema() {2712var schemas, types;27132714switch (arguments.length) {2715case 1:2716schemas = Schema.DEFAULT;2717types = arguments[0];2718break;27192720case 2:2721schemas = arguments[0];2722types = arguments[1];2723break;27242725default:2726throw new YAMLException('Wrong number of arguments for Schema.create function');2727}27282729schemas = common.toArray(schemas);2730types = common.toArray(types);27312732if (!schemas.every(function (schema) { return schema instanceof Schema; })) {2733throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');2734}27352736if (!types.every(function (type) { return type instanceof Type; })) {2737throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');2738}27392740return new Schema({2741include: schemas,2742explicit: types2743});2744};274527462747module.exports = Schema;27482749},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){2750// Standard YAML's Core schema.2751// http://www.yaml.org/spec/1.2/spec.html#id28049232752//2753// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.2754// So, Core schema has no distinctions from JSON schema is JS-YAML.275527562757'use strict';275827592760var Schema = require('../schema');276127622763module.exports = new Schema({2764include: [2765require('./json')2766]2767});27682769},{"../schema":7,"./json":12}],9:[function(require,module,exports){2770// JS-YAML's default schema for `load` function.2771// It is not described in the YAML specification.2772//2773// This schema is based on JS-YAML's default safe schema and includes2774// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.2775//2776// Also this schema is used as default base schema at `Schema.create` function.277727782779'use strict';278027812782var Schema = require('../schema');278327842785module.exports = Schema.DEFAULT = new Schema({2786include: [2787require('./default_safe')2788],2789explicit: [2790require('../type/js/undefined'),2791require('../type/js/regexp'),2792require('../type/js/function')2793]2794});27952796},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){2797// JS-YAML's default schema for `safeLoad` function.2798// It is not described in the YAML specification.2799//2800// This schema is based on standard YAML's Core schema and includes most of2801// extra types described at YAML tag repository. (http://yaml.org/type/)280228032804'use strict';280528062807var Schema = require('../schema');280828092810module.exports = new Schema({2811include: [2812require('./core')2813],2814implicit: [2815require('../type/timestamp'),2816require('../type/merge')2817],2818explicit: [2819require('../type/binary'),2820require('../type/omap'),2821require('../type/pairs'),2822require('../type/set')2823]2824});28252826},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){2827// Standard YAML's Failsafe schema.2828// http://www.yaml.org/spec/1.2/spec.html#id2802346282928302831'use strict';283228332834var Schema = require('../schema');283528362837module.exports = new Schema({2838explicit: [2839require('../type/str'),2840require('../type/seq'),2841require('../type/map')2842]2843});28442845},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){2846// Standard YAML's JSON schema.2847// http://www.yaml.org/spec/1.2/spec.html#id28032312848//2849// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.2850// So, this schema is not such strict as defined in the YAML specification.2851// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.285228532854'use strict';285528562857var Schema = require('../schema');285828592860module.exports = new Schema({2861include: [2862require('./failsafe')2863],2864implicit: [2865require('../type/null'),2866require('../type/bool'),2867require('../type/int'),2868require('../type/float')2869]2870});28712872},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){2873'use strict';28742875var YAMLException = require('./exception');28762877var TYPE_CONSTRUCTOR_OPTIONS = [2878'kind',2879'resolve',2880'construct',2881'instanceOf',2882'predicate',2883'represent',2884'defaultStyle',2885'styleAliases'2886];28872888var YAML_NODE_KINDS = [2889'scalar',2890'sequence',2891'mapping'2892];28932894function compileStyleAliases(map) {2895var result = {};28962897if (null !== map) {2898Object.keys(map).forEach(function (style) {2899map[style].forEach(function (alias) {2900result[String(alias)] = style;2901});2902});2903}29042905return result;2906}29072908function Type(tag, options) {2909options = options || {};29102911Object.keys(options).forEach(function (name) {2912if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {2913throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');2914}2915});29162917// TODO: Add tag format check.2918this.tag = tag;2919this.kind = options['kind'] || null;2920this.resolve = options['resolve'] || function () { return true; };2921this.construct = options['construct'] || function (data) { return data; };2922this.instanceOf = options['instanceOf'] || null;2923this.predicate = options['predicate'] || null;2924this.represent = options['represent'] || null;2925this.defaultStyle = options['defaultStyle'] || null;2926this.styleAliases = compileStyleAliases(options['styleAliases'] || null);29272928if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {2929throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');2930}2931}29322933module.exports = Type;29342935},{"./exception":4}],14:[function(require,module,exports){2936'use strict';29372938/*eslint-disable no-bitwise*/29392940// A trick for browserified version.2941// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined2942var NodeBuffer = require('buffer').Buffer;2943var Type = require('../type');294429452946// [ 64, 65, 66 ] -> [ padding, CR, LF ]2947var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';294829492950function resolveYamlBinary(data) {2951if (null === data) {2952return false;2953}29542955var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP;29562957// Convert one by one.2958for (idx = 0; idx < max; idx++) {2959code = map.indexOf(data.charAt(idx));29602961// Skip CR/LF2962if (code > 64) { continue; }29632964// Fail on illegal characters2965if (code < 0) { return false; }29662967bitlen += 6;2968}29692970// If there are any bits left, source was corrupted2971return (bitlen % 8) === 0;2972}29732974function constructYamlBinary(data) {2975var code, idx, tailbits,2976input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan2977max = input.length,2978map = BASE64_MAP,2979bits = 0,2980result = [];29812982// Collect by 6*4 bits (3 bytes)29832984for (idx = 0; idx < max; idx++) {2985if ((idx % 4 === 0) && idx) {2986result.push((bits >> 16) & 0xFF);2987result.push((bits >> 8) & 0xFF);2988result.push(bits & 0xFF);2989}29902991bits = (bits << 6) | map.indexOf(input.charAt(idx));2992}29932994// Dump tail29952996tailbits = (max % 4) * 6;29972998if (tailbits === 0) {2999result.push((bits >> 16) & 0xFF);3000result.push((bits >> 8) & 0xFF);3001result.push(bits & 0xFF);3002} else if (tailbits === 18) {3003result.push((bits >> 10) & 0xFF);3004result.push((bits >> 2) & 0xFF);3005} else if (tailbits === 12) {3006result.push((bits >> 4) & 0xFF);3007}30083009// Wrap into Buffer for NodeJS and leave Array for browser3010if (NodeBuffer) {3011return new NodeBuffer(result);3012}30133014return result;3015}30163017function representYamlBinary(object /*, style*/) {3018var result = '', bits = 0, idx, tail,3019max = object.length,3020map = BASE64_MAP;30213022// Convert every three bytes to 4 ASCII characters.30233024for (idx = 0; idx < max; idx++) {3025if ((idx % 3 === 0) && idx) {3026result += map[(bits >> 18) & 0x3F];3027result += map[(bits >> 12) & 0x3F];3028result += map[(bits >> 6) & 0x3F];3029result += map[bits & 0x3F];3030}30313032bits = (bits << 8) + object[idx];3033}30343035// Dump tail30363037tail = max % 3;30383039if (tail === 0) {3040result += map[(bits >> 18) & 0x3F];3041result += map[(bits >> 12) & 0x3F];3042result += map[(bits >> 6) & 0x3F];3043result += map[bits & 0x3F];3044} else if (tail === 2) {3045result += map[(bits >> 10) & 0x3F];3046result += map[(bits >> 4) & 0x3F];3047result += map[(bits << 2) & 0x3F];3048result += map[64];3049} else if (tail === 1) {3050result += map[(bits >> 2) & 0x3F];3051result += map[(bits << 4) & 0x3F];3052result += map[64];3053result += map[64];3054}30553056return result;3057}30583059function isBinary(object) {3060return NodeBuffer && NodeBuffer.isBuffer(object);3061}30623063module.exports = new Type('tag:yaml.org,2002:binary', {3064kind: 'scalar',3065resolve: resolveYamlBinary,3066construct: constructYamlBinary,3067predicate: isBinary,3068represent: representYamlBinary3069});30703071},{"../type":13,"buffer":30}],15:[function(require,module,exports){3072'use strict';30733074var Type = require('../type');30753076function resolveYamlBoolean(data) {3077if (null === data) {3078return false;3079}30803081var max = data.length;30823083return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||3084(max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));3085}30863087function constructYamlBoolean(data) {3088return data === 'true' ||3089data === 'True' ||3090data === 'TRUE';3091}30923093function isBoolean(object) {3094return '[object Boolean]' === Object.prototype.toString.call(object);3095}30963097module.exports = new Type('tag:yaml.org,2002:bool', {3098kind: 'scalar',3099resolve: resolveYamlBoolean,3100construct: constructYamlBoolean,3101predicate: isBoolean,3102represent: {3103lowercase: function (object) { return object ? 'true' : 'false'; },3104uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },3105camelcase: function (object) { return object ? 'True' : 'False'; }3106},3107defaultStyle: 'lowercase'3108});31093110},{"../type":13}],16:[function(require,module,exports){3111'use strict';31123113var common = require('../common');3114var Type = require('../type');31153116var YAML_FLOAT_PATTERN = new RegExp(3117'^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +3118'|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +3119'|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +3120'|[-+]?\\.(?:inf|Inf|INF)' +3121'|\\.(?:nan|NaN|NAN))$');31223123function resolveYamlFloat(data) {3124if (null === data) {3125return false;3126}31273128var value, sign, base, digits;31293130if (!YAML_FLOAT_PATTERN.test(data)) {3131return false;3132}3133return true;3134}31353136function constructYamlFloat(data) {3137var value, sign, base, digits;31383139value = data.replace(/_/g, '').toLowerCase();3140sign = '-' === value[0] ? -1 : 1;3141digits = [];31423143if (0 <= '+-'.indexOf(value[0])) {3144value = value.slice(1);3145}31463147if ('.inf' === value) {3148return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;31493150} else if ('.nan' === value) {3151return NaN;31523153} else if (0 <= value.indexOf(':')) {3154value.split(':').forEach(function (v) {3155digits.unshift(parseFloat(v, 10));3156});31573158value = 0.0;3159base = 1;31603161digits.forEach(function (d) {3162value += d * base;3163base *= 60;3164});31653166return sign * value;31673168}3169return sign * parseFloat(value, 10);3170}31713172function representYamlFloat(object, style) {3173if (isNaN(object)) {3174switch (style) {3175case 'lowercase':3176return '.nan';3177case 'uppercase':3178return '.NAN';3179case 'camelcase':3180return '.NaN';3181}3182} else if (Number.POSITIVE_INFINITY === object) {3183switch (style) {3184case 'lowercase':3185return '.inf';3186case 'uppercase':3187return '.INF';3188case 'camelcase':3189return '.Inf';3190}3191} else if (Number.NEGATIVE_INFINITY === object) {3192switch (style) {3193case 'lowercase':3194return '-.inf';3195case 'uppercase':3196return '-.INF';3197case 'camelcase':3198return '-.Inf';3199}3200} else if (common.isNegativeZero(object)) {3201return '-0.0';3202}3203return object.toString(10);3204}32053206function isFloat(object) {3207return ('[object Number]' === Object.prototype.toString.call(object)) &&3208(0 !== object % 1 || common.isNegativeZero(object));3209}32103211module.exports = new Type('tag:yaml.org,2002:float', {3212kind: 'scalar',3213resolve: resolveYamlFloat,3214construct: constructYamlFloat,3215predicate: isFloat,3216represent: representYamlFloat,3217defaultStyle: 'lowercase'3218});32193220},{"../common":2,"../type":13}],17:[function(require,module,exports){3221'use strict';32223223var common = require('../common');3224var Type = require('../type');32253226function isHexCode(c) {3227return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||3228((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||3229((0x61/* a */ <= c) && (c <= 0x66/* f */));3230}32313232function isOctCode(c) {3233return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));3234}32353236function isDecCode(c) {3237return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));3238}32393240function resolveYamlInteger(data) {3241if (null === data) {3242return false;3243}32443245var max = data.length,3246index = 0,3247hasDigits = false,3248ch;32493250if (!max) { return false; }32513252ch = data[index];32533254// sign3255if (ch === '-' || ch === '+') {3256ch = data[++index];3257}32583259if (ch === '0') {3260// 03261if (index + 1 === max) { return true; }3262ch = data[++index];32633264// base 2, base 8, base 1632653266if (ch === 'b') {3267// base 23268index++;32693270for (; index < max; index++) {3271ch = data[index];3272if (ch === '_') { continue; }3273if (ch !== '0' && ch !== '1') {3274return false;3275}3276hasDigits = true;3277}3278return hasDigits;3279}328032813282if (ch === 'x') {3283// base 163284index++;32853286for (; index < max; index++) {3287ch = data[index];3288if (ch === '_') { continue; }3289if (!isHexCode(data.charCodeAt(index))) {3290return false;3291}3292hasDigits = true;3293}3294return hasDigits;3295}32963297// base 83298for (; index < max; index++) {3299ch = data[index];3300if (ch === '_') { continue; }3301if (!isOctCode(data.charCodeAt(index))) {3302return false;3303}3304hasDigits = true;3305}3306return hasDigits;3307}33083309// base 10 (except 0) or base 6033103311for (; index < max; index++) {3312ch = data[index];3313if (ch === '_') { continue; }3314if (ch === ':') { break; }3315if (!isDecCode(data.charCodeAt(index))) {3316return false;3317}3318hasDigits = true;3319}33203321if (!hasDigits) { return false; }33223323// if !base60 - done;3324if (ch !== ':') { return true; }33253326// base60 almost not used, no needs to optimize3327return /^(:[0-5]?[0-9])+$/.test(data.slice(index));3328}33293330function constructYamlInteger(data) {3331var value = data, sign = 1, ch, base, digits = [];33323333if (value.indexOf('_') !== -1) {3334value = value.replace(/_/g, '');3335}33363337ch = value[0];33383339if (ch === '-' || ch === '+') {3340if (ch === '-') { sign = -1; }3341value = value.slice(1);3342ch = value[0];3343}33443345if ('0' === value) {3346return 0;3347}33483349if (ch === '0') {3350if (value[1] === 'b') {3351return sign * parseInt(value.slice(2), 2);3352}3353if (value[1] === 'x') {3354return sign * parseInt(value, 16);3355}3356return sign * parseInt(value, 8);33573358}33593360if (value.indexOf(':') !== -1) {3361value.split(':').forEach(function (v) {3362digits.unshift(parseInt(v, 10));3363});33643365value = 0;3366base = 1;33673368digits.forEach(function (d) {3369value += (d * base);3370base *= 60;3371});33723373return sign * value;33743375}33763377return sign * parseInt(value, 10);3378}33793380function isInteger(object) {3381return ('[object Number]' === Object.prototype.toString.call(object)) &&3382(0 === object % 1 && !common.isNegativeZero(object));3383}33843385module.exports = new Type('tag:yaml.org,2002:int', {3386kind: 'scalar',3387resolve: resolveYamlInteger,3388construct: constructYamlInteger,3389predicate: isInteger,3390represent: {3391binary: function (object) { return '0b' + object.toString(2); },3392octal: function (object) { return '0' + object.toString(8); },3393decimal: function (object) { return object.toString(10); },3394hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }3395},3396defaultStyle: 'decimal',3397styleAliases: {3398binary: [ 2, 'bin' ],3399octal: [ 8, 'oct' ],3400decimal: [ 10, 'dec' ],3401hexadecimal: [ 16, 'hex' ]3402}3403});34043405},{"../common":2,"../type":13}],18:[function(require,module,exports){3406'use strict';34073408var esprima;34093410// Browserified version does not have esprima3411//3412// 1. For node.js just require module as deps3413// 2. For browser try to require mudule via external AMD system.3414// If not found - try to fallback to window.esprima. If not3415// found too - then fail to parse.3416//3417try {3418esprima = require('esprima');3419} catch (_) {3420/*global window */3421if (typeof window !== 'undefined') { esprima = window.esprima; }3422}34233424var Type = require('../../type');34253426function resolveJavascriptFunction(data) {3427if (null === data) {3428return false;3429}34303431try {3432var source = '(' + data + ')',3433ast = esprima.parse(source, { range: true }),3434params = [],3435body;34363437if ('Program' !== ast.type ||34381 !== ast.body.length ||3439'ExpressionStatement' !== ast.body[0].type ||3440'FunctionExpression' !== ast.body[0].expression.type) {3441return false;3442}34433444return true;3445} catch (err) {3446return false;3447}3448}34493450function constructJavascriptFunction(data) {3451/*jslint evil:true*/34523453var source = '(' + data + ')',3454ast = esprima.parse(source, { range: true }),3455params = [],3456body;34573458if ('Program' !== ast.type ||34591 !== ast.body.length ||3460'ExpressionStatement' !== ast.body[0].type ||3461'FunctionExpression' !== ast.body[0].expression.type) {3462throw new Error('Failed to resolve function');3463}34643465ast.body[0].expression.params.forEach(function (param) {3466params.push(param.name);3467});34683469body = ast.body[0].expression.body.range;34703471// Esprima's ranges include the first '{' and the last '}' characters on3472// function expressions. So cut them out.3473/*eslint-disable no-new-func*/3474return new Function(params, source.slice(body[0] + 1, body[1] - 1));3475}34763477function representJavascriptFunction(object /*, style*/) {3478return object.toString();3479}34803481function isFunction(object) {3482return '[object Function]' === Object.prototype.toString.call(object);3483}34843485module.exports = new Type('tag:yaml.org,2002:js/function', {3486kind: 'scalar',3487resolve: resolveJavascriptFunction,3488construct: constructJavascriptFunction,3489predicate: isFunction,3490represent: representJavascriptFunction3491});34923493},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){3494'use strict';34953496var Type = require('../../type');34973498function resolveJavascriptRegExp(data) {3499if (null === data) {3500return false;3501}35023503if (0 === data.length) {3504return false;3505}35063507var regexp = data,3508tail = /\/([gim]*)$/.exec(data),3509modifiers = '';35103511// if regexp starts with '/' it can have modifiers and must be properly closed3512// `/foo/gim` - modifiers tail can be maximum 3 chars3513if ('/' === regexp[0]) {3514if (tail) {3515modifiers = tail[1];3516}35173518if (modifiers.length > 3) { return false; }3519// if expression starts with /, is should be properly terminated3520if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }35213522regexp = regexp.slice(1, regexp.length - modifiers.length - 1);3523}35243525try {3526var dummy = new RegExp(regexp, modifiers);3527return true;3528} catch (error) {3529return false;3530}3531}35323533function constructJavascriptRegExp(data) {3534var regexp = data,3535tail = /\/([gim]*)$/.exec(data),3536modifiers = '';35373538// `/foo/gim` - tail can be maximum 4 chars3539if ('/' === regexp[0]) {3540if (tail) {3541modifiers = tail[1];3542}3543regexp = regexp.slice(1, regexp.length - modifiers.length - 1);3544}35453546return new RegExp(regexp, modifiers);3547}35483549function representJavascriptRegExp(object /*, style*/) {3550var result = '/' + object.source + '/';35513552if (object.global) {3553result += 'g';3554}35553556if (object.multiline) {3557result += 'm';3558}35593560if (object.ignoreCase) {3561result += 'i';3562}35633564return result;3565}35663567function isRegExp(object) {3568return '[object RegExp]' === Object.prototype.toString.call(object);3569}35703571module.exports = new Type('tag:yaml.org,2002:js/regexp', {3572kind: 'scalar',3573resolve: resolveJavascriptRegExp,3574construct: constructJavascriptRegExp,3575predicate: isRegExp,3576represent: representJavascriptRegExp3577});35783579},{"../../type":13}],20:[function(require,module,exports){3580'use strict';35813582var Type = require('../../type');35833584function resolveJavascriptUndefined() {3585return true;3586}35873588function constructJavascriptUndefined() {3589/*eslint-disable no-undefined*/3590return undefined;3591}35923593function representJavascriptUndefined() {3594return '';3595}35963597function isUndefined(object) {3598return 'undefined' === typeof object;3599}36003601module.exports = new Type('tag:yaml.org,2002:js/undefined', {3602kind: 'scalar',3603resolve: resolveJavascriptUndefined,3604construct: constructJavascriptUndefined,3605predicate: isUndefined,3606represent: representJavascriptUndefined3607});36083609},{"../../type":13}],21:[function(require,module,exports){3610'use strict';36113612var Type = require('../type');36133614module.exports = new Type('tag:yaml.org,2002:map', {3615kind: 'mapping',3616construct: function (data) { return null !== data ? data : {}; }3617});36183619},{"../type":13}],22:[function(require,module,exports){3620'use strict';36213622var Type = require('../type');36233624function resolveYamlMerge(data) {3625return '<<' === data || null === data;3626}36273628module.exports = new Type('tag:yaml.org,2002:merge', {3629kind: 'scalar',3630resolve: resolveYamlMerge3631});36323633},{"../type":13}],23:[function(require,module,exports){3634'use strict';36353636var Type = require('../type');36373638function resolveYamlNull(data) {3639if (null === data) {3640return true;3641}36423643var max = data.length;36443645return (max === 1 && data === '~') ||3646(max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));3647}36483649function constructYamlNull() {3650return null;3651}36523653function isNull(object) {3654return null === object;3655}36563657module.exports = new Type('tag:yaml.org,2002:null', {3658kind: 'scalar',3659resolve: resolveYamlNull,3660construct: constructYamlNull,3661predicate: isNull,3662represent: {3663canonical: function () { return '~'; },3664lowercase: function () { return 'null'; },3665uppercase: function () { return 'NULL'; },3666camelcase: function () { return 'Null'; }3667},3668defaultStyle: 'lowercase'3669});36703671},{"../type":13}],24:[function(require,module,exports){3672'use strict';36733674var Type = require('../type');36753676var _hasOwnProperty = Object.prototype.hasOwnProperty;3677var _toString = Object.prototype.toString;36783679function resolveYamlOmap(data) {3680if (null === data) {3681return true;3682}36833684var objectKeys = [], index, length, pair, pairKey, pairHasKey,3685object = data;36863687for (index = 0, length = object.length; index < length; index += 1) {3688pair = object[index];3689pairHasKey = false;36903691if ('[object Object]' !== _toString.call(pair)) {3692return false;3693}36943695for (pairKey in pair) {3696if (_hasOwnProperty.call(pair, pairKey)) {3697if (!pairHasKey) {3698pairHasKey = true;3699} else {3700return false;3701}3702}3703}37043705if (!pairHasKey) {3706return false;3707}37083709if (-1 === objectKeys.indexOf(pairKey)) {3710objectKeys.push(pairKey);3711} else {3712return false;3713}3714}37153716return true;3717}37183719function constructYamlOmap(data) {3720return null !== data ? data : [];3721}37223723module.exports = new Type('tag:yaml.org,2002:omap', {3724kind: 'sequence',3725resolve: resolveYamlOmap,3726construct: constructYamlOmap3727});37283729},{"../type":13}],25:[function(require,module,exports){3730'use strict';37313732var Type = require('../type');37333734var _toString = Object.prototype.toString;37353736function resolveYamlPairs(data) {3737if (null === data) {3738return true;3739}37403741var index, length, pair, keys, result,3742object = data;37433744result = new Array(object.length);37453746for (index = 0, length = object.length; index < length; index += 1) {3747pair = object[index];37483749if ('[object Object]' !== _toString.call(pair)) {3750return false;3751}37523753keys = Object.keys(pair);37543755if (1 !== keys.length) {3756return false;3757}37583759result[index] = [ keys[0], pair[keys[0]] ];3760}37613762return true;3763}37643765function constructYamlPairs(data) {3766if (null === data) {3767return [];3768}37693770var index, length, pair, keys, result,3771object = data;37723773result = new Array(object.length);37743775for (index = 0, length = object.length; index < length; index += 1) {3776pair = object[index];37773778keys = Object.keys(pair);37793780result[index] = [ keys[0], pair[keys[0]] ];3781}37823783return result;3784}37853786module.exports = new Type('tag:yaml.org,2002:pairs', {3787kind: 'sequence',3788resolve: resolveYamlPairs,3789construct: constructYamlPairs3790});37913792},{"../type":13}],26:[function(require,module,exports){3793'use strict';37943795var Type = require('../type');37963797module.exports = new Type('tag:yaml.org,2002:seq', {3798kind: 'sequence',3799construct: function (data) { return null !== data ? data : []; }3800});38013802},{"../type":13}],27:[function(require,module,exports){3803'use strict';38043805var Type = require('../type');38063807var _hasOwnProperty = Object.prototype.hasOwnProperty;38083809function resolveYamlSet(data) {3810if (null === data) {3811return true;3812}38133814var key, object = data;38153816for (key in object) {3817if (_hasOwnProperty.call(object, key)) {3818if (null !== object[key]) {3819return false;3820}3821}3822}38233824return true;3825}38263827function constructYamlSet(data) {3828return null !== data ? data : {};3829}38303831module.exports = new Type('tag:yaml.org,2002:set', {3832kind: 'mapping',3833resolve: resolveYamlSet,3834construct: constructYamlSet3835});38363837},{"../type":13}],28:[function(require,module,exports){3838'use strict';38393840var Type = require('../type');38413842module.exports = new Type('tag:yaml.org,2002:str', {3843kind: 'scalar',3844construct: function (data) { return null !== data ? data : ''; }3845});38463847},{"../type":13}],29:[function(require,module,exports){3848'use strict';38493850var Type = require('../type');38513852var YAML_TIMESTAMP_REGEXP = new RegExp(3853'^([0-9][0-9][0-9][0-9])' + // [1] year3854'-([0-9][0-9]?)' + // [2] month3855'-([0-9][0-9]?)' + // [3] day3856'(?:(?:[Tt]|[ \\t]+)' + // ...3857'([0-9][0-9]?)' + // [4] hour3858':([0-9][0-9])' + // [5] minute3859':([0-9][0-9])' + // [6] second3860'(?:\\.([0-9]*))?' + // [7] fraction3861'(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour3862'(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute38633864function resolveYamlTimestamp(data) {3865if (null === data) {3866return false;3867}38683869var match, year, month, day, hour, minute, second, fraction = 0,3870delta = null, tz_hour, tz_minute, date;38713872match = YAML_TIMESTAMP_REGEXP.exec(data);38733874if (null === match) {3875return false;3876}38773878return true;3879}38803881function constructYamlTimestamp(data) {3882var match, year, month, day, hour, minute, second, fraction = 0,3883delta = null, tz_hour, tz_minute, date;38843885match = YAML_TIMESTAMP_REGEXP.exec(data);38863887if (null === match) {3888throw new Error('Date resolve error');3889}38903891// match: [1] year [2] month [3] day38923893year = +(match[1]);3894month = +(match[2]) - 1; // JS month starts with 03895day = +(match[3]);38963897if (!match[4]) { // no hour3898return new Date(Date.UTC(year, month, day));3899}39003901// match: [4] hour [5] minute [6] second [7] fraction39023903hour = +(match[4]);3904minute = +(match[5]);3905second = +(match[6]);39063907if (match[7]) {3908fraction = match[7].slice(0, 3);3909while (fraction.length < 3) { // milli-seconds3910fraction += '0';3911}3912fraction = +fraction;3913}39143915// match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute39163917if (match[9]) {3918tz_hour = +(match[10]);3919tz_minute = +(match[11] || 0);3920delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds3921if ('-' === match[9]) {3922delta = -delta;3923}3924}39253926date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));39273928if (delta) {3929date.setTime(date.getTime() - delta);3930}39313932return date;3933}39343935function representYamlTimestamp(object /*, style*/) {3936return object.toISOString();3937}39383939module.exports = new Type('tag:yaml.org,2002:timestamp', {3940kind: 'scalar',3941resolve: resolveYamlTimestamp,3942construct: constructYamlTimestamp,3943instanceOf: Date,3944represent: representYamlTimestamp3945});39463947},{"../type":13}],30:[function(require,module,exports){39483949},{}],"/":[function(require,module,exports){3950'use strict';395139523953var yaml = require('./lib/js-yaml.js');395439553956module.exports = yaml;39573958},{"./lib/js-yaml.js":1}]},{},[])("/")3959});39603961