@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.
Files changed (232) hide show
  1. package/components/metadata.js +2 -1
  2. package/lib/ci/build-types/test_build.js +3 -3
  3. package/lib/ci/failure_aggregator.js +2 -2
  4. package/lib/ci/run_ci.js +3 -2
  5. package/lib/cli.js +6 -6
  6. package/lib/figures.js +6 -6
  7. package/lib/prepare_security.js +20 -21
  8. package/lib/request.js +1 -1
  9. package/lib/update-v8/backport.js +3 -4
  10. package/lib/utils.js +4 -2
  11. package/lib/verbosity.js +2 -4
  12. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/README.md +4 -4
  13. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.d.mts +21 -0
  14. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.mjs +46 -0
  15. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/LICENSE +22 -0
  16. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.d.ts +2 -0
  17. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.js +2 -0
  18. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.d.ts +35 -0
  19. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.js +1 -0
  20. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.d.ts +34 -0
  21. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.js +2 -0
  22. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/package.json +88 -0
  23. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/package.json +25 -20
  24. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.d.ts +48 -3
  25. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.js +58 -19
  26. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/package.json +1 -1
  27. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/readme.md +36 -1
  28. package/node_modules/ansi-regex/index.js +9 -4
  29. package/node_modules/ansi-regex/package.json +1 -1
  30. package/node_modules/ansi-regex/readme.md +6 -0
  31. package/node_modules/ansi-styles/index.d.ts +12 -12
  32. package/node_modules/ansi-styles/index.js +3 -3
  33. package/node_modules/ansi-styles/package.json +4 -4
  34. package/node_modules/cli-truncate/index.d.ts +3 -3
  35. package/node_modules/cli-truncate/index.js +40 -14
  36. package/node_modules/cli-truncate/node_modules/string-width/index.js +133 -15
  37. package/node_modules/cli-truncate/node_modules/string-width/package.json +4 -4
  38. package/node_modules/cli-truncate/node_modules/string-width/readme.md +1 -1
  39. package/node_modules/cli-truncate/package.json +7 -7
  40. package/node_modules/cli-truncate/readme.md +2 -3
  41. package/node_modules/ghauth/.github/dependabot.yml +11 -3
  42. package/node_modules/ghauth/.github/workflows/depsound.yml +33 -0
  43. package/node_modules/ghauth/.github/workflows/test-and-release.yml +4 -4
  44. package/node_modules/ghauth/CHANGELOG.md +60 -0
  45. package/node_modules/ghauth/package.json +30 -6
  46. package/node_modules/js-yaml/README.md +20 -187
  47. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +1008 -946
  48. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
  49. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +29 -23
  50. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
  51. package/node_modules/js-yaml/dist/js-yaml.cjs.js +1043 -583
  52. package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
  53. package/node_modules/js-yaml/dist/js-yaml.d.ts +877 -133
  54. package/node_modules/js-yaml/dist/js-yaml.mjs +995 -556
  55. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
  56. package/node_modules/js-yaml/package.json +8 -7
  57. package/node_modules/listr2/dist/{index.d.cts → index.d.mts} +90 -60
  58. package/node_modules/listr2/dist/{index.js → index.mjs} +496 -373
  59. package/node_modules/listr2/node_modules/string-width/index.d.ts +39 -0
  60. package/node_modules/listr2/node_modules/string-width/index.js +207 -0
  61. package/node_modules/listr2/node_modules/string-width/package.json +65 -0
  62. package/node_modules/listr2/node_modules/string-width/readme.md +66 -0
  63. package/node_modules/listr2/node_modules/wrap-ansi/index.d.ts +1 -1
  64. package/node_modules/listr2/node_modules/wrap-ansi/index.js +544 -116
  65. package/node_modules/listr2/node_modules/wrap-ansi/package.json +10 -13
  66. package/node_modules/listr2/node_modules/wrap-ansi/readme.md +2 -0
  67. package/node_modules/listr2/package.json +16 -19
  68. package/node_modules/log-update/index.d.ts +64 -1
  69. package/node_modules/log-update/index.js +268 -18
  70. package/node_modules/log-update/node_modules/string-width/index.d.ts +39 -0
  71. package/node_modules/log-update/node_modules/string-width/index.js +207 -0
  72. package/node_modules/log-update/node_modules/string-width/package.json +65 -0
  73. package/node_modules/log-update/node_modules/string-width/readme.md +66 -0
  74. package/node_modules/log-update/node_modules/wrap-ansi/index.d.ts +1 -1
  75. package/node_modules/log-update/node_modules/wrap-ansi/index.js +544 -116
  76. package/node_modules/log-update/node_modules/wrap-ansi/package.json +10 -13
  77. package/node_modules/log-update/node_modules/wrap-ansi/readme.md +2 -0
  78. package/node_modules/log-update/package.json +14 -12
  79. package/node_modules/log-update/readme.md +61 -0
  80. package/node_modules/slice-ansi/index.d.ts +2 -2
  81. package/node_modules/slice-ansi/index.js +260 -112
  82. package/node_modules/slice-ansi/package.json +10 -9
  83. package/node_modules/slice-ansi/readme.md +3 -2
  84. package/node_modules/slice-ansi/tokenize-ansi.js +752 -0
  85. package/node_modules/smol-toml/README.md +205 -191
  86. package/node_modules/smol-toml/dist/date.d.ts +0 -1
  87. package/node_modules/smol-toml/dist/date.js +0 -1
  88. package/node_modules/smol-toml/dist/error.d.ts +0 -1
  89. package/node_modules/smol-toml/dist/error.js +0 -1
  90. package/node_modules/smol-toml/dist/extract.js +32 -65
  91. package/node_modules/smol-toml/dist/index.cjs +302 -288
  92. package/node_modules/smol-toml/dist/index.d.ts +0 -1
  93. package/node_modules/smol-toml/dist/index.js +0 -1
  94. package/node_modules/smol-toml/dist/parse.d.ts +1 -3
  95. package/node_modules/smol-toml/dist/parse.js +22 -21
  96. package/node_modules/smol-toml/dist/primitive.js +75 -76
  97. package/node_modules/smol-toml/dist/stringify.d.ts +0 -1
  98. package/node_modules/smol-toml/dist/stringify.js +43 -30
  99. package/node_modules/smol-toml/dist/struct.js +90 -93
  100. package/node_modules/smol-toml/dist/util.d.ts +1 -1
  101. package/node_modules/smol-toml/dist/util.js +36 -39
  102. package/node_modules/smol-toml/package.json +6 -6
  103. package/node_modules/strip-ansi/index.js +5 -0
  104. package/node_modules/strip-ansi/package.json +5 -5
  105. package/package.json +3 -9
  106. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.cjs +0 -127
  107. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.cts +0 -152
  108. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.ts +0 -152
  109. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.js +0 -92
  110. package/node_modules/chalk/package.json +0 -92
  111. package/node_modules/chalk/readme.md +0 -331
  112. package/node_modules/chalk/source/index.d.ts +0 -437
  113. package/node_modules/chalk/source/index.js +0 -261
  114. package/node_modules/chalk/source/utilities.js +0 -33
  115. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -299
  116. package/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -261
  117. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  118. package/node_modules/chalk/source/vendor/supports-color/browser.js +0 -32
  119. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  120. package/node_modules/chalk/source/vendor/supports-color/index.js +0 -206
  121. package/node_modules/colorette/LICENSE.md +0 -7
  122. package/node_modules/colorette/README.md +0 -134
  123. package/node_modules/colorette/index.cjs +0 -218
  124. package/node_modules/colorette/index.d.ts +0 -93
  125. package/node_modules/colorette/index.js +0 -150
  126. package/node_modules/colorette/package.json +0 -40
  127. package/node_modules/eventemitter3/LICENSE +0 -21
  128. package/node_modules/eventemitter3/README.md +0 -94
  129. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
  130. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
  131. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
  132. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
  133. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
  134. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
  135. package/node_modules/eventemitter3/index.d.ts +0 -135
  136. package/node_modules/eventemitter3/index.js +0 -336
  137. package/node_modules/eventemitter3/index.mjs +0 -4
  138. package/node_modules/eventemitter3/package.json +0 -67
  139. package/node_modules/figures/index.d.ts +0 -279
  140. package/node_modules/figures/index.js +0 -292
  141. package/node_modules/figures/package.json +0 -49
  142. package/node_modules/figures/readme.md +0 -337
  143. package/node_modules/isexe/LICENSE.md +0 -55
  144. package/node_modules/isexe/README.md +0 -80
  145. package/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
  146. package/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
  147. package/node_modules/isexe/dist/commonjs/index.js +0 -56
  148. package/node_modules/isexe/dist/commonjs/index.js.map +0 -1
  149. package/node_modules/isexe/dist/commonjs/index.min.js +0 -2
  150. package/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
  151. package/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
  152. package/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
  153. package/node_modules/isexe/dist/commonjs/options.js +0 -3
  154. package/node_modules/isexe/dist/commonjs/options.js.map +0 -1
  155. package/node_modules/isexe/dist/commonjs/package.json +0 -3
  156. package/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
  157. package/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
  158. package/node_modules/isexe/dist/commonjs/posix.js +0 -67
  159. package/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
  160. package/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
  161. package/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
  162. package/node_modules/isexe/dist/commonjs/win32.js +0 -63
  163. package/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
  164. package/node_modules/isexe/dist/esm/index.d.ts +0 -14
  165. package/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
  166. package/node_modules/isexe/dist/esm/index.js +0 -16
  167. package/node_modules/isexe/dist/esm/index.js.map +0 -1
  168. package/node_modules/isexe/dist/esm/index.min.js +0 -2
  169. package/node_modules/isexe/dist/esm/index.min.js.map +0 -7
  170. package/node_modules/isexe/dist/esm/options.d.ts +0 -32
  171. package/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
  172. package/node_modules/isexe/dist/esm/options.js +0 -2
  173. package/node_modules/isexe/dist/esm/options.js.map +0 -1
  174. package/node_modules/isexe/dist/esm/package.json +0 -3
  175. package/node_modules/isexe/dist/esm/posix.d.ts +0 -18
  176. package/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
  177. package/node_modules/isexe/dist/esm/posix.js +0 -62
  178. package/node_modules/isexe/dist/esm/posix.js.map +0 -1
  179. package/node_modules/isexe/dist/esm/win32.d.ts +0 -18
  180. package/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
  181. package/node_modules/isexe/dist/esm/win32.js +0 -58
  182. package/node_modules/isexe/dist/esm/win32.js.map +0 -1
  183. package/node_modules/isexe/package.json +0 -78
  184. package/node_modules/listr2/dist/index.cjs +0 -2189
  185. package/node_modules/listr2/dist/index.d.ts +0 -1528
  186. package/node_modules/rfdc/.github/workflows/ci.yml +0 -21
  187. package/node_modules/rfdc/LICENSE +0 -15
  188. package/node_modules/rfdc/default.js +0 -3
  189. package/node_modules/rfdc/index.d.ts +0 -13
  190. package/node_modules/rfdc/index.js +0 -198
  191. package/node_modules/rfdc/index.test-d.ts +0 -13
  192. package/node_modules/rfdc/package.json +0 -73
  193. package/node_modules/rfdc/readme.md +0 -181
  194. package/node_modules/rfdc/test/index.js +0 -306
  195. package/node_modules/smol-toml/dist/date.d.ts.map +0 -1
  196. package/node_modules/smol-toml/dist/date.js.map +0 -1
  197. package/node_modules/smol-toml/dist/error.d.ts.map +0 -1
  198. package/node_modules/smol-toml/dist/error.js.map +0 -1
  199. package/node_modules/smol-toml/dist/extract.js.map +0 -1
  200. package/node_modules/smol-toml/dist/index.cjs.map +0 -1
  201. package/node_modules/smol-toml/dist/index.d.ts.map +0 -1
  202. package/node_modules/smol-toml/dist/index.js.map +0 -1
  203. package/node_modules/smol-toml/dist/parse.d.ts.map +0 -1
  204. package/node_modules/smol-toml/dist/parse.js.map +0 -1
  205. package/node_modules/smol-toml/dist/primitive.d.ts +0 -29
  206. package/node_modules/smol-toml/dist/primitive.d.ts.map +0 -1
  207. package/node_modules/smol-toml/dist/primitive.js.map +0 -1
  208. package/node_modules/smol-toml/dist/stringify.d.ts.map +0 -1
  209. package/node_modules/smol-toml/dist/stringify.js.map +0 -1
  210. package/node_modules/smol-toml/dist/struct.js.map +0 -1
  211. package/node_modules/smol-toml/dist/util.d.ts.map +0 -1
  212. package/node_modules/smol-toml/dist/util.js.map +0 -1
  213. package/node_modules/smol-toml/src/date.ts +0 -152
  214. package/node_modules/smol-toml/src/error.ts +0 -77
  215. package/node_modules/smol-toml/src/extract.ts +0 -113
  216. package/node_modules/smol-toml/src/index.ts +0 -42
  217. package/node_modules/smol-toml/src/parse.ts +0 -184
  218. package/node_modules/smol-toml/src/primitive.ts +0 -249
  219. package/node_modules/smol-toml/src/stringify.ts +0 -191
  220. package/node_modules/smol-toml/src/struct.ts +0 -202
  221. package/node_modules/smol-toml/src/util.ts +0 -106
  222. package/node_modules/which/LICENSE +0 -15
  223. package/node_modules/which/README.md +0 -51
  224. package/node_modules/which/bin/which.js +0 -52
  225. package/node_modules/which/lib/index.js +0 -111
  226. package/node_modules/which/package.json +0 -52
  227. /package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/LICENSE +0 -0
  228. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.d.ts +0 -0
  229. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.js +0 -0
  230. /package/node_modules/{chalk → ansi-escapes}/license +0 -0
  231. /package/node_modules/{figures → listr2/node_modules/string-width}/license +0 -0
  232. /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, skipComment, skipVoid } from './util.js';
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(str, ptr, end = '=') {
35
- let dot = ptr - 1;
34
+ export function parseKey(ctx, end = '=') {
35
+ let start = ctx.p;
36
+ let dot = start - 1;
36
37
  let parsed = [];
37
- let endPtr = str.indexOf(end, ptr);
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: str,
41
- ptr: ptr,
41
+ toml: ctx.s,
42
+ ptr: start,
42
43
  });
43
44
  }
44
45
  do {
45
- let c = str[(ptr = ++dot)];
46
+ let c = ctx.s.charCodeAt(ctx.p = ++dot);
46
47
  // If it's whitespace, ignore
47
- if (c !== ' ' && c !== '\t') {
48
+ if (c !== 0x20 && c !== 0x9 /* \t */) {
48
49
  // If it's a string
49
- if (c === '"' || c === "'") {
50
- if (c === str[ptr + 1] && c === str[ptr + 2]) {
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: str,
53
- ptr: ptr,
53
+ toml: ctx.s,
54
+ ptr: ctx.p,
54
55
  });
55
56
  }
56
- let [part, eos] = parseString(str, ptr);
57
- dot = str.indexOf('.', eos);
58
- let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
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: str,
63
- ptr: ptr + dot + newLine,
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: str,
69
- ptr: eos,
69
+ toml: ctx.s,
70
+ ptr: ctx.p,
70
71
  });
71
72
  }
72
- if (endPtr < eos) {
73
- endPtr = str.indexOf(end, eos);
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: str,
77
- ptr: 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 = str.indexOf('.', ptr);
86
- let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
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: str,
90
- ptr: 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
- return [parsed, skipVoid(str, endPtr + 1, true, true)];
99
+ ctx.p = endPtr + 1;
100
+ skipVoid(ctx, true, true);
101
+ return parsed;
99
102
  }
100
103
  /** @internal */
101
- export function parseInlineTable(str, ptr, depth, integersAsBigInt) {
104
+ export function parseInlineTable(ctx, integersAsBigInt) {
102
105
  let res = {};
103
106
  let seen = new Set();
104
107
  let c;
105
- ptr++;
106
- while ((c = str[ptr++]) !== '}' && c) {
107
- if (c === ',') {
108
- throw new TomlError('expected value, found comma', {
109
- toml: str,
110
- ptr: ptr - 1,
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
- else if (c === '#')
114
- ptr = skipComment(str, ptr);
115
- else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
116
- let k;
117
- let t = res;
118
- let hasOwn = false;
119
- let [key, keyEndPtr] = parseKey(str, ptr - 1);
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]))) {
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: str,
137
- ptr: ptr,
126
+ toml: ctx.s,
127
+ ptr: p,
138
128
  });
139
129
  }
140
- let [value, valueEndPtr] = extractValue(str, keyEndPtr, '}', depth - 1, integersAsBigInt);
141
- seen.add(value);
142
- t[k] = value;
143
- ptr = valueEndPtr;
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
- if (!c) {
147
- throw new TomlError('unfinished table encountered', {
148
- toml: str,
149
- ptr: ptr,
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(str, ptr, depth, integersAsBigInt) {
156
+ export function parseArray(ctx, integersAsBigInt) {
156
157
  let res = [];
157
158
  let c;
158
- ptr++;
159
- while ((c = str[ptr++]) !== ']' && c) {
160
- if (c === ',') {
161
- throw new TomlError('expected value, found comma', {
162
- toml: str,
163
- ptr: ptr - 1,
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
- else if (c === '#')
167
- ptr = skipComment(str, ptr);
168
- else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
169
- let e = extractValue(str, ptr - 1, ']', depth - 1, integersAsBigInt);
170
- res.push(e[0]);
171
- ptr = e[1];
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
- if (!c) {
175
- throw new TomlError('unfinished array encountered', {
176
- toml: str,
177
- ptr: ptr,
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, end = str.length) {
30
+ export function indexOfNewline(str, start = 0) {
31
31
  let idx = str.indexOf('\n', start);
32
- if (str[idx - 1] === '\r')
32
+ if (str.charCodeAt(idx - 1) === 0xd /* \r */)
33
33
  idx--;
34
- return idx <= end ? idx : -1;
34
+ return idx;
35
35
  }
36
36
  /** @internal */
37
- export function skipComment(str, ptr) {
38
- for (let i = ptr; i < str.length; i++) {
39
- let c = str[i];
40
- if (c === '\n')
41
- return i;
42
- if (c === '\r' && str[i + 1] === '\n')
43
- return i + 1;
44
- if ((c < '\x20' && c !== '\t') || c === '\x7f') {
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: str,
47
- ptr: 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(str, ptr, banNewLines, banComments) {
55
+ export function skipVoid(ctx, banNewLines, banComments) {
55
56
  let c;
56
57
  while (1) {
57
- while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || (c === '\r' && str[ptr + 1] === '\n'))))
58
- ptr++;
59
- // Tucking the return statement here would save 5 characters >:)
60
- // But TypeScript fails to detect there is no way to exit the loop so it complains about the lack of final return
61
- if (banComments || c !== '#')
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
- ptr = skipComment(str, ptr);
65
+ skipComment(ctx);
64
66
  }
65
- return ptr;
66
67
  }
67
68
  /** @internal */
68
- export function skipUntil(str, ptr, sep, end, banNewLines = false) {
69
+ export function skipUntil(ctx, sep, end) {
70
+ let ptr = ctx.p;
69
71
  if (!end) {
70
- ptr = indexOfNewline(str, ptr);
71
- return ptr < 0 ? str.length : ptr;
72
+ ptr = indexOfNewline(ctx.s, ptr);
73
+ ctx.p = ptr < 0 ? ctx.s.length : ptr;
74
+ return;
72
75
  }
73
- for (let i = ptr; i < str.length; i++) {
74
- let c = str[i];
75
- if (c === '#') {
76
- i = indexOfNewline(str, i);
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 || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
84
- return i;
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: str,
89
- ptr: 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.7.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.1.1",
41
+ "@types/node": "^26.2.0",
42
42
  "mitata": "^1.0.34",
43
43
  "pin-github-action": "^3.5.1",
44
- "rolldown": "^1.2.0",
44
+ "rolldown": "^1.2.3",
45
45
  "typescript": "^7.0.2",
46
- "vite": "^7.3.5",
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.17.0",
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.1.2",
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.0.1"
52
+ "ansi-regex": "^6.2.2"
53
53
  },
54
54
  "devDependencies": {
55
- "ava": "^3.15.0",
56
- "tsd": "^0.17.0",
57
- "xo": "^0.44.0"
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.0",
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-enquirer": "^2.0.12",
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": "^9.0.5",
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
- });