yaml 1.8.2 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/dist/Anchors.js +10 -13
- package/browser/dist/Document.js +72 -67
- package/browser/dist/addComment.js +1 -1
- package/browser/dist/cst/Alias.js +12 -8
- package/browser/dist/cst/BlankLine.js +16 -20
- package/browser/dist/cst/BlockValue.js +14 -10
- package/browser/dist/cst/Collection.js +17 -13
- package/browser/dist/cst/CollectionItem.js +15 -11
- package/browser/dist/cst/Comment.js +13 -9
- package/browser/dist/cst/Directive.js +13 -9
- package/browser/dist/cst/Document.js +17 -13
- package/browser/dist/cst/FlowCollection.js +17 -13
- package/browser/dist/cst/Node.js +3 -5
- package/browser/dist/cst/ParseContext.js +12 -14
- package/browser/dist/cst/PlainValue.js +12 -8
- package/browser/dist/cst/QuoteDouble.js +13 -9
- package/browser/dist/cst/QuoteSingle.js +13 -9
- package/browser/dist/cst/Range.js +2 -5
- package/browser/dist/cst/parse.js +3 -3
- package/browser/dist/errors.js +23 -8
- package/browser/dist/foldFlowLines.js +1 -1
- package/browser/dist/index.js +71 -21
- package/browser/dist/listTagNames.js +5 -5
- package/browser/dist/schema/Alias.js +30 -34
- package/browser/dist/schema/Collection.js +40 -47
- package/browser/dist/schema/Map.js +39 -56
- package/browser/dist/schema/Merge.js +37 -46
- package/browser/dist/schema/Node.js +2 -5
- package/browser/dist/schema/Pair.js +36 -13
- package/browser/dist/schema/Scalar.js +13 -9
- package/browser/dist/schema/Seq.js +27 -25
- package/browser/dist/schema/index.js +25 -39
- package/browser/dist/schema/parseMap.js +8 -8
- package/browser/dist/schema/parseSeq.js +5 -5
- package/browser/dist/schema/parseUtils.js +11 -15
- package/browser/dist/stringify.js +2 -1
- package/browser/dist/tags/core.js +39 -23
- package/browser/dist/tags/failsafe/index.js +4 -4
- package/browser/dist/tags/failsafe/map.js +15 -18
- package/browser/dist/tags/failsafe/seq.js +14 -18
- package/browser/dist/tags/failsafe/string.js +1 -1
- package/browser/dist/tags/index.js +10 -10
- package/browser/dist/tags/json.js +27 -26
- package/browser/dist/tags/options.js +3 -0
- package/browser/dist/tags/yaml-1.1/binary.js +10 -8
- package/browser/dist/tags/yaml-1.1/index.js +75 -43
- package/browser/dist/tags/yaml-1.1/omap.js +34 -39
- package/browser/dist/tags/yaml-1.1/pairs.js +17 -20
- package/browser/dist/tags/yaml-1.1/set.js +27 -23
- package/browser/dist/test-events.js +4 -4
- package/browser/dist/toJSON.js +3 -4
- package/browser/dist/warnings.js +29 -18
- package/browser/index.js +1 -1
- package/browser/map.js +4 -2
- package/browser/pair.js +4 -2
- package/browser/parse-cst.js +1 -1
- package/browser/scalar.js +4 -2
- package/browser/schema.js +11 -6
- package/browser/seq.js +4 -2
- package/browser/types/binary.js +5 -6
- package/browser/types/omap.js +4 -2
- package/browser/types/pairs.js +4 -2
- package/browser/types/set.js +4 -2
- package/browser/types/timestamp.js +5 -9
- package/browser/types.js +12 -10
- package/browser/util.js +16 -13
- package/dist/Anchors.js +13 -18
- package/dist/Document.js +52 -48
- package/dist/addComment.js +1 -4
- package/dist/constants.js +0 -3
- package/dist/cst/Alias.js +8 -13
- package/dist/cst/BlankLine.js +8 -24
- package/dist/cst/BlockValue.js +12 -17
- package/dist/cst/Collection.js +22 -27
- package/dist/cst/CollectionItem.js +16 -21
- package/dist/cst/Comment.js +6 -11
- package/dist/cst/Directive.js +7 -12
- package/dist/cst/Document.js +23 -28
- package/dist/cst/FlowCollection.js +21 -26
- package/dist/cst/Node.js +4 -9
- package/dist/cst/ParseContext.js +38 -43
- package/dist/cst/PlainValue.js +10 -15
- package/dist/cst/QuoteDouble.js +9 -14
- package/dist/cst/QuoteSingle.js +9 -14
- package/dist/cst/Range.js +2 -5
- package/dist/cst/parse.js +5 -10
- package/dist/cst/source-utils.js +0 -3
- package/dist/errors.js +4 -9
- package/dist/foldFlowLines.js +1 -4
- package/dist/index.js +59 -17
- package/dist/listTagNames.js +9 -14
- package/dist/schema/Alias.js +12 -17
- package/dist/schema/Collection.js +16 -20
- package/dist/schema/Map.js +12 -17
- package/dist/schema/Merge.js +13 -18
- package/dist/schema/Node.js +2 -5
- package/dist/schema/Pair.js +44 -31
- package/dist/schema/Scalar.js +6 -11
- package/dist/schema/Seq.js +9 -14
- package/dist/schema/index.js +22 -27
- package/dist/schema/parseMap.js +19 -28
- package/dist/schema/parseSeq.js +10 -15
- package/dist/schema/parseUtils.js +0 -3
- package/dist/stringify.js +6 -12
- package/dist/tags/core.js +34 -26
- package/dist/tags/failsafe/index.js +6 -11
- package/dist/tags/failsafe/map.js +8 -13
- package/dist/tags/failsafe/seq.js +8 -13
- package/dist/tags/failsafe/string.js +3 -6
- package/dist/tags/index.js +20 -29
- package/dist/tags/json.js +26 -22
- package/dist/tags/options.js +5 -4
- package/dist/tags/yaml-1.1/binary.js +11 -11
- package/dist/tags/yaml-1.1/index.js +69 -38
- package/dist/tags/yaml-1.1/omap.js +19 -24
- package/dist/tags/yaml-1.1/pairs.js +12 -17
- package/dist/tags/yaml-1.1/set.js +12 -21
- package/dist/tags/yaml-1.1/timestamp.js +0 -3
- package/dist/test-events.js +4 -9
- package/dist/toJSON.js +3 -5
- package/dist/warnings.js +31 -22
- package/index.d.ts +358 -0
- package/index.js +1 -1
- package/map.js +1 -1
- package/package.json +29 -23
- package/pair.js +1 -1
- package/parse-cst.d.ts +187 -0
- package/parse-cst.js +1 -1
- package/scalar.js +1 -1
- package/schema.js +2 -2
- package/seq.js +1 -1
- package/types/binary.js +1 -1
- package/types/omap.js +1 -1
- package/types/pairs.js +1 -1
- package/types/set.js +1 -1
- package/types/timestamp.js +1 -1
- package/types.d.ts +393 -0
- package/types.js +7 -6
- package/types.mjs +6 -5
- package/util.d.ts +86 -0
- package/util.js +6 -5
- package/util.mjs +4 -3
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
4
|
import _get from "@babel/runtime/helpers/get";
|
|
7
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
|
|
10
|
+
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
11
|
+
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
+
|
|
16
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
+
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
|
|
9
20
|
import { YAMLSemanticError } from '../../errors';
|
|
10
|
-
import YAMLMap,
|
|
11
|
-
import Pair from '../../schema/Pair';
|
|
12
|
-
import parseMap from '../../schema/parseMap';
|
|
13
|
-
import Scalar from '../../schema/Scalar';
|
|
21
|
+
import { YAMLMap, findPair } from '../../schema/Map';
|
|
22
|
+
import { Pair } from '../../schema/Pair';
|
|
23
|
+
import { parseMap } from '../../schema/parseMap';
|
|
24
|
+
import { Scalar } from '../../schema/Scalar';
|
|
14
25
|
export var YAMLSet = /*#__PURE__*/function (_YAMLMap) {
|
|
15
26
|
_inherits(YAMLSet, _YAMLMap);
|
|
16
27
|
|
|
28
|
+
var _super = _createSuper(YAMLSet);
|
|
29
|
+
|
|
17
30
|
function YAMLSet() {
|
|
18
31
|
var _this;
|
|
19
32
|
|
|
20
33
|
_classCallCheck(this, YAMLSet);
|
|
21
34
|
|
|
22
|
-
_this =
|
|
35
|
+
_this = _super.call(this);
|
|
23
36
|
_this.tag = YAMLSet.tag;
|
|
24
37
|
return _this;
|
|
25
38
|
}
|
|
@@ -75,34 +88,25 @@ function parseSet(doc, cst) {
|
|
|
75
88
|
|
|
76
89
|
function createSet(schema, iterable, ctx) {
|
|
77
90
|
var set = new YAMLSet();
|
|
78
|
-
|
|
79
|
-
var
|
|
80
|
-
|
|
91
|
+
|
|
92
|
+
var _iterator = _createForOfIteratorHelper(iterable),
|
|
93
|
+
_step;
|
|
81
94
|
|
|
82
95
|
try {
|
|
83
|
-
for (
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
84
97
|
var value = _step.value;
|
|
85
98
|
set.items.push(schema.createPair(value, null, ctx));
|
|
86
99
|
}
|
|
87
100
|
} catch (err) {
|
|
88
|
-
|
|
89
|
-
_iteratorError = err;
|
|
101
|
+
_iterator.e(err);
|
|
90
102
|
} finally {
|
|
91
|
-
|
|
92
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
93
|
-
_iterator.return();
|
|
94
|
-
}
|
|
95
|
-
} finally {
|
|
96
|
-
if (_didIteratorError) {
|
|
97
|
-
throw _iteratorError;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
103
|
+
_iterator.f();
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
return set;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
export
|
|
109
|
+
export var set = {
|
|
106
110
|
identify: function identify(value) {
|
|
107
111
|
return value instanceof Set;
|
|
108
112
|
},
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import
|
|
3
|
-
import Document from './Document'; // test harness for yaml-test-suite event tests
|
|
2
|
+
import { parse } from './cst/parse';
|
|
3
|
+
import { Document } from './Document'; // test harness for yaml-test-suite event tests
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function testEvents(src, options) {
|
|
6
6
|
var opt = Object.assign({
|
|
7
7
|
keepCstNodes: true,
|
|
8
8
|
keepNodeTypes: true,
|
|
9
9
|
version: '1.2'
|
|
10
10
|
}, options);
|
|
11
|
-
var docs =
|
|
11
|
+
var docs = parse(src).map(function (cstDoc) {
|
|
12
12
|
return new Document(opt).parse(cstDoc);
|
|
13
13
|
});
|
|
14
14
|
var errDoc = docs.find(function (doc) {
|
package/browser/dist/toJSON.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function toJSON(value, arg, ctx) {
|
|
2
2
|
if (Array.isArray(value)) return value.map(function (v, i) {
|
|
3
3
|
return toJSON(v, String(i), ctx);
|
|
4
4
|
});
|
|
5
5
|
|
|
6
6
|
if (value && typeof value.toJSON === 'function') {
|
|
7
|
-
var anchor = ctx && ctx.anchors && ctx.anchors.
|
|
8
|
-
return a.node === value;
|
|
9
|
-
});
|
|
7
|
+
var anchor = ctx && ctx.anchors && ctx.anchors.get(value);
|
|
10
8
|
if (anchor) ctx.onCreate = function (res) {
|
|
11
9
|
anchor.res = res;
|
|
12
10
|
delete ctx.onCreate;
|
|
@@ -16,5 +14,6 @@ export default function toJSON(value, arg, ctx) {
|
|
|
16
14
|
return res;
|
|
17
15
|
}
|
|
18
16
|
|
|
17
|
+
if ((!ctx || !ctx.keep) && typeof value === 'bigint') return Number(value);
|
|
19
18
|
return value;
|
|
20
19
|
}
|
package/browser/dist/warnings.js
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
/* global
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */
|
|
2
|
+
function shouldWarn(deprecation) {
|
|
3
|
+
var env = typeof process !== 'undefined' && process.env || {};
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
if (deprecation) {
|
|
6
|
+
if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;
|
|
7
|
+
return !env.YAML_SILENCE_DEPRECATION_WARNINGS;
|
|
8
|
+
}
|
|
8
9
|
|
|
10
|
+
if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;
|
|
11
|
+
return !env.YAML_SILENCE_WARNINGS;
|
|
12
|
+
}
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
export function warn(warning, type) {
|
|
15
|
+
if (shouldWarn(false)) {
|
|
16
|
+
var emit = typeof process !== 'undefined' && process.emitWarning; // This will throw in Jest if `warning` is an Error instance due to
|
|
17
|
+
// https://github.com/facebook/jest/issues/2549
|
|
18
|
+
|
|
19
|
+
if (emit) emit(warning, type);else {
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn(type ? "".concat(type, ": ").concat(warning) : warning);
|
|
22
|
+
}
|
|
13
23
|
}
|
|
14
24
|
}
|
|
15
25
|
export function warnFileDeprecation(filename) {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
if (shouldWarn(true)) {
|
|
27
|
+
var path = filename.replace(/.*yaml[/\\]/i, '').replace(/\.js$/, '').replace(/\\/g, '/');
|
|
28
|
+
warn("The endpoint 'yaml/".concat(path, "' will be removed in a future release."), 'DeprecationWarning');
|
|
29
|
+
}
|
|
19
30
|
}
|
|
20
31
|
var warned = {};
|
|
21
32
|
export function warnOptionDeprecation(name, alternative) {
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
if (!warned[name] && shouldWarn(true)) {
|
|
34
|
+
warned[name] = true;
|
|
35
|
+
var msg = "The option '".concat(name, "' will be removed in a future release");
|
|
36
|
+
msg += alternative ? ", use '".concat(alternative, "' instead.") : '.';
|
|
37
|
+
warn(msg, 'DeprecationWarning');
|
|
38
|
+
}
|
|
28
39
|
}
|
package/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { YAML as default } from './dist'
|
package/browser/map.js
CHANGED
package/browser/pair.js
CHANGED
package/browser/parse-cst.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { parse as default } from './dist/cst/parse'
|
package/browser/scalar.js
CHANGED
package/browser/schema.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
module.exports.strOptions = opt.strOptions
|
|
5
|
-
module.exports.stringify = require('./dist/stringify').stringifyString
|
|
1
|
+
import { Schema } from './dist/schema'
|
|
2
|
+
import { nullOptions, strOptions } from './dist/tags/options'
|
|
3
|
+
import { stringifyString } from './dist/stringify'
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Schema.nullOptions = nullOptions
|
|
6
|
+
Schema.strOptions = strOptions
|
|
7
|
+
Schema.stringify = stringifyString
|
|
8
|
+
export { Schema as default }
|
|
9
|
+
export { nullOptions, strOptions, stringifyString as stringify }
|
|
10
|
+
|
|
11
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
12
|
+
warnFileDeprecation(__filename)
|
package/browser/seq.js
CHANGED
package/browser/types/binary.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { binary } from '../dist/tags/yaml-1.1/binary'
|
|
2
|
+
export { binary }
|
|
3
|
+
export default [binary]
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require('../dist/warnings').warnFileDeprecation(__filename)
|
|
5
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
6
|
+
warnFileDeprecation(__filename)
|
package/browser/types/omap.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { omap as default } from '../dist/tags/yaml-1.1/omap'
|
|
2
|
+
|
|
3
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
4
|
+
warnFileDeprecation(__filename)
|
package/browser/types/pairs.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { pairs as default } from '../dist/tags/yaml-1.1/pairs'
|
|
2
|
+
|
|
3
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
4
|
+
warnFileDeprecation(__filename)
|
package/browser/types/set.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { set as default } from '../dist/tags/yaml-1.1/set'
|
|
2
|
+
|
|
3
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
4
|
+
warnFileDeprecation(__filename)
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { floatTime, intTime, timestamp } from '../dist/tags/yaml-1.1/timestamp'
|
|
2
|
+
export { floatTime, intTime, timestamp }
|
|
3
|
+
export default [intTime, floatTime, timestamp]
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.floatTime = ts.floatTime
|
|
7
|
-
exports.intTime = ts.intTime
|
|
8
|
-
exports.timestamp = ts.timestamp
|
|
9
|
-
|
|
10
|
-
require('../dist/warnings').warnFileDeprecation(__filename)
|
|
5
|
+
import { warnFileDeprecation } from './dist/warnings'
|
|
6
|
+
warnFileDeprecation(__filename)
|
package/browser/types.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export {
|
|
2
|
+
binaryOptions,
|
|
3
|
+
boolOptions,
|
|
4
|
+
intOptions,
|
|
5
|
+
nullOptions,
|
|
6
|
+
strOptions
|
|
7
|
+
} from './dist/tags/options'
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export { Schema } from './dist/schema'
|
|
10
|
+
export { YAMLMap } from './dist/schema/Map'
|
|
11
|
+
export { YAMLSeq } from './dist/schema/Seq'
|
|
12
|
+
export { Pair } from './dist/schema/Pair'
|
|
13
|
+
export { Scalar } from './dist/schema/Scalar'
|
package/browser/util.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { findPair } from './dist/schema/Map'
|
|
2
|
+
export { parseMap } from './dist/schema/parseMap'
|
|
3
|
+
export { parseSeq } from './dist/schema/parseSeq'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export {
|
|
6
|
+
stringifyNumber,
|
|
7
|
+
stringifyString,
|
|
8
|
+
toJSON,
|
|
9
|
+
Type
|
|
10
|
+
} from './dist/stringify'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export {
|
|
13
|
+
YAMLError,
|
|
14
|
+
YAMLReferenceError,
|
|
15
|
+
YAMLSemanticError,
|
|
16
|
+
YAMLSyntaxError,
|
|
17
|
+
YAMLWarning
|
|
18
|
+
} from './dist/errors'
|
package/dist/Anchors.js
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
3
|
+
exports.Anchors = void 0;
|
|
7
4
|
|
|
8
|
-
var _Alias =
|
|
5
|
+
var _Alias = require("./schema/Alias");
|
|
9
6
|
|
|
10
|
-
var _Map =
|
|
7
|
+
var _Map = require("./schema/Map");
|
|
11
8
|
|
|
12
|
-
var _Merge =
|
|
9
|
+
var _Merge = require("./schema/Merge");
|
|
13
10
|
|
|
14
|
-
var _Scalar =
|
|
11
|
+
var _Scalar = require("./schema/Scalar");
|
|
15
12
|
|
|
16
|
-
var _Seq =
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
var _Seq = require("./schema/Seq");
|
|
19
14
|
|
|
20
15
|
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
16
|
|
|
22
17
|
class Anchors {
|
|
23
18
|
static validAnchorNode(node) {
|
|
24
|
-
return node instanceof _Scalar.
|
|
19
|
+
return node instanceof _Scalar.Scalar || node instanceof _Seq.YAMLSeq || node instanceof _Map.YAMLMap;
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
constructor(prefix) {
|
|
@@ -32,15 +27,15 @@ class Anchors {
|
|
|
32
27
|
|
|
33
28
|
createAlias(node, name) {
|
|
34
29
|
this.setAnchor(node, name);
|
|
35
|
-
return new _Alias.
|
|
30
|
+
return new _Alias.Alias(node);
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
createMergePair(...sources) {
|
|
39
|
-
const merge = new _Merge.
|
|
34
|
+
const merge = new _Merge.Merge();
|
|
40
35
|
merge.value.items = sources.map(s => {
|
|
41
|
-
if (s instanceof _Alias.
|
|
42
|
-
if (s.source instanceof _Map.
|
|
43
|
-
} else if (s instanceof _Map.
|
|
36
|
+
if (s instanceof _Alias.Alias) {
|
|
37
|
+
if (s.source instanceof _Map.YAMLMap) return s;
|
|
38
|
+
} else if (s instanceof _Map.YAMLMap) {
|
|
44
39
|
return this.createAlias(s);
|
|
45
40
|
}
|
|
46
41
|
|
|
@@ -122,4 +117,4 @@ class Anchors {
|
|
|
122
117
|
|
|
123
118
|
}
|
|
124
119
|
|
|
125
|
-
exports.
|
|
120
|
+
exports.Anchors = Anchors;
|