@node-core/utils 7.1.0 → 7.2.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/components/metadata.js +2 -1
- package/lib/ci/build-types/test_build.js +3 -3
- package/lib/ci/failure_aggregator.js +2 -2
- package/lib/ci/run_ci.js +3 -2
- package/lib/cli.js +6 -6
- package/lib/figures.js +6 -6
- package/lib/prepare_security.js +20 -21
- package/lib/request.js +1 -1
- package/lib/update-v8/backport.js +3 -4
- package/lib/utils.js +4 -2
- package/lib/verbosity.js +2 -4
- package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/README.md +4 -4
- package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.d.mts +21 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.mjs +46 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/LICENSE +22 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.d.ts +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.js +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.d.ts +35 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.js +1 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.d.ts +34 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.js +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/package.json +88 -0
- package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/package.json +25 -20
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.d.ts +48 -3
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.js +58 -19
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/package.json +1 -1
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/readme.md +36 -1
- package/node_modules/ansi-regex/index.js +9 -4
- package/node_modules/ansi-regex/package.json +1 -1
- package/node_modules/ansi-regex/readme.md +6 -0
- package/node_modules/ansi-styles/index.d.ts +12 -12
- package/node_modules/ansi-styles/index.js +3 -3
- package/node_modules/ansi-styles/package.json +4 -4
- package/node_modules/cli-truncate/index.d.ts +3 -3
- package/node_modules/cli-truncate/index.js +40 -14
- package/node_modules/cli-truncate/node_modules/string-width/index.js +133 -15
- package/node_modules/cli-truncate/node_modules/string-width/package.json +4 -4
- package/node_modules/cli-truncate/node_modules/string-width/readme.md +1 -1
- package/node_modules/cli-truncate/package.json +7 -7
- package/node_modules/cli-truncate/readme.md +2 -3
- package/node_modules/ghauth/.github/dependabot.yml +11 -3
- package/node_modules/ghauth/.github/workflows/depsound.yml +33 -0
- package/node_modules/ghauth/.github/workflows/test-and-release.yml +4 -4
- package/node_modules/ghauth/CHANGELOG.md +60 -0
- package/node_modules/ghauth/package.json +30 -6
- package/node_modules/js-yaml/README.md +20 -187
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +1008 -946
- 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 +29 -23
- 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 +1043 -583
- package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.d.ts +877 -133
- package/node_modules/js-yaml/dist/js-yaml.mjs +995 -556
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/package.json +8 -7
- package/node_modules/listr2/dist/{index.d.cts → index.d.mts} +90 -60
- package/node_modules/listr2/dist/{index.js → index.mjs} +496 -373
- package/node_modules/listr2/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/listr2/node_modules/string-width/index.js +207 -0
- package/node_modules/listr2/node_modules/string-width/package.json +65 -0
- package/node_modules/listr2/node_modules/string-width/readme.md +66 -0
- package/node_modules/listr2/node_modules/wrap-ansi/index.d.ts +1 -1
- package/node_modules/listr2/node_modules/wrap-ansi/index.js +544 -116
- package/node_modules/listr2/node_modules/wrap-ansi/package.json +10 -13
- package/node_modules/listr2/node_modules/wrap-ansi/readme.md +2 -0
- package/node_modules/listr2/package.json +16 -19
- package/node_modules/log-update/index.d.ts +64 -1
- package/node_modules/log-update/index.js +268 -18
- package/node_modules/log-update/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/log-update/node_modules/string-width/index.js +207 -0
- package/node_modules/log-update/node_modules/string-width/package.json +65 -0
- package/node_modules/log-update/node_modules/string-width/readme.md +66 -0
- package/node_modules/log-update/node_modules/wrap-ansi/index.d.ts +1 -1
- package/node_modules/log-update/node_modules/wrap-ansi/index.js +544 -116
- package/node_modules/log-update/node_modules/wrap-ansi/package.json +10 -13
- package/node_modules/log-update/node_modules/wrap-ansi/readme.md +2 -0
- package/node_modules/log-update/package.json +14 -12
- package/node_modules/log-update/readme.md +61 -0
- package/node_modules/slice-ansi/index.d.ts +2 -2
- package/node_modules/slice-ansi/index.js +260 -112
- package/node_modules/slice-ansi/package.json +10 -9
- package/node_modules/slice-ansi/readme.md +3 -2
- package/node_modules/slice-ansi/tokenize-ansi.js +752 -0
- package/node_modules/smol-toml/README.md +205 -191
- package/node_modules/smol-toml/dist/date.d.ts +0 -1
- package/node_modules/smol-toml/dist/date.js +0 -1
- package/node_modules/smol-toml/dist/error.d.ts +0 -1
- package/node_modules/smol-toml/dist/error.js +0 -1
- package/node_modules/smol-toml/dist/extract.js +32 -65
- package/node_modules/smol-toml/dist/index.cjs +302 -288
- package/node_modules/smol-toml/dist/index.d.ts +0 -1
- package/node_modules/smol-toml/dist/index.js +0 -1
- package/node_modules/smol-toml/dist/parse.d.ts +1 -3
- package/node_modules/smol-toml/dist/parse.js +22 -21
- package/node_modules/smol-toml/dist/primitive.js +75 -76
- package/node_modules/smol-toml/dist/stringify.d.ts +0 -1
- package/node_modules/smol-toml/dist/stringify.js +43 -30
- package/node_modules/smol-toml/dist/struct.js +90 -93
- package/node_modules/smol-toml/dist/util.d.ts +1 -1
- package/node_modules/smol-toml/dist/util.js +36 -39
- package/node_modules/smol-toml/package.json +6 -6
- package/node_modules/strip-ansi/index.js +5 -0
- package/node_modules/strip-ansi/package.json +5 -5
- package/package.json +3 -9
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.cjs +0 -127
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.cts +0 -152
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.ts +0 -152
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.js +0 -92
- package/node_modules/chalk/package.json +0 -92
- package/node_modules/chalk/readme.md +0 -331
- package/node_modules/chalk/source/index.d.ts +0 -437
- package/node_modules/chalk/source/index.js +0 -261
- package/node_modules/chalk/source/utilities.js +0 -33
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -299
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -261
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/node_modules/chalk/source/vendor/supports-color/browser.js +0 -32
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/node_modules/chalk/source/vendor/supports-color/index.js +0 -206
- package/node_modules/colorette/LICENSE.md +0 -7
- package/node_modules/colorette/README.md +0 -134
- package/node_modules/colorette/index.cjs +0 -218
- package/node_modules/colorette/index.d.ts +0 -93
- package/node_modules/colorette/index.js +0 -150
- package/node_modules/colorette/package.json +0 -40
- package/node_modules/eventemitter3/LICENSE +0 -21
- package/node_modules/eventemitter3/README.md +0 -94
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
- package/node_modules/eventemitter3/index.d.ts +0 -135
- package/node_modules/eventemitter3/index.js +0 -336
- package/node_modules/eventemitter3/index.mjs +0 -4
- package/node_modules/eventemitter3/package.json +0 -67
- package/node_modules/figures/index.d.ts +0 -279
- package/node_modules/figures/index.js +0 -292
- package/node_modules/figures/package.json +0 -49
- package/node_modules/figures/readme.md +0 -337
- package/node_modules/isexe/LICENSE.md +0 -55
- package/node_modules/isexe/README.md +0 -80
- package/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
- package/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/index.js +0 -56
- package/node_modules/isexe/dist/commonjs/index.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/index.min.js +0 -2
- package/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
- package/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/options.js +0 -3
- package/node_modules/isexe/dist/commonjs/options.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/package.json +0 -3
- package/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
- package/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/posix.js +0 -67
- package/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
- package/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/win32.js +0 -63
- package/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
- package/node_modules/isexe/dist/esm/index.d.ts +0 -14
- package/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/index.js +0 -16
- package/node_modules/isexe/dist/esm/index.js.map +0 -1
- package/node_modules/isexe/dist/esm/index.min.js +0 -2
- package/node_modules/isexe/dist/esm/index.min.js.map +0 -7
- package/node_modules/isexe/dist/esm/options.d.ts +0 -32
- package/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/options.js +0 -2
- package/node_modules/isexe/dist/esm/options.js.map +0 -1
- package/node_modules/isexe/dist/esm/package.json +0 -3
- package/node_modules/isexe/dist/esm/posix.d.ts +0 -18
- package/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/posix.js +0 -62
- package/node_modules/isexe/dist/esm/posix.js.map +0 -1
- package/node_modules/isexe/dist/esm/win32.d.ts +0 -18
- package/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/win32.js +0 -58
- package/node_modules/isexe/dist/esm/win32.js.map +0 -1
- package/node_modules/isexe/package.json +0 -78
- package/node_modules/listr2/dist/index.cjs +0 -2189
- package/node_modules/listr2/dist/index.d.ts +0 -1528
- package/node_modules/rfdc/.github/workflows/ci.yml +0 -21
- package/node_modules/rfdc/LICENSE +0 -15
- package/node_modules/rfdc/default.js +0 -3
- package/node_modules/rfdc/index.d.ts +0 -13
- package/node_modules/rfdc/index.js +0 -198
- package/node_modules/rfdc/index.test-d.ts +0 -13
- package/node_modules/rfdc/package.json +0 -73
- package/node_modules/rfdc/readme.md +0 -181
- package/node_modules/rfdc/test/index.js +0 -306
- package/node_modules/smol-toml/dist/date.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/date.js.map +0 -1
- package/node_modules/smol-toml/dist/error.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/error.js.map +0 -1
- package/node_modules/smol-toml/dist/extract.js.map +0 -1
- package/node_modules/smol-toml/dist/index.cjs.map +0 -1
- package/node_modules/smol-toml/dist/index.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/index.js.map +0 -1
- package/node_modules/smol-toml/dist/parse.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/parse.js.map +0 -1
- package/node_modules/smol-toml/dist/primitive.d.ts +0 -29
- package/node_modules/smol-toml/dist/primitive.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/primitive.js.map +0 -1
- package/node_modules/smol-toml/dist/stringify.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/stringify.js.map +0 -1
- package/node_modules/smol-toml/dist/struct.js.map +0 -1
- package/node_modules/smol-toml/dist/util.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/util.js.map +0 -1
- package/node_modules/smol-toml/src/date.ts +0 -152
- package/node_modules/smol-toml/src/error.ts +0 -77
- package/node_modules/smol-toml/src/extract.ts +0 -113
- package/node_modules/smol-toml/src/index.ts +0 -42
- package/node_modules/smol-toml/src/parse.ts +0 -184
- package/node_modules/smol-toml/src/primitive.ts +0 -249
- package/node_modules/smol-toml/src/stringify.ts +0 -191
- package/node_modules/smol-toml/src/struct.ts +0 -202
- package/node_modules/smol-toml/src/util.ts +0 -106
- package/node_modules/which/LICENSE +0 -15
- package/node_modules/which/README.md +0 -51
- package/node_modules/which/bin/which.js +0 -52
- package/node_modules/which/lib/index.js +0 -111
- package/node_modules/which/package.json +0 -52
- /package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/LICENSE +0 -0
- /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.d.ts +0 -0
- /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.js +0 -0
- /package/node_modules/{chalk → ansi-escapes}/license +0 -0
- /package/node_modules/{figures → listr2/node_modules/string-width}/license +0 -0
- /package/node_modules/log-update/node_modules/{ansi-escapes → string-width}/license +0 -0
|
@@ -27,54 +27,55 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { parseString } from './primitive.js';
|
|
29
29
|
import { extractValue } from './extract.js';
|
|
30
|
-
import { indexOfNewline,
|
|
30
|
+
import { indexOfNewline, skipVoid } from './util.js';
|
|
31
31
|
import { TomlError } from './error.js';
|
|
32
32
|
let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
33
33
|
/** @internal */
|
|
34
|
-
export function parseKey(
|
|
35
|
-
let
|
|
34
|
+
export function parseKey(ctx, end = '=') {
|
|
35
|
+
let start = ctx.p;
|
|
36
|
+
let dot = start - 1;
|
|
36
37
|
let parsed = [];
|
|
37
|
-
let endPtr =
|
|
38
|
+
let endPtr = ctx.s.indexOf(end, start);
|
|
38
39
|
if (endPtr < 0) {
|
|
39
40
|
throw new TomlError('incomplete key-value: cannot find end of key', {
|
|
40
|
-
toml:
|
|
41
|
-
ptr:
|
|
41
|
+
toml: ctx.s,
|
|
42
|
+
ptr: start,
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
do {
|
|
45
|
-
let c =
|
|
46
|
+
let c = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
46
47
|
// If it's whitespace, ignore
|
|
47
|
-
if (c !==
|
|
48
|
+
if (c !== 0x20 && c !== 0x9 /* \t */) {
|
|
48
49
|
// If it's a string
|
|
49
|
-
if (c ===
|
|
50
|
-
if (c ===
|
|
50
|
+
if (c === 0x22 /* " */ || c === 0x27 /* ' */) {
|
|
51
|
+
if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {
|
|
51
52
|
throw new TomlError('multiline strings are not allowed in keys', {
|
|
52
|
-
toml:
|
|
53
|
-
ptr:
|
|
53
|
+
toml: ctx.s,
|
|
54
|
+
ptr: ctx.p,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
let
|
|
57
|
-
dot =
|
|
58
|
-
let strEnd =
|
|
57
|
+
let part = parseString(ctx);
|
|
58
|
+
dot = ctx.s.indexOf('.', ctx.p);
|
|
59
|
+
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
59
60
|
let newLine = indexOfNewline(strEnd);
|
|
60
61
|
if (newLine > -1) {
|
|
61
62
|
throw new TomlError('newlines are not allowed in keys', {
|
|
62
|
-
toml:
|
|
63
|
-
ptr:
|
|
63
|
+
toml: ctx.s,
|
|
64
|
+
ptr: newLine,
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
if (strEnd.trimStart()) {
|
|
67
68
|
throw new TomlError('found extra tokens after the string part', {
|
|
68
|
-
toml:
|
|
69
|
-
ptr:
|
|
69
|
+
toml: ctx.s,
|
|
70
|
+
ptr: ctx.p,
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
if (endPtr <
|
|
73
|
-
endPtr =
|
|
73
|
+
if (endPtr < ctx.p) {
|
|
74
|
+
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
74
75
|
if (endPtr < 0) {
|
|
75
76
|
throw new TomlError('incomplete key-value: cannot find end of key', {
|
|
76
|
-
toml:
|
|
77
|
-
ptr:
|
|
77
|
+
toml: ctx.s,
|
|
78
|
+
ptr: start,
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -82,12 +83,12 @@ export function parseKey(str, ptr, end = '=') {
|
|
|
82
83
|
}
|
|
83
84
|
else {
|
|
84
85
|
// Normal raw key part consumption and validation
|
|
85
|
-
dot =
|
|
86
|
-
let part =
|
|
86
|
+
dot = ctx.s.indexOf('.', ctx.p);
|
|
87
|
+
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
87
88
|
if (!KEY_PART_RE.test(part)) {
|
|
88
89
|
throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {
|
|
89
|
-
toml:
|
|
90
|
-
ptr:
|
|
90
|
+
toml: ctx.s,
|
|
91
|
+
ptr: ctx.p,
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
parsed.push(part.trimEnd());
|
|
@@ -95,88 +96,84 @@ export function parseKey(str, ptr, end = '=') {
|
|
|
95
96
|
}
|
|
96
97
|
// Until there's no more dot
|
|
97
98
|
} while (dot + 1 && dot < endPtr);
|
|
98
|
-
|
|
99
|
+
ctx.p = endPtr + 1;
|
|
100
|
+
skipVoid(ctx, true, true);
|
|
101
|
+
return parsed;
|
|
99
102
|
}
|
|
100
103
|
/** @internal */
|
|
101
|
-
export function parseInlineTable(
|
|
104
|
+
export function parseInlineTable(ctx, integersAsBigInt) {
|
|
102
105
|
let res = {};
|
|
103
106
|
let seen = new Set();
|
|
104
107
|
let c;
|
|
105
|
-
|
|
106
|
-
while (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
108
|
+
ctx.p++;
|
|
109
|
+
while (ctx.p < ctx.s.length) {
|
|
110
|
+
skipVoid(ctx);
|
|
111
|
+
if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {
|
|
112
|
+
ctx.p++;
|
|
113
|
+
return res;
|
|
112
114
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
k = key[i];
|
|
124
|
-
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
|
|
125
|
-
throw new TomlError('trying to redefine an already defined value', {
|
|
126
|
-
toml: str,
|
|
127
|
-
ptr: ptr,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (!hasOwn && k === '__proto__') {
|
|
131
|
-
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (hasOwn) {
|
|
115
|
+
let k;
|
|
116
|
+
let t = res;
|
|
117
|
+
let hasOwn = false;
|
|
118
|
+
let p = ctx.p;
|
|
119
|
+
let key = parseKey(ctx);
|
|
120
|
+
for (let i = 0; i < key.length; i++) {
|
|
121
|
+
if (i)
|
|
122
|
+
t = hasOwn ? t[k] : (t[k] = {});
|
|
123
|
+
k = key[i];
|
|
124
|
+
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
|
|
135
125
|
throw new TomlError('trying to redefine an already defined value', {
|
|
136
|
-
toml:
|
|
137
|
-
ptr:
|
|
126
|
+
toml: ctx.s,
|
|
127
|
+
ptr: p,
|
|
138
128
|
});
|
|
139
129
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
if (!hasOwn && k === '__proto__') {
|
|
131
|
+
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (hasOwn) {
|
|
135
|
+
throw new TomlError('trying to redefine an already defined value', {
|
|
136
|
+
toml: ctx.s,
|
|
137
|
+
ptr: ctx.p,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
let value = extractValue(ctx, 0x7d /* } */, integersAsBigInt);
|
|
141
|
+
seen.add(t[k] = value);
|
|
142
|
+
skipVoid(ctx);
|
|
143
|
+
if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {
|
|
144
|
+
return res;
|
|
145
|
+
}
|
|
146
|
+
if (c !== 0x2c /* , */) {
|
|
147
|
+
throw new TomlError('expected comma or end of structure', { toml: ctx.s, ptr: ctx.p - 1 });
|
|
144
148
|
}
|
|
145
149
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
return [res, ptr];
|
|
150
|
+
throw new TomlError('unfinished table encountered', {
|
|
151
|
+
toml: ctx.s,
|
|
152
|
+
ptr: ctx.p,
|
|
153
|
+
});
|
|
153
154
|
}
|
|
154
155
|
/** @internal */
|
|
155
|
-
export function parseArray(
|
|
156
|
+
export function parseArray(ctx, integersAsBigInt) {
|
|
156
157
|
let res = [];
|
|
157
158
|
let c;
|
|
158
|
-
|
|
159
|
-
while (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
});
|
|
159
|
+
ctx.p++;
|
|
160
|
+
while (ctx.p < ctx.s.length) {
|
|
161
|
+
skipVoid(ctx);
|
|
162
|
+
if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {
|
|
163
|
+
ctx.p++;
|
|
164
|
+
return res;
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
res.push(extractValue(ctx, 0x5d /* ] */, integersAsBigInt));
|
|
167
|
+
skipVoid(ctx);
|
|
168
|
+
if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {
|
|
169
|
+
return res;
|
|
170
|
+
}
|
|
171
|
+
if (c !== 0x2c /* , */) {
|
|
172
|
+
throw new TomlError('expected comma or end of structure', { toml: ctx.s, ptr: ctx.p - 1 });
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return [res, ptr];
|
|
175
|
+
throw new TomlError('unfinished array encountered', {
|
|
176
|
+
toml: ctx.s,
|
|
177
|
+
ptr: ctx.p,
|
|
178
|
+
});
|
|
181
179
|
}
|
|
182
|
-
//# sourceMappingURL=struct.js.map
|
|
@@ -26,6 +26,7 @@
|
|
|
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
|
+
export type IntegersAsBigInt = undefined | boolean | 'asNeeded';
|
|
29
30
|
export type TomlPrimitive = string | number | bigint | boolean | TomlDate;
|
|
30
31
|
export type TomlTable = {
|
|
31
32
|
[key: string]: TomlValue;
|
|
@@ -35,4 +36,3 @@ export type TomlTableWithoutBigInt = {
|
|
|
35
36
|
[key: string]: TomlValueWithoutBigInt;
|
|
36
37
|
};
|
|
37
38
|
export type TomlValueWithoutBigInt = Exclude<TomlPrimitive, bigint> | TomlValueWithoutBigInt[] | TomlTableWithoutBigInt;
|
|
38
|
-
//# sourceMappingURL=util.d.ts.map
|
|
@@ -27,66 +27,63 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { TomlError } from './error.js';
|
|
29
29
|
/** @internal */
|
|
30
|
-
export function indexOfNewline(str, start = 0
|
|
30
|
+
export function indexOfNewline(str, start = 0) {
|
|
31
31
|
let idx = str.indexOf('\n', start);
|
|
32
|
-
if (str
|
|
32
|
+
if (str.charCodeAt(idx - 1) === 0xd /* \r */)
|
|
33
33
|
idx--;
|
|
34
|
-
return idx
|
|
34
|
+
return idx;
|
|
35
35
|
}
|
|
36
36
|
/** @internal */
|
|
37
|
-
export function skipComment(
|
|
38
|
-
for (
|
|
39
|
-
let c =
|
|
40
|
-
if (c ===
|
|
41
|
-
|
|
42
|
-
if (c ===
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
export function skipComment(ctx) {
|
|
38
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
39
|
+
let c = ctx.s.charCodeAt(ctx.p);
|
|
40
|
+
if (c === 0xa /* \n */)
|
|
41
|
+
break;
|
|
42
|
+
if (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */) {
|
|
43
|
+
ctx.p++;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
if ((c < 0x20 && c !== 0x9 /* \t */) || c === 0x7f) {
|
|
45
47
|
throw new TomlError('control characters are not allowed in comments', {
|
|
46
|
-
toml:
|
|
47
|
-
ptr:
|
|
48
|
+
toml: ctx.s,
|
|
49
|
+
ptr: ctx.p,
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
|
-
return str.length;
|
|
52
53
|
}
|
|
53
54
|
/** @internal */
|
|
54
|
-
export function skipVoid(
|
|
55
|
+
export function skipVoid(ctx, banNewLines, banComments) {
|
|
55
56
|
let c;
|
|
56
57
|
while (1) {
|
|
57
|
-
while ((c =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
while ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||
|
|
59
|
+
c === 0x9 /* \t */ ||
|
|
60
|
+
(!banNewLines &&
|
|
61
|
+
(c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */))))
|
|
62
|
+
ctx.p++;
|
|
63
|
+
if (banComments || c !== 0x23 /* # */)
|
|
62
64
|
break;
|
|
63
|
-
|
|
65
|
+
skipComment(ctx);
|
|
64
66
|
}
|
|
65
|
-
return ptr;
|
|
66
67
|
}
|
|
67
68
|
/** @internal */
|
|
68
|
-
export function skipUntil(
|
|
69
|
+
export function skipUntil(ctx, sep, end) {
|
|
70
|
+
let ptr = ctx.p;
|
|
69
71
|
if (!end) {
|
|
70
|
-
ptr = indexOfNewline(
|
|
71
|
-
|
|
72
|
+
ptr = indexOfNewline(ctx.s, ptr);
|
|
73
|
+
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
74
|
+
return;
|
|
72
75
|
}
|
|
73
|
-
for (
|
|
74
|
-
let c =
|
|
75
|
-
if (c ===
|
|
76
|
-
|
|
77
|
-
if (i < 0)
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
else if (c === sep) {
|
|
81
|
-
return i + 1;
|
|
76
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
77
|
+
let c = ctx.s.charCodeAt(ctx.p);
|
|
78
|
+
if (c === 0x23 /* # */) {
|
|
79
|
+
skipComment(ctx);
|
|
82
80
|
}
|
|
83
|
-
else if (c === end ||
|
|
84
|
-
return
|
|
81
|
+
else if (c === end || c === sep) {
|
|
82
|
+
return;
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
throw new TomlError('cannot find end of structure', {
|
|
88
|
-
toml:
|
|
89
|
-
ptr
|
|
86
|
+
toml: ctx.s,
|
|
87
|
+
ptr,
|
|
90
88
|
});
|
|
91
89
|
}
|
|
92
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smol-toml",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A small, fast, and correct TOML parser/serializer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parser",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"README.md",
|
|
20
20
|
"LICENSE",
|
|
21
|
-
"src",
|
|
22
21
|
"dist"
|
|
23
22
|
],
|
|
24
23
|
"type": "module",
|
|
@@ -37,19 +36,20 @@
|
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@mitata/counters": "^0.0.8",
|
|
39
38
|
"@tsconfig/node-lts": "^24.0.0",
|
|
39
|
+
"@tsconfig/node-ts": "^23.6.4",
|
|
40
40
|
"@tsconfig/strictest": "^2.0.8",
|
|
41
|
-
"@types/node": "^26.
|
|
41
|
+
"@types/node": "^26.2.0",
|
|
42
42
|
"mitata": "^1.0.34",
|
|
43
43
|
"pin-github-action": "^3.5.1",
|
|
44
|
-
"rolldown": "^1.2.
|
|
44
|
+
"rolldown": "^1.2.3",
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
|
-
"vite": "^7.3.
|
|
46
|
+
"vite": "^7.3.6",
|
|
47
47
|
"vitest": "^4.1.10"
|
|
48
48
|
},
|
|
49
49
|
"devEngines": {
|
|
50
50
|
"packageManager": {
|
|
51
51
|
"name": "pnpm",
|
|
52
|
-
"version": "11.
|
|
52
|
+
"version": "11.21.0",
|
|
53
53
|
"onFail": "error"
|
|
54
54
|
},
|
|
55
55
|
"runtime": {
|
|
@@ -7,6 +7,11 @@ export default function stripAnsi(string) {
|
|
|
7
7
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// Fast path: ANSI codes require ESC (7-bit) or CSI (8-bit) introducer
|
|
11
|
+
if (!string.includes('\u001B') && !string.includes('\u009B')) {
|
|
12
|
+
return string;
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
// Even though the regex is global, we don't need to reset the `.lastIndex`
|
|
11
16
|
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
|
|
12
17
|
// and doing it manually has a performance penalty.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strip-ansi",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Strip ANSI escape codes from a string",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/strip-ansi",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"text"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"ansi-regex": "^6.
|
|
52
|
+
"ansi-regex": "^6.2.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"ava": "^
|
|
56
|
-
"tsd": "^0.
|
|
57
|
-
"xo": "^
|
|
55
|
+
"ava": "^6.4.1",
|
|
56
|
+
"tsd": "^0.33.0",
|
|
57
|
+
"xo": "^1.2.3"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-core/utils",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "Utilities for Node.js core collaborators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,24 +35,21 @@
|
|
|
35
35
|
"bundleDependencies": true,
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@inquirer/prompts": "^7.4.1",
|
|
38
|
-
"@listr2/prompt-adapter-
|
|
38
|
+
"@listr2/prompt-adapter-inquirer": "^4.2.7",
|
|
39
39
|
"@node-core/caritat": "^1.6.0",
|
|
40
40
|
"@pkgjs/nv": "^0.3.0",
|
|
41
41
|
"branch-diff": "^3.1.1",
|
|
42
|
-
"chalk": "^6.0.0",
|
|
43
42
|
"changelog-maker": "^4.4.1",
|
|
44
43
|
"cheerio": "^1.0.0",
|
|
45
44
|
"core-validate-commit": "^6.0.0",
|
|
46
|
-
"figures": "^6.1.0",
|
|
47
45
|
"ghauth": "^7.0.1",
|
|
48
46
|
"git-secure-tag": "^2.3.1",
|
|
49
47
|
"js-yaml": "^5.2.1",
|
|
50
|
-
"listr2": "^
|
|
48
|
+
"listr2": "^11.1.0",
|
|
51
49
|
"ora": "^9.0.0",
|
|
52
50
|
"semver": "^7.7.1",
|
|
53
51
|
"smol-toml": "^1.7.0",
|
|
54
52
|
"undici": "^8.3.0",
|
|
55
|
-
"which": "^7.0.0",
|
|
56
53
|
"yargs": "^18.0.0"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
@@ -61,9 +58,6 @@
|
|
|
61
58
|
"c8": "^12.0.0",
|
|
62
59
|
"eslint": "^9.39.4",
|
|
63
60
|
"eslint-plugin-import": "^2.32.0",
|
|
64
|
-
"eslint-plugin-n": "^17.24.0",
|
|
65
|
-
"eslint-plugin-promise": "^7.3.0",
|
|
66
|
-
"globals": "^17.4.0",
|
|
67
61
|
"neostandard": "^0.13.0",
|
|
68
62
|
"sinon": "^22.0.0"
|
|
69
63
|
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/index.ts
|
|
32
|
-
var src_exports = {};
|
|
33
|
-
__export(src_exports, {
|
|
34
|
-
ListrEnquirerPromptAdapter: () => ListrEnquirerPromptAdapter
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
|
|
38
|
-
// src/prompt.ts
|
|
39
|
-
var import_listr2 = require("listr2");
|
|
40
|
-
var ListrEnquirerPromptAdapter = class extends import_listr2.ListrPromptAdapter {
|
|
41
|
-
static {
|
|
42
|
-
__name(this, "ListrEnquirerPromptAdapter");
|
|
43
|
-
}
|
|
44
|
-
error;
|
|
45
|
-
prompt;
|
|
46
|
-
/**
|
|
47
|
-
* Get the current running instance of `enquirer`.
|
|
48
|
-
*/
|
|
49
|
-
get instance() {
|
|
50
|
-
return this.prompt;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Create a new prompt with `enquirer`.
|
|
54
|
-
*
|
|
55
|
-
* `enquirer` is a peer dependency that must be installed seperately.
|
|
56
|
-
*/
|
|
57
|
-
async run(options, settings) {
|
|
58
|
-
if (!Array.isArray(options)) {
|
|
59
|
-
options = [{ ...options, name: "default" }];
|
|
60
|
-
} else if (options.length === 1) {
|
|
61
|
-
options = options.map((option) => {
|
|
62
|
-
return { ...option, name: "default" };
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
options = options.map((option) => {
|
|
66
|
-
return {
|
|
67
|
-
onCancel: /* @__PURE__ */ __name(() => {
|
|
68
|
-
this.error = new import_listr2.PromptError("Cancelled prompt.");
|
|
69
|
-
return true;
|
|
70
|
-
}, "onCancel"),
|
|
71
|
-
...option,
|
|
72
|
-
stdout: settings?.stdout ?? this.wrapper.stdout(import_listr2.ListrTaskEventType.PROMPT)
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
let enquirer;
|
|
76
|
-
if (settings?.enquirer) {
|
|
77
|
-
enquirer = settings.enquirer;
|
|
78
|
-
} else {
|
|
79
|
-
try {
|
|
80
|
-
enquirer = await import("enquirer").then((imported) => imported.default ? new imported.default() : new imported());
|
|
81
|
-
} catch {
|
|
82
|
-
this.reportFailed();
|
|
83
|
-
throw new import_listr2.PromptError("Enquirer is a optional peer dependency that must be installed separately.");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
this.reportStarted();
|
|
87
|
-
this.task.on(import_listr2.ListrTaskEventType.STATE, (event) => {
|
|
88
|
-
if (event === import_listr2.ListrTaskState.SKIPPED && this.prompt && !this.error) {
|
|
89
|
-
this.cancel({ throw: false });
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
let response;
|
|
93
|
-
try {
|
|
94
|
-
response = await enquirer.once("prompt", (prompt) => this.prompt = prompt).prompt(options);
|
|
95
|
-
} catch (e) {
|
|
96
|
-
this.reportFailed();
|
|
97
|
-
if (this.error) {
|
|
98
|
-
throw this.error;
|
|
99
|
-
}
|
|
100
|
-
throw e;
|
|
101
|
-
}
|
|
102
|
-
this.reportCompleted();
|
|
103
|
-
if (options.length === 1) {
|
|
104
|
-
return response.default;
|
|
105
|
-
} else {
|
|
106
|
-
return response;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Cancel the ongoing prompt.
|
|
111
|
-
*/
|
|
112
|
-
cancel(options) {
|
|
113
|
-
if (!this.prompt || this.error) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (options?.throw) {
|
|
117
|
-
this.prompt.cancel();
|
|
118
|
-
} else {
|
|
119
|
-
this.prompt.submit();
|
|
120
|
-
}
|
|
121
|
-
this.reportFailed();
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
-
0 && (module.exports = {
|
|
126
|
-
ListrEnquirerPromptAdapter
|
|
127
|
-
});
|