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