@node-core/utils 7.3.1 → 7.4.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/bin/ncu-ci.js +39 -0
- package/lib/ci/availability.js +24 -0
- package/lib/ci/ci_utils.js +13 -0
- package/lib/ci/failure_file_scanner.js +72 -21
- package/lib/ci/jenkins.js +23 -0
- package/lib/ci/resumable_build.js +86 -0
- package/lib/ci/resume_ci.js +64 -25
- package/lib/ci/run_ci.js +39 -9
- package/lib/ci/workload.js +72 -0
- package/lib/update-v8/deps.js +4 -1
- package/node_modules/branch-diff/.github/dependabot.yml +14 -2
- package/node_modules/branch-diff/.github/workflows/test-and-release.yml +4 -15
- package/node_modules/branch-diff/CHANGELOG.md +24 -0
- package/node_modules/branch-diff/package.json +35 -3
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +2 -2
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +1 -1
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.cjs.js +2 -1
- package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.mjs +2 -1
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/package.json +1 -1
- package/node_modules/smol-toml/README.md +460 -273
- package/node_modules/smol-toml/dist/date.js +50 -21
- package/node_modules/smol-toml/dist/error.d.ts +1 -2
- package/node_modules/smol-toml/dist/error.js +6 -2
- package/node_modules/smol-toml/dist/extract.js +240 -20
- package/node_modules/smol-toml/dist/index.cjs +409 -373
- package/node_modules/smol-toml/dist/index.d.ts +5 -4
- package/node_modules/smol-toml/dist/index.js +2 -1
- package/node_modules/smol-toml/dist/parse.d.ts +38 -1
- package/node_modules/smol-toml/dist/parse.js +52 -37
- package/node_modules/smol-toml/dist/primitive.js +23 -110
- package/node_modules/smol-toml/dist/stringify.d.ts +2 -1
- package/node_modules/smol-toml/dist/stringify.js +74 -36
- package/node_modules/smol-toml/dist/struct.js +76 -99
- package/node_modules/smol-toml/dist/util.d.ts +6 -1
- package/node_modules/smol-toml/dist/util.js +4 -36
- package/node_modules/smol-toml/package.json +8 -8
- package/package.json +1 -1
|
@@ -27,85 +27,69 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { parseString } from './primitive.js';
|
|
29
29
|
import { extractValue } from './extract.js';
|
|
30
|
-
import {
|
|
30
|
+
import { skipVoid } from './util.js';
|
|
31
31
|
import { TomlError } from './error.js';
|
|
32
|
-
let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
33
32
|
/** @internal */
|
|
34
|
-
export function parseKey(ctx, end =
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
export function parseKey(ctx, end = 0x3d /* = */) {
|
|
34
|
+
// States:
|
|
35
|
+
// 0: before first char
|
|
36
|
+
// 1: parsing bare key
|
|
37
|
+
// 2: after key component
|
|
38
|
+
let startPtr;
|
|
39
|
+
let state = 0;
|
|
37
40
|
let parsed = [];
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
throw new TomlError('incomplete key-value: cannot find end of key', {
|
|
41
|
-
toml: ctx.s,
|
|
42
|
-
ptr: start,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
41
|
+
let sliceStart;
|
|
42
|
+
let c = ctx.s.charCodeAt(startPtr = ctx.p);
|
|
45
43
|
do {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (endPtr < 0) {
|
|
76
|
-
throw new TomlError('incomplete key-value: cannot find end of key', {
|
|
77
|
-
toml: ctx.s,
|
|
78
|
-
ptr: start,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
parsed.push(part);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
// Normal raw key part consumption and validation
|
|
86
|
-
dot = ctx.s.indexOf('.', ctx.p);
|
|
87
|
-
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
88
|
-
if (!KEY_PART_RE.test(part)) {
|
|
89
|
-
throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {
|
|
90
|
-
toml: ctx.s,
|
|
91
|
-
ptr: ctx.p,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
parsed.push(part.trimEnd());
|
|
44
|
+
// End of key
|
|
45
|
+
if (c === end) {
|
|
46
|
+
if (!state)
|
|
47
|
+
TomlError.x('unexpected end of key', ctx);
|
|
48
|
+
if (state === 1)
|
|
49
|
+
parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
50
|
+
return ctx.p++, parsed;
|
|
51
|
+
}
|
|
52
|
+
// Dotted key separator
|
|
53
|
+
else if (c === 0x2e /* . */) {
|
|
54
|
+
if (!state)
|
|
55
|
+
TomlError.x('illegal empty bare key', ctx);
|
|
56
|
+
if (state === 1)
|
|
57
|
+
parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
58
|
+
state = 0;
|
|
59
|
+
}
|
|
60
|
+
// Quoted key
|
|
61
|
+
else if (!state && (c === 0x22 /* " */ || c === 0x27 /* ' */)) {
|
|
62
|
+
if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2))
|
|
63
|
+
TomlError.x('illegal quoted key: multiline strings are not allowed', ctx);
|
|
64
|
+
parsed.push(parseString(ctx));
|
|
65
|
+
state = 2;
|
|
66
|
+
ctx.p--;
|
|
67
|
+
}
|
|
68
|
+
// Whitespace; no-op in state 0 and 2, end of bare key in state 1
|
|
69
|
+
else if (c === 0x20 || c === 0x9 /* \t */) {
|
|
70
|
+
if (state === 1) {
|
|
71
|
+
parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
72
|
+
state = 2;
|
|
95
73
|
}
|
|
96
74
|
}
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
75
|
+
// If state is post-key, no character is allowed; otherwise ensure it's a bare-key component
|
|
76
|
+
else if (state === 2 || (c < 0x30 && c !== 0x2d /* - */) || (c > 0x39 && c < 0x41) || (c > 0x5a && c < 0x61 && c !== 0x5f /* _ */) || c > 0x7a) {
|
|
77
|
+
TomlError.x('illegal character in key', ctx);
|
|
78
|
+
}
|
|
79
|
+
// Illegal character
|
|
80
|
+
else if (!state) {
|
|
81
|
+
state = 1;
|
|
82
|
+
sliceStart = ctx.p;
|
|
83
|
+
}
|
|
84
|
+
} while (c = ctx.s.charCodeAt(++ctx.p));
|
|
85
|
+
TomlError.x('incomplete key-value: cannot find end of key', ctx, startPtr);
|
|
102
86
|
}
|
|
103
87
|
/** @internal */
|
|
104
|
-
export function parseInlineTable(ctx
|
|
105
|
-
let
|
|
88
|
+
export function parseInlineTable(ctx) {
|
|
89
|
+
let startPtr = ctx.p++;
|
|
90
|
+
let res = Object.create(null);
|
|
106
91
|
let seen = new Set();
|
|
107
92
|
let c;
|
|
108
|
-
ctx.p++;
|
|
109
93
|
while (ctx.p < ctx.s.length) {
|
|
110
94
|
skipVoid(ctx);
|
|
111
95
|
if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {
|
|
@@ -115,65 +99,58 @@ export function parseInlineTable(ctx, integersAsBigInt) {
|
|
|
115
99
|
let k;
|
|
116
100
|
let t = res;
|
|
117
101
|
let hasOwn = false;
|
|
118
|
-
let
|
|
102
|
+
let errPtr = ctx.p;
|
|
119
103
|
let key = parseKey(ctx);
|
|
120
104
|
for (let i = 0; i < key.length; i++) {
|
|
121
105
|
if (i)
|
|
122
|
-
t = hasOwn ? t[k] : (t[k] =
|
|
106
|
+
t = hasOwn ? t[k] : (t[k] = Object.create(null));
|
|
123
107
|
k = key[i];
|
|
124
108
|
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
109
|
+
TomlError.x('trying to redefine an already defined value', ctx, errPtr);
|
|
110
|
+
}
|
|
111
|
+
let unsafe = k === '__proto__';
|
|
112
|
+
if (ctx.uk && (unsafe || k === 'constructor')) {
|
|
113
|
+
t = ctx.uk !== 1 && TomlError.x('document contains an unsafe property', ctx, errPtr);
|
|
114
|
+
break;
|
|
129
115
|
}
|
|
130
|
-
if (!hasOwn &&
|
|
116
|
+
if (!hasOwn && unsafe) {
|
|
131
117
|
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
|
|
132
118
|
}
|
|
133
119
|
}
|
|
134
120
|
if (hasOwn) {
|
|
135
|
-
|
|
136
|
-
toml: ctx.s,
|
|
137
|
-
ptr: ctx.p,
|
|
138
|
-
});
|
|
121
|
+
TomlError.x('trying to redefine an already defined value', ctx, errPtr);
|
|
139
122
|
}
|
|
140
|
-
|
|
141
|
-
|
|
123
|
+
skipVoid(ctx, true, true);
|
|
124
|
+
let value = extractValue(ctx, 0x7d /* } */);
|
|
125
|
+
if (t && typeof (t[k] = value) === 'object')
|
|
126
|
+
seen.add(value);
|
|
142
127
|
skipVoid(ctx);
|
|
143
128
|
if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {
|
|
144
129
|
return res;
|
|
145
130
|
}
|
|
146
|
-
if (c !== 0x2c /* , */)
|
|
147
|
-
|
|
148
|
-
}
|
|
131
|
+
if (c !== 0x2c /* , */)
|
|
132
|
+
TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
|
|
149
133
|
}
|
|
150
|
-
|
|
151
|
-
toml: ctx.s,
|
|
152
|
-
ptr: ctx.p,
|
|
153
|
-
});
|
|
134
|
+
TomlError.x('unfinished table', ctx, startPtr);
|
|
154
135
|
}
|
|
155
136
|
/** @internal */
|
|
156
|
-
export function parseArray(ctx
|
|
137
|
+
export function parseArray(ctx) {
|
|
138
|
+
let startPtr = ctx.p++;
|
|
157
139
|
let res = [];
|
|
158
140
|
let c;
|
|
159
|
-
ctx.p++;
|
|
160
141
|
while (ctx.p < ctx.s.length) {
|
|
161
142
|
skipVoid(ctx);
|
|
162
143
|
if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {
|
|
163
144
|
ctx.p++;
|
|
164
145
|
return res;
|
|
165
146
|
}
|
|
166
|
-
res.push(extractValue(ctx, 0x5d /* ]
|
|
147
|
+
res.push(extractValue(ctx, 0x5d /* ] */));
|
|
167
148
|
skipVoid(ctx);
|
|
168
149
|
if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {
|
|
169
150
|
return res;
|
|
170
151
|
}
|
|
171
|
-
if (c !== 0x2c /* , */)
|
|
172
|
-
|
|
173
|
-
}
|
|
152
|
+
if (c !== 0x2c /* , */)
|
|
153
|
+
TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
|
|
174
154
|
}
|
|
175
|
-
|
|
176
|
-
toml: ctx.s,
|
|
177
|
-
ptr: ctx.p,
|
|
178
|
-
});
|
|
155
|
+
TomlError.x('unfinished array', ctx, startPtr);
|
|
179
156
|
}
|
|
@@ -26,8 +26,12 @@
|
|
|
26
26
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
27
|
*/
|
|
28
28
|
import type { TomlDate } from './date.js';
|
|
29
|
+
type _Temporal = typeof globalThis extends {
|
|
30
|
+
Temporal: infer T;
|
|
31
|
+
} ? T : never;
|
|
32
|
+
type AnyTemporalDateTime = InstanceType<_Temporal['Instant']> | InstanceType<_Temporal['PlainDate']> | InstanceType<_Temporal['PlainDateTime']> | InstanceType<_Temporal['PlainTime']> | InstanceType<_Temporal['ZonedDateTime']>;
|
|
29
33
|
export type IntegersAsBigInt = undefined | boolean | 'asNeeded';
|
|
30
|
-
export type TomlPrimitive = string | number | bigint | boolean | TomlDate;
|
|
34
|
+
export type TomlPrimitive = string | number | bigint | boolean | TomlDate | AnyTemporalDateTime;
|
|
31
35
|
export type TomlTable = {
|
|
32
36
|
[key: string]: TomlValue;
|
|
33
37
|
};
|
|
@@ -36,3 +40,4 @@ export type TomlTableWithoutBigInt = {
|
|
|
36
40
|
[key: string]: TomlValueWithoutBigInt;
|
|
37
41
|
};
|
|
38
42
|
export type TomlValueWithoutBigInt = Exclude<TomlPrimitive, bigint> | TomlValueWithoutBigInt[] | TomlTableWithoutBigInt;
|
|
43
|
+
export {};
|
|
@@ -27,13 +27,6 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { TomlError } from './error.js';
|
|
29
29
|
/** @internal */
|
|
30
|
-
export function indexOfNewline(str, start = 0) {
|
|
31
|
-
let idx = str.indexOf('\n', start);
|
|
32
|
-
if (str.charCodeAt(idx - 1) === 0xd /* \r */)
|
|
33
|
-
idx--;
|
|
34
|
-
return idx;
|
|
35
|
-
}
|
|
36
|
-
/** @internal */
|
|
37
30
|
export function skipComment(ctx) {
|
|
38
31
|
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
39
32
|
let c = ctx.s.charCodeAt(ctx.p);
|
|
@@ -44,46 +37,21 @@ export function skipComment(ctx) {
|
|
|
44
37
|
break;
|
|
45
38
|
}
|
|
46
39
|
if ((c < 0x20 && c !== 0x9 /* \t */) || c === 0x7f) {
|
|
47
|
-
|
|
48
|
-
toml: ctx.s,
|
|
49
|
-
ptr: ctx.p,
|
|
50
|
-
});
|
|
40
|
+
TomlError.x('control characters are not allowed in comments', ctx);
|
|
51
41
|
}
|
|
52
42
|
}
|
|
53
43
|
}
|
|
54
44
|
/** @internal */
|
|
55
45
|
export function skipVoid(ctx, banNewLines, banComments) {
|
|
56
46
|
let c;
|
|
57
|
-
while (
|
|
58
|
-
while ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||
|
|
47
|
+
while (ctx.p < ctx.s.length) {
|
|
48
|
+
while (ctx.p < ctx.s.length && ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||
|
|
59
49
|
c === 0x9 /* \t */ ||
|
|
60
50
|
(!banNewLines &&
|
|
61
|
-
(c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */))))
|
|
51
|
+
(c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */)))))
|
|
62
52
|
ctx.p++;
|
|
63
53
|
if (banComments || c !== 0x23 /* # */)
|
|
64
54
|
break;
|
|
65
55
|
skipComment(ctx);
|
|
66
56
|
}
|
|
67
57
|
}
|
|
68
|
-
/** @internal */
|
|
69
|
-
export function skipUntil(ctx, sep, end) {
|
|
70
|
-
let ptr = ctx.p;
|
|
71
|
-
if (!end) {
|
|
72
|
-
ptr = indexOfNewline(ctx.s, ptr);
|
|
73
|
-
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
77
|
-
let c = ctx.s.charCodeAt(ctx.p);
|
|
78
|
-
if (c === 0x23 /* # */) {
|
|
79
|
-
skipComment(ctx);
|
|
80
|
-
}
|
|
81
|
-
else if (c === end || c === sep) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
throw new TomlError('cannot find end of structure', {
|
|
86
|
-
toml: ctx.s,
|
|
87
|
-
ptr,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smol-toml",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "A small, fast, and correct TOML parser/serializer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parser",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@mitata/counters": "^0.0.8",
|
|
38
|
-
"@tsconfig/node-lts": "^24.0.
|
|
38
|
+
"@tsconfig/node-lts": "^24.0.1",
|
|
39
39
|
"@tsconfig/node-ts": "^23.6.4",
|
|
40
40
|
"@tsconfig/strictest": "^2.0.8",
|
|
41
|
-
"@types/node": "^26.2
|
|
41
|
+
"@types/node": "^26.6.2",
|
|
42
42
|
"mitata": "^1.0.34",
|
|
43
|
-
"pin-github-action": "^3.5.
|
|
44
|
-
"rolldown": "^1.2.
|
|
43
|
+
"pin-github-action": "^3.5.2",
|
|
44
|
+
"rolldown": "^1.2.9",
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
|
-
"vite": "^
|
|
47
|
-
"vitest": "^
|
|
46
|
+
"vite": "^8.3.0",
|
|
47
|
+
"vitest": "^5.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devEngines": {
|
|
50
50
|
"packageManager": {
|
|
51
51
|
"name": "pnpm",
|
|
52
|
-
"version": "
|
|
52
|
+
"version": "12.5.1",
|
|
53
53
|
"onFail": "error"
|
|
54
54
|
},
|
|
55
55
|
"runtime": {
|