yaml 2.3.0-0 → 2.3.0-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/compose/compose-collection.js +1 -1
- package/browser/dist/compose/compose-scalar.js +1 -1
- package/browser/dist/compose/composer.js +1 -1
- package/browser/dist/compose/resolve-flow-collection.js +1 -1
- package/browser/dist/compose/util-map-includes.js +1 -1
- package/browser/dist/doc/Document.js +2 -4
- package/browser/dist/doc/anchors.js +1 -1
- package/browser/dist/doc/createNode.js +1 -1
- package/browser/dist/doc/directives.js +1 -1
- package/browser/dist/index.js +1 -1
- package/browser/dist/nodes/Alias.js +9 -2
- package/browser/dist/nodes/Collection.js +2 -1
- package/browser/dist/nodes/Node.js +25 -35
- package/browser/dist/nodes/Pair.js +1 -1
- package/browser/dist/nodes/Scalar.js +2 -1
- package/browser/dist/nodes/YAMLMap.js +1 -1
- package/browser/dist/nodes/YAMLSeq.js +1 -1
- package/browser/dist/nodes/addPairToJSMap.js +1 -1
- package/browser/dist/nodes/identity.js +36 -0
- package/browser/dist/nodes/toJS.js +1 -1
- package/browser/dist/schema/Schema.js +1 -1
- package/browser/dist/schema/common/map.js +1 -1
- package/browser/dist/schema/common/seq.js +1 -1
- package/browser/dist/schema/yaml-1.1/omap.js +2 -2
- package/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/browser/dist/schema/yaml-1.1/set.js +1 -1
- package/browser/dist/stringify/stringify.js +1 -1
- package/browser/dist/stringify/stringifyCollection.js +1 -1
- package/browser/dist/stringify/stringifyDocument.js +1 -1
- package/browser/dist/stringify/stringifyPair.js +1 -1
- package/browser/dist/stringify/stringifyString.js +6 -6
- package/browser/dist/util.js +2 -0
- package/browser/dist/visit.js +1 -1
- package/dist/compose/compose-collection.d.ts +1 -1
- package/dist/compose/compose-collection.js +3 -3
- package/dist/compose/compose-scalar.js +7 -7
- package/dist/compose/composer.d.ts +1 -1
- package/dist/compose/composer.js +3 -3
- package/dist/compose/resolve-flow-collection.d.ts +1 -1
- package/dist/compose/resolve-flow-collection.js +2 -2
- package/dist/compose/util-map-includes.d.ts +3 -3
- package/dist/compose/util-map-includes.js +3 -3
- package/dist/doc/Document.d.ts +2 -1
- package/dist/doc/Document.js +12 -14
- package/dist/doc/anchors.d.ts +2 -2
- package/dist/doc/anchors.js +2 -2
- package/dist/doc/createNode.d.ts +1 -1
- package/dist/doc/createNode.js +8 -8
- package/dist/doc/directives.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -9
- package/dist/nodes/Alias.d.ts +1 -1
- package/dist/nodes/Alias.js +12 -5
- package/dist/nodes/Collection.d.ts +3 -2
- package/dist/nodes/Collection.js +10 -9
- package/dist/nodes/Node.d.ts +4 -17
- package/dist/nodes/Node.js +25 -51
- package/dist/nodes/Pair.d.ts +2 -2
- package/dist/nodes/Pair.js +4 -4
- package/dist/nodes/Scalar.js +2 -1
- package/dist/nodes/YAMLMap.d.ts +1 -1
- package/dist/nodes/YAMLMap.js +9 -9
- package/dist/nodes/YAMLSeq.d.ts +1 -1
- package/dist/nodes/YAMLSeq.js +5 -5
- package/dist/nodes/addPairToJSMap.js +7 -7
- package/dist/nodes/identity.d.ts +23 -0
- package/dist/nodes/identity.js +53 -0
- package/dist/nodes/toJS.d.ts +1 -4
- package/dist/nodes/toJS.js +2 -2
- package/dist/schema/Schema.d.ts +1 -1
- package/dist/schema/Schema.js +4 -4
- package/dist/schema/common/map.js +2 -2
- package/dist/schema/common/seq.js +2 -2
- package/dist/schema/core/schema.d.ts +1 -1
- package/dist/schema/json/schema.d.ts +1 -1
- package/dist/schema/tags.d.ts +1 -1
- package/dist/schema/yaml-1.1/omap.d.ts +1 -1
- package/dist/schema/yaml-1.1/omap.js +4 -4
- package/dist/schema/yaml-1.1/pairs.d.ts +1 -1
- package/dist/schema/yaml-1.1/pairs.js +5 -5
- package/dist/schema/yaml-1.1/schema.d.ts +1 -1
- package/dist/schema/yaml-1.1/set.js +5 -5
- package/dist/stringify/stringify.js +8 -8
- package/dist/stringify/stringifyCollection.js +8 -8
- package/dist/stringify/stringifyDocument.d.ts +3 -3
- package/dist/stringify/stringifyDocument.js +2 -2
- package/dist/stringify/stringifyPair.js +9 -9
- package/dist/stringify/stringifyString.js +6 -6
- package/dist/test-events.js +8 -8
- package/dist/util.d.ts +2 -0
- package/dist/util.js +4 -0
- package/dist/visit.js +18 -18
- package/package.json +7 -4
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var identity = require('../nodes/identity.js');
|
|
4
4
|
var Scalar = require('../nodes/Scalar.js');
|
|
5
5
|
var stringify = require('./stringify.js');
|
|
6
6
|
var stringifyComment = require('./stringifyComment.js');
|
|
7
7
|
|
|
8
8
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
9
9
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
10
|
-
let keyComment = (
|
|
10
|
+
let keyComment = (identity.isNode(key) && key.comment) || null;
|
|
11
11
|
if (simpleKeys) {
|
|
12
12
|
if (keyComment) {
|
|
13
13
|
throw new Error('With simple keys, key nodes cannot have comments');
|
|
14
14
|
}
|
|
15
|
-
if (
|
|
15
|
+
if (identity.isCollection(key)) {
|
|
16
16
|
const msg = 'With simple keys, collection cannot be used as a key value';
|
|
17
17
|
throw new Error(msg);
|
|
18
18
|
}
|
|
@@ -20,8 +20,8 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
20
20
|
let explicitKey = !simpleKeys &&
|
|
21
21
|
(!key ||
|
|
22
22
|
(keyComment && value == null && !ctx.inFlow) ||
|
|
23
|
-
|
|
24
|
-
(
|
|
23
|
+
identity.isCollection(key) ||
|
|
24
|
+
(identity.isScalar(key)
|
|
25
25
|
? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL
|
|
26
26
|
: typeof key === 'object'));
|
|
27
27
|
ctx = Object.assign({}, ctx, {
|
|
@@ -66,7 +66,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
66
66
|
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
|
|
67
67
|
}
|
|
68
68
|
let vsb, vcb, valueComment;
|
|
69
|
-
if (
|
|
69
|
+
if (identity.isNode(value)) {
|
|
70
70
|
vsb = !!value.spaceBefore;
|
|
71
71
|
vcb = value.commentBefore;
|
|
72
72
|
valueComment = value.comment;
|
|
@@ -79,14 +79,14 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
79
79
|
value = doc.createNode(value);
|
|
80
80
|
}
|
|
81
81
|
ctx.implicitKey = false;
|
|
82
|
-
if (!explicitKey && !keyComment &&
|
|
82
|
+
if (!explicitKey && !keyComment && identity.isScalar(value))
|
|
83
83
|
ctx.indentAtStart = str.length + 1;
|
|
84
84
|
chompKeep = false;
|
|
85
85
|
if (!indentSeq &&
|
|
86
86
|
indentStep.length >= 2 &&
|
|
87
87
|
!ctx.inFlow &&
|
|
88
88
|
!explicitKey &&
|
|
89
|
-
|
|
89
|
+
identity.isSeq(value) &&
|
|
90
90
|
!value.flow &&
|
|
91
91
|
!value.tag &&
|
|
92
92
|
!value.anchor) {
|
|
@@ -110,7 +110,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
110
110
|
ws += `\n${ctx.indent}`;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
else if (!explicitKey &&
|
|
113
|
+
else if (!explicitKey && identity.isCollection(value)) {
|
|
114
114
|
const vs0 = valueStr[0];
|
|
115
115
|
const nl0 = valueStr.indexOf('\n');
|
|
116
116
|
const hasNewline = nl0 !== -1;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var Scalar = require('../nodes/Scalar.js');
|
|
4
4
|
var foldFlowLines = require('./foldFlowLines.js');
|
|
5
5
|
|
|
6
|
-
const getFoldOptions = (ctx) => ({
|
|
7
|
-
indentAtStart: ctx.indentAtStart,
|
|
6
|
+
const getFoldOptions = (ctx, isBlock) => ({
|
|
7
|
+
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
8
8
|
lineWidth: ctx.options.lineWidth,
|
|
9
9
|
minContentWidth: ctx.options.minContentWidth
|
|
10
10
|
});
|
|
@@ -117,7 +117,7 @@ function doubleQuotedString(value, ctx) {
|
|
|
117
117
|
str = start ? str + json.slice(start) : json;
|
|
118
118
|
return implicitKey
|
|
119
119
|
? str
|
|
120
|
-
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx));
|
|
120
|
+
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
121
121
|
}
|
|
122
122
|
function singleQuotedString(value, ctx) {
|
|
123
123
|
if (ctx.options.singleQuote === false ||
|
|
@@ -129,7 +129,7 @@ function singleQuotedString(value, ctx) {
|
|
|
129
129
|
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
|
130
130
|
return ctx.implicitKey
|
|
131
131
|
? res
|
|
132
|
-
: foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
|
|
132
|
+
: foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
133
133
|
}
|
|
134
134
|
function quotedString(value, ctx) {
|
|
135
135
|
const { singleQuote } = ctx.options;
|
|
@@ -236,7 +236,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
|
236
236
|
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
237
237
|
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
238
238
|
.replace(/\n+/g, `$&${indent}`);
|
|
239
|
-
const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx));
|
|
239
|
+
const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
240
240
|
return `${header}\n${indent}${body}`;
|
|
241
241
|
}
|
|
242
242
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
@@ -286,7 +286,7 @@ function plainString(item, ctx, onComment, onChompKeep) {
|
|
|
286
286
|
}
|
|
287
287
|
return implicitKey
|
|
288
288
|
? str
|
|
289
|
-
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
|
|
289
|
+
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
290
290
|
}
|
|
291
291
|
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
292
292
|
const { implicitKey, inFlow } = ctx;
|
package/dist/test-events.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var identity = require('./nodes/identity.js');
|
|
4
4
|
var publicApi = require('./public-api.js');
|
|
5
5
|
var visit = require('./visit.js');
|
|
6
6
|
|
|
@@ -66,10 +66,10 @@ function addEvents(events, doc, errPos, node) {
|
|
|
66
66
|
events.push('=VAL :');
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
if (errPos !== -1 &&
|
|
69
|
+
if (errPos !== -1 && identity.isNode(node) && node.range[0] >= errPos)
|
|
70
70
|
throw new Error();
|
|
71
71
|
let props = '';
|
|
72
|
-
let anchor =
|
|
72
|
+
let anchor = identity.isScalar(node) || identity.isCollection(node) ? node.anchor : undefined;
|
|
73
73
|
if (anchor) {
|
|
74
74
|
if (/\d$/.test(anchor)) {
|
|
75
75
|
const alt = anchor.replace(/\d$/, '');
|
|
@@ -78,9 +78,9 @@ function addEvents(events, doc, errPos, node) {
|
|
|
78
78
|
}
|
|
79
79
|
props = ` &${anchor}`;
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
81
|
+
if (identity.isNode(node) && node.tag)
|
|
82
82
|
props += ` <${node.tag}>`;
|
|
83
|
-
if (
|
|
83
|
+
if (identity.isMap(node)) {
|
|
84
84
|
const ev = node.flow ? '+MAP {}' : '+MAP';
|
|
85
85
|
events.push(`${ev}${props}`);
|
|
86
86
|
node.items.forEach(({ key, value }) => {
|
|
@@ -89,7 +89,7 @@ function addEvents(events, doc, errPos, node) {
|
|
|
89
89
|
});
|
|
90
90
|
events.push('-MAP');
|
|
91
91
|
}
|
|
92
|
-
else if (
|
|
92
|
+
else if (identity.isSeq(node)) {
|
|
93
93
|
const ev = node.flow ? '+SEQ []' : '+SEQ';
|
|
94
94
|
events.push(`${ev}${props}`);
|
|
95
95
|
node.items.forEach(item => {
|
|
@@ -97,13 +97,13 @@ function addEvents(events, doc, errPos, node) {
|
|
|
97
97
|
});
|
|
98
98
|
events.push('-SEQ');
|
|
99
99
|
}
|
|
100
|
-
else if (
|
|
100
|
+
else if (identity.isPair(node)) {
|
|
101
101
|
events.push(`+MAP${props}`);
|
|
102
102
|
addEvents(events, doc, errPos, node.key);
|
|
103
103
|
addEvents(events, doc, errPos, node.value);
|
|
104
104
|
events.push('-MAP');
|
|
105
105
|
}
|
|
106
|
-
else if (
|
|
106
|
+
else if (identity.isAlias(node)) {
|
|
107
107
|
let alias = node.source;
|
|
108
108
|
if (alias && /\d$/.test(alias)) {
|
|
109
109
|
const alt = alias.replace(/\d$/, '');
|
package/dist/util.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { createNode, CreateNodeContext } from './doc/createNode.js';
|
|
1
2
|
export { debug, LogLevelId, warn } from './log.js';
|
|
3
|
+
export { createPair } from './nodes/Pair.js';
|
|
2
4
|
export { findPair } from './nodes/YAMLMap.js';
|
|
3
5
|
export { toJS, ToJSContext } from './nodes/toJS.js';
|
|
4
6
|
export { map as mapTag } from './schema/common/map.js';
|
package/dist/util.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var createNode = require('./doc/createNode.js');
|
|
3
4
|
var log = require('./log.js');
|
|
5
|
+
var Pair = require('./nodes/Pair.js');
|
|
4
6
|
var YAMLMap = require('./nodes/YAMLMap.js');
|
|
5
7
|
var toJS = require('./nodes/toJS.js');
|
|
6
8
|
var map = require('./schema/common/map.js');
|
|
@@ -12,8 +14,10 @@ var stringifyString = require('./stringify/stringifyString.js');
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
17
|
+
exports.createNode = createNode.createNode;
|
|
15
18
|
exports.debug = log.debug;
|
|
16
19
|
exports.warn = log.warn;
|
|
20
|
+
exports.createPair = Pair.createPair;
|
|
17
21
|
exports.findPair = YAMLMap.findPair;
|
|
18
22
|
exports.toJS = toJS.toJS;
|
|
19
23
|
exports.mapTag = map.map;
|
package/dist/visit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var identity = require('./nodes/identity.js');
|
|
4
4
|
|
|
5
5
|
const BREAK = Symbol('break visit');
|
|
6
6
|
const SKIP = Symbol('skip children');
|
|
@@ -37,7 +37,7 @@ const REMOVE = Symbol('remove node');
|
|
|
37
37
|
*/
|
|
38
38
|
function visit(node, visitor) {
|
|
39
39
|
const visitor_ = initVisitor(visitor);
|
|
40
|
-
if (
|
|
40
|
+
if (identity.isDocument(node)) {
|
|
41
41
|
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
|
|
42
42
|
if (cd === REMOVE)
|
|
43
43
|
node.contents = null;
|
|
@@ -56,12 +56,12 @@ visit.SKIP = SKIP;
|
|
|
56
56
|
visit.REMOVE = REMOVE;
|
|
57
57
|
function visit_(key, node, visitor, path) {
|
|
58
58
|
const ctrl = callVisitor(key, node, visitor, path);
|
|
59
|
-
if (
|
|
59
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
60
60
|
replaceNode(key, path, ctrl);
|
|
61
61
|
return visit_(key, ctrl, visitor, path);
|
|
62
62
|
}
|
|
63
63
|
if (typeof ctrl !== 'symbol') {
|
|
64
|
-
if (
|
|
64
|
+
if (identity.isCollection(node)) {
|
|
65
65
|
path = Object.freeze(path.concat(node));
|
|
66
66
|
for (let i = 0; i < node.items.length; ++i) {
|
|
67
67
|
const ci = visit_(i, node.items[i], visitor, path);
|
|
@@ -75,7 +75,7 @@ function visit_(key, node, visitor, path) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
else if (
|
|
78
|
+
else if (identity.isPair(node)) {
|
|
79
79
|
path = Object.freeze(path.concat(node));
|
|
80
80
|
const ck = visit_('key', node.key, visitor, path);
|
|
81
81
|
if (ck === BREAK)
|
|
@@ -124,7 +124,7 @@ function visit_(key, node, visitor, path) {
|
|
|
124
124
|
*/
|
|
125
125
|
async function visitAsync(node, visitor) {
|
|
126
126
|
const visitor_ = initVisitor(visitor);
|
|
127
|
-
if (
|
|
127
|
+
if (identity.isDocument(node)) {
|
|
128
128
|
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
|
|
129
129
|
if (cd === REMOVE)
|
|
130
130
|
node.contents = null;
|
|
@@ -143,12 +143,12 @@ visitAsync.SKIP = SKIP;
|
|
|
143
143
|
visitAsync.REMOVE = REMOVE;
|
|
144
144
|
async function visitAsync_(key, node, visitor, path) {
|
|
145
145
|
const ctrl = await callVisitor(key, node, visitor, path);
|
|
146
|
-
if (
|
|
146
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
147
147
|
replaceNode(key, path, ctrl);
|
|
148
148
|
return visitAsync_(key, ctrl, visitor, path);
|
|
149
149
|
}
|
|
150
150
|
if (typeof ctrl !== 'symbol') {
|
|
151
|
-
if (
|
|
151
|
+
if (identity.isCollection(node)) {
|
|
152
152
|
path = Object.freeze(path.concat(node));
|
|
153
153
|
for (let i = 0; i < node.items.length; ++i) {
|
|
154
154
|
const ci = await visitAsync_(i, node.items[i], visitor, path);
|
|
@@ -162,7 +162,7 @@ async function visitAsync_(key, node, visitor, path) {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
else if (
|
|
165
|
+
else if (identity.isPair(node)) {
|
|
166
166
|
path = Object.freeze(path.concat(node));
|
|
167
167
|
const ck = await visitAsync_('key', node.key, visitor, path);
|
|
168
168
|
if (ck === BREAK)
|
|
@@ -200,34 +200,34 @@ function initVisitor(visitor) {
|
|
|
200
200
|
function callVisitor(key, node, visitor, path) {
|
|
201
201
|
if (typeof visitor === 'function')
|
|
202
202
|
return visitor(key, node, path);
|
|
203
|
-
if (
|
|
203
|
+
if (identity.isMap(node))
|
|
204
204
|
return visitor.Map?.(key, node, path);
|
|
205
|
-
if (
|
|
205
|
+
if (identity.isSeq(node))
|
|
206
206
|
return visitor.Seq?.(key, node, path);
|
|
207
|
-
if (
|
|
207
|
+
if (identity.isPair(node))
|
|
208
208
|
return visitor.Pair?.(key, node, path);
|
|
209
|
-
if (
|
|
209
|
+
if (identity.isScalar(node))
|
|
210
210
|
return visitor.Scalar?.(key, node, path);
|
|
211
|
-
if (
|
|
211
|
+
if (identity.isAlias(node))
|
|
212
212
|
return visitor.Alias?.(key, node, path);
|
|
213
213
|
return undefined;
|
|
214
214
|
}
|
|
215
215
|
function replaceNode(key, path, node) {
|
|
216
216
|
const parent = path[path.length - 1];
|
|
217
|
-
if (
|
|
217
|
+
if (identity.isCollection(parent)) {
|
|
218
218
|
parent.items[key] = node;
|
|
219
219
|
}
|
|
220
|
-
else if (
|
|
220
|
+
else if (identity.isPair(parent)) {
|
|
221
221
|
if (key === 'key')
|
|
222
222
|
parent.key = node;
|
|
223
223
|
else
|
|
224
224
|
parent.value = node;
|
|
225
225
|
}
|
|
226
|
-
else if (
|
|
226
|
+
else if (identity.isDocument(parent)) {
|
|
227
227
|
parent.contents = node;
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
|
-
const pt =
|
|
230
|
+
const pt = identity.isAlias(parent) ? 'alias' : 'scalar';
|
|
231
231
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
232
232
|
}
|
|
233
233
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml",
|
|
3
|
-
"version": "2.3.0-
|
|
3
|
+
"version": "2.3.0-2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
6
|
"repository": "github:eemeli/yaml",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
28
29
|
"node": "./dist/index.js",
|
|
29
30
|
"default": "./browser/index.js"
|
|
30
31
|
},
|
|
31
32
|
"./package.json": "./package.json",
|
|
32
33
|
"./util": {
|
|
34
|
+
"types": "./dist/util.d.ts",
|
|
33
35
|
"node": "./dist/util.js",
|
|
34
36
|
"default": "./browser/dist/util.js"
|
|
35
37
|
}
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
"@babel/preset-env": "^7.12.11",
|
|
78
80
|
"@rollup/plugin-babel": "^6.0.3",
|
|
79
81
|
"@rollup/plugin-replace": "^5.0.2",
|
|
80
|
-
"@rollup/plugin-typescript": "^
|
|
82
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
81
83
|
"@types/jest": "^29.2.4",
|
|
82
84
|
"@types/node": "^14.18.35",
|
|
83
85
|
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
@@ -92,9 +94,10 @@
|
|
|
92
94
|
"prettier": "^2.2.1",
|
|
93
95
|
"rollup": "^3.7.5",
|
|
94
96
|
"tslib": "^2.1.0",
|
|
95
|
-
"typescript": "^
|
|
97
|
+
"typescript": "^5.0.3"
|
|
96
98
|
},
|
|
97
99
|
"engines": {
|
|
98
|
-
"node": ">= 14"
|
|
100
|
+
"node": ">= 14",
|
|
101
|
+
"npm": ">= 7"
|
|
99
102
|
}
|
|
100
103
|
}
|