novac 2.2.0 → 2.2.2

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 (122) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/bin/novac +6 -3
  4. package/bin/nvc +0 -0
  5. package/bin/nvml +0 -0
  6. package/demo.nv +0 -0
  7. package/demo_builtins.nv +0 -0
  8. package/demo_http.nv +0 -0
  9. package/examples/bf.nv +5 -13
  10. package/examples/math.nv +2 -2
  11. package/kits/kitffmpeg/kitdef.js +1174 -0
  12. package/kits/libos/kitdef.js +3135 -0
  13. package/kits/libtasker/kitdef.js +125 -0
  14. package/package.json +1 -1
  15. package/scripts/update-bin.js +0 -0
  16. package/src/core/executor.js +7 -4
  17. package/src/core/lexer.js +2 -2
  18. package/src/index.js +0 -0
  19. package/novac/LICENSE +0 -21
  20. package/novac/README.md +0 -1823
  21. package/novac/bin/novac +0 -950
  22. package/novac/bin/nvc +0 -522
  23. package/novac/bin/nvml +0 -542
  24. package/novac/demo.nv +0 -245
  25. package/novac/demo_builtins.nv +0 -209
  26. package/novac/demo_http.nv +0 -62
  27. package/novac/examples/bf.nv +0 -69
  28. package/novac/examples/math.nv +0 -21
  29. package/novac/kits/kitai/kitdef.js +0 -2185
  30. package/novac/kits/kitansi/kitdef.js +0 -1402
  31. package/novac/kits/kitformat/kitdef.js +0 -1485
  32. package/novac/kits/kitgps/kitdef.js +0 -1862
  33. package/novac/kits/kitlibfs/kitdef.js +0 -231
  34. package/novac/kits/kitlibproc/kitdef.js +0 -78
  35. package/novac/kits/kitmatrix/ex.js +0 -19
  36. package/novac/kits/kitmatrix/kitdef.js +0 -960
  37. package/novac/kits/kitmpatch/kitdef.js +0 -906
  38. package/novac/kits/kitnovacweb/README.md +0 -1572
  39. package/novac/kits/kitnovacweb/demo.nv +0 -12
  40. package/novac/kits/kitnovacweb/demo.nvml +0 -71
  41. package/novac/kits/kitnovacweb/index.nova +0 -12
  42. package/novac/kits/kitnovacweb/kitdef.js +0 -692
  43. package/novac/kits/kitnovacweb/nova.kit.json +0 -8
  44. package/novac/kits/kitnovacweb/nvml/executor.js +0 -739
  45. package/novac/kits/kitnovacweb/nvml/index.js +0 -67
  46. package/novac/kits/kitnovacweb/nvml/lexer.js +0 -263
  47. package/novac/kits/kitnovacweb/nvml/parser.js +0 -508
  48. package/novac/kits/kitnovacweb/nvml/renderer.js +0 -924
  49. package/novac/kits/kitparse/kitdef.js +0 -1688
  50. package/novac/kits/kitregex++/kitdef.js +0 -1353
  51. package/novac/kits/kitrequire/kitdef.js +0 -1599
  52. package/novac/kits/kitx11/kitdef.js +0 -1
  53. package/novac/kits/kitx11/kitx11.js +0 -2472
  54. package/novac/kits/kitx11/kitx11_conn.js +0 -948
  55. package/novac/kits/kitx11/kitx11_worker.js +0 -121
  56. package/novac/kits/libtea/tf.js +0 -2691
  57. package/novac/kits/libterm/ex.js +0 -285
  58. package/novac/kits/libterm/kitdef.js +0 -1927
  59. package/novac/node_modules/chalk/license +0 -9
  60. package/novac/node_modules/chalk/package.json +0 -83
  61. package/novac/node_modules/chalk/readme.md +0 -297
  62. package/novac/node_modules/chalk/source/index.d.ts +0 -325
  63. package/novac/node_modules/chalk/source/index.js +0 -225
  64. package/novac/node_modules/chalk/source/utilities.js +0 -33
  65. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
  66. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
  67. package/novac/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  68. package/novac/node_modules/chalk/source/vendor/supports-color/browser.js +0 -34
  69. package/novac/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  70. package/novac/node_modules/chalk/source/vendor/supports-color/index.js +0 -190
  71. package/novac/node_modules/commander/LICENSE +0 -22
  72. package/novac/node_modules/commander/Readme.md +0 -1176
  73. package/novac/node_modules/commander/esm.mjs +0 -16
  74. package/novac/node_modules/commander/index.js +0 -24
  75. package/novac/node_modules/commander/lib/argument.js +0 -150
  76. package/novac/node_modules/commander/lib/command.js +0 -2777
  77. package/novac/node_modules/commander/lib/error.js +0 -39
  78. package/novac/node_modules/commander/lib/help.js +0 -747
  79. package/novac/node_modules/commander/lib/option.js +0 -380
  80. package/novac/node_modules/commander/lib/suggestSimilar.js +0 -101
  81. package/novac/node_modules/commander/package-support.json +0 -19
  82. package/novac/node_modules/commander/package.json +0 -82
  83. package/novac/node_modules/commander/typings/esm.d.mts +0 -3
  84. package/novac/node_modules/commander/typings/index.d.ts +0 -1113
  85. package/novac/node_modules/node-addon-api/LICENSE.md +0 -9
  86. package/novac/node_modules/node-addon-api/README.md +0 -95
  87. package/novac/node_modules/node-addon-api/common.gypi +0 -21
  88. package/novac/node_modules/node-addon-api/except.gypi +0 -25
  89. package/novac/node_modules/node-addon-api/index.js +0 -14
  90. package/novac/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  91. package/novac/node_modules/node-addon-api/napi-inl.h +0 -7165
  92. package/novac/node_modules/node-addon-api/napi.h +0 -3364
  93. package/novac/node_modules/node-addon-api/node_addon_api.gyp +0 -42
  94. package/novac/node_modules/node-addon-api/node_api.gyp +0 -9
  95. package/novac/node_modules/node-addon-api/noexcept.gypi +0 -26
  96. package/novac/node_modules/node-addon-api/nothing.c +0 -0
  97. package/novac/node_modules/node-addon-api/package-support.json +0 -21
  98. package/novac/node_modules/node-addon-api/package.json +0 -480
  99. package/novac/node_modules/node-addon-api/tools/README.md +0 -73
  100. package/novac/node_modules/node-addon-api/tools/check-napi.js +0 -99
  101. package/novac/node_modules/node-addon-api/tools/clang-format.js +0 -71
  102. package/novac/node_modules/node-addon-api/tools/conversion.js +0 -301
  103. package/novac/node_modules/serialize-javascript/LICENSE +0 -27
  104. package/novac/node_modules/serialize-javascript/README.md +0 -149
  105. package/novac/node_modules/serialize-javascript/index.js +0 -297
  106. package/novac/node_modules/serialize-javascript/package.json +0 -33
  107. package/novac/package.json +0 -27
  108. package/novac/scripts/update-bin.js +0 -24
  109. package/novac/src/core/bstd.js +0 -1035
  110. package/novac/src/core/config.js +0 -155
  111. package/novac/src/core/describe.js +0 -187
  112. package/novac/src/core/emitter.js +0 -499
  113. package/novac/src/core/error.js +0 -86
  114. package/novac/src/core/executor.js +0 -5606
  115. package/novac/src/core/formatter.js +0 -686
  116. package/novac/src/core/lexer.js +0 -1026
  117. package/novac/src/core/nova_builtins.js +0 -717
  118. package/novac/src/core/nova_thread_worker.js +0 -166
  119. package/novac/src/core/parser.js +0 -2181
  120. package/novac/src/core/types.js +0 -112
  121. package/novac/src/index.js +0 -28
  122. package/novac/src/runtime/stdlib.js +0 -244
@@ -1,325 +0,0 @@
1
- // TODO: Make it this when TS suports that.
2
- // import {ModifierName, ForegroundColor, BackgroundColor, ColorName} from '#ansi-styles';
3
- // import {ColorInfo, ColorSupportLevel} from '#supports-color';
4
- import {
5
- ModifierName,
6
- ForegroundColorName,
7
- BackgroundColorName,
8
- ColorName,
9
- } from './vendor/ansi-styles/index.js';
10
- import {ColorInfo, ColorSupportLevel} from './vendor/supports-color/index.js';
11
-
12
- export interface Options {
13
- /**
14
- Specify the color support for Chalk.
15
-
16
- By default, color support is automatically detected based on the environment.
17
-
18
- Levels:
19
- - `0` - All colors disabled.
20
- - `1` - Basic 16 colors support.
21
- - `2` - ANSI 256 colors support.
22
- - `3` - Truecolor 16 million colors support.
23
- */
24
- readonly level?: ColorSupportLevel;
25
- }
26
-
27
- /**
28
- Return a new Chalk instance.
29
- */
30
- export const Chalk: new (options?: Options) => ChalkInstance; // eslint-disable-line @typescript-eslint/naming-convention
31
-
32
- export interface ChalkInstance {
33
- (...text: unknown[]): string;
34
-
35
- /**
36
- The color support for Chalk.
37
-
38
- By default, color support is automatically detected based on the environment.
39
-
40
- Levels:
41
- - `0` - All colors disabled.
42
- - `1` - Basic 16 colors support.
43
- - `2` - ANSI 256 colors support.
44
- - `3` - Truecolor 16 million colors support.
45
- */
46
- level: ColorSupportLevel;
47
-
48
- /**
49
- Use RGB values to set text color.
50
-
51
- @example
52
- ```
53
- import chalk from 'chalk';
54
-
55
- chalk.rgb(222, 173, 237);
56
- ```
57
- */
58
- rgb: (red: number, green: number, blue: number) => this;
59
-
60
- /**
61
- Use HEX value to set text color.
62
-
63
- @param color - Hexadecimal value representing the desired color.
64
-
65
- @example
66
- ```
67
- import chalk from 'chalk';
68
-
69
- chalk.hex('#DEADED');
70
- ```
71
- */
72
- hex: (color: string) => this;
73
-
74
- /**
75
- Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
76
-
77
- @example
78
- ```
79
- import chalk from 'chalk';
80
-
81
- chalk.ansi256(201);
82
- ```
83
- */
84
- ansi256: (index: number) => this;
85
-
86
- /**
87
- Use RGB values to set background color.
88
-
89
- @example
90
- ```
91
- import chalk from 'chalk';
92
-
93
- chalk.bgRgb(222, 173, 237);
94
- ```
95
- */
96
- bgRgb: (red: number, green: number, blue: number) => this;
97
-
98
- /**
99
- Use HEX value to set background color.
100
-
101
- @param color - Hexadecimal value representing the desired color.
102
-
103
- @example
104
- ```
105
- import chalk from 'chalk';
106
-
107
- chalk.bgHex('#DEADED');
108
- ```
109
- */
110
- bgHex: (color: string) => this;
111
-
112
- /**
113
- Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
114
-
115
- @example
116
- ```
117
- import chalk from 'chalk';
118
-
119
- chalk.bgAnsi256(201);
120
- ```
121
- */
122
- bgAnsi256: (index: number) => this;
123
-
124
- /**
125
- Modifier: Reset the current style.
126
- */
127
- readonly reset: this;
128
-
129
- /**
130
- Modifier: Make the text bold.
131
- */
132
- readonly bold: this;
133
-
134
- /**
135
- Modifier: Make the text have lower opacity.
136
- */
137
- readonly dim: this;
138
-
139
- /**
140
- Modifier: Make the text italic. *(Not widely supported)*
141
- */
142
- readonly italic: this;
143
-
144
- /**
145
- Modifier: Put a horizontal line below the text. *(Not widely supported)*
146
- */
147
- readonly underline: this;
148
-
149
- /**
150
- Modifier: Put a horizontal line above the text. *(Not widely supported)*
151
- */
152
- readonly overline: this;
153
-
154
- /**
155
- Modifier: Invert background and foreground colors.
156
- */
157
- readonly inverse: this;
158
-
159
- /**
160
- Modifier: Print the text but make it invisible.
161
- */
162
- readonly hidden: this;
163
-
164
- /**
165
- Modifier: Puts a horizontal line through the center of the text. *(Not widely supported)*
166
- */
167
- readonly strikethrough: this;
168
-
169
- /**
170
- Modifier: Print the text only when Chalk has a color level above zero.
171
-
172
- Can be useful for things that are purely cosmetic.
173
- */
174
- readonly visible: this;
175
-
176
- readonly black: this;
177
- readonly red: this;
178
- readonly green: this;
179
- readonly yellow: this;
180
- readonly blue: this;
181
- readonly magenta: this;
182
- readonly cyan: this;
183
- readonly white: this;
184
-
185
- /*
186
- Alias for `blackBright`.
187
- */
188
- readonly gray: this;
189
-
190
- /*
191
- Alias for `blackBright`.
192
- */
193
- readonly grey: this;
194
-
195
- readonly blackBright: this;
196
- readonly redBright: this;
197
- readonly greenBright: this;
198
- readonly yellowBright: this;
199
- readonly blueBright: this;
200
- readonly magentaBright: this;
201
- readonly cyanBright: this;
202
- readonly whiteBright: this;
203
-
204
- readonly bgBlack: this;
205
- readonly bgRed: this;
206
- readonly bgGreen: this;
207
- readonly bgYellow: this;
208
- readonly bgBlue: this;
209
- readonly bgMagenta: this;
210
- readonly bgCyan: this;
211
- readonly bgWhite: this;
212
-
213
- /*
214
- Alias for `bgBlackBright`.
215
- */
216
- readonly bgGray: this;
217
-
218
- /*
219
- Alias for `bgBlackBright`.
220
- */
221
- readonly bgGrey: this;
222
-
223
- readonly bgBlackBright: this;
224
- readonly bgRedBright: this;
225
- readonly bgGreenBright: this;
226
- readonly bgYellowBright: this;
227
- readonly bgBlueBright: this;
228
- readonly bgMagentaBright: this;
229
- readonly bgCyanBright: this;
230
- readonly bgWhiteBright: this;
231
- }
232
-
233
- /**
234
- Main Chalk object that allows to chain styles together.
235
-
236
- Call the last one as a method with a string argument.
237
-
238
- Order doesn't matter, and later styles take precedent in case of a conflict.
239
-
240
- This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
241
- */
242
- declare const chalk: ChalkInstance;
243
-
244
- export const supportsColor: ColorInfo;
245
-
246
- export const chalkStderr: typeof chalk;
247
- export const supportsColorStderr: typeof supportsColor;
248
-
249
- export {
250
- ModifierName, ForegroundColorName, BackgroundColorName, ColorName,
251
- modifierNames, foregroundColorNames, backgroundColorNames, colorNames,
252
- // } from '#ansi-styles';
253
- } from './vendor/ansi-styles/index.js';
254
-
255
- export {
256
- ColorInfo,
257
- ColorSupport,
258
- ColorSupportLevel,
259
- // } from '#supports-color';
260
- } from './vendor/supports-color/index.js';
261
-
262
- // TODO: Remove these aliases in the next major version
263
- /**
264
- @deprecated Use `ModifierName` instead.
265
-
266
- Basic modifier names.
267
- */
268
- export type Modifiers = ModifierName;
269
-
270
- /**
271
- @deprecated Use `ForegroundColorName` instead.
272
-
273
- Basic foreground color names.
274
-
275
- [More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
276
- */
277
- export type ForegroundColor = ForegroundColorName;
278
-
279
- /**
280
- @deprecated Use `BackgroundColorName` instead.
281
-
282
- Basic background color names.
283
-
284
- [More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
285
- */
286
- export type BackgroundColor = BackgroundColorName;
287
-
288
- /**
289
- @deprecated Use `ColorName` instead.
290
-
291
- Basic color names. The combination of foreground and background color names.
292
-
293
- [More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
294
- */
295
- export type Color = ColorName;
296
-
297
- /**
298
- @deprecated Use `modifierNames` instead.
299
-
300
- Basic modifier names.
301
- */
302
- export const modifiers: readonly Modifiers[];
303
-
304
- /**
305
- @deprecated Use `foregroundColorNames` instead.
306
-
307
- Basic foreground color names.
308
- */
309
- export const foregroundColors: readonly ForegroundColor[];
310
-
311
- /**
312
- @deprecated Use `backgroundColorNames` instead.
313
-
314
- Basic background color names.
315
- */
316
- export const backgroundColors: readonly BackgroundColor[];
317
-
318
- /**
319
- @deprecated Use `colorNames` instead.
320
-
321
- Basic color names. The combination of foreground and background color names.
322
- */
323
- export const colors: readonly Color[];
324
-
325
- export default chalk;
@@ -1,225 +0,0 @@
1
- import ansiStyles from '#ansi-styles';
2
- import supportsColor from '#supports-color';
3
- import { // eslint-disable-line import/order
4
- stringReplaceAll,
5
- stringEncaseCRLFWithFirstIndex,
6
- } from './utilities.js';
7
-
8
- const {stdout: stdoutColor, stderr: stderrColor} = supportsColor;
9
-
10
- const GENERATOR = Symbol('GENERATOR');
11
- const STYLER = Symbol('STYLER');
12
- const IS_EMPTY = Symbol('IS_EMPTY');
13
-
14
- // `supportsColor.level` → `ansiStyles.color[name]` mapping
15
- const levelMapping = [
16
- 'ansi',
17
- 'ansi',
18
- 'ansi256',
19
- 'ansi16m',
20
- ];
21
-
22
- const styles = Object.create(null);
23
-
24
- const applyOptions = (object, options = {}) => {
25
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
26
- throw new Error('The `level` option should be an integer from 0 to 3');
27
- }
28
-
29
- // Detect level if not set manually
30
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
31
- object.level = options.level === undefined ? colorLevel : options.level;
32
- };
33
-
34
- export class Chalk {
35
- constructor(options) {
36
- // eslint-disable-next-line no-constructor-return
37
- return chalkFactory(options);
38
- }
39
- }
40
-
41
- const chalkFactory = options => {
42
- const chalk = (...strings) => strings.join(' ');
43
- applyOptions(chalk, options);
44
-
45
- Object.setPrototypeOf(chalk, createChalk.prototype);
46
-
47
- return chalk;
48
- };
49
-
50
- function createChalk(options) {
51
- return chalkFactory(options);
52
- }
53
-
54
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
55
-
56
- for (const [styleName, style] of Object.entries(ansiStyles)) {
57
- styles[styleName] = {
58
- get() {
59
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
60
- Object.defineProperty(this, styleName, {value: builder});
61
- return builder;
62
- },
63
- };
64
- }
65
-
66
- styles.visible = {
67
- get() {
68
- const builder = createBuilder(this, this[STYLER], true);
69
- Object.defineProperty(this, 'visible', {value: builder});
70
- return builder;
71
- },
72
- };
73
-
74
- const getModelAnsi = (model, level, type, ...arguments_) => {
75
- if (model === 'rgb') {
76
- if (level === 'ansi16m') {
77
- return ansiStyles[type].ansi16m(...arguments_);
78
- }
79
-
80
- if (level === 'ansi256') {
81
- return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
82
- }
83
-
84
- return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
85
- }
86
-
87
- if (model === 'hex') {
88
- return getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));
89
- }
90
-
91
- return ansiStyles[type][model](...arguments_);
92
- };
93
-
94
- const usedModels = ['rgb', 'hex', 'ansi256'];
95
-
96
- for (const model of usedModels) {
97
- styles[model] = {
98
- get() {
99
- const {level} = this;
100
- return function (...arguments_) {
101
- const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);
102
- return createBuilder(this, styler, this[IS_EMPTY]);
103
- };
104
- },
105
- };
106
-
107
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
108
- styles[bgModel] = {
109
- get() {
110
- const {level} = this;
111
- return function (...arguments_) {
112
- const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
113
- return createBuilder(this, styler, this[IS_EMPTY]);
114
- };
115
- },
116
- };
117
- }
118
-
119
- const proto = Object.defineProperties(() => {}, {
120
- ...styles,
121
- level: {
122
- enumerable: true,
123
- get() {
124
- return this[GENERATOR].level;
125
- },
126
- set(level) {
127
- this[GENERATOR].level = level;
128
- },
129
- },
130
- });
131
-
132
- const createStyler = (open, close, parent) => {
133
- let openAll;
134
- let closeAll;
135
- if (parent === undefined) {
136
- openAll = open;
137
- closeAll = close;
138
- } else {
139
- openAll = parent.openAll + open;
140
- closeAll = close + parent.closeAll;
141
- }
142
-
143
- return {
144
- open,
145
- close,
146
- openAll,
147
- closeAll,
148
- parent,
149
- };
150
- };
151
-
152
- const createBuilder = (self, _styler, _isEmpty) => {
153
- // Single argument is hot path, implicit coercion is faster than anything
154
- // eslint-disable-next-line no-implicit-coercion
155
- const builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
156
-
157
- // We alter the prototype because we must return a function, but there is
158
- // no way to create a function with a different prototype
159
- Object.setPrototypeOf(builder, proto);
160
-
161
- builder[GENERATOR] = self;
162
- builder[STYLER] = _styler;
163
- builder[IS_EMPTY] = _isEmpty;
164
-
165
- return builder;
166
- };
167
-
168
- const applyStyle = (self, string) => {
169
- if (self.level <= 0 || !string) {
170
- return self[IS_EMPTY] ? '' : string;
171
- }
172
-
173
- let styler = self[STYLER];
174
-
175
- if (styler === undefined) {
176
- return string;
177
- }
178
-
179
- const {openAll, closeAll} = styler;
180
- if (string.includes('\u001B')) {
181
- while (styler !== undefined) {
182
- // Replace any instances already present with a re-opening code
183
- // otherwise only the part of the string until said closing code
184
- // will be colored, and the rest will simply be 'plain'.
185
- string = stringReplaceAll(string, styler.close, styler.open);
186
-
187
- styler = styler.parent;
188
- }
189
- }
190
-
191
- // We can move both next actions out of loop, because remaining actions in loop won't have
192
- // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
193
- // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
194
- const lfIndex = string.indexOf('\n');
195
- if (lfIndex !== -1) {
196
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
197
- }
198
-
199
- return openAll + string + closeAll;
200
- };
201
-
202
- Object.defineProperties(createChalk.prototype, styles);
203
-
204
- const chalk = createChalk();
205
- export const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
206
-
207
- export {
208
- modifierNames,
209
- foregroundColorNames,
210
- backgroundColorNames,
211
- colorNames,
212
-
213
- // TODO: Remove these aliases in the next major version
214
- modifierNames as modifiers,
215
- foregroundColorNames as foregroundColors,
216
- backgroundColorNames as backgroundColors,
217
- colorNames as colors,
218
- } from './vendor/ansi-styles/index.js';
219
-
220
- export {
221
- stdoutColor as supportsColor,
222
- stderrColor as supportsColorStderr,
223
- };
224
-
225
- export default chalk;
@@ -1,33 +0,0 @@
1
- // TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
2
- export function stringReplaceAll(string, substring, replacer) {
3
- let index = string.indexOf(substring);
4
- if (index === -1) {
5
- return string;
6
- }
7
-
8
- const substringLength = substring.length;
9
- let endIndex = 0;
10
- let returnValue = '';
11
- do {
12
- returnValue += string.slice(endIndex, index) + substring + replacer;
13
- endIndex = index + substringLength;
14
- index = string.indexOf(substring, endIndex);
15
- } while (index !== -1);
16
-
17
- returnValue += string.slice(endIndex);
18
- return returnValue;
19
- }
20
-
21
- export function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
22
- let endIndex = 0;
23
- let returnValue = '';
24
- do {
25
- const gotCR = string[index - 1] === '\r';
26
- returnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
27
- endIndex = index + 1;
28
- index = string.indexOf('\n', endIndex);
29
- } while (index !== -1);
30
-
31
- returnValue += string.slice(endIndex);
32
- return returnValue;
33
- }