yaml 2.5.0 → 2.5.1
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/resolve-flow-collection.js +2 -0
- package/browser/dist/compose/resolve-flow-scalar.js +1 -1
- package/browser/dist/doc/applyReviver.js +1 -0
- package/browser/dist/log.js +0 -2
- package/browser/dist/parse/parser.js +3 -1
- package/dist/compose/resolve-flow-collection.js +2 -0
- package/dist/compose/resolve-flow-scalar.js +1 -1
- package/dist/doc/applyReviver.js +1 -0
- package/dist/log.js +0 -2
- package/dist/nodes/Node.d.ts +1 -0
- package/dist/parse/parser.js +3 -1
- package/package.json +6 -8
- package/browser/dist/node_modules/tslib/tslib.es6.js +0 -21
|
@@ -163,6 +163,8 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
|
|
163
163
|
const map = new YAMLMap(ctx.schema);
|
|
164
164
|
map.flow = true;
|
|
165
165
|
map.items.push(pair);
|
|
166
|
+
const endRange = (valueNode ?? keyNode).range;
|
|
167
|
+
map.range = [keyNode.range[0], endRange[1], endRange[2]];
|
|
166
168
|
coll.items.push(map);
|
|
167
169
|
}
|
|
168
170
|
offset = valueNode ? valueNode.range[2] : valueProps.end;
|
|
@@ -84,7 +84,7 @@ function foldLines(source) {
|
|
|
84
84
|
first = new RegExp('(.*?)(?<![ \t])[ \t]*\r?\n', 'sy');
|
|
85
85
|
line = new RegExp('[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n', 'sy');
|
|
86
86
|
}
|
|
87
|
-
catch
|
|
87
|
+
catch {
|
|
88
88
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
89
89
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
90
90
|
}
|
|
@@ -11,6 +11,7 @@ function applyReviver(reviver, obj, key, val) {
|
|
|
11
11
|
for (let i = 0, len = val.length; i < len; ++i) {
|
|
12
12
|
const v0 = val[i];
|
|
13
13
|
const v1 = applyReviver(reviver, val, String(i), v0);
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-array-delete
|
|
14
15
|
if (v1 === undefined)
|
|
15
16
|
delete val[i];
|
|
16
17
|
else if (v1 !== v0)
|
package/browser/dist/log.js
CHANGED
|
@@ -4,8 +4,6 @@ function debug(logLevel, ...messages) {
|
|
|
4
4
|
}
|
|
5
5
|
function warn(logLevel, warning) {
|
|
6
6
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
7
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/7478
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
9
7
|
if (typeof process !== 'undefined' && process.emitWarning)
|
|
10
8
|
process.emitWarning(warning);
|
|
11
9
|
else
|
|
@@ -608,7 +608,9 @@ class Parser {
|
|
|
608
608
|
const sep = it.sep;
|
|
609
609
|
sep.push(this.sourceToken);
|
|
610
610
|
// @ts-expect-error type guard is wrong here
|
|
611
|
-
delete it.key
|
|
611
|
+
delete it.key;
|
|
612
|
+
// @ts-expect-error type guard is wrong here
|
|
613
|
+
delete it.sep;
|
|
612
614
|
this.stack.push({
|
|
613
615
|
type: 'block-map',
|
|
614
616
|
offset: this.offset,
|
|
@@ -165,6 +165,8 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
|
|
165
165
|
const map = new YAMLMap.YAMLMap(ctx.schema);
|
|
166
166
|
map.flow = true;
|
|
167
167
|
map.items.push(pair);
|
|
168
|
+
const endRange = (valueNode ?? keyNode).range;
|
|
169
|
+
map.range = [keyNode.range[0], endRange[1], endRange[2]];
|
|
168
170
|
coll.items.push(map);
|
|
169
171
|
}
|
|
170
172
|
offset = valueNode ? valueNode.range[2] : valueProps.end;
|
|
@@ -86,7 +86,7 @@ function foldLines(source) {
|
|
|
86
86
|
first = new RegExp('(.*?)(?<![ \t])[ \t]*\r?\n', 'sy');
|
|
87
87
|
line = new RegExp('[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n', 'sy');
|
|
88
88
|
}
|
|
89
|
-
catch
|
|
89
|
+
catch {
|
|
90
90
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
91
91
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
92
92
|
}
|
package/dist/doc/applyReviver.js
CHANGED
|
@@ -13,6 +13,7 @@ function applyReviver(reviver, obj, key, val) {
|
|
|
13
13
|
for (let i = 0, len = val.length; i < len; ++i) {
|
|
14
14
|
const v0 = val[i];
|
|
15
15
|
const v1 = applyReviver(reviver, val, String(i), v0);
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-array-delete
|
|
16
17
|
if (v1 === undefined)
|
|
17
18
|
delete val[i];
|
|
18
19
|
else if (v1 !== v0)
|
package/dist/log.js
CHANGED
|
@@ -6,8 +6,6 @@ function debug(logLevel, ...messages) {
|
|
|
6
6
|
}
|
|
7
7
|
function warn(logLevel, warning) {
|
|
8
8
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
9
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/7478
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
11
9
|
if (typeof process !== 'undefined' && process.emitWarning)
|
|
12
10
|
process.emitWarning(warning);
|
|
13
11
|
else
|
package/dist/nodes/Node.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type NodeType<T> = T extends string | number | bigint | boolean | null |
|
|
|
15
15
|
[key: number]: any;
|
|
16
16
|
} ? YAMLMap<NodeType<keyof T>, NodeType<T[keyof T]>> : Node;
|
|
17
17
|
export type ParsedNode = Alias.Parsed | Scalar.Parsed | YAMLMap.Parsed | YAMLSeq.Parsed;
|
|
18
|
+
/** `[start, value-end, node-end]` */
|
|
18
19
|
export type Range = [number, number, number];
|
|
19
20
|
export declare abstract class NodeBase {
|
|
20
21
|
readonly [NODE_TYPE]: symbol;
|
package/dist/parse/parser.js
CHANGED
|
@@ -612,7 +612,9 @@ class Parser {
|
|
|
612
612
|
const sep = it.sep;
|
|
613
613
|
sep.push(this.sourceToken);
|
|
614
614
|
// @ts-expect-error type guard is wrong here
|
|
615
|
-
delete it.key
|
|
615
|
+
delete it.key;
|
|
616
|
+
// @ts-expect-error type guard is wrong here
|
|
617
|
+
delete it.sep;
|
|
616
618
|
this.stack.push({
|
|
617
619
|
type: 'block-map',
|
|
618
620
|
offset: this.offset,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
6
|
"repository": "github:eemeli/yaml",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"build:browser": "rollup -c config/rollup.browser-config.mjs",
|
|
43
43
|
"build:node": "rollup -c config/rollup.node-config.mjs",
|
|
44
44
|
"clean": "git clean -fdxe node_modules",
|
|
45
|
-
"lint": "eslint src/",
|
|
45
|
+
"lint": "eslint config/ src/",
|
|
46
46
|
"prettier": "prettier --write .",
|
|
47
47
|
"prestart": "rollup --sourcemap -c config/rollup.node-config.mjs",
|
|
48
48
|
"start": "node --enable-source-maps -i -e 'YAML=require(\"./dist/index.js\");const{parse,parseDocument,parseAllDocuments}=YAML'",
|
|
@@ -69,20 +69,17 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@babel/core": "^7.12.10",
|
|
72
|
-
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
73
|
-
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
|
|
74
72
|
"@babel/plugin-transform-typescript": "^7.12.17",
|
|
75
73
|
"@babel/preset-env": "^7.12.11",
|
|
74
|
+
"@eslint/js": "^9.9.1",
|
|
76
75
|
"@rollup/plugin-babel": "^6.0.3",
|
|
77
76
|
"@rollup/plugin-replace": "^5.0.2",
|
|
78
77
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
79
78
|
"@types/jest": "^29.2.4",
|
|
80
79
|
"@types/node": "^20.11.20",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
|
82
|
-
"@typescript-eslint/parser": "^7.0.2",
|
|
83
80
|
"babel-jest": "^29.0.1",
|
|
84
81
|
"cross-env": "^7.0.3",
|
|
85
|
-
"eslint": "^
|
|
82
|
+
"eslint": "^9.9.1",
|
|
86
83
|
"eslint-config-prettier": "^9.0.0",
|
|
87
84
|
"fast-check": "^2.12.0",
|
|
88
85
|
"jest": "^29.0.1",
|
|
@@ -90,7 +87,8 @@
|
|
|
90
87
|
"prettier": "^3.0.2",
|
|
91
88
|
"rollup": "^4.12.0",
|
|
92
89
|
"tslib": "^2.1.0",
|
|
93
|
-
"typescript": "^5.0.3"
|
|
90
|
+
"typescript": "^5.0.3",
|
|
91
|
+
"typescript-eslint": "^8.4.0"
|
|
94
92
|
},
|
|
95
93
|
"engines": {
|
|
96
94
|
"node": ">= 14"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
16
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
17
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
18
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { __classPrivateFieldGet };
|