@node-core/utils 7.2.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 (182) hide show
  1. package/lib/ci/build-types/test_build.js +3 -3
  2. package/lib/ci/failure_aggregator.js +2 -2
  3. package/lib/ci/run_ci.js +3 -2
  4. package/lib/cli.js +6 -6
  5. package/lib/figures.js +6 -6
  6. package/lib/update-v8/backport.js +3 -4
  7. package/lib/verbosity.js +2 -4
  8. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/README.md +4 -4
  9. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.d.mts +21 -0
  10. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.mjs +46 -0
  11. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/LICENSE +22 -0
  12. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.d.ts +2 -0
  13. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.js +2 -0
  14. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.d.ts +35 -0
  15. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.js +1 -0
  16. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.d.ts +34 -0
  17. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.js +2 -0
  18. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/package.json +88 -0
  19. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/package.json +25 -20
  20. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.d.ts +48 -3
  21. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.js +58 -19
  22. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/package.json +1 -1
  23. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/readme.md +36 -1
  24. package/node_modules/ansi-regex/index.js +9 -4
  25. package/node_modules/ansi-regex/package.json +1 -1
  26. package/node_modules/ansi-regex/readme.md +6 -0
  27. package/node_modules/ansi-styles/index.d.ts +12 -12
  28. package/node_modules/ansi-styles/index.js +3 -3
  29. package/node_modules/ansi-styles/package.json +4 -4
  30. package/node_modules/cli-truncate/index.d.ts +3 -3
  31. package/node_modules/cli-truncate/index.js +40 -14
  32. package/node_modules/cli-truncate/node_modules/string-width/index.js +133 -15
  33. package/node_modules/cli-truncate/node_modules/string-width/package.json +4 -4
  34. package/node_modules/cli-truncate/node_modules/string-width/readme.md +1 -1
  35. package/node_modules/cli-truncate/package.json +7 -7
  36. package/node_modules/cli-truncate/readme.md +2 -3
  37. package/node_modules/ghauth/.github/dependabot.yml +11 -3
  38. package/node_modules/ghauth/.github/workflows/depsound.yml +33 -0
  39. package/node_modules/ghauth/.github/workflows/test-and-release.yml +4 -4
  40. package/node_modules/ghauth/CHANGELOG.md +60 -0
  41. package/node_modules/ghauth/package.json +30 -6
  42. package/node_modules/js-yaml/README.md +20 -187
  43. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +1008 -946
  44. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
  45. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +29 -23
  46. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
  47. package/node_modules/js-yaml/dist/js-yaml.cjs.js +1043 -583
  48. package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
  49. package/node_modules/js-yaml/dist/js-yaml.d.ts +877 -133
  50. package/node_modules/js-yaml/dist/js-yaml.mjs +995 -556
  51. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
  52. package/node_modules/js-yaml/package.json +8 -7
  53. package/node_modules/listr2/dist/{index.d.cts → index.d.mts} +90 -60
  54. package/node_modules/listr2/dist/{index.js → index.mjs} +496 -373
  55. package/node_modules/listr2/node_modules/string-width/index.d.ts +39 -0
  56. package/node_modules/listr2/node_modules/string-width/index.js +207 -0
  57. package/node_modules/listr2/node_modules/string-width/package.json +65 -0
  58. package/node_modules/listr2/node_modules/string-width/readme.md +66 -0
  59. package/node_modules/listr2/node_modules/wrap-ansi/index.d.ts +1 -1
  60. package/node_modules/listr2/node_modules/wrap-ansi/index.js +544 -116
  61. package/node_modules/listr2/node_modules/wrap-ansi/package.json +10 -13
  62. package/node_modules/listr2/node_modules/wrap-ansi/readme.md +2 -0
  63. package/node_modules/listr2/package.json +16 -19
  64. package/node_modules/log-update/index.d.ts +64 -1
  65. package/node_modules/log-update/index.js +268 -18
  66. package/node_modules/log-update/node_modules/string-width/index.d.ts +39 -0
  67. package/node_modules/log-update/node_modules/string-width/index.js +207 -0
  68. package/node_modules/log-update/node_modules/string-width/package.json +65 -0
  69. package/node_modules/log-update/node_modules/string-width/readme.md +66 -0
  70. package/node_modules/log-update/node_modules/wrap-ansi/index.d.ts +1 -1
  71. package/node_modules/log-update/node_modules/wrap-ansi/index.js +544 -116
  72. package/node_modules/log-update/node_modules/wrap-ansi/package.json +10 -13
  73. package/node_modules/log-update/node_modules/wrap-ansi/readme.md +2 -0
  74. package/node_modules/log-update/package.json +14 -12
  75. package/node_modules/log-update/readme.md +61 -0
  76. package/node_modules/slice-ansi/index.d.ts +2 -2
  77. package/node_modules/slice-ansi/index.js +260 -112
  78. package/node_modules/slice-ansi/package.json +10 -9
  79. package/node_modules/slice-ansi/readme.md +3 -2
  80. package/node_modules/slice-ansi/tokenize-ansi.js +752 -0
  81. package/node_modules/smol-toml/README.md +205 -191
  82. package/node_modules/smol-toml/dist/date.d.ts +0 -1
  83. package/node_modules/smol-toml/dist/date.js +0 -1
  84. package/node_modules/smol-toml/dist/error.d.ts +0 -1
  85. package/node_modules/smol-toml/dist/error.js +0 -1
  86. package/node_modules/smol-toml/dist/extract.js +32 -65
  87. package/node_modules/smol-toml/dist/index.cjs +302 -288
  88. package/node_modules/smol-toml/dist/index.d.ts +0 -1
  89. package/node_modules/smol-toml/dist/index.js +0 -1
  90. package/node_modules/smol-toml/dist/parse.d.ts +1 -3
  91. package/node_modules/smol-toml/dist/parse.js +22 -21
  92. package/node_modules/smol-toml/dist/primitive.js +75 -76
  93. package/node_modules/smol-toml/dist/stringify.d.ts +0 -1
  94. package/node_modules/smol-toml/dist/stringify.js +43 -30
  95. package/node_modules/smol-toml/dist/struct.js +90 -93
  96. package/node_modules/smol-toml/dist/util.d.ts +1 -1
  97. package/node_modules/smol-toml/dist/util.js +36 -39
  98. package/node_modules/smol-toml/package.json +6 -6
  99. package/node_modules/strip-ansi/index.js +5 -0
  100. package/node_modules/strip-ansi/package.json +5 -5
  101. package/package.json +3 -5
  102. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.cjs +0 -127
  103. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.cts +0 -152
  104. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.ts +0 -152
  105. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.js +0 -92
  106. package/node_modules/chalk/package.json +0 -92
  107. package/node_modules/chalk/readme.md +0 -331
  108. package/node_modules/chalk/source/index.d.ts +0 -437
  109. package/node_modules/chalk/source/index.js +0 -261
  110. package/node_modules/chalk/source/utilities.js +0 -33
  111. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -299
  112. package/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -261
  113. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  114. package/node_modules/chalk/source/vendor/supports-color/browser.js +0 -32
  115. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  116. package/node_modules/chalk/source/vendor/supports-color/index.js +0 -206
  117. package/node_modules/colorette/LICENSE.md +0 -7
  118. package/node_modules/colorette/README.md +0 -134
  119. package/node_modules/colorette/index.cjs +0 -218
  120. package/node_modules/colorette/index.d.ts +0 -93
  121. package/node_modules/colorette/index.js +0 -150
  122. package/node_modules/colorette/package.json +0 -40
  123. package/node_modules/eventemitter3/LICENSE +0 -21
  124. package/node_modules/eventemitter3/README.md +0 -94
  125. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
  126. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
  127. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
  128. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
  129. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
  130. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
  131. package/node_modules/eventemitter3/index.d.ts +0 -135
  132. package/node_modules/eventemitter3/index.js +0 -336
  133. package/node_modules/eventemitter3/index.mjs +0 -4
  134. package/node_modules/eventemitter3/package.json +0 -67
  135. package/node_modules/figures/index.d.ts +0 -279
  136. package/node_modules/figures/index.js +0 -292
  137. package/node_modules/figures/package.json +0 -49
  138. package/node_modules/figures/readme.md +0 -337
  139. package/node_modules/listr2/dist/index.cjs +0 -2189
  140. package/node_modules/listr2/dist/index.d.ts +0 -1528
  141. package/node_modules/rfdc/.github/workflows/ci.yml +0 -21
  142. package/node_modules/rfdc/LICENSE +0 -15
  143. package/node_modules/rfdc/default.js +0 -3
  144. package/node_modules/rfdc/index.d.ts +0 -13
  145. package/node_modules/rfdc/index.js +0 -198
  146. package/node_modules/rfdc/index.test-d.ts +0 -13
  147. package/node_modules/rfdc/package.json +0 -73
  148. package/node_modules/rfdc/readme.md +0 -181
  149. package/node_modules/rfdc/test/index.js +0 -306
  150. package/node_modules/smol-toml/dist/date.d.ts.map +0 -1
  151. package/node_modules/smol-toml/dist/date.js.map +0 -1
  152. package/node_modules/smol-toml/dist/error.d.ts.map +0 -1
  153. package/node_modules/smol-toml/dist/error.js.map +0 -1
  154. package/node_modules/smol-toml/dist/extract.js.map +0 -1
  155. package/node_modules/smol-toml/dist/index.cjs.map +0 -1
  156. package/node_modules/smol-toml/dist/index.d.ts.map +0 -1
  157. package/node_modules/smol-toml/dist/index.js.map +0 -1
  158. package/node_modules/smol-toml/dist/parse.d.ts.map +0 -1
  159. package/node_modules/smol-toml/dist/parse.js.map +0 -1
  160. package/node_modules/smol-toml/dist/primitive.d.ts +0 -29
  161. package/node_modules/smol-toml/dist/primitive.d.ts.map +0 -1
  162. package/node_modules/smol-toml/dist/primitive.js.map +0 -1
  163. package/node_modules/smol-toml/dist/stringify.d.ts.map +0 -1
  164. package/node_modules/smol-toml/dist/stringify.js.map +0 -1
  165. package/node_modules/smol-toml/dist/struct.js.map +0 -1
  166. package/node_modules/smol-toml/dist/util.d.ts.map +0 -1
  167. package/node_modules/smol-toml/dist/util.js.map +0 -1
  168. package/node_modules/smol-toml/src/date.ts +0 -152
  169. package/node_modules/smol-toml/src/error.ts +0 -77
  170. package/node_modules/smol-toml/src/extract.ts +0 -113
  171. package/node_modules/smol-toml/src/index.ts +0 -42
  172. package/node_modules/smol-toml/src/parse.ts +0 -184
  173. package/node_modules/smol-toml/src/primitive.ts +0 -249
  174. package/node_modules/smol-toml/src/stringify.ts +0 -191
  175. package/node_modules/smol-toml/src/struct.ts +0 -202
  176. package/node_modules/smol-toml/src/util.ts +0 -106
  177. /package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/LICENSE +0 -0
  178. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.d.ts +0 -0
  179. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.js +0 -0
  180. /package/node_modules/{chalk → ansi-escapes}/license +0 -0
  181. /package/node_modules/{figures → listr2/node_modules/string-width}/license +0 -0
  182. /package/node_modules/log-update/node_modules/{ansi-escapes → string-width}/license +0 -0
@@ -1,211 +1,44 @@
1
- JS-YAML - YAML 1.2 parser / writer for JavaScript
2
- =================================================
1
+ # js-yaml
3
2
 
4
3
  [![CI](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml/badge.svg)](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml)
5
4
  [![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
6
5
 
7
- __[Online Demo](https://nodeca.github.io/js-yaml/)__
6
+ > YAML 1.2 parser and serializer for JavaScript.
8
7
 
8
+ __[Online demo](https://nodeca.github.io/js-yaml/)__
9
9
 
10
- A fast and complete [YAML](https://yaml.org/) parser and writer for JavaScript.
11
- Supports both the 1.2 and 1.1 specs, and passes the entire
12
- [YAML Test Suite](https://github.com/yaml/yaml-test-suite).
10
+ - Supports the YAML 1.2 and YAML 1.1 specifications.
11
+ - Passes the entire [YAML Test Suite](https://github.com/yaml/yaml-test-suite).
13
12
 
14
13
 
15
- Installation
16
- ------------
14
+ ### [Documentation >>](https://nodeca.github.io/js-yaml/doc/)
17
15
 
18
- ```
19
- npm install js-yaml
20
- ```
21
16
 
22
- Upgrading from v4? See the [v5 migration guide](docs/migrate_v4_to_v5.md).
17
+ ##### Install
23
18
 
19
+ ```bash
20
+ npm install js-yaml
21
+ ```
24
22
 
25
- API
26
- ---
27
23
 
28
- Here we cover the most useful methods. If you need advanced details (such as
29
- creating your own tags), see the [examples](examples/) for more info.
24
+ ##### Usage
30
25
 
31
- ``` javascript
26
+ ```js
32
27
  import { load } from 'js-yaml'
33
- import { readFileSync } from 'node:fs'
34
28
 
35
- // Get document, or throw exception on error
36
29
  try {
37
- const doc = load(readFileSync('example.yml', 'utf8'))
38
- console.log(doc)
30
+ const document = load('greeting: hello')
31
+ console.log(document.greeting)
39
32
  } catch (e) {
40
- console.log(e)
33
+ console.error(e)
41
34
  }
42
35
  ```
43
36
 
37
+ ```js
38
+ import { dump } from 'js-yaml'
44
39
 
45
- ### load (string [ , options ])
46
-
47
- Parses `string` as a single YAML document. Throws `YAMLException` on error.
48
- This function **does not** understand multi-document or empty sources; it throws
49
- an exception on those.
50
-
51
- > [!WARNING]
52
- > When processing untrusted input, see the
53
- > [security considerations](docs/safety.md).
54
-
55
- options:
56
-
57
- - `filename` _(default: null)_ - string to be used as a file path in
58
- error/warning messages.
59
- - `schema` _(default: `CORE_SCHEMA`)_ - specifies a schema to use.
60
- - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects.
61
- - `JSON_SCHEMA` - all JSON-supported types.
62
- - `CORE_SCHEMA` - a superset of `JSON_SCHEMA`, accepting more notations for
63
- the same types.
64
- - `YAML11_SCHEMA` - adds the legacy YAML 1.1 types (`!!binary`, `!!timestamp`,
65
- `!!omap`, `!!pairs`, `!!set`, merge keys `<<`, and the broader 1.1 scalar
66
- notations).
67
- - `json` _(default: false)_ - compatibility with `JSON.parse` behaviour. If
68
- `true`, duplicate keys in a mapping override values rather than throwing an
69
- error.
70
- - `maxDepth` _(default: 100)_ - limits the nesting depth for collections (does
71
- not take aliases into account).
72
- - `maxTotalMergeKeys` _(default: 10000)_ - limits the total number of keys
73
- processed by merge (`<<`) across one `load()` / `loadAll()` call. Set to `-1`
74
- to disable.
75
- - `maxAliases` _(default: -1)_ - limits the number of alias nodes (`*ref`) per
76
- document. Set to `0` to reject all aliases, or to `-1` for no limit.
77
-
78
- > [!NOTE]
79
- >
80
- > The default `CORE_SCHEMA` comes without the `!!merge` tag. You can easily
81
- > enable it if needed:
82
- >
83
- > ``` javascript
84
- > import { load, CORE_SCHEMA, mergeTag } from 'js-yaml'
85
- >
86
- > load(data, { schema: CORE_SCHEMA.withTags(mergeTag) })
87
- > ```
88
-
89
- > [!WARNING]
90
- >
91
- > The default `mapTag` is `{}`-object based and does not allow complex keys
92
- > (objects, arrays and so on). That's an intentional choice for convenience.
93
- > Also, non-string scalar keys, such as `null`, numbers or booleans, are
94
- > converted to strings.
95
- >
96
- > In the rare cases where you really need complex keys, use `realMapTag` in the
97
- > schema instead. It stores any key exactly as provided, at the cost of less
98
- > convenient access.
99
-
100
- See [examples](examples/) for advanced customization approaches.
101
-
102
-
103
- ### loadAll (string [, options ])
104
-
105
- Same as `load()`, but understands multi-document sources. Returns an array of
106
- documents.
107
-
108
- ``` javascript
109
- import { loadAll } from 'js-yaml'
110
-
111
- console.log(loadAll(data))
112
- ```
113
-
114
-
115
- ### dump (object [ , options ])
116
-
117
- Serializes `object` as a YAML document. By default it can dump every supported
118
- YAML type, so it throws an exception if you try to dump regexps or functions.
119
- However, you can disable exceptions by setting the `skipInvalid` option to
120
- `true`.
121
-
122
- options:
123
-
124
- - `indent` _(default: 2)_ - indentation width to use (in spaces).
125
- - `flowLevel` _(default: -1)_ - nesting level at which collections switch from
126
- block to flow style (`-1` means never).
127
- - `seqNoIndent` _(default: false)_ - when `true`, does not add an indentation
128
- level to array elements, `␣␣- 1` => `- 1`.
129
- - `seqInlineFirst` _(default: true)_ - when `true`, allows a nested collection
130
- to start on the same line after `-`, `-\n - 1` => `- - 1`.
131
- - `skipInvalid` _(default: false)_ - do not throw on invalid types (such as a
132
- function in the schema). Invalid mapping pairs and sequence items are skipped;
133
- `undefined` sequence items are serialized as `null`.
134
- - `schema` _(default: a `YAML11_SCHEMA`-based schema)_ - specifies a schema to
135
- use.
136
- - `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
137
- function, use the function to sort the keys.
138
- - `lineWidth` _(default: `80`)_ - sets the max line width. Set `-1` for unlimited
139
- width.
140
- - `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into
141
- references; inline them instead.
142
- - `quoteStyle` _(`single` or `double`, default: `single`)_ - quoting style to use
143
- when a string needs quotes.
144
- - `forceQuotes` _(default: `false`)_ - if `true`, quote all non-key strings,
145
- using `quoteStyle`.
146
- - `flowBracketPadding` _(default: `false`)_ - add spaces inside flow collection
147
- brackets, `{a: 1}` => `{ a: 1 }`.
148
- - `flowSkipCommaSpace` _(default: `false`)_ - omit the space after commas in
149
- flow collections, `[1, 2]` => `[1,2]`.
150
- - `flowSkipColonSpace` _(default: `false`)_ - omit the space after `:` in flow
151
- mappings, `{a: 1}` => `{a:1}`.
152
- - `quoteFlowKeys` _(default: `false`)_ - quote flow mapping keys, `{a: 1}` =>
153
- `{"a": 1}`.
154
- - `tagBeforeAnchor` _(default: `false`)_ - print an explicit tag before an
155
- anchor, `&ref_0 !!set` => `!!set &ref_0`.
156
- - `transform` - a function `(documents: Document[]) => void` that can mutate the
157
- generated AST before it is rendered.
158
-
159
- See [examples](examples/) for advanced customization approaches.
160
-
161
-
162
- Supported YAML types
163
- --------------------
164
-
165
- The list of standard YAML tags and corresponding JavaScript types. See also
166
- [YAML tag discussion](https://pyyaml.org/wiki/YAMLTagDiscussion) and
167
- [YAML types repository](https://yaml.org/type/).
168
-
169
- ```
170
- !!null '' # null
171
- !!bool 'true' # bool
172
- !!int '3...' # number
173
- !!float '3.14...' # number
174
- !!str '...' # string
175
- !!seq [ ... ] # array
176
- !!map { ... } # object (or Map)
177
- ```
178
-
179
- The types below are only available in `YAML11_SCHEMA` (not in the default
180
- `CORE_SCHEMA`):
181
-
182
- ```
183
- !!binary '...base64...' # Uint8Array
184
- !!timestamp 'YYYY-...' # date
185
- !!set { ... } # Set
186
-
187
- # Legacy YAML 1.1 compatibility only; these types cannot be dumped.
188
- !!omap [ ... ] # array of key-value pairs
189
- !!pairs [ ... ] # array of array pairs
190
- ```
191
-
192
- To preserve complex keys in the first position of a `!!pairs` item, replace
193
- the default object-based map with `realMapTag` in the schema.
194
-
195
- **JavaScript-specific tags**
196
-
197
- See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for
198
- extra types.
199
-
200
-
201
- CLI
202
- ---
203
-
204
- This can be useful sometimes for a quick check.
205
-
206
- ```
207
- npx js-yaml -h
40
+ const source = dump({ greeting: 'hello' })
41
+ console.log(source)
208
42
  ```
209
43
 
210
- Note: the CLI script comes with minimal options, and there are no big plans to
211
- extend it.
44
+ [More usage examples](docs/usage.md).