Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Document.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _addComment = _interopRequireDefault(require("./addComment"));
  7. var _Anchors = _interopRequireDefault(require("./Anchors"));
  8. var _constants = require("./constants");
  9. var _errors = require("./errors");
  10. var _listTagNames = _interopRequireDefault(require("./listTagNames"));
  11. var _schema = _interopRequireDefault(require("./schema"));
  12. var _Alias = _interopRequireDefault(require("./schema/Alias"));
  13. var _Collection = _interopRequireWildcard(require("./schema/Collection"));
  14. var _Node = _interopRequireDefault(require("./schema/Node"));
  15. var _Scalar = _interopRequireDefault(require("./schema/Scalar"));
  16. var _toJSON = _interopRequireDefault(require("./toJSON"));
  17. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
  18. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  19. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  21. const isCollectionItem = node => node && [_constants.Type.MAP_KEY, _constants.Type.MAP_VALUE, _constants.Type.SEQ_ITEM].includes(node.type);
  22. class Document {
  23. constructor(options) {
  24. this.anchors = new _Anchors.default(options.anchorPrefix);
  25. this.commentBefore = null;
  26. this.comment = null;
  27. this.contents = null;
  28. this.directivesEndMarker = null;
  29. this.errors = [];
  30. this.options = options;
  31. this.schema = null;
  32. this.tagPrefixes = [];
  33. this.version = null;
  34. this.warnings = [];
  35. }
  36. assertCollectionContents() {
  37. if (this.contents instanceof _Collection.default) return true;
  38. throw new Error('Expected a YAML collection as document contents');
  39. }
  40. add(value) {
  41. this.assertCollectionContents();
  42. return this.contents.add(value);
  43. }
  44. addIn(path, value) {
  45. this.assertCollectionContents();
  46. this.contents.addIn(path, value);
  47. }
  48. delete(key) {
  49. this.assertCollectionContents();
  50. return this.contents.delete(key);
  51. }
  52. deleteIn(path) {
  53. if ((0, _Collection.isEmptyPath)(path)) {
  54. if (this.contents == null) return false;
  55. this.contents = null;
  56. return true;
  57. }
  58. this.assertCollectionContents();
  59. return this.contents.deleteIn(path);
  60. }
  61. getDefaults() {
  62. return Document.defaults[this.version] || Document.defaults[this.options.version] || {};
  63. }
  64. get(key, keepScalar) {
  65. return this.contents instanceof _Collection.default ? this.contents.get(key, keepScalar) : undefined;
  66. }
  67. getIn(path, keepScalar) {
  68. if ((0, _Collection.isEmptyPath)(path)) return !keepScalar && this.contents instanceof _Scalar.default ? this.contents.value : this.contents;
  69. return this.contents instanceof _Collection.default ? this.contents.getIn(path, keepScalar) : undefined;
  70. }
  71. has(key) {
  72. return this.contents instanceof _Collection.default ? this.contents.has(key) : false;
  73. }
  74. hasIn(path) {
  75. if ((0, _Collection.isEmptyPath)(path)) return this.contents !== undefined;
  76. return this.contents instanceof _Collection.default ? this.contents.hasIn(path) : false;
  77. }
  78. set(key, value) {
  79. this.assertCollectionContents();
  80. this.contents.set(key, value);
  81. }
  82. setIn(path, value) {
  83. if ((0, _Collection.isEmptyPath)(path)) this.contents = value;else {
  84. this.assertCollectionContents();
  85. this.contents.setIn(path, value);
  86. }
  87. }
  88. setSchema(id, customTags) {
  89. if (!id && !customTags && this.schema) return;
  90. if (typeof id === 'number') id = id.toFixed(1);
  91. if (id === '1.0' || id === '1.1' || id === '1.2') {
  92. if (this.version) this.version = id;else this.options.version = id;
  93. delete this.options.schema;
  94. } else if (id && typeof id === 'string') {
  95. this.options.schema = id;
  96. }
  97. if (Array.isArray(customTags)) this.options.customTags = customTags;
  98. const opt = Object.assign({}, this.getDefaults(), this.options);
  99. this.schema = new _schema.default(opt);
  100. }
  101. parse(node, prevDoc) {
  102. if (this.options.keepCstNodes) this.cstNode = node;
  103. if (this.options.keepNodeTypes) this.type = 'DOCUMENT';
  104. const {
  105. directives = [],
  106. contents = [],
  107. directivesEndMarker,
  108. error,
  109. valueRange
  110. } = node;
  111. if (error) {
  112. if (!error.source) error.source = this;
  113. this.errors.push(error);
  114. }
  115. this.parseDirectives(directives, prevDoc);
  116. if (directivesEndMarker) this.directivesEndMarker = true;
  117. this.range = valueRange ? [valueRange.start, valueRange.end] : null;
  118. this.setSchema();
  119. this.anchors._cstAliases = [];
  120. this.parseContents(contents);
  121. this.anchors.resolveNodes();
  122. if (this.options.prettyErrors) {
  123. for (const error of this.errors) if (error instanceof _errors.YAMLError) error.makePretty();
  124. for (const warn of this.warnings) if (warn instanceof _errors.YAMLError) warn.makePretty();
  125. }
  126. return this;
  127. }
  128. parseDirectives(directives, prevDoc) {
  129. const directiveComments = [];
  130. let hasDirectives = false;
  131. directives.forEach(directive => {
  132. const {
  133. comment,
  134. name
  135. } = directive;
  136. switch (name) {
  137. case 'TAG':
  138. this.resolveTagDirective(directive);
  139. hasDirectives = true;
  140. break;
  141. case 'YAML':
  142. case 'YAML:1.0':
  143. this.resolveYamlDirective(directive);
  144. hasDirectives = true;
  145. break;
  146. default:
  147. if (name) {
  148. const msg = `YAML only supports %TAG and %YAML directives, and not %${name}`;
  149. this.warnings.push(new _errors.YAMLWarning(directive, msg));
  150. }
  151. }
  152. if (comment) directiveComments.push(comment);
  153. });
  154. if (prevDoc && !hasDirectives && '1.1' === (this.version || prevDoc.version || this.options.version)) {
  155. const copyTagPrefix = ({
  156. handle,
  157. prefix
  158. }) => ({
  159. handle,
  160. prefix
  161. });
  162. this.tagPrefixes = prevDoc.tagPrefixes.map(copyTagPrefix);
  163. this.version = prevDoc.version;
  164. }
  165. this.commentBefore = directiveComments.join('\n') || null;
  166. }
  167. parseContents(contents) {
  168. const comments = {
  169. before: [],
  170. after: []
  171. };
  172. const contentNodes = [];
  173. let spaceBefore = false;
  174. contents.forEach(node => {
  175. if (node.valueRange) {
  176. if (contentNodes.length === 1) {
  177. const msg = 'Document is not valid YAML (bad indentation?)';
  178. this.errors.push(new _errors.YAMLSyntaxError(node, msg));
  179. }
  180. const res = this.resolveNode(node);
  181. if (spaceBefore) {
  182. res.spaceBefore = true;
  183. spaceBefore = false;
  184. }
  185. contentNodes.push(res);
  186. } else if (node.comment !== null) {
  187. const cc = contentNodes.length === 0 ? comments.before : comments.after;
  188. cc.push(node.comment);
  189. } else if (node.type === _constants.Type.BLANK_LINE) {
  190. spaceBefore = true;
  191. if (contentNodes.length === 0 && comments.before.length > 0 && !this.commentBefore) {
  192. // space-separated comments at start are parsed as document comments
  193. this.commentBefore = comments.before.join('\n');
  194. comments.before = [];
  195. }
  196. }
  197. });
  198. switch (contentNodes.length) {
  199. case 0:
  200. this.contents = null;
  201. comments.after = comments.before;
  202. break;
  203. case 1:
  204. this.contents = contentNodes[0];
  205. if (this.contents) {
  206. const cb = comments.before.join('\n') || null;
  207. if (cb) {
  208. const cbNode = this.contents instanceof _Collection.default && this.contents.items[0] ? this.contents.items[0] : this.contents;
  209. cbNode.commentBefore = cbNode.commentBefore ? `${cb}\n${cbNode.commentBefore}` : cb;
  210. }
  211. } else {
  212. comments.after = comments.before.concat(comments.after);
  213. }
  214. break;
  215. default:
  216. this.contents = contentNodes;
  217. if (this.contents[0]) {
  218. this.contents[0].commentBefore = comments.before.join('\n') || null;
  219. } else {
  220. comments.after = comments.before.concat(comments.after);
  221. }
  222. }
  223. this.comment = comments.after.join('\n') || null;
  224. }
  225. resolveTagDirective(directive) {
  226. const [handle, prefix] = directive.parameters;
  227. if (handle && prefix) {
  228. if (this.tagPrefixes.every(p => p.handle !== handle)) {
  229. this.tagPrefixes.push({
  230. handle,
  231. prefix
  232. });
  233. } else {
  234. const msg = 'The %TAG directive must only be given at most once per handle in the same document.';
  235. this.errors.push(new _errors.YAMLSemanticError(directive, msg));
  236. }
  237. } else {
  238. const msg = 'Insufficient parameters given for %TAG directive';
  239. this.errors.push(new _errors.YAMLSemanticError(directive, msg));
  240. }
  241. }
  242. resolveYamlDirective(directive) {
  243. let [version] = directive.parameters;
  244. if (directive.name === 'YAML:1.0') version = '1.0';
  245. if (this.version) {
  246. const msg = 'The %YAML directive must only be given at most once per document.';
  247. this.errors.push(new _errors.YAMLSemanticError(directive, msg));
  248. }
  249. if (!version) {
  250. const msg = 'Insufficient parameters given for %YAML directive';
  251. this.errors.push(new _errors.YAMLSemanticError(directive, msg));
  252. } else {
  253. if (!Document.defaults[version]) {
  254. const v0 = this.version || this.options.version;
  255. const msg = `Document will be parsed as YAML ${v0} rather than YAML ${version}`;
  256. this.warnings.push(new _errors.YAMLWarning(directive, msg));
  257. }
  258. this.version = version;
  259. }
  260. }
  261. resolveTagName(node) {
  262. const {
  263. tag,
  264. type
  265. } = node;
  266. let nonSpecific = false;
  267. if (tag) {
  268. const {
  269. handle,
  270. suffix,
  271. verbatim
  272. } = tag;
  273. if (verbatim) {
  274. if (verbatim !== '!' && verbatim !== '!!') return verbatim;
  275. const msg = `Verbatim tags aren't resolved, so ${verbatim} is invalid.`;
  276. this.errors.push(new _errors.YAMLSemanticError(node, msg));
  277. } else if (handle === '!' && !suffix) {
  278. nonSpecific = true;
  279. } else {
  280. let prefix = this.tagPrefixes.find(p => p.handle === handle);
  281. if (!prefix) {
  282. const dtp = this.getDefaults().tagPrefixes;
  283. if (dtp) prefix = dtp.find(p => p.handle === handle);
  284. }
  285. if (prefix) {
  286. if (suffix) {
  287. if (handle === '!' && (this.version || this.options.version) === '1.0') {
  288. if (suffix[0] === '^') return suffix;
  289. if (/[:/]/.test(suffix)) {
  290. // word/foo -> tag:word.yaml.org,2002:foo
  291. const vocab = suffix.match(/^([a-z0-9-]+)\/(.*)/i);
  292. return vocab ? `tag:${vocab[1]}.yaml.org,2002:${vocab[2]}` : `tag:${suffix}`;
  293. }
  294. }
  295. return prefix.prefix + decodeURIComponent(suffix);
  296. }
  297. this.errors.push(new _errors.YAMLSemanticError(node, `The ${handle} tag has no suffix.`));
  298. } else {
  299. const msg = `The ${handle} tag handle is non-default and was not declared.`;
  300. this.errors.push(new _errors.YAMLSemanticError(node, msg));
  301. }
  302. }
  303. }
  304. switch (type) {
  305. case _constants.Type.BLOCK_FOLDED:
  306. case _constants.Type.BLOCK_LITERAL:
  307. case _constants.Type.QUOTE_DOUBLE:
  308. case _constants.Type.QUOTE_SINGLE:
  309. return _schema.default.defaultTags.STR;
  310. case _constants.Type.FLOW_MAP:
  311. case _constants.Type.MAP:
  312. return _schema.default.defaultTags.MAP;
  313. case _constants.Type.FLOW_SEQ:
  314. case _constants.Type.SEQ:
  315. return _schema.default.defaultTags.SEQ;
  316. case _constants.Type.PLAIN:
  317. return nonSpecific ? _schema.default.defaultTags.STR : null;
  318. default:
  319. return null;
  320. }
  321. }
  322. resolveNode(node) {
  323. if (!node) return null;
  324. const {
  325. anchors,
  326. errors,
  327. schema
  328. } = this;
  329. let hasAnchor = false;
  330. let hasTag = false;
  331. const comments = {
  332. before: [],
  333. after: []
  334. };
  335. const props = isCollectionItem(node.context.parent) ? node.context.parent.props.concat(node.props) : node.props;
  336. for (const {
  337. start,
  338. end
  339. } of props) {
  340. switch (node.context.src[start]) {
  341. case _constants.Char.COMMENT:
  342. {
  343. if (!node.commentHasRequiredWhitespace(start)) {
  344. const msg = 'Comments must be separated from other tokens by white space characters';
  345. errors.push(new _errors.YAMLSemanticError(node, msg));
  346. }
  347. const c = node.context.src.slice(start + 1, end);
  348. const {
  349. header,
  350. valueRange
  351. } = node;
  352. if (valueRange && (start > valueRange.start || header && start > header.start)) {
  353. comments.after.push(c);
  354. } else {
  355. comments.before.push(c);
  356. }
  357. }
  358. break;
  359. case _constants.Char.ANCHOR:
  360. if (hasAnchor) {
  361. const msg = 'A node can have at most one anchor';
  362. errors.push(new _errors.YAMLSemanticError(node, msg));
  363. }
  364. hasAnchor = true;
  365. break;
  366. case _constants.Char.TAG:
  367. if (hasTag) {
  368. const msg = 'A node can have at most one tag';
  369. errors.push(new _errors.YAMLSemanticError(node, msg));
  370. }
  371. hasTag = true;
  372. break;
  373. }
  374. }
  375. if (hasAnchor) {
  376. const name = node.anchor;
  377. const prev = anchors.getNode(name); // At this point, aliases for any preceding node with the same anchor
  378. // name have already been resolved, so it may safely be renamed.
  379. if (prev) anchors.map[anchors.newName(name)] = prev; // During parsing, we need to store the CST node in anchors.map as
  380. // anchors need to be available during resolution to allow for
  381. // circular references.
  382. anchors.map[name] = node;
  383. }
  384. let res;
  385. if (node.type === _constants.Type.ALIAS) {
  386. if (hasAnchor || hasTag) {
  387. const msg = 'An alias node must not specify any properties';
  388. errors.push(new _errors.YAMLSemanticError(node, msg));
  389. }
  390. const name = node.rawValue;
  391. const src = anchors.getNode(name);
  392. if (!src) {
  393. const msg = `Aliased anchor not found: ${name}`;
  394. errors.push(new _errors.YAMLReferenceError(node, msg));
  395. return null;
  396. } // Lazy resolution for circular references
  397. res = new _Alias.default(src);
  398. anchors._cstAliases.push(res);
  399. } else {
  400. const tagName = this.resolveTagName(node);
  401. if (tagName) {
  402. res = schema.resolveNodeWithFallback(this, node, tagName);
  403. } else {
  404. if (node.type !== _constants.Type.PLAIN) {
  405. const msg = `Failed to resolve ${node.type} node here`;
  406. errors.push(new _errors.YAMLSyntaxError(node, msg));
  407. return null;
  408. }
  409. try {
  410. res = schema.resolveScalar(node.strValue || '');
  411. } catch (error) {
  412. if (!error.source) error.source = node;
  413. errors.push(error);
  414. return null;
  415. }
  416. }
  417. }
  418. if (res) {
  419. res.range = [node.range.start, node.range.end];
  420. if (this.options.keepCstNodes) res.cstNode = node;
  421. if (this.options.keepNodeTypes) res.type = node.type;
  422. const cb = comments.before.join('\n');
  423. if (cb) {
  424. res.commentBefore = res.commentBefore ? `${res.commentBefore}\n${cb}` : cb;
  425. }
  426. const ca = comments.after.join('\n');
  427. if (ca) res.comment = res.comment ? `${res.comment}\n${ca}` : ca;
  428. }
  429. return node.resolved = res;
  430. }
  431. listNonDefaultTags() {
  432. return (0, _listTagNames.default)(this.contents).filter(t => t.indexOf(_schema.default.defaultPrefix) !== 0);
  433. }
  434. setTagPrefix(handle, prefix) {
  435. if (handle[0] !== '!' || handle[handle.length - 1] !== '!') throw new Error('Handle must start and end with !');
  436. if (prefix) {
  437. const prev = this.tagPrefixes.find(p => p.handle === handle);
  438. if (prev) prev.prefix = prefix;else this.tagPrefixes.push({
  439. handle,
  440. prefix
  441. });
  442. } else {
  443. this.tagPrefixes = this.tagPrefixes.filter(p => p.handle !== handle);
  444. }
  445. }
  446. stringifyTag(tag) {
  447. if ((this.version || this.options.version) === '1.0') {
  448. const priv = tag.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
  449. if (priv) return '!' + priv[1];
  450. const vocab = tag.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
  451. return vocab ? `!${vocab[1]}/${vocab[2]}` : `!${tag.replace(/^tag:/, '')}`;
  452. } else {
  453. let p = this.tagPrefixes.find(p => tag.indexOf(p.prefix) === 0);
  454. if (!p) {
  455. const dtp = this.getDefaults().tagPrefixes;
  456. p = dtp && dtp.find(p => tag.indexOf(p.prefix) === 0);
  457. }
  458. if (!p) return tag[0] === '!' ? tag : `!<${tag}>`;
  459. const suffix = tag.substr(p.prefix.length).replace(/[!,[\]{}]/g, ch => ({
  460. '!': '%21',
  461. ',': '%2C',
  462. '[': '%5B',
  463. ']': '%5D',
  464. '{': '%7B',
  465. '}': '%7D'
  466. })[ch]);
  467. return p.handle + suffix;
  468. }
  469. }
  470. toJSON(arg) {
  471. const {
  472. keepBlobsInJSON,
  473. mapAsMap,
  474. maxAliasCount
  475. } = this.options;
  476. const keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof _Scalar.default));
  477. const ctx = {
  478. doc: this,
  479. keep,
  480. mapAsMap: keep && !!mapAsMap,
  481. maxAliasCount
  482. };
  483. const anchorNames = Object.keys(this.anchors.map);
  484. if (anchorNames.length > 0) ctx.anchors = anchorNames.map(name => ({
  485. alias: [],
  486. aliasCount: 0,
  487. count: 1,
  488. node: this.anchors.map[name]
  489. }));
  490. return (0, _toJSON.default)(this.contents, arg, ctx);
  491. }
  492. toString() {
  493. if (this.errors.length > 0) throw new Error('Document with errors cannot be stringified');
  494. this.setSchema();
  495. const lines = [];
  496. let hasDirectives = false;
  497. if (this.version) {
  498. let vd = '%YAML 1.2';
  499. if (this.schema.name === 'yaml-1.1') {
  500. if (this.version === '1.0') vd = '%YAML:1.0';else if (this.version === '1.1') vd = '%YAML 1.1';
  501. }
  502. lines.push(vd);
  503. hasDirectives = true;
  504. }
  505. const tagNames = this.listNonDefaultTags();
  506. this.tagPrefixes.forEach(({
  507. handle,
  508. prefix
  509. }) => {
  510. if (tagNames.some(t => t.indexOf(prefix) === 0)) {
  511. lines.push(`%TAG ${handle} ${prefix}`);
  512. hasDirectives = true;
  513. }
  514. });
  515. if (hasDirectives || this.directivesEndMarker) lines.push('---');
  516. if (this.commentBefore) {
  517. if (hasDirectives || !this.directivesEndMarker) lines.unshift('');
  518. lines.unshift(this.commentBefore.replace(/^/gm, '#'));
  519. }
  520. const ctx = {
  521. anchors: {},
  522. doc: this,
  523. indent: ''
  524. };
  525. let chompKeep = false;
  526. let contentComment = null;
  527. if (this.contents) {
  528. if (this.contents instanceof _Node.default) {
  529. if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');
  530. if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment
  531. ctx.forceBlockIndent = !!this.comment;
  532. contentComment = this.contents.comment;
  533. }
  534. const onChompKeep = contentComment ? null : () => chompKeep = true;
  535. const body = this.schema.stringify(this.contents, ctx, () => contentComment = null, onChompKeep);
  536. lines.push((0, _addComment.default)(body, '', contentComment));
  537. } else if (this.contents !== undefined) {
  538. lines.push(this.schema.stringify(this.contents, ctx));
  539. }
  540. if (this.comment) {
  541. if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '') lines.push('');
  542. lines.push(this.comment.replace(/^/gm, '#'));
  543. }
  544. return lines.join('\n') + '\n';
  545. }
  546. }
  547. exports.default = Document;
  548. _defineProperty(Document, "defaults", {
  549. '1.0': {
  550. schema: 'yaml-1.1',
  551. merge: true,
  552. tagPrefixes: [{
  553. handle: '!',
  554. prefix: _schema.default.defaultPrefix
  555. }, {
  556. handle: '!!',
  557. prefix: 'tag:private.yaml.org,2002:'
  558. }]
  559. },
  560. '1.1': {
  561. schema: 'yaml-1.1',
  562. merge: true,
  563. tagPrefixes: [{
  564. handle: '!',
  565. prefix: '!'
  566. }, {
  567. handle: '!!',
  568. prefix: _schema.default.defaultPrefix
  569. }]
  570. },
  571. '1.2': {
  572. schema: 'core',
  573. merge: false,
  574. tagPrefixes: [{
  575. handle: '!',
  576. prefix: '!'
  577. }, {
  578. handle: '!!',
  579. prefix: _schema.default.defaultPrefix
  580. }]
  581. }
  582. });