@alextheman/utility 4.16.2 → 5.0.0

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.
@@ -0,0 +1,562 @@
1
+ import path from "node:path";
2
+ import z from "zod";
3
+ import "libsodium-wrappers";
4
+
5
+ //#region src/node/functions/normalizeImportPath.ts
6
+ /**
7
+ * Normalizes an import path meant for use in an import statement in JavaScript.
8
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.
9
+ *
10
+ * If the path starts with ./, it is preserved (unlike what would happen with path.posix.normalize() normally).
11
+ *
12
+ * Helpful for custom linter rules that need to check (or fix) import paths.
13
+ *
14
+ * @category String Helpers
15
+ *
16
+ * @param importPath - The import path to normalize.
17
+ *
18
+ * @returns The import path normalized.
19
+ */
20
+ function normalizeImportPath(importPath) {
21
+ const normalizedPath = path.posix.normalize(importPath);
22
+ if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) return `./${normalizedPath}`;
23
+ return normalizedPath;
24
+ }
25
+ /**
26
+ * Normalises an import path meant for use in an import statement in JavaScript.
27
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory.
28
+ *
29
+ * If the path starts with ./, it is preserved (unlike what would happen with path.posix.normalize() normally).
30
+ *
31
+ * Helpful for custom linter rules that need to check (or fix) import paths.
32
+ *
33
+ * @category String Helpers
34
+ *
35
+ * @param importPath - The import path to normalise.
36
+ *
37
+ * @returns The import path normalised.
38
+ */
39
+ const normaliseImportPath = normalizeImportPath;
40
+
41
+ //#endregion
42
+ //#region src/root/constants/FILE_PATH_REGEX.ts
43
+ const FILE_PATH_REGEX = String.raw`^(?<directory>.+)[\/\\](?<base>[^\/\\]+)$`;
44
+
45
+ //#endregion
46
+ //#region src/root/constants/VERSION_NUMBER_REGEX.ts
47
+ const VERSION_NUMBER_REGEX = "^(?:v)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$";
48
+
49
+ //#endregion
50
+ //#region src/root/functions/arrayHelpers/fillArray.ts
51
+ /**
52
+ * Creates a new array where each element is the result of the provided callback.
53
+ *
54
+ * If the callback returns at least one Promise, the entire result will be wrapped
55
+ * in a `Promise` and resolved with `Promise.all`. Otherwise, a plain array is returned.
56
+ *
57
+ * @category Array Helpers
58
+ *
59
+ * @template ItemType - The return type of the callback (awaited if any items are a Promise) that becomes the type of the array items.
60
+ *
61
+ * @param callback - A function invoked with the current index. May return a value or a Promise.
62
+ * @param length - The desired length of the resulting array.
63
+ *
64
+ * @returns An array of the callback results, or a Promise resolving to one if the callback is async.
65
+ */
66
+ function fillArray(callback, length = 1) {
67
+ const outputArray = new Array(length).fill(null).map((_, index) => {
68
+ return callback(index);
69
+ });
70
+ if (outputArray.some((item) => {
71
+ return item instanceof Promise;
72
+ })) return Promise.all(outputArray);
73
+ return outputArray;
74
+ }
75
+
76
+ //#endregion
77
+ //#region src/root/functions/arrayHelpers/paralleliseArrays.ts
78
+ /**
79
+ * Creates a new array of tuples, each containing the item at the given index from both arrays.
80
+ *
81
+ * If `secondArray` is shorter than `firstArray`, the second position in the tuple
82
+ * will be `undefined`. Iteration always uses the length of the first array.
83
+ *
84
+ * @category Array Helpers
85
+ *
86
+ * @template FirstArrayItem
87
+ * @template SecondArrayItem
88
+ *
89
+ * @param firstArray - The first array. Each item in this will take up the first tuple spot.
90
+ * @param secondArray - The second array. Each item in this will take up the second tuple spot.
91
+ *
92
+ * @returns An array of `[firstItem, secondItem]` tuples for each index in `firstArray`.
93
+ */
94
+ function paralleliseArrays(firstArray, secondArray) {
95
+ const outputArray = [];
96
+ for (let i = 0; i < firstArray.length; i++) outputArray.push([firstArray[i], secondArray[i]]);
97
+ return outputArray;
98
+ }
99
+
100
+ //#endregion
101
+ //#region src/root/types/DataError.ts
102
+ /**
103
+ * Represents errors you may get that may've been caused by a specific piece of data.
104
+ *
105
+ * @category Types
106
+ *
107
+ * @template DataType - The type of the data that caused the error.
108
+ */
109
+ var DataError = class DataError extends Error {
110
+ code;
111
+ data;
112
+ /**
113
+ * @param data - The data that caused the error.
114
+ * @param code - A standardised code (e.g. UNEXPECTED_DATA).
115
+ * @param message - A human-readable error message (e.g. The data provided is invalid).
116
+ * @param options - Extra options to pass to super Error constructor.
117
+ */
118
+ constructor(data, code = "INVALID_DATA", message = "The data provided is invalid", options) {
119
+ super(message, options);
120
+ if (Error.captureStackTrace) Error.captureStackTrace(this, new.target);
121
+ this.name = new.target.name;
122
+ this.code = code;
123
+ this.data = data;
124
+ Object.defineProperty(this, "message", { enumerable: true });
125
+ Object.setPrototypeOf(this, new.target.prototype);
126
+ }
127
+ /**
128
+ * Checks whether the given input may have been caused by a DataError.
129
+ *
130
+ * @param input - The input to check.
131
+ *
132
+ * @returns `true` if the input is a DataError, and `false` otherwise. The type of the input will also be narrowed down to DataError if `true`.
133
+ */
134
+ static check(input) {
135
+ if (input instanceof DataError) return true;
136
+ const data = input;
137
+ return typeof data === "object" && data !== null && typeof data.message === "string" && typeof data.code === "string" && "data" in data;
138
+ }
139
+ };
140
+
141
+ //#endregion
142
+ //#region src/root/types/VersionNumber.ts
143
+ /**
144
+ * Represents a software version number, considered to be made up of a major, minor, and patch part.
145
+ *
146
+ * @category Types
147
+ */
148
+ var VersionNumber = class VersionNumber {
149
+ static NON_NEGATIVE_TUPLE_ERROR = "Input array must be a tuple of three non-negative integers.";
150
+ /** The major number. Increments when a feature is removed or changed in a way that is not backwards-compatible with the previous release. */
151
+ major = 0;
152
+ /** The minor number. Increments when a new feature is added/deprecated and is expected to be backwards-compatible with the previous release. */
153
+ minor = 0;
154
+ /** The patch number. Increments when the next release is fixing a bug or doing a small refactor that should not be noticeable in practice. */
155
+ patch = 0;
156
+ /**
157
+ * @param input - The input to create a new instance of `VersionNumber` from.
158
+ */
159
+ constructor(input) {
160
+ if (input instanceof VersionNumber) {
161
+ this.major = input.major;
162
+ this.minor = input.minor;
163
+ this.patch = input.patch;
164
+ } else if (typeof input === "string") {
165
+ if (!RegExp(VERSION_NUMBER_REGEX).test(input)) throw new DataError({ input }, "INVALID_VERSION", `"${input}" is not a valid version number. Version numbers must be of the format "X.Y.Z" or "vX.Y.Z", where X, Y, and Z are non-negative integers.`);
166
+ const [major, minor, patch] = VersionNumber.formatString(input, { omitPrefix: true }).split(".").map((number) => {
167
+ return parseIntStrict(number);
168
+ });
169
+ this.major = major;
170
+ this.minor = minor;
171
+ this.patch = patch;
172
+ } else if (Array.isArray(input)) {
173
+ if (input.length !== 3) throw new DataError({ input }, "INVALID_LENGTH", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
174
+ const [major, minor, patch] = input.map((number) => {
175
+ const parsedInteger = parseIntStrict(number?.toString());
176
+ if (parsedInteger < 0) throw new DataError({ input }, "NEGATIVE_INPUTS", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
177
+ return parsedInteger;
178
+ });
179
+ this.major = major;
180
+ this.minor = minor;
181
+ this.patch = patch;
182
+ }
183
+ }
184
+ /**
185
+ * Gets the current version type of the current instance of `VersionNumber`.
186
+ *
187
+ * @returns Either `"major"`, `"minor"`, or `"patch"`, depending on the version type.
188
+ */
189
+ get type() {
190
+ if (this.minor === 0 && this.patch === 0) return VersionType.MAJOR;
191
+ if (this.patch === 0) return VersionType.MINOR;
192
+ return VersionType.PATCH;
193
+ }
194
+ static formatString(input, options) {
195
+ if (options?.omitPrefix) return input.startsWith("v") ? input.slice(1) : input;
196
+ return input.startsWith("v") ? input : `v${input}`;
197
+ }
198
+ /**
199
+ * Checks if the provided version numbers have the exact same major, minor, and patch numbers.
200
+ *
201
+ * @param firstVersion - The first version number to compare.
202
+ * @param secondVersion - The second version number to compare.
203
+ *
204
+ * @returns `true` if the provided version numbers have exactly the same major, minor, and patch numbers, and returns `false` otherwise.
205
+ */
206
+ static isEqual(firstVersion, secondVersion) {
207
+ return firstVersion.major === secondVersion.major && firstVersion.minor === secondVersion.minor && firstVersion.patch === secondVersion.patch;
208
+ }
209
+ /**
210
+ * Get a formatted string representation of the current version number
211
+ *
212
+ * @param options - Options to apply to the string formatting.
213
+ *
214
+ * @returns A formatted string representation of the current version number with the options applied.
215
+ */
216
+ format(options) {
217
+ let baseOutput = `${this.major}`;
218
+ if (!options?.omitMinor) {
219
+ baseOutput += `.${this.minor}`;
220
+ if (!options?.omitPatch) baseOutput += `.${this.patch}`;
221
+ }
222
+ return VersionNumber.formatString(baseOutput, { omitPrefix: options?.omitPrefix });
223
+ }
224
+ /**
225
+ * Increments the current version number by the given increment type, returning the result as a new reference in memory.
226
+ *
227
+ * @param incrementType - The type of increment. Can be one of the following:
228
+ * - `"major"`: Change the major version `v1.2.3` → `v2.0.0`
229
+ * - `"minor"`: Change the minor version `v1.2.3` → `v1.3.0`
230
+ * - `"patch"`: Change the patch version `v1.2.3` → `v1.2.4`
231
+ * @param incrementAmount - The amount to increment by (defaults to 1).
232
+ *
233
+ * @returns A new instance of `VersionNumber` with the increment applied.
234
+ */
235
+ increment(incrementType, incrementAmount = 1) {
236
+ const incrementBy = parseIntStrict(String(incrementAmount));
237
+ const calculatedRawVersion = {
238
+ major: [
239
+ this.major + incrementBy,
240
+ 0,
241
+ 0
242
+ ],
243
+ minor: [
244
+ this.major,
245
+ this.minor + incrementBy,
246
+ 0
247
+ ],
248
+ patch: [
249
+ this.major,
250
+ this.minor,
251
+ this.patch + incrementBy
252
+ ]
253
+ }[incrementType];
254
+ try {
255
+ return new VersionNumber(calculatedRawVersion);
256
+ } catch (error) {
257
+ if (DataError.check(error) && error.code === "NEGATIVE_INPUTS") throw new DataError({
258
+ currentVersion: this.toString(),
259
+ calculatedRawVersion: `v${calculatedRawVersion.join(".")}`,
260
+ incrementAmount
261
+ }, "NEGATIVE_VERSION", "Cannot apply this increment amount as it would lead to a negative version number.");
262
+ else throw error;
263
+ }
264
+ }
265
+ /**
266
+ * Ensures that the VersionNumber behaves correctly when attempted to be coerced to a string.
267
+ *
268
+ * @param hint - Not used as of now, but generally used to help with numeric coercion, I think (which we most likely do not need for version numbers).
269
+ *
270
+ * @returns A stringified representation of the current version number, prefixed with `v`.
271
+ */
272
+ [Symbol.toPrimitive](hint) {
273
+ if (hint === "number") throw new DataError({ thisVersion: this.toString() }, "INVALID_COERCION", "VersionNumber cannot be coerced to a number type.");
274
+ return this.toString();
275
+ }
276
+ /**
277
+ * Ensures that the VersionNumber behaves correctly when attempted to be converted to JSON.
278
+ *
279
+ * @returns A stringified representation of the current version number, prefixed with `v`.
280
+ */
281
+ toJSON() {
282
+ return this.toString();
283
+ }
284
+ /**
285
+ * Get a string representation of the current version number.
286
+ *
287
+ * @returns A stringified representation of the current version number with the prefix.
288
+ */
289
+ toString() {
290
+ const rawString = `${this.major}.${this.minor}.${this.patch}`;
291
+ return VersionNumber.formatString(rawString, { omitPrefix: false });
292
+ }
293
+ };
294
+ const zodVersionNumber = z.union([
295
+ z.string(),
296
+ z.tuple([
297
+ z.number(),
298
+ z.number(),
299
+ z.number()
300
+ ]),
301
+ z.instanceof(VersionNumber)
302
+ ]).transform((rawVersionNumber) => {
303
+ return new VersionNumber(rawVersionNumber);
304
+ });
305
+
306
+ //#endregion
307
+ //#region src/root/functions/parsers/parseIntStrict.ts
308
+ /**
309
+ * Converts a string to an integer and throws an error if it cannot be converted.
310
+ *
311
+ * @category Parsers
312
+ *
313
+ * @param string - A string to convert into a number.
314
+ * @param radix - A value between 2 and 36 that specifies the base of the number in string. If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. All other strings are considered decimal.
315
+ *
316
+ * @throws {DataError} If the provided string cannot safely be converted to an integer.
317
+ *
318
+ * @returns The integer parsed from the input string.
319
+ */
320
+ function parseIntStrict(string, radix) {
321
+ const trimmedString = string.trim();
322
+ const maxAllowedAlphabeticalCharacter = radix && radix > 10 && radix <= 36 ? String.fromCharCode(87 + radix - 1) : void 0;
323
+ if (!(radix && radix > 10 && radix <= 36 ? new RegExp(`^[+-]?[0-9a-${maxAllowedAlphabeticalCharacter}]+$`, "i") : /^[+-]?\d+$/).test(trimmedString)) throw new DataError(radix ? {
324
+ string,
325
+ radix
326
+ } : { string }, "INTEGER_PARSING_ERROR", `Only numeric values${radix && radix > 10 && radix <= 36 ? ` or character${radix !== 11 ? "s" : ""} A${radix !== 11 ? `-${maxAllowedAlphabeticalCharacter?.toUpperCase()} ` : " "}` : " "}are allowed.`);
327
+ if (radix && radix < 10 && [...trimmedString].some((character) => {
328
+ return parseInt(character) >= radix;
329
+ })) throw new DataError({
330
+ string,
331
+ radix
332
+ }, "INTEGER_PARSING_ERROR", "Value contains one or more digits outside of the range of the given radix.");
333
+ const parseIntResult = parseInt(trimmedString, radix);
334
+ if (isNaN(parseIntResult)) throw new DataError({ string }, "INTEGER_PARSING_ERROR", "Value is not a valid integer.");
335
+ return parseIntResult;
336
+ }
337
+
338
+ //#endregion
339
+ //#region src/root/functions/taggedTemplate/interpolate.ts
340
+ /**
341
+ * Returns the result of interpolating a template string when given the strings and interpolations separately.
342
+ *
343
+ * You can pass a template string directly by doing:
344
+ *
345
+ * ```
346
+ * interpolate`Template string here`;
347
+ * ```
348
+ *
349
+ * In this case, it will be functionally the same as if you just wrote the template string by itself.
350
+ *
351
+ * @category Tagged Template
352
+ *
353
+ * @template InterpolationsType - The type of the interpolations.
354
+ *
355
+ * @param strings - The strings from the template to process.
356
+ * @param interpolations - An array of all interpolations from the template.
357
+ *
358
+ * @returns A new string with the strings and interpolations from the template applied.
359
+ */
360
+ function interpolate(strings, ...interpolations) {
361
+ let result = "";
362
+ for (const [string, interpolation = ""] of paralleliseArrays(strings, interpolations)) result += string + interpolation;
363
+ return result;
364
+ }
365
+
366
+ //#endregion
367
+ //#region src/root/functions/taggedTemplate/normaliseIndents.ts
368
+ function calculateTabSize(line, whitespaceLength) {
369
+ const potentialWhitespacePart = line.slice(0, whitespaceLength);
370
+ const trimmedString = line.trimStart();
371
+ if (potentialWhitespacePart.trim() !== "") return 0;
372
+ const tabSize = line.length - (trimmedString.length + whitespaceLength);
373
+ return tabSize < 0 ? 0 : tabSize;
374
+ }
375
+ function getWhitespaceLength(lines) {
376
+ const [firstNonEmptyLine] = lines.filter((line) => {
377
+ return line.trim() !== "";
378
+ });
379
+ return firstNonEmptyLine.length - firstNonEmptyLine.trimStart().length;
380
+ }
381
+ function reduceLines(lines, { preserveTabs = true }) {
382
+ const slicedLines = lines.slice(1);
383
+ const isFirstLineEmpty = lines[0].trim() === "";
384
+ const whitespaceLength = getWhitespaceLength(isFirstLineEmpty ? lines : slicedLines);
385
+ return (isFirstLineEmpty ? slicedLines : lines).map((line) => {
386
+ const tabSize = calculateTabSize(line, whitespaceLength);
387
+ return (preserveTabs ? fillArray(() => {
388
+ return " ";
389
+ }, tabSize).join("") : "") + line.trimStart();
390
+ }).join("\n");
391
+ }
392
+ /**
393
+ * Applies any options if provided, then removes any extraneous indents from a multi-line template string.
394
+ *
395
+ * You can pass a template string directly by doing:
396
+ *
397
+ * ```typescript
398
+ * normaliseIndents`Template string here
399
+ * with a new line
400
+ * and another new line`;
401
+ * ```
402
+ *
403
+ * You may also pass the options first, then invoke the resulting function with a template string:
404
+ *
405
+ * ```typescript
406
+ * normaliseIndents({ preserveTabs: false })`Template string here
407
+ * with a new line
408
+ * and another new line`;
409
+ * ```
410
+ *
411
+ * @category Tagged Template
412
+ *
413
+ * @param first - The strings from the template to process, or the options to apply.
414
+ * @param args - An array of all interpolations from the template.
415
+ *
416
+ * @returns An additional function to invoke, or a new string with the strings and interpolations from the template applied, and extraneous indents removed.
417
+ */
418
+ function normaliseIndents(first, ...args) {
419
+ if (typeof first === "object" && first !== null && !Array.isArray(first)) {
420
+ const options = first;
421
+ return (strings, ...interpolations) => {
422
+ return normaliseIndents(strings, ...interpolations, options);
423
+ };
424
+ }
425
+ const strings = first;
426
+ const options = typeof args[args.length - 1] === "object" && !Array.isArray(args[args.length - 1]) ? args.pop() : {};
427
+ return reduceLines(interpolate(strings, ...[...args]).split("\n"), options);
428
+ }
429
+
430
+ //#endregion
431
+ //#region src/root/functions/miscellaneous/sayHello.ts
432
+ /**
433
+ * Returns a string representing the lyrics to the package's theme song, Commit To You
434
+ *
435
+ * [Pls listen!](https://www.youtube.com/watch?v=mH-Sg-8EnxM)
436
+ *
437
+ * @returns The lyrics string in markdown format.
438
+ */
439
+ function sayHello() {
440
+ return normaliseIndents`
441
+ # Commit To You
442
+
443
+ ### Verse 1
444
+
445
+ I know you've been checking me out,
446
+ Shall we take it to the next level now?
447
+ 'Cause I really wanna be there all for you,
448
+ All for you!
449
+ Come on now, let's make a fresh start!
450
+ Pin my number, then you can take me out!
451
+ Can't you see I really do care about you,
452
+ About you!
453
+
454
+ ### Pre-chorus 1
455
+ Although our calendars are imperfect, at best,
456
+ I'd like to organise time with you! (with you!).
457
+ Just tell me when and I'll make it clear,
458
+ All clear for you,
459
+ All clear for you!
460
+ (One, two, three, go!)
461
+
462
+ ### Chorus
463
+ I wanna be of utility, I'll help you on the run!
464
+ I'll be the one here in the back, while you go have some fun!
465
+ Looking out for you tonight, I'll be the one you can rely on!
466
+ Watch you go and watch me pass by,
467
+ I'll be here!
468
+ I'll commit to you!
469
+
470
+ ### Verse 2
471
+ Though sometimes it won't be easy,
472
+ You'll be here to bring out the best in me,
473
+ And I'll hold myself to high standards for you!
474
+ All for you!
475
+ We'll grow as a pair, you and me,
476
+ We'll build up a healthy dependency,
477
+ You can build with me and I'll develop with you!
478
+ I'm with you!
479
+
480
+ ### Pre-chorus 2
481
+ I'll be with you when you're up or you're down,
482
+ We'll deal with all our problems together (together!)
483
+ Just tell me what you want, I'll make it clear,
484
+ All clear for you,
485
+ All clear for you!
486
+ (One, three, one, go!)
487
+
488
+ ### Chorus
489
+ I wanna be of utility, I'll help you on the run!
490
+ (help you on the run!)
491
+ I'll be the one here in the back, while you go have some fun!
492
+ (you go have some fun!)
493
+ Looking out for you tonight, I'll be the one you can rely on!
494
+ Watch you go and watch me pass by,
495
+ I'll be here!
496
+ I'll commit to you!
497
+
498
+ ### Bridge
499
+ Looking into our stack!
500
+ I'll commit to you!
501
+ We've got a lot to unpack!
502
+ I'll commit to you!
503
+ The environment that we're in!
504
+ I'll commit to you!
505
+ Delicate as a string!
506
+ I'll commit to you!
507
+
508
+ But I think you're my type!
509
+ I'll commit to you!
510
+ Oh, this feels all so right!
511
+ I'll commit to you!
512
+ Nothing stopping us now!
513
+ I'll commit to you!
514
+ Let's show them what we're about!
515
+ Two, three, four, go!
516
+
517
+ ### Final Chorus
518
+ I wanna be of utility, I'll help you on the run!
519
+ (help you on the run!)
520
+ I'll be the one here in the back, while you go have some fun!
521
+ (you go have some fun!)
522
+ Looking out for you tonight, I'll be the one you can rely on!
523
+ Watch you go and watch me pass by,
524
+ I'll be here!
525
+ I'll commit to you!
526
+
527
+ I wanna be of utility, I'll help you on the run!
528
+ (I'll commit to you!)
529
+ I'll be the one here in the back, while you go have some fun!
530
+ (I'll commit to you!)
531
+ Looking out for you tonight, I'll be the one you can rely on!
532
+ (I'll commit to you!)
533
+ Watch you go and watch me pass by,
534
+ (I'll commit to you!)
535
+ I'll be here!
536
+
537
+ ### Outro
538
+ I'll commit to you!
539
+ I'll commit to you!
540
+ I'll commit to you!
541
+ `;
542
+ }
543
+
544
+ //#endregion
545
+ //#region src/root/functions/parsers/parseVersionType.ts
546
+ /**
547
+ * Represents the three common software version types.
548
+ *
549
+ * @category Types
550
+ */
551
+ const VersionType = {
552
+ MAJOR: "major",
553
+ MINOR: "minor",
554
+ PATCH: "patch"
555
+ };
556
+
557
+ //#endregion
558
+ //#region src/node/functions/sayHello.ts
559
+ var sayHello_default = sayHello;
560
+
561
+ //#endregion
562
+ export { normaliseImportPath, normalizeImportPath, sayHello_default as sayHello };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "4.16.2",
3
+ "version": "5.0.0",
4
4
  "description": "Helpful utility functions.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,16 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "import": "./dist/index.js",
16
16
  "require": "./dist/index.cjs"
17
+ },
18
+ "./internal": {
19
+ "types": "./dist/internal/index.d.ts",
20
+ "import": "./dist/internal/index.js",
21
+ "require": "./dist/internal/index.cjs"
22
+ },
23
+ "./node": {
24
+ "types": "./dist/node/index.d.ts",
25
+ "import": "./dist/node/index.js",
26
+ "require": "./dist/node/index.cjs"
17
27
  }
18
28
  },
19
29
  "files": [
@@ -21,6 +31,7 @@
21
31
  ],
22
32
  "dependencies": {
23
33
  "dotenv": "^17.3.1",
34
+ "execa": "^9.6.1",
24
35
  "libsodium-wrappers": "^0.8.2",
25
36
  "zod": "^4.3.6"
26
37
  },
@@ -30,7 +41,6 @@
30
41
  "alex-c-line": "^1.26.2",
31
42
  "dotenv-cli": "^11.0.0",
32
43
  "eslint": "^10.0.0",
33
- "execa": "^9.6.1",
34
44
  "globals": "^17.3.0",
35
45
  "husky": "^9.1.7",
36
46
  "jsdom": "^28.0.0",
@@ -68,7 +78,7 @@
68
78
  "prepare-live-eslint-plugin": "pnpm uninstall @alextheman/eslint-plugin && pnpm install --save-dev @alextheman/eslint-plugin",
69
79
  "prepare-local-eslint-plugin": "dotenv -e .env -- sh -c 'ESLINT_PLUGIN_PATH=${LOCAL_ESLINT_PLUGIN_PATH:-../eslint-plugin}; pnpm --prefix \"$ESLINT_PLUGIN_PATH\" run build && pnpm uninstall @alextheman/eslint-plugin && pnpm install --save-dev file:\"$ESLINT_PLUGIN_PATH\"'",
70
80
  "test": "vitest run",
71
- "test-end-to-end": "RUN_END_TO_END=true vitest run tests/end-to-end",
81
+ "test-end-to-end": "RUN_END_TO_END=true vitest run tests/end-to-end --reporter verbose",
72
82
  "test-watch": "vitest",
73
83
  "update-dependencies": "pnpm update --latest && pnpm update",
74
84
  "use-live-eslint-plugin": "pnpm run prepare-live-eslint-plugin && pnpm run lint",