typenative 0.7.0 → 0.7.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 (217) hide show
  1. package/bin/node/assert.js +2 -2
  2. package/bin/node/child_process.js +66 -8
  3. package/bin/node/fs.js +1012 -4
  4. package/bin/node/histogram.js +1991 -0
  5. package/bin/node/process.js +14 -2
  6. package/bin/node/sqlite.js +1488 -5
  7. package/bin/node/stream.js +2 -1
  8. package/bin/node/system_extra.js +3 -270
  9. package/bin/node/test.js +39 -1
  10. package/bin/node/test_report.js +47 -1
  11. package/bin/node/test_run.js +57 -2
  12. package/bin/node/util.js +8 -5
  13. package/bin/node/webassembly.js +20 -5
  14. package/bin/node/webview.js +3257 -244
  15. package/bin/node/zlib.js +118 -14
  16. package/bin/node/zlib_iter.js +585 -0
  17. package/bin/transpiler.js +1370 -258
  18. package/bin/version.js +1 -1
  19. package/govendor/software.sslmate.com/src/go-pkcs12/.gitattributes +10 -0
  20. package/govendor/software.sslmate.com/src/go-pkcs12/LICENSE +28 -0
  21. package/govendor/software.sslmate.com/src/go-pkcs12/README.md +31 -0
  22. package/govendor/software.sslmate.com/src/go-pkcs12/bmp-string.go +63 -0
  23. package/govendor/software.sslmate.com/src/go-pkcs12/crypto.go +331 -0
  24. package/govendor/software.sslmate.com/src/go-pkcs12/errors.go +23 -0
  25. package/govendor/software.sslmate.com/src/go-pkcs12/go.mod +3 -0
  26. package/govendor/software.sslmate.com/src/go-pkcs12/internal/rc2/rc2.go +271 -0
  27. package/govendor/software.sslmate.com/src/go-pkcs12/mac.go +202 -0
  28. package/govendor/software.sslmate.com/src/go-pkcs12/pbkdf.go +184 -0
  29. package/govendor/software.sslmate.com/src/go-pkcs12/pkcs12.go +1000 -0
  30. package/govendor/software.sslmate.com/src/go-pkcs12/safebags.go +107 -0
  31. package/package.json +10 -1
  32. package/types/tsconfig.json +17 -0
  33. package/types/typenative-npm.d.ts +492 -12
  34. package/types/typenative.d.ts +88 -2
  35. package/.gitattributes +0 -1
  36. package/.github/workflows/ci.yml +0 -68
  37. package/.github/workflows/npm-publish-github-packages.yml +0 -88
  38. package/CHANGELOG.md +0 -1746
  39. package/CONTRIBUTION.md +0 -133
  40. package/conformance.md +0 -1497
  41. package/examples/README.md +0 -114
  42. package/examples/angular-templates/README.md +0 -141
  43. package/examples/angular-templates/bench.mjs +0 -173
  44. package/examples/angular-templates/dom-type-globals.d.ts +0 -21
  45. package/examples/angular-templates/dom-type-stubs.ts +0 -21
  46. package/examples/angular-templates/main.ts +0 -135
  47. package/examples/angular-templates/parity.mjs +0 -157
  48. package/examples/angular-templates/run-node.mjs +0 -69
  49. package/examples/angular-templates/vendor/angular/compiler/LICENSE +0 -21
  50. package/examples/desktop-notes/README.md +0 -106
  51. package/examples/desktop-notes/bench.mjs +0 -125
  52. package/examples/desktop-notes/main.ts +0 -131
  53. package/examples/desktop-notes/package-lock.json +0 -726
  54. package/examples/desktop-notes/package.json +0 -9
  55. package/examples/desktop-notes/ui.ts +0 -176
  56. package/examples/dupe-finder/README.md +0 -78
  57. package/examples/dupe-finder/bench.mjs +0 -120
  58. package/examples/dupe-finder/main.ts +0 -87
  59. package/examples/fibonacci/README.md +0 -89
  60. package/examples/fibonacci/bench.mjs +0 -87
  61. package/examples/fibonacci/main.ts +0 -21
  62. package/examples/hello-world/README.md +0 -62
  63. package/examples/hello-world/bench.mjs +0 -66
  64. package/examples/hello-world/main.ts +0 -7
  65. package/examples/json-server/README.md +0 -132
  66. package/examples/json-server/bench.mjs +0 -263
  67. package/examples/json-server/main.ts +0 -67
  68. package/examples/mandelbrot-png/README.md +0 -63
  69. package/examples/mandelbrot-png/bench.mjs +0 -95
  70. package/examples/mandelbrot-png/main.ts +0 -98
  71. package/examples/mandelbrot-png/preview.png +0 -0
  72. package/examples/marked-cli/README.md +0 -174
  73. package/examples/marked-cli/bench.mjs +0 -178
  74. package/examples/marked-cli/main.ts +0 -410
  75. package/examples/marked-cli/parity.mjs +0 -185
  76. package/examples/marked-cli/vendor/marked/LICENSE +0 -44
  77. package/examples/marked-cli/vendor/marked/VENDOR.md +0 -26
  78. package/examples/openai-chat/README.md +0 -148
  79. package/examples/openai-chat/bench.mjs +0 -175
  80. package/examples/openai-chat/main.ts +0 -488
  81. package/examples/react-compiler/README.md +0 -185
  82. package/examples/react-compiler/bench.mjs +0 -181
  83. package/examples/react-compiler/main.ts +0 -324
  84. package/examples/react-compiler/parity.mjs +0 -362
  85. package/examples/react-compiler/run-node.mjs +0 -90
  86. package/examples/react-compiler/vendor/babel/LICENSE +0 -22
  87. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-lower.json +0 -15
  88. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-upper.json +0 -51
  89. package/examples/react-compiler/vendor/charcodes/package.json +0 -25
  90. package/examples/react-compiler/vendor/invariant/LICENSE +0 -21
  91. package/examples/react-compiler/vendor/invariant/invariant.cjs +0 -51
  92. package/examples/react-compiler/vendor/invariant/invariant.d.cts +0 -11
  93. package/examples/react-compiler/vendor/invariant/types/LICENSE +0 -21
  94. package/examples/react-compiler/vendor/jridgewell/gen-mapping/LICENSE +0 -19
  95. package/examples/react-compiler/vendor/jridgewell/resolve-uri/LICENSE +0 -19
  96. package/examples/react-compiler/vendor/jridgewell/sourcemap-codec/LICENSE +0 -19
  97. package/examples/react-compiler/vendor/jridgewell/trace-mapping/LICENSE +0 -19
  98. package/examples/react-compiler/vendor/js-tokens/LICENSE +0 -21
  99. package/examples/react-compiler/vendor/js-tokens/index.cjs +0 -23
  100. package/examples/react-compiler/vendor/js-tokens/index.d.cts +0 -13
  101. package/examples/react-compiler/vendor/jsesc/LICENSE-MIT.txt +0 -20
  102. package/examples/react-compiler/vendor/jsesc/jsesc.cjs +0 -337
  103. package/examples/react-compiler/vendor/jsesc/jsesc.d.cts +0 -384
  104. package/examples/react-compiler/vendor/jsesc/types/LICENSE +0 -21
  105. package/examples/react-compiler/vendor/picocolors/LICENSE +0 -15
  106. package/examples/react-compiler/vendor/picocolors/picocolors.cjs +0 -75
  107. package/examples/react-compiler/vendor/picocolors/picocolors.d.cts +0 -5
  108. package/examples/react-compiler/vendor/picocolors/types.d.ts +0 -51
  109. package/examples/react-compiler/vendor/react-compiler/LICENSE +0 -21
  110. package/examples/react-compiler/vendor/stubs/babel-core.ts +0 -31
  111. package/examples/react-compiler/vendor/stubs/debug.ts +0 -18
  112. package/examples/react-compiler/vendor/stubs/js-tokens.d.ts +0 -13
  113. package/examples/react-compiler/vendor/stubs/pretty-format.ts +0 -18
  114. package/examples/react-compiler/vendor/zod/LICENSE +0 -21
  115. package/examples/react-compiler/vendor/zod-validation-error/LICENSE +0 -9
  116. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/NonEmptyArray.ts +0 -5
  117. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinPath.ts +0 -49
  118. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinValues.ts +0 -48
  119. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/stringify.ts +0 -50
  120. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/titleCase.ts +0 -6
  121. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/MessageBuilder.ts +0 -126
  122. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/ValidationError.ts +0 -39
  123. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/custom.ts +0 -12
  124. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/errorMap.ts +0 -78
  125. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/index.ts +0 -2
  126. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidElement.ts +0 -12
  127. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidKey.ts +0 -12
  128. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidStringFormat.ts +0 -131
  129. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidType.ts +0 -54
  130. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidUnion.ts +0 -12
  131. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidValue.ts +0 -40
  132. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/notMultipleOf.ts +0 -12
  133. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooBig.ts +0 -76
  134. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooSmall.ts +0 -76
  135. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/types.ts +0 -27
  136. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/unrecognizedKeys.ts +0 -27
  137. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromError.ts +0 -13
  138. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodError.ts +0 -61
  139. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodIssue.ts +0 -38
  140. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/index.ts +0 -20
  141. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationError.ts +0 -5
  142. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationErrorLike.ts +0 -8
  143. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isZodErrorLike.ts +0 -11
  144. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/toValidationError.ts +0 -20
  145. package/examples/react-compiler/vendor.mjs +0 -688
  146. package/examples/todo-cli/README.md +0 -69
  147. package/examples/todo-cli/bench.mjs +0 -89
  148. package/examples/todo-cli/main.ts +0 -92
  149. package/examples/yaml-cli/README.md +0 -152
  150. package/examples/yaml-cli/bench.mjs +0 -265
  151. package/examples/yaml-cli/main.ts +0 -251
  152. package/examples/yaml-cli/parity.mjs +0 -156
  153. package/examples/yaml-cli/vendor/yaml/LICENSE +0 -13
  154. package/examples/yaml-cli/vendor/yaml/VENDOR.md +0 -25
  155. package/performance/README.md +0 -248
  156. package/performance/any-dynamic.ts +0 -21
  157. package/performance/any-record-view.ts +0 -20
  158. package/performance/arr-for-of.ts +0 -29
  159. package/performance/arr-hof.ts +0 -21
  160. package/performance/arr-push-index.ts +0 -15
  161. package/performance/arr-push-local.ts +0 -39
  162. package/performance/arr-slice-concat.ts +0 -24
  163. package/performance/arr-sort.ts +0 -21
  164. package/performance/async-await.ts +0 -24
  165. package/performance/async-promise-all.ts +0 -38
  166. package/performance/bigint-arith.ts +0 -36
  167. package/performance/buf-encode.ts +0 -29
  168. package/performance/class-accessors.ts +0 -48
  169. package/performance/class-dispatch.ts +0 -52
  170. package/performance/date-format.ts +0 -18
  171. package/performance/events-emit.ts +0 -27
  172. package/performance/exc-throw-rare.ts +0 -25
  173. package/performance/exc-try-catch.ts +0 -26
  174. package/performance/fn-closures.ts +0 -29
  175. package/performance/fn-recursion-tree.ts +0 -31
  176. package/performance/fn-rest-spread.ts +0 -43
  177. package/performance/gen-for-of.ts +0 -46
  178. package/performance/gen-next.ts +0 -32
  179. package/performance/iter-helpers.ts +0 -38
  180. package/performance/json-any.ts +0 -30
  181. package/performance/json-roundtrip.ts +0 -27
  182. package/performance/map-delete.ts +0 -24
  183. package/performance/map-iterate.ts +0 -26
  184. package/performance/map-number-keys.ts +0 -37
  185. package/performance/map-string-keys.ts +0 -22
  186. package/performance/num-arith-loop.ts +0 -14
  187. package/performance/num-bitwise.ts +0 -21
  188. package/performance/num-hash-imul.ts +0 -36
  189. package/performance/num-mod-int.ts +0 -16
  190. package/performance/num-to-string.ts +0 -16
  191. package/performance/obj-alloc.ts +0 -32
  192. package/performance/obj-keys-entries.ts +0 -44
  193. package/performance/obj-optional-chain.ts +0 -42
  194. package/performance/obj-record-dict.ts +0 -24
  195. package/performance/obj-spread-destructure.ts +0 -40
  196. package/performance/regex-exec.ts +0 -29
  197. package/performance/regex-replace-fn.ts +0 -24
  198. package/performance/regex-site.ts +0 -28
  199. package/performance/set-ops.ts +0 -20
  200. package/performance/str-char-scan.ts +0 -35
  201. package/performance/str-concat-plus.ts +0 -18
  202. package/performance/str-concat.ts +0 -24
  203. package/performance/str-methods.ts +0 -24
  204. package/performance/str-short-scan.ts +0 -26
  205. package/performance/str-split-join.ts +0 -23
  206. package/performance/str-switch-compare.ts +0 -50
  207. package/performance/str-template.ts +0 -16
  208. package/performance/str-unicode.ts +0 -25
  209. package/performance/typed-array.ts +0 -30
  210. package/performance/union-switch.ts +0 -57
  211. package/performance/union-typeof.ts +0 -40
  212. package/performance/wasm-call.ts +0 -63
  213. package/tsparser/check.go +0 -158
  214. package/tsparser/go.mod +0 -14
  215. package/tsparser/go.sum +0 -22
  216. package/tsparser/main.go +0 -363
  217. package/tsparser/tsparser.exe +0 -4
@@ -1,384 +0,0 @@
1
- export = jsesc;
2
-
3
- /**
4
- * This function takes a value and returns an escaped version of the value where any characters
5
- * that are not printable ASCII symbols are escaped using the shortest possible (but valid)
6
- * escape sequences for use in JavaScript strings. The first supported value type is strings.
7
- * Instead of a string, the value can also be an array, an object, a map, a set, or a buffer.
8
- * In such cases, jsesc returns a stringified version of the value where any characters that
9
- * are not printable ASCII symbols are escaped in the same way.
10
- *
11
- * @example
12
- * import jsesc = require('jsesc');
13
- *
14
- * jsesc('Ich ♥ Bücher');
15
- * // → 'Ich \\u2665 B\\xFCcher'
16
- *
17
- * jsesc('foo 𝌆 bar');
18
- * // → 'foo \\uD834\\uDF06 bar'
19
- *
20
- * // Escaping an array
21
- * jsesc([
22
- * 'Ich ♥ Bücher', 'foo 𝌆 bar'
23
- * ]);
24
- * // → '[\'Ich \\u2665 B\\xFCcher\',\'foo \\uD834\\uDF06 bar\']'
25
- *
26
- * // Escaping an object
27
- * jsesc({
28
- * 'Ich ♥ Bücher': 'foo 𝌆 bar'
29
- * });
30
- * // → '{\'Ich \\u2665 B\\xFCcher\':\'foo \\uD834\\uDF06 bar\'}'
31
- */
32
- declare function jsesc(argument: any, opts?: jsesc.Opts): string;
33
-
34
- declare namespace jsesc {
35
- /**
36
- * A string representing the semantic version number.
37
- */
38
- const version: string;
39
-
40
- interface Opts {
41
- /**
42
- * The value `'single'` for the `quotes` option means that any occurrences of `'` in the input string are
43
- * escaped as `\'`, so that the output can be used in a string literal wrapped in single quotes. If you want
44
- * to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to
45
- * `'double'`. If you want to use the output as part of a template literal (i.e. wrapped in backticks), set
46
- * the `quotes` option to `'backtick'`.
47
- *
48
- * @default 'single'
49
- *
50
- * @example
51
- * import jsesc = require('jsesc');
52
- *
53
- * jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.');
54
- * // → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
55
- *
56
- * jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', {
57
- * quotes: 'single'
58
- * });
59
- * // → '`Lorem` ipsum "dolor" sit \\\'amet\\\' etc.'
60
- * // → "`Lorem` ipsum \"dolor\" sit \\'amet\\' etc."
61
- *
62
- * jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', {
63
- * quotes: 'double'
64
- * });
65
- * // → '`Lorem` ipsum \\"dolor\\" sit \'amet\' etc.'
66
- * // → "`Lorem` ipsum \\\"dolor\\\" sit 'amet' etc."
67
- *
68
- * jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', {
69
- * quotes: 'backtick'
70
- * });
71
- * // → '\\`Lorem\\` ipsum "dolor" sit \'amet\' etc.'
72
- * // → "\\`Lorem\\` ipsum \"dolor\" sit 'amet' etc."
73
- * // → `\\\`Lorem\\\` ipsum "dolor" sit 'amet' etc.`
74
- *
75
- * // This setting also affects the output for arrays and objects:
76
- * jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {
77
- * quotes: 'double'
78
- * });
79
- * // → '{"Ich \\u2665 B\\xFCcher":"foo \\uD834\\uDF06 bar"}'
80
- *
81
- * jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {
82
- * quotes: 'double'
83
- * });
84
- * // → '["Ich \\u2665 B\\xFCcher","foo \\uD834\\uDF06 bar"]'
85
- */
86
- quotes?: "single" | "double" | "backtick" | undefined;
87
-
88
- /**
89
- * The value `'decimal'` for the `numbers` option means that any numeric values are represented using decimal
90
- * integer literals. Other valid options are `binary`, `octal`, and `hexadecimal`, which result in binary
91
- * integer literals, octal integer literals, and hexadecimal integer literals, respectively.
92
- *
93
- * @default 'decimal'
94
- *
95
- * @example
96
- * import jsesc = require('jsesc');
97
- *
98
- * jsesc(42, {
99
- * numbers: 'binary'
100
- * });
101
- * // → '0b101010'
102
- *
103
- * jsesc(42, {
104
- * numbers: 'octal'
105
- * });
106
- * // → '0o52'
107
- *
108
- * jsesc(42, {
109
- * numbers: 'decimal'
110
- * });
111
- * // → '42'
112
- *
113
- * jsesc(42, {
114
- * numbers: 'hexadecimal'
115
- * });
116
- * // → '0x2A'
117
- */
118
- numbers?: "binary" | "octal" | "decimal" | "hexadecimal" | undefined;
119
-
120
- /**
121
- * When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be
122
- * specified through the `quotes` setting.
123
- *
124
- * @default false (disabled)
125
- *
126
- * @example
127
- * import jsesc = require('jsesc');
128
- *
129
- * jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
130
- * quotes: 'single',
131
- * wrap: true
132
- * });
133
- * // → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\''
134
- * // → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'"
135
- *
136
- * jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
137
- * quotes: 'double',
138
- * wrap: true
139
- * });
140
- * // → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."'
141
- * // → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\""
142
- */
143
- wrap?: boolean | undefined;
144
-
145
- /**
146
- * When enabled, any astral Unicode symbols in the input are escaped using
147
- * [ECMAScript 6 Unicode code point escape sequences](https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point)
148
- * instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5
149
- * environments is a concern, don’t enable this setting. If the `json` setting is enabled, the value for the
150
- * `es6` setting is ignored (as if it was `false`).
151
- *
152
- * @default false (disabled)
153
- *
154
- * @example
155
- * import jsesc = require('jsesc');
156
- *
157
- * // By default, the `es6` option is disabled:
158
- * jsesc('foo 𝌆 bar 💩 baz');
159
- * // → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz'
160
- *
161
- * // To explicitly disable it:
162
- * jsesc('foo 𝌆 bar 💩 baz', {
163
- * es6: false
164
- * });
165
- * // → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz'
166
- *
167
- * // To enable it:
168
- * jsesc('foo 𝌆 bar 💩 baz', {
169
- * es6: true
170
- * });
171
- * // → 'foo \\u{1D306} bar \\u{1F4A9} baz'
172
- */
173
- es6?: boolean | undefined;
174
-
175
- /**
176
- * When enabled, all the symbols in the output are escaped — even printable ASCII symbols.
177
- * This setting also affects the output for string literals within arrays and objects.
178
- *
179
- * @default false (disabled)
180
- *
181
- * @example
182
- * import jsesc = require('jsesc');
183
- *
184
- * jsesc('lolwat"foo\'bar', {
185
- * escapeEverything: true
186
- * });
187
- * // → '\\x6C\\x6F\\x6C\\x77\\x61\\x74\\"\\x66\\x6F\\x6F\\\'\\x62\\x61\\x72'
188
- * // → "\\x6C\\x6F\\x6C\\x77\\x61\\x74\\\"\\x66\\x6F\\x6F\\'\\x62\\x61\\x72"
189
- */
190
- escapeEverything?: boolean | undefined;
191
-
192
- /**
193
- * When enabled, only a limited set of symbols in the output are escaped:
194
- *
195
- * - U+0000 `\0`
196
- * - U+0008 `\b`
197
- * - U+0009 `\t`
198
- * - U+000A `\n`
199
- * - U+000C `\f`
200
- * - U+000D `\r`
201
- * - U+005C `\\`
202
- * - U+2028 `\u2028`
203
- * - U+2029 `\u2029`
204
- * - whatever symbol is being used for wrapping string literals (based on the `quotes` option)
205
- * - [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14)
206
- *
207
- * Note: with this option enabled, jsesc output is no longer guaranteed to be ASCII-safe.
208
- *
209
- * @default false (disabled)
210
- *
211
- * @example
212
- * import jsesc = require('jsesc');
213
- *
214
- * jsesc('foo\u2029bar\nbaz©qux𝌆flops', {
215
- * minimal: false
216
- * });
217
- * // → 'foo\\u2029bar\\nbaz©qux𝌆flops'
218
- */
219
- minimal?: boolean | undefined;
220
-
221
- /**
222
- * When enabled, occurrences of [`</script` and `</style`](https://mathiasbynens.be/notes/etago) in the output
223
- * are escaped as `<\/script` and `<\/style`, and [`<!--`](https://mathiasbynens.be/notes/etago#comment-8) is
224
- * escaped as `\x3C!--` (or `\u003C!--` when the `json` option is enabled). This setting is useful when jsesc’s
225
- * output ends up as part of a `<script>` or `<style>` element in an HTML document.
226
- *
227
- * @default false (disabled)
228
- *
229
- * @example
230
- * import jsesc = require('jsesc');
231
- *
232
- * jsesc('foo</script>bar', {
233
- * isScriptContext: true
234
- * });
235
- * // → 'foo<\\/script>bar'
236
- */
237
- isScriptContext?: boolean | undefined;
238
-
239
- /**
240
- * When enabled, the output for arrays and objects is as compact as possible; it’s not formatted nicely.
241
- *
242
- * @default true (enabled)
243
- *
244
- * @example
245
- * import jsesc = require('jsesc');
246
- *
247
- * jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {
248
- * compact: true // this is the default
249
- * });
250
- * // → '{\'Ich \u2665 B\xFCcher\':\'foo \uD834\uDF06 bar\'}'
251
- *
252
- * jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {
253
- * compact: false
254
- * });
255
- * // → '{\n\t\'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}'
256
- *
257
- * jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {
258
- * compact: false
259
- * });
260
- * // → '[\n\t\'Ich \u2665 B\xFCcher\',\n\t\'foo \uD834\uDF06 bar\'\n]'
261
- */
262
- compact?: boolean | undefined;
263
-
264
- /**
265
- * When the `compact` setting is disabled (`false`), the value of the `indent` option is used to format the
266
- * output for arrays and objects. This setting has no effect on the output for strings.
267
- *
268
- * @default '\t'
269
- *
270
- * @example
271
- * import jsesc = require('jsesc');
272
- *
273
- * jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {
274
- * compact: false,
275
- * indent: '\t' // this is the default
276
- * });
277
- * // → '{\n\t\'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}'
278
- *
279
- * jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {
280
- * compact: false,
281
- * indent: ' '
282
- * });
283
- * // → '{\n \'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}'
284
- *
285
- * jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {
286
- * compact: false,
287
- * indent: ' '
288
- * });
289
- * // → '[\n \'Ich \u2665 B\xFCcher\',\n\ t\'foo \uD834\uDF06 bar\'\n]'
290
- */
291
- indent?: string | undefined;
292
-
293
- /**
294
- * It represents the current indentation level, i.e. the number of times the value of the `indent` option is
295
- * repeated.
296
- *
297
- * @default 0
298
- *
299
- * @example
300
- * import jsesc = require('jsesc');
301
- *
302
- * jsesc(['a', 'b', 'c'], {
303
- * compact: false,
304
- * indentLevel: 1
305
- * });
306
- * // → '[\n\t\t\'a\',\n\t\t\'b\',\n\t\t\'c\'\n\t]'
307
- *
308
- * jsesc(['a', 'b', 'c'], {
309
- * compact: false,
310
- * indentLevel: 2
311
- * });
312
- * // → '[\n\t\t\t\'a\',\n\t\t\t\'b\',\n\t\t\t\'c\'\n\t\t]'
313
- */
314
- indentLevel?: number | undefined;
315
-
316
- /**
317
- * When enabled, the output is valid JSON.
318
- * [Hexadecimal character escape sequences](https://mathiasbynens.be/notes/javascript-escapes#hexadecimal) and
319
- * [the `\v` or `\0` escape sequences](https://mathiasbynens.be/notes/javascript-escapes#single) are not used.
320
- * Setting `json: true` implies `quotes: 'double', wrap: true, es6: false`, although these values can still be
321
- * overridden if needed — but in such cases, the output won’t be valid JSON anymore.
322
- *
323
- * **Note:** Using this option on objects or arrays that contain non-string values relies on `JSON.stringify()`.
324
- * For legacy environments like IE ≤ 7, use [a `JSON` polyfill](http://bestiejs.github.io/json3/).
325
- *
326
- * @default false (disabled)
327
- *
328
- * @example
329
- * import jsesc = require('jsesc');
330
- *
331
- * jsesc('foo\x00bar\xFF\uFFFDbaz', {
332
- * json: true
333
- * });
334
- * // → '"foo\\u0000bar\\u00FF\\uFFFDbaz"'
335
- *
336
- * jsesc({ 'foo\x00bar\xFF\uFFFDbaz': 'foo\x00bar\xFF\uFFFDbaz' }, {
337
- * json: true
338
- * });
339
- * // → '{"foo\\u0000bar\\u00FF\\uFFFDbaz":"foo\\u0000bar\\u00FF\\uFFFDbaz"}'
340
- *
341
- * jsesc([ 'foo\x00bar\xFF\uFFFDbaz', 'foo\x00bar\xFF\uFFFDbaz' ], {
342
- * json: true
343
- * });
344
- * // → '["foo\\u0000bar\\u00FF\\uFFFDbaz","foo\\u0000bar\\u00FF\\uFFFDbaz"]'
345
- *
346
- * // Values that are acceptable in JSON but aren’t strings, arrays, or object
347
- * // literals can’t be escaped, so they’ll just be preserved:
348
- * jsesc([ 'foo\x00bar', [1, '©', { 'foo': true, 'qux': null }], 42 ], {
349
- * json: true
350
- * });
351
- * // → '["foo\\u0000bar",[1,"\\u00A9",{"foo":true,"qux":null}],42]'
352
- * // Values that aren’t allowed in JSON are run through `JSON.stringify()`:
353
- * jsesc([ undefined, -Infinity ], {
354
- * json: true
355
- * });
356
- * // → '[null,null]'
357
- */
358
- json?: boolean | undefined;
359
-
360
- /**
361
- * When enabled, any alphabetical hexadecimal digits in escape sequences as well as any hexadecimal integer
362
- * literals (see the `numbers` option) in the output are in lowercase.
363
- *
364
- * @default false (disabled)
365
- *
366
- * @example
367
- * import jsesc = require('jsesc');
368
- *
369
- * jsesc('Ich ♥ Bücher', {
370
- * lowercaseHex: true
371
- * });
372
- * // → 'Ich \\u2665 B\\xfccher'
373
- * // ^^
374
- *
375
- * jsesc(42, {
376
- * numbers: 'hexadecimal',
377
- * lowercaseHex: true
378
- * });
379
- * // → '0x2a'
380
- * // ^^
381
- */
382
- lowercaseHex?: boolean | undefined;
383
- }
384
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
@@ -1,15 +0,0 @@
1
- ISC License
2
-
3
- Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,75 +0,0 @@
1
- let p = process || {}, argv = p.argv || [], env = p.env || {}
2
- let isColorSupported =
3
- !(!!env.NO_COLOR || argv.includes("--no-color")) &&
4
- (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
5
-
6
- let formatter = (open, close, replace = open) =>
7
- input => {
8
- let string = "" + input, index = string.indexOf(close, open.length)
9
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
10
- }
11
-
12
- let replaceClose = (string, close, replace, index) => {
13
- let result = "", cursor = 0
14
- do {
15
- result += string.substring(cursor, index) + replace
16
- cursor = index + close.length
17
- index = string.indexOf(close, cursor)
18
- } while (~index)
19
- return result + string.substring(cursor)
20
- }
21
-
22
- let createColors = (enabled = isColorSupported) => {
23
- let f = enabled ? formatter : () => String
24
- return {
25
- isColorSupported: enabled,
26
- reset: f("\x1b[0m", "\x1b[0m"),
27
- bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
28
- dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
29
- italic: f("\x1b[3m", "\x1b[23m"),
30
- underline: f("\x1b[4m", "\x1b[24m"),
31
- inverse: f("\x1b[7m", "\x1b[27m"),
32
- hidden: f("\x1b[8m", "\x1b[28m"),
33
- strikethrough: f("\x1b[9m", "\x1b[29m"),
34
-
35
- black: f("\x1b[30m", "\x1b[39m"),
36
- red: f("\x1b[31m", "\x1b[39m"),
37
- green: f("\x1b[32m", "\x1b[39m"),
38
- yellow: f("\x1b[33m", "\x1b[39m"),
39
- blue: f("\x1b[34m", "\x1b[39m"),
40
- magenta: f("\x1b[35m", "\x1b[39m"),
41
- cyan: f("\x1b[36m", "\x1b[39m"),
42
- white: f("\x1b[37m", "\x1b[39m"),
43
- gray: f("\x1b[90m", "\x1b[39m"),
44
-
45
- bgBlack: f("\x1b[40m", "\x1b[49m"),
46
- bgRed: f("\x1b[41m", "\x1b[49m"),
47
- bgGreen: f("\x1b[42m", "\x1b[49m"),
48
- bgYellow: f("\x1b[43m", "\x1b[49m"),
49
- bgBlue: f("\x1b[44m", "\x1b[49m"),
50
- bgMagenta: f("\x1b[45m", "\x1b[49m"),
51
- bgCyan: f("\x1b[46m", "\x1b[49m"),
52
- bgWhite: f("\x1b[47m", "\x1b[49m"),
53
-
54
- blackBright: f("\x1b[90m", "\x1b[39m"),
55
- redBright: f("\x1b[91m", "\x1b[39m"),
56
- greenBright: f("\x1b[92m", "\x1b[39m"),
57
- yellowBright: f("\x1b[93m", "\x1b[39m"),
58
- blueBright: f("\x1b[94m", "\x1b[39m"),
59
- magentaBright: f("\x1b[95m", "\x1b[39m"),
60
- cyanBright: f("\x1b[96m", "\x1b[39m"),
61
- whiteBright: f("\x1b[97m", "\x1b[39m"),
62
-
63
- bgBlackBright: f("\x1b[100m", "\x1b[49m"),
64
- bgRedBright: f("\x1b[101m", "\x1b[49m"),
65
- bgGreenBright: f("\x1b[102m", "\x1b[49m"),
66
- bgYellowBright: f("\x1b[103m", "\x1b[49m"),
67
- bgBlueBright: f("\x1b[104m", "\x1b[49m"),
68
- bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
69
- bgCyanBright: f("\x1b[106m", "\x1b[49m"),
70
- bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
71
- }
72
- }
73
-
74
- module.exports = createColors()
75
- module.exports.createColors = createColors
@@ -1,5 +0,0 @@
1
- import { Colors } from "./types"
2
-
3
- declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
4
-
5
- export = picocolors
@@ -1,51 +0,0 @@
1
- export type Formatter = (input: string | number | null | undefined) => string
2
-
3
- export interface Colors {
4
- isColorSupported: boolean
5
-
6
- reset: Formatter
7
- bold: Formatter
8
- dim: Formatter
9
- italic: Formatter
10
- underline: Formatter
11
- inverse: Formatter
12
- hidden: Formatter
13
- strikethrough: Formatter
14
-
15
- black: Formatter
16
- red: Formatter
17
- green: Formatter
18
- yellow: Formatter
19
- blue: Formatter
20
- magenta: Formatter
21
- cyan: Formatter
22
- white: Formatter
23
- gray: Formatter
24
-
25
- bgBlack: Formatter
26
- bgRed: Formatter
27
- bgGreen: Formatter
28
- bgYellow: Formatter
29
- bgBlue: Formatter
30
- bgMagenta: Formatter
31
- bgCyan: Formatter
32
- bgWhite: Formatter
33
-
34
- blackBright: Formatter
35
- redBright: Formatter
36
- greenBright: Formatter
37
- yellowBright: Formatter
38
- blueBright: Formatter
39
- magentaBright: Formatter
40
- cyanBright: Formatter
41
- whiteBright: Formatter
42
-
43
- bgBlackBright: Formatter
44
- bgRedBright: Formatter
45
- bgGreenBright: Formatter
46
- bgYellowBright: Formatter
47
- bgBlueBright: Formatter
48
- bgMagentaBright: Formatter
49
- bgCyanBright: Formatter
50
- bgWhiteBright: Formatter
51
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Meta Platforms, Inc. and affiliates.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,31 +0,0 @@
1
- // Stand-in for @babel/core. The React Compiler imports it for three things:
2
- // the `NodePath` class (which @babel/core re-exports from @babel/traverse),
3
- // the types of a Babel plugin (`PluginObj`, `PluginItem`, `BabelFileResult`),
4
- // and `transformFromAstSync`, which only `runBabelPluginReactCompiler` (a
5
- // test helper that main.ts never calls) uses to run the compiler as a Babel
6
- // plugin. main.ts drives the compiler without @babel/core: @babel/parser
7
- // parses, @babel/traverse hands the compiler the Program path, and
8
- // @babel/generator prints. So this stub forwards `NodePath` and `types` and
9
- // declares the plugin types; `transformFromAstSync` throws.
10
-
11
- import type { File } from '../babel/types/src/index.ts';
12
-
13
- export { NodePath } from '../babel/traverse/src/index.ts';
14
- export * as types from '../babel/types/src/index.ts';
15
-
16
- export type PluginItem = unknown;
17
-
18
- export type PluginObj = {
19
- name?: string;
20
- visitor: Record<string, any>;
21
- };
22
-
23
- export type BabelFileResult = {
24
- ast?: File | null;
25
- code?: string | null;
26
- map?: unknown;
27
- };
28
-
29
- export function transformFromAstSync(_ast: File, _code: string, _options: unknown): BabelFileResult | null {
30
- throw new Error('@babel/core is not vendored: transformFromAstSync is unavailable');
31
- }
@@ -1,18 +0,0 @@
1
- // Stand-in for the `debug` package (https://github.com/debug-js/debug), which
2
- // @babel/traverse uses for its `DEBUG=babel` trace of path visits. That trace
3
- // is off unless the DEBUG environment variable enables it, and nothing in this
4
- // example turns it on, so this logger is always disabled: `enabled` is false
5
- // and calling it does nothing, which is what `debug` does when disabled.
6
-
7
- export interface Debugger {
8
- (formatter: unknown, ...args: unknown[]): void;
9
- enabled: boolean;
10
- namespace: string;
11
- }
12
-
13
- export default function createDebug(namespace: string): Debugger {
14
- const log = ((_formatter: unknown, ..._args: unknown[]): void => {}) as Debugger;
15
- log.enabled = false;
16
- log.namespace = namespace;
17
- return log;
18
- }
@@ -1,13 +0,0 @@
1
- // Declarations for js-tokens@4 (which ships none), as Babel 7's
2
- // @babel/code-frame uses it: the default export is the tokenizing RegExp and
3
- // `matchToToken` turns one of its matches into a token. Babel's highlighter
4
- // also names the token types of js-tokens@8 in its Babel 8 branch, so those
5
- // are declared too (type-only).
6
-
7
- declare const jsTokens: RegExp & { default: RegExp };
8
- declare namespace jsTokens {
9
- function matchToToken(match: RegExpExecArray): { type: string; value: string; closed?: boolean };
10
- type Token = { type: string; value: string; closed?: boolean };
11
- type JSXToken = { type: string; value: string; closed?: boolean };
12
- }
13
- export = jsTokens;
@@ -1,18 +0,0 @@
1
- // Stand-in for `pretty-format` (https://github.com/jestjs/jest, packages/
2
- // pretty-format), which the React Compiler only calls to print debug output:
3
- // behind its `DEBUG` constants (false), in `Dominator.debug()`, and for the
4
- // `debugLogIRs` logger hook, none of which this example uses. Kept to the
5
- // signature the compiler calls; it prints with JSON.stringify, Maps and Sets
6
- // as arrays of entries.
7
-
8
- export default function prettyFormat(value: unknown): string {
9
- return JSON.stringify(
10
- value,
11
- (_key: string, v: unknown): unknown => {
12
- if (v instanceof Map) return [...v.entries()];
13
- if (v instanceof Set) return [...v.values()];
14
- return v;
15
- },
16
- 2,
17
- );
18
- }