@alextheman/utility 4.3.1 → 4.3.3

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.
package/README.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @alextheman/utility
2
2
 
3
+ ![npm version](https://img.shields.io/npm/v/@alextheman/utility)
4
+ ![npm downloads](https://img.shields.io/npm/dm/@alextheman/utility)
5
+ ![npm license](https://img.shields.io/npm/l/@alextheman/utility)
6
+
7
+ [![CI](https://github.com/AlexMan123456/utility/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexMan123456/utility/actions/workflows/ci.yml)
8
+ [![Publish to NPM Registry](https://github.com/AlexMan123456/utility/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/AlexMan123456/utility/actions/workflows/npm-publish.yml)
9
+ [![Publish to Netlify](https://github.com/AlexMan123456/utility/actions/workflows/netlify-docs-publish.yml/badge.svg)](https://github.com/AlexMan123456/utility/actions/workflows/netlify-docs-publish.yml)
10
+
11
+ [![Netlify Status](https://api.netlify.com/api/v1/badges/74fd3eaf-3002-472b-ae5e-2bd0ab984b9e/deploy-status)](https://app.netlify.com/projects/alextheman-utility-docs/deploys)
12
+
13
+
3
14
  This is my personal utility package. It provides custom utility functions that can be used in more or less any TypeScript or JavaScript project, using either the browser or Node environment.
4
15
 
5
16
  ## Installation
@@ -24,3 +35,9 @@ import { formatDateAndTime } from "@alextheman/utility";
24
35
  const myVariable: NonUndefined<string> = formatDateAndTime(new Date());
25
36
  // ...
26
37
  ```
38
+
39
+ ## Documentation
40
+
41
+ You can find the relevant documentation of all features of the package in the [docs/features/markdown](https://github.com/AlexMan123456/utility/tree/main/docs/features/markdown) directory of the repository. The hosted documentation site can be found [here](https://alextheman-utility-docs.netlify.app/).
42
+
43
+ See the GitHub repository [here](https://github.com/AlexMan123456/utility).
package/dist/index.cjs CHANGED
@@ -175,19 +175,6 @@ var DataError = class extends Error {
175
175
  };
176
176
  var DataError_default = DataError;
177
177
 
178
- //#endregion
179
- //#region src/types/VersionType.ts
180
- /**
181
- * Represents the three common software version types.
182
- *
183
- * @category Types
184
- */
185
- const VersionType = {
186
- MAJOR: "major",
187
- MINOR: "minor",
188
- PATCH: "patch"
189
- };
190
-
191
178
  //#endregion
192
179
  //#region src/types/VersionNumber.ts
193
180
  /**
@@ -834,11 +821,16 @@ var parseZodSchema_default = parseZodSchema;
834
821
 
835
822
  //#endregion
836
823
  //#region src/functions/parsers/parseEnv.ts
837
- const envSchema = zod.z.enum([
838
- "test",
839
- "development",
840
- "production"
841
- ]);
824
+ /**
825
+ * Represents the three common development environments.
826
+ *
827
+ * @category Types
828
+ */
829
+ const Env = {
830
+ TEST: "test",
831
+ DEVELOPMENT: "development",
832
+ PRODUCTION: "production"
833
+ };
842
834
  /**
843
835
  * Parses the input and verifies it matches one of the environments allowed by the Env types ("test" | "development" | "production").
844
836
  *
@@ -851,7 +843,7 @@ const envSchema = zod.z.enum([
851
843
  * @returns The specified environment if allowed.
852
844
  */
853
845
  function parseEnv(data) {
854
- return parseZodSchema_default(envSchema, data, new DataError_default(data, "INVALID_ENV", "The provided environment type must be one of `test | development | production`"));
846
+ return parseZodSchema_default(zod.z.enum(Env), data, new DataError_default(data, "INVALID_ENV", "The provided environment type must be one of `test | development | production`"));
855
847
  }
856
848
  var parseEnv_default = parseEnv;
857
849
 
@@ -882,6 +874,16 @@ var parseFormData_default = parseFormData;
882
874
  //#endregion
883
875
  //#region src/functions/parsers/parseVersionType.ts
884
876
  /**
877
+ * Represents the three common software version types.
878
+ *
879
+ * @category Types
880
+ */
881
+ const VersionType = {
882
+ MAJOR: "major",
883
+ MINOR: "minor",
884
+ PATCH: "patch"
885
+ };
886
+ /**
885
887
  * Parses the input and verifies it is a valid software version type (i.e. `"major" | "minor" | "patch"`)
886
888
  *
887
889
  * @category Parsers
@@ -1123,6 +1125,28 @@ function createTemplateStringsArray(strings) {
1123
1125
  }
1124
1126
  var createTemplateStringsArray_default = createTemplateStringsArray;
1125
1127
 
1128
+ //#endregion
1129
+ //#region src/functions/taggedTemplate/getInterpolations.ts
1130
+ /**
1131
+ * Gets the strings and interpolations separately from a template string.
1132
+ * You can pass a template string directly by doing:
1133
+ *
1134
+ * ```typescript
1135
+ * getInterpolations`Template string here`.
1136
+ * ```
1137
+ *
1138
+ * @category Tagged Template
1139
+ *
1140
+ * @param strings - The strings from the template to process.
1141
+ * @param interpolations - An array of all interpolations from the template.
1142
+ *
1143
+ * @returns A tuple where the first item is the strings from the template, and the second is the interpolations.
1144
+ */
1145
+ function getInterpolations(strings, ...interpolations) {
1146
+ return [strings, interpolations];
1147
+ }
1148
+ var getInterpolations_default = getInterpolations;
1149
+
1126
1150
  //#endregion
1127
1151
  //#region src/functions/taggedTemplate/interpolate.ts
1128
1152
  /**
@@ -1130,7 +1154,9 @@ var createTemplateStringsArray_default = createTemplateStringsArray;
1130
1154
  *
1131
1155
  * You can pass a template string directly by doing:
1132
1156
  *
1133
- * interpolate`Template string here`.
1157
+ * ```
1158
+ * interpolate`Template string here`.
1159
+ * ```
1134
1160
  *
1135
1161
  * In this case, it will be functionally the same as if you just wrote the template string by itself.
1136
1162
  *
@@ -1155,7 +1181,9 @@ var interpolate_default = interpolate;
1155
1181
  *
1156
1182
  * You can pass a template string directly by doing:
1157
1183
  *
1158
- * interpolateObjects`Template string here ${{ my: "object" }}`.
1184
+ * ```typescript
1185
+ * interpolateObjects`Template string here ${{ my: "object" }}`.
1186
+ * ```
1159
1187
  *
1160
1188
  * @category Tagged Template
1161
1189
  *
@@ -1205,15 +1233,19 @@ function reduceLines(lines, { preserveTabs = true }) {
1205
1233
  *
1206
1234
  * You can pass a template string directly by doing:
1207
1235
  *
1208
- * normaliseIndents`Template string here
1209
- * with a new line
1210
- * and another new line`.
1236
+ * ```typescript
1237
+ * normaliseIndents`Template string here
1238
+ * with a new line
1239
+ * and another new line`.
1240
+ * ```
1211
1241
  *
1212
1242
  * You may also pass the options first, then invoke the resulting function with a template string:
1213
1243
  *
1214
- * normaliseIndents({ preserveTabs: false })`Template string here
1215
- * with a new line
1216
- * and another new line`.
1244
+ * ```typescript
1245
+ * normaliseIndents({ preserveTabs: false })`Template string here
1246
+ * with a new line
1247
+ * and another new line`.
1248
+ * ```
1217
1249
  *
1218
1250
  *@category Tagged Template
1219
1251
  *
@@ -1238,15 +1270,19 @@ function normaliseIndents(first, ...args) {
1238
1270
  *
1239
1271
  * You can pass a template string directly by doing:
1240
1272
  *
1241
- * normalizeIndents`Template string here
1242
- * with a new line
1243
- * and another new line`.
1273
+ * ```typescript
1274
+ * normalizeIndents`Template string here
1275
+ * with a new line
1276
+ * and another new line`.
1277
+ * ```
1244
1278
  *
1245
1279
  * You may also pass the options first, then invoke the resulting function with a template string:
1246
1280
  *
1247
- * normalizeIndents({ preserveTabs: false })`Template string here
1248
- * with a new line
1249
- * and another new line`.
1281
+ * ```typescript
1282
+ * normalizeIndents({ preserveTabs: false })`Template string here
1283
+ * with a new line
1284
+ * and another new line`.
1285
+ * ```
1250
1286
  *
1251
1287
  * @param first - The strings from the template to process, or the options to apply.
1252
1288
  * @param args - An array of all interpolations from the template.
@@ -1351,6 +1387,7 @@ var incrementVersion_default = incrementVersion;
1351
1387
  //#endregion
1352
1388
  exports.APIError = APIError_default;
1353
1389
  exports.DataError = DataError_default;
1390
+ exports.Env = Env;
1354
1391
  exports.NAMESPACE_EXPORT_REGEX = NAMESPACE_EXPORT_REGEX_default;
1355
1392
  exports.VERSION_NUMBER_REGEX = VERSION_NUMBER_REGEX_default;
1356
1393
  exports.VersionNumber = VersionNumber_default;
@@ -1367,6 +1404,7 @@ exports.determineVersionType = determineVersionType_default;
1367
1404
  exports.fillArray = fillArray_default;
1368
1405
  exports.formatDateAndTime = formatDateAndTime_default;
1369
1406
  exports.getIndividualVersionNumbers = getIndividualVersionNumbers_default;
1407
+ exports.getInterpolations = getInterpolations_default;
1370
1408
  exports.getRandomNumber = getRandomNumber_default;
1371
1409
  exports.getRecordKeys = getRecordKeys_default;
1372
1410
  exports.httpErrorCodeLookup = httpErrorCodeLookup;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ZodType, core, z } from "zod";
1
+ import { ZodType, core } from "zod";
2
2
 
3
3
  //#region src/constants/NAMESPACE_EXPORT_REGEX.d.ts
4
4
  declare const NAMESPACE_EXPORT_REGEX = "export\\s+\\*\\s+from";
@@ -252,39 +252,14 @@ declare class DataError extends Error {
252
252
  static check(input: unknown): input is DataError;
253
253
  }
254
254
  //#endregion
255
- //#region src/types/RecordKey.d.ts
256
- /**
257
- * Represents the native Record's possible key type.
258
- *
259
- * @category Types
260
- */
261
- type RecordKey = string | number | symbol;
262
- //#endregion
263
- //#region src/types/CreateEnumType.d.ts
264
- /**
265
- * Get the value types from a const object so the object can behave similarly to an enum.
266
- *
267
- * @category Types
268
- *
269
- * @template ObjectType - The type of the object to get the value types for.
270
- */
271
- type CreateEnumType<ObjectType extends Record<RecordKey, unknown>> = ObjectType[keyof ObjectType];
272
- //#endregion
273
- //#region src/types/VersionType.d.ts
255
+ //#region src/types/VersionNumber.d.ts
274
256
  /**
275
- * Represents the three common software version types.
257
+ * Options to apply to the stringification of the version number.
276
258
  *
277
- * @category Types
259
+ * @category Class Options
278
260
  */
279
- declare const VersionType: {
280
- readonly MAJOR: "major";
281
- readonly MINOR: "minor";
282
- readonly PATCH: "patch";
283
- };
284
- type VersionType = CreateEnumType<typeof VersionType>;
285
- //#endregion
286
- //#region src/types/VersionNumber.d.ts
287
- interface ToStringOptions {
261
+ interface VersionNumberToStringOptions {
262
+ /** Whether you want to omit the "v" prefix or not (defaults to false). */
288
263
  omitPrefix?: boolean;
289
264
  }
290
265
  /**
@@ -338,7 +313,7 @@ declare class VersionNumber {
338
313
  *
339
314
  * @returns A stringified representation of the current version number, leaving out the prefix if `omitPrefix` option was set to true.
340
315
  */
341
- toString(options?: ToStringOptions): string;
316
+ toString(options?: VersionNumberToStringOptions): string;
342
317
  }
343
318
  //#endregion
344
319
  //#region src/types/ArrayElement.d.ts
@@ -351,6 +326,24 @@ declare class VersionNumber {
351
326
  */
352
327
  type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
353
328
  //#endregion
329
+ //#region src/types/RecordKey.d.ts
330
+ /**
331
+ * Represents the native Record's possible key type.
332
+ *
333
+ * @category Types
334
+ */
335
+ type RecordKey = string | number | symbol;
336
+ //#endregion
337
+ //#region src/types/CreateEnumType.d.ts
338
+ /**
339
+ * Get the value types from a const object so the object can behave similarly to an enum.
340
+ *
341
+ * @category Types
342
+ *
343
+ * @template ObjectType - The type of the object to get the value types for.
344
+ */
345
+ type CreateEnumType<ObjectType extends Record<RecordKey, unknown>> = ObjectType[keyof ObjectType];
346
+ //#endregion
354
347
  //#region src/types/DisallowUndefined.d.ts
355
348
  /**
356
349
  * Resolves to an error message type if the type argument could potentially be undefined.
@@ -395,10 +388,24 @@ type OptionalOnCondition<Condition extends boolean, ResolvedTypeIfTrue> = Condit
395
388
  //#region src/functions/miscellaneous/createFormData.d.ts
396
389
  type FormDataNullableResolutionStrategy = "stringify" | "empty" | "omit";
397
390
  type FormDataArrayResolutionStrategy = "stringify" | "multiple";
391
+ /**
392
+ * Base options for resolving form data.
393
+ *
394
+ * @category Function Options
395
+ *
396
+ * @template Key - The type of the key of the input record.
397
+ */
398
398
  interface CreateFormDataOptionsBase<Key extends RecordKey> {
399
399
  /** How to resolve any arrays provided in the data (can either stringify them or add them multiple times). */
400
400
  arrayResolution?: FormDataArrayResolutionStrategy | Partial<Record<Key, FormDataArrayResolutionStrategy>>;
401
401
  }
402
+ /**
403
+ * Options for resolving form data when it may be undefined or null, but not both.
404
+ *
405
+ * @category Function Options
406
+ *
407
+ * @template Key - The type of the key of the input record.
408
+ */
402
409
  interface CreateFormDataOptionsUndefinedOrNullResolution<Key extends RecordKey> extends CreateFormDataOptionsBase<Key> {
403
410
  /** How to resolve undefined data (May either stringify to 'undefined', resolve to an empty string, or omit entirely). */
404
411
  undefinedResolution?: FormDataNullableResolutionStrategy | Partial<Record<Key, FormDataNullableResolutionStrategy>>;
@@ -407,6 +414,13 @@ interface CreateFormDataOptionsUndefinedOrNullResolution<Key extends RecordKey>
407
414
  /** @note This must not be provided at the same time as undefinedResolution and/or nullResolution. */
408
415
  nullableResolution?: never;
409
416
  }
417
+ /**
418
+ * Options for resolving form data when it may be nullable, but not both.
419
+ *
420
+ * @category Function Options
421
+ *
422
+ * @template Key - The type of the key of the input record.
423
+ */
410
424
  interface CreateFormDataOptionsNullableResolution<Key extends RecordKey> extends CreateFormDataOptionsBase<Key> {
411
425
  /** @note This must not be provided at the same time as nullableResolution. */
412
426
  undefinedResolution?: never;
@@ -415,6 +429,13 @@ interface CreateFormDataOptionsNullableResolution<Key extends RecordKey> extends
415
429
  /** How to resolve nullable data (May either stringify to 'undefined | null', resolve to an empty string, or omit entirely). */
416
430
  nullableResolution: FormDataNullableResolutionStrategy | Partial<Record<Key, FormDataNullableResolutionStrategy>>;
417
431
  }
432
+ /**
433
+ * Options for resolving form data.
434
+ *
435
+ * @category Function Options
436
+ *
437
+ * @template Key - The type of the key of the input record.
438
+ */
418
439
  type CreateFormDataOptions<Key extends RecordKey> = CreateFormDataOptionsUndefinedOrNullResolution<Key> | CreateFormDataOptionsNullableResolution<Key>;
419
440
  /**
420
441
  * Creates FormData from a given object, resolving non-string types as appropriate.
@@ -456,6 +477,11 @@ declare function getRandomNumber(lowerBound: number, upperBound: number): number
456
477
  declare function isOrdered(array: readonly number[]): boolean;
457
478
  //#endregion
458
479
  //#region src/functions/miscellaneous/stringListToArray.d.ts
480
+ /**
481
+ * Options to apply to the conversion of a string list to an array.
482
+ *
483
+ * @category Function Options
484
+ */
459
485
  interface StringListToArrayOptions {
460
486
  /** What each item in the list is separated by. */
461
487
  separator?: string;
@@ -536,17 +562,17 @@ declare function omitProperties<ObjectType extends Record<string, unknown> | Rea
536
562
  declare function parseBoolean(inputString: string): boolean;
537
563
  //#endregion
538
564
  //#region src/functions/parsers/parseEnv.d.ts
539
- declare const envSchema: z.ZodEnum<{
540
- test: "test";
541
- development: "development";
542
- production: "production";
543
- }>;
544
565
  /**
545
- * Represents the most common development environments
566
+ * Represents the three common development environments.
546
567
  *
547
568
  * @category Types
548
569
  */
549
- type Env = z.infer<typeof envSchema>;
570
+ declare const Env: {
571
+ TEST: string;
572
+ DEVELOPMENT: string;
573
+ PRODUCTION: string;
574
+ };
575
+ type Env = CreateEnumType<typeof Env>;
550
576
  /**
551
577
  * Parses the input and verifies it matches one of the environments allowed by the Env types ("test" | "development" | "production").
552
578
  *
@@ -597,6 +623,17 @@ declare function parseFormData(formData: FormData): Record<string, string | Blob
597
623
  declare function parseIntStrict(string: string, radix?: number): number;
598
624
  //#endregion
599
625
  //#region src/functions/parsers/parseVersionType.d.ts
626
+ /**
627
+ * Represents the three common software version types.
628
+ *
629
+ * @category Types
630
+ */
631
+ declare const VersionType: {
632
+ readonly MAJOR: "major";
633
+ readonly MINOR: "minor";
634
+ readonly PATCH: "patch";
635
+ };
636
+ type VersionType = CreateEnumType<typeof VersionType>;
600
637
  /**
601
638
  * Parses the input and verifies it is a valid software version type (i.e. `"major" | "minor" | "patch"`)
602
639
  *
@@ -677,6 +714,11 @@ declare function deepFreeze<ObjectType extends object>(object: ObjectType): Read
677
714
  declare function appendSemicolon(stringToAppendTo: string): string;
678
715
  //#endregion
679
716
  //#region src/functions/stringHelpers/camelToKebab.d.ts
717
+ /**
718
+ * Options to apply to the conversion from camelCase to kebab-case
719
+ *
720
+ * @category Function Options
721
+ */
680
722
  interface CamelToKebabOptions {
681
723
  /** Whether to leave consecutive capitals alone in the conversion or not (e.g. `validateAPIUser` becomes `validate-a-p-i-user` if `false`, and `validate-api-user` if `true`) */
682
724
  preserveConsecutiveCapitals?: boolean;
@@ -694,6 +736,11 @@ interface CamelToKebabOptions {
694
736
  declare function camelToKebab(string: string, options?: CamelToKebabOptions): string;
695
737
  //#endregion
696
738
  //#region src/functions/stringHelpers/kebabToCamel.d.ts
739
+ /**
740
+ * Options to apply to the conversion from kebab-case to camelCase
741
+ *
742
+ * @category Function Options
743
+ */
697
744
  interface KebabToCamelOptions {
698
745
  /** Whether or not the converted string should start with an uppercase (e.g. CamelCase instead of camelCase). */
699
746
  startWithUpper?: boolean;
@@ -767,13 +814,33 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
767
814
  */
768
815
  declare function createTemplateStringsArray(strings: readonly string[]): TemplateStringsArray;
769
816
  //#endregion
817
+ //#region src/functions/taggedTemplate/getInterpolations.d.ts
818
+ /**
819
+ * Gets the strings and interpolations separately from a template string.
820
+ * You can pass a template string directly by doing:
821
+ *
822
+ * ```typescript
823
+ * getInterpolations`Template string here`.
824
+ * ```
825
+ *
826
+ * @category Tagged Template
827
+ *
828
+ * @param strings - The strings from the template to process.
829
+ * @param interpolations - An array of all interpolations from the template.
830
+ *
831
+ * @returns A tuple where the first item is the strings from the template, and the second is the interpolations.
832
+ */
833
+ declare function getInterpolations(strings: TemplateStringsArray, ...interpolations: unknown[]): [TemplateStringsArray, unknown[]];
834
+ //#endregion
770
835
  //#region src/functions/taggedTemplate/interpolate.d.ts
771
836
  /**
772
837
  * Returns the result of interpolating a template string when given the strings and interpolations separately.
773
838
  *
774
839
  * You can pass a template string directly by doing:
775
840
  *
776
- * interpolate`Template string here`.
841
+ * ```
842
+ * interpolate`Template string here`.
843
+ * ```
777
844
  *
778
845
  * In this case, it will be functionally the same as if you just wrote the template string by itself.
779
846
  *
@@ -792,7 +859,9 @@ declare function interpolate(strings: TemplateStringsArray, ...interpolations: u
792
859
  *
793
860
  * You can pass a template string directly by doing:
794
861
  *
795
- * interpolateObjects`Template string here ${{ my: "object" }}`.
862
+ * ```typescript
863
+ * interpolateObjects`Template string here ${{ my: "object" }}`.
864
+ * ```
796
865
  *
797
866
  * @category Tagged Template
798
867
  *
@@ -804,6 +873,11 @@ declare function interpolate(strings: TemplateStringsArray, ...interpolations: u
804
873
  declare function interpolateObjects(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
805
874
  //#endregion
806
875
  //#region src/functions/taggedTemplate/normaliseIndents.d.ts
876
+ /**
877
+ * Options to apply to the normalisation of indents in multi-line template strings
878
+ *
879
+ * @category Function Options
880
+ */
807
881
  interface NormaliseIndentsOptions {
808
882
  /** Whether to preserve extra tabs or not (defaults to true) */
809
883
  preserveTabs?: boolean;
@@ -826,9 +900,11 @@ declare function normaliseIndents(options: NormaliseIndentsOptions): NormaliseIn
826
900
  *
827
901
  * You can pass a template string directly by doing:
828
902
  *
829
- * normaliseIndents`Template string here
830
- * with a new line
831
- * and another new line`.
903
+ * ```typescript
904
+ * normaliseIndents`Template string here
905
+ * with a new line
906
+ * and another new line`.
907
+ * ```
832
908
  *
833
909
  *@category Tagged Template
834
910
  *
@@ -843,15 +919,19 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
843
919
  *
844
920
  * You can pass a template string directly by doing:
845
921
  *
846
- * normalizeIndents`Template string here
847
- * with a new line
848
- * and another new line`.
922
+ * ```typescript
923
+ * normalizeIndents`Template string here
924
+ * with a new line
925
+ * and another new line`.
926
+ * ```
849
927
  *
850
928
  * You may also pass the options first, then invoke the resulting function with a template string:
851
929
  *
852
- * normalizeIndents({ preserveTabs: false })`Template string here
853
- * with a new line
854
- * and another new line`.
930
+ * ```typescript
931
+ * normalizeIndents({ preserveTabs: false })`Template string here
932
+ * with a new line
933
+ * and another new line`.
934
+ * ```
855
935
  *
856
936
  * @param first - The strings from the template to process, or the options to apply.
857
937
  * @param args - An array of all interpolations from the template.
@@ -931,4 +1011,4 @@ interface ParseVersionOptions {
931
1011
  */
932
1012
  declare function parseVersion(input: string, options?: ParseVersionOptions): string;
933
1013
  //#endregion
934
- export { APIError, ArrayElement, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, IncrementVersionOptions, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, ParseVersionOptions, RecordKey, StringListToArrayOptions, VERSION_NUMBER_REGEX, VersionNumber, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, determineVersionType, fillArray, formatDateAndTime, getIndividualVersionNumbers, getRandomNumber, getRecordKeys, httpErrorCodeLookup, incrementVersion, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersion, parseVersionType, parseZodSchema, randomiseArray, range, removeDuplicates, stringListToArray, truncate, wait };
1014
+ export { APIError, ArrayElement, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, IncrementVersionOptions, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, ParallelTuple, ParseVersionOptions, RecordKey, StringListToArrayOptions, VERSION_NUMBER_REGEX, VersionNumber, VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, determineVersionType, fillArray, formatDateAndTime, getIndividualVersionNumbers, getInterpolations, getRandomNumber, getRecordKeys, httpErrorCodeLookup, incrementVersion, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersion, parseVersionType, parseZodSchema, randomiseArray, range, removeDuplicates, stringListToArray, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ZodType, core, z as z$1 } from "zod";
1
+ import { ZodType, core } from "zod";
2
2
 
3
3
  //#region src/constants/NAMESPACE_EXPORT_REGEX.d.ts
4
4
  declare const NAMESPACE_EXPORT_REGEX = "export\\s+\\*\\s+from";
@@ -252,39 +252,14 @@ declare class DataError extends Error {
252
252
  static check(input: unknown): input is DataError;
253
253
  }
254
254
  //#endregion
255
- //#region src/types/RecordKey.d.ts
256
- /**
257
- * Represents the native Record's possible key type.
258
- *
259
- * @category Types
260
- */
261
- type RecordKey = string | number | symbol;
262
- //#endregion
263
- //#region src/types/CreateEnumType.d.ts
264
- /**
265
- * Get the value types from a const object so the object can behave similarly to an enum.
266
- *
267
- * @category Types
268
- *
269
- * @template ObjectType - The type of the object to get the value types for.
270
- */
271
- type CreateEnumType<ObjectType extends Record<RecordKey, unknown>> = ObjectType[keyof ObjectType];
272
- //#endregion
273
- //#region src/types/VersionType.d.ts
255
+ //#region src/types/VersionNumber.d.ts
274
256
  /**
275
- * Represents the three common software version types.
257
+ * Options to apply to the stringification of the version number.
276
258
  *
277
- * @category Types
259
+ * @category Class Options
278
260
  */
279
- declare const VersionType: {
280
- readonly MAJOR: "major";
281
- readonly MINOR: "minor";
282
- readonly PATCH: "patch";
283
- };
284
- type VersionType = CreateEnumType<typeof VersionType>;
285
- //#endregion
286
- //#region src/types/VersionNumber.d.ts
287
- interface ToStringOptions {
261
+ interface VersionNumberToStringOptions {
262
+ /** Whether you want to omit the "v" prefix or not (defaults to false). */
288
263
  omitPrefix?: boolean;
289
264
  }
290
265
  /**
@@ -338,7 +313,7 @@ declare class VersionNumber {
338
313
  *
339
314
  * @returns A stringified representation of the current version number, leaving out the prefix if `omitPrefix` option was set to true.
340
315
  */
341
- toString(options?: ToStringOptions): string;
316
+ toString(options?: VersionNumberToStringOptions): string;
342
317
  }
343
318
  //#endregion
344
319
  //#region src/types/ArrayElement.d.ts
@@ -351,6 +326,24 @@ declare class VersionNumber {
351
326
  */
352
327
  type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
353
328
  //#endregion
329
+ //#region src/types/RecordKey.d.ts
330
+ /**
331
+ * Represents the native Record's possible key type.
332
+ *
333
+ * @category Types
334
+ */
335
+ type RecordKey = string | number | symbol;
336
+ //#endregion
337
+ //#region src/types/CreateEnumType.d.ts
338
+ /**
339
+ * Get the value types from a const object so the object can behave similarly to an enum.
340
+ *
341
+ * @category Types
342
+ *
343
+ * @template ObjectType - The type of the object to get the value types for.
344
+ */
345
+ type CreateEnumType<ObjectType extends Record<RecordKey, unknown>> = ObjectType[keyof ObjectType];
346
+ //#endregion
354
347
  //#region src/types/DisallowUndefined.d.ts
355
348
  /**
356
349
  * Resolves to an error message type if the type argument could potentially be undefined.
@@ -395,10 +388,24 @@ type OptionalOnCondition<Condition extends boolean, ResolvedTypeIfTrue> = Condit
395
388
  //#region src/functions/miscellaneous/createFormData.d.ts
396
389
  type FormDataNullableResolutionStrategy = "stringify" | "empty" | "omit";
397
390
  type FormDataArrayResolutionStrategy = "stringify" | "multiple";
391
+ /**
392
+ * Base options for resolving form data.
393
+ *
394
+ * @category Function Options
395
+ *
396
+ * @template Key - The type of the key of the input record.
397
+ */
398
398
  interface CreateFormDataOptionsBase<Key extends RecordKey> {
399
399
  /** How to resolve any arrays provided in the data (can either stringify them or add them multiple times). */
400
400
  arrayResolution?: FormDataArrayResolutionStrategy | Partial<Record<Key, FormDataArrayResolutionStrategy>>;
401
401
  }
402
+ /**
403
+ * Options for resolving form data when it may be undefined or null, but not both.
404
+ *
405
+ * @category Function Options
406
+ *
407
+ * @template Key - The type of the key of the input record.
408
+ */
402
409
  interface CreateFormDataOptionsUndefinedOrNullResolution<Key extends RecordKey> extends CreateFormDataOptionsBase<Key> {
403
410
  /** How to resolve undefined data (May either stringify to 'undefined', resolve to an empty string, or omit entirely). */
404
411
  undefinedResolution?: FormDataNullableResolutionStrategy | Partial<Record<Key, FormDataNullableResolutionStrategy>>;
@@ -407,6 +414,13 @@ interface CreateFormDataOptionsUndefinedOrNullResolution<Key extends RecordKey>
407
414
  /** @note This must not be provided at the same time as undefinedResolution and/or nullResolution. */
408
415
  nullableResolution?: never;
409
416
  }
417
+ /**
418
+ * Options for resolving form data when it may be nullable, but not both.
419
+ *
420
+ * @category Function Options
421
+ *
422
+ * @template Key - The type of the key of the input record.
423
+ */
410
424
  interface CreateFormDataOptionsNullableResolution<Key extends RecordKey> extends CreateFormDataOptionsBase<Key> {
411
425
  /** @note This must not be provided at the same time as nullableResolution. */
412
426
  undefinedResolution?: never;
@@ -415,6 +429,13 @@ interface CreateFormDataOptionsNullableResolution<Key extends RecordKey> extends
415
429
  /** How to resolve nullable data (May either stringify to 'undefined | null', resolve to an empty string, or omit entirely). */
416
430
  nullableResolution: FormDataNullableResolutionStrategy | Partial<Record<Key, FormDataNullableResolutionStrategy>>;
417
431
  }
432
+ /**
433
+ * Options for resolving form data.
434
+ *
435
+ * @category Function Options
436
+ *
437
+ * @template Key - The type of the key of the input record.
438
+ */
418
439
  type CreateFormDataOptions<Key extends RecordKey> = CreateFormDataOptionsUndefinedOrNullResolution<Key> | CreateFormDataOptionsNullableResolution<Key>;
419
440
  /**
420
441
  * Creates FormData from a given object, resolving non-string types as appropriate.
@@ -456,6 +477,11 @@ declare function getRandomNumber(lowerBound: number, upperBound: number): number
456
477
  declare function isOrdered(array: readonly number[]): boolean;
457
478
  //#endregion
458
479
  //#region src/functions/miscellaneous/stringListToArray.d.ts
480
+ /**
481
+ * Options to apply to the conversion of a string list to an array.
482
+ *
483
+ * @category Function Options
484
+ */
459
485
  interface StringListToArrayOptions {
460
486
  /** What each item in the list is separated by. */
461
487
  separator?: string;
@@ -536,17 +562,17 @@ declare function omitProperties<ObjectType extends Record<string, unknown> | Rea
536
562
  declare function parseBoolean(inputString: string): boolean;
537
563
  //#endregion
538
564
  //#region src/functions/parsers/parseEnv.d.ts
539
- declare const envSchema: z$1.ZodEnum<{
540
- test: "test";
541
- development: "development";
542
- production: "production";
543
- }>;
544
565
  /**
545
- * Represents the most common development environments
566
+ * Represents the three common development environments.
546
567
  *
547
568
  * @category Types
548
569
  */
549
- type Env = z$1.infer<typeof envSchema>;
570
+ declare const Env: {
571
+ TEST: string;
572
+ DEVELOPMENT: string;
573
+ PRODUCTION: string;
574
+ };
575
+ type Env = CreateEnumType<typeof Env>;
550
576
  /**
551
577
  * Parses the input and verifies it matches one of the environments allowed by the Env types ("test" | "development" | "production").
552
578
  *
@@ -597,6 +623,17 @@ declare function parseFormData(formData: FormData): Record<string, string | Blob
597
623
  declare function parseIntStrict(string: string, radix?: number): number;
598
624
  //#endregion
599
625
  //#region src/functions/parsers/parseVersionType.d.ts
626
+ /**
627
+ * Represents the three common software version types.
628
+ *
629
+ * @category Types
630
+ */
631
+ declare const VersionType: {
632
+ readonly MAJOR: "major";
633
+ readonly MINOR: "minor";
634
+ readonly PATCH: "patch";
635
+ };
636
+ type VersionType = CreateEnumType<typeof VersionType>;
600
637
  /**
601
638
  * Parses the input and verifies it is a valid software version type (i.e. `"major" | "minor" | "patch"`)
602
639
  *
@@ -677,6 +714,11 @@ declare function deepFreeze<ObjectType extends object>(object: ObjectType): Read
677
714
  declare function appendSemicolon(stringToAppendTo: string): string;
678
715
  //#endregion
679
716
  //#region src/functions/stringHelpers/camelToKebab.d.ts
717
+ /**
718
+ * Options to apply to the conversion from camelCase to kebab-case
719
+ *
720
+ * @category Function Options
721
+ */
680
722
  interface CamelToKebabOptions {
681
723
  /** Whether to leave consecutive capitals alone in the conversion or not (e.g. `validateAPIUser` becomes `validate-a-p-i-user` if `false`, and `validate-api-user` if `true`) */
682
724
  preserveConsecutiveCapitals?: boolean;
@@ -694,6 +736,11 @@ interface CamelToKebabOptions {
694
736
  declare function camelToKebab(string: string, options?: CamelToKebabOptions): string;
695
737
  //#endregion
696
738
  //#region src/functions/stringHelpers/kebabToCamel.d.ts
739
+ /**
740
+ * Options to apply to the conversion from kebab-case to camelCase
741
+ *
742
+ * @category Function Options
743
+ */
697
744
  interface KebabToCamelOptions {
698
745
  /** Whether or not the converted string should start with an uppercase (e.g. CamelCase instead of camelCase). */
699
746
  startWithUpper?: boolean;
@@ -767,13 +814,33 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
767
814
  */
768
815
  declare function createTemplateStringsArray(strings: readonly string[]): TemplateStringsArray;
769
816
  //#endregion
817
+ //#region src/functions/taggedTemplate/getInterpolations.d.ts
818
+ /**
819
+ * Gets the strings and interpolations separately from a template string.
820
+ * You can pass a template string directly by doing:
821
+ *
822
+ * ```typescript
823
+ * getInterpolations`Template string here`.
824
+ * ```
825
+ *
826
+ * @category Tagged Template
827
+ *
828
+ * @param strings - The strings from the template to process.
829
+ * @param interpolations - An array of all interpolations from the template.
830
+ *
831
+ * @returns A tuple where the first item is the strings from the template, and the second is the interpolations.
832
+ */
833
+ declare function getInterpolations(strings: TemplateStringsArray, ...interpolations: unknown[]): [TemplateStringsArray, unknown[]];
834
+ //#endregion
770
835
  //#region src/functions/taggedTemplate/interpolate.d.ts
771
836
  /**
772
837
  * Returns the result of interpolating a template string when given the strings and interpolations separately.
773
838
  *
774
839
  * You can pass a template string directly by doing:
775
840
  *
776
- * interpolate`Template string here`.
841
+ * ```
842
+ * interpolate`Template string here`.
843
+ * ```
777
844
  *
778
845
  * In this case, it will be functionally the same as if you just wrote the template string by itself.
779
846
  *
@@ -792,7 +859,9 @@ declare function interpolate(strings: TemplateStringsArray, ...interpolations: u
792
859
  *
793
860
  * You can pass a template string directly by doing:
794
861
  *
795
- * interpolateObjects`Template string here ${{ my: "object" }}`.
862
+ * ```typescript
863
+ * interpolateObjects`Template string here ${{ my: "object" }}`.
864
+ * ```
796
865
  *
797
866
  * @category Tagged Template
798
867
  *
@@ -804,6 +873,11 @@ declare function interpolate(strings: TemplateStringsArray, ...interpolations: u
804
873
  declare function interpolateObjects(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
805
874
  //#endregion
806
875
  //#region src/functions/taggedTemplate/normaliseIndents.d.ts
876
+ /**
877
+ * Options to apply to the normalisation of indents in multi-line template strings
878
+ *
879
+ * @category Function Options
880
+ */
807
881
  interface NormaliseIndentsOptions {
808
882
  /** Whether to preserve extra tabs or not (defaults to true) */
809
883
  preserveTabs?: boolean;
@@ -826,9 +900,11 @@ declare function normaliseIndents(options: NormaliseIndentsOptions): NormaliseIn
826
900
  *
827
901
  * You can pass a template string directly by doing:
828
902
  *
829
- * normaliseIndents`Template string here
830
- * with a new line
831
- * and another new line`.
903
+ * ```typescript
904
+ * normaliseIndents`Template string here
905
+ * with a new line
906
+ * and another new line`.
907
+ * ```
832
908
  *
833
909
  *@category Tagged Template
834
910
  *
@@ -843,15 +919,19 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
843
919
  *
844
920
  * You can pass a template string directly by doing:
845
921
  *
846
- * normalizeIndents`Template string here
847
- * with a new line
848
- * and another new line`.
922
+ * ```typescript
923
+ * normalizeIndents`Template string here
924
+ * with a new line
925
+ * and another new line`.
926
+ * ```
849
927
  *
850
928
  * You may also pass the options first, then invoke the resulting function with a template string:
851
929
  *
852
- * normalizeIndents({ preserveTabs: false })`Template string here
853
- * with a new line
854
- * and another new line`.
930
+ * ```typescript
931
+ * normalizeIndents({ preserveTabs: false })`Template string here
932
+ * with a new line
933
+ * and another new line`.
934
+ * ```
855
935
  *
856
936
  * @param first - The strings from the template to process, or the options to apply.
857
937
  * @param args - An array of all interpolations from the template.
@@ -931,4 +1011,4 @@ interface ParseVersionOptions {
931
1011
  */
932
1012
  declare function parseVersion(input: string, options?: ParseVersionOptions): string;
933
1013
  //#endregion
934
- export { APIError, ArrayElement, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, type Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, IncrementVersionOptions, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, ParseVersionOptions, RecordKey, StringListToArrayOptions, VERSION_NUMBER_REGEX, VersionNumber, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, determineVersionType, fillArray, formatDateAndTime, getIndividualVersionNumbers, getRandomNumber, getRecordKeys, httpErrorCodeLookup, incrementVersion, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersion, parseVersionType, parseZodSchema, randomiseArray, range, removeDuplicates, stringListToArray, truncate, wait };
1014
+ export { APIError, ArrayElement, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, type IncrementVersionOptions, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, ParallelTuple, type ParseVersionOptions, RecordKey, StringListToArrayOptions, VERSION_NUMBER_REGEX, VersionNumber, VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, determineVersionType, fillArray, formatDateAndTime, getIndividualVersionNumbers, getInterpolations, getRandomNumber, getRecordKeys, httpErrorCodeLookup, incrementVersion, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersion, parseVersionType, parseZodSchema, randomiseArray, range, removeDuplicates, stringListToArray, truncate, wait };
package/dist/index.js CHANGED
@@ -146,19 +146,6 @@ var DataError = class extends Error {
146
146
  };
147
147
  var DataError_default = DataError;
148
148
 
149
- //#endregion
150
- //#region src/types/VersionType.ts
151
- /**
152
- * Represents the three common software version types.
153
- *
154
- * @category Types
155
- */
156
- const VersionType = {
157
- MAJOR: "major",
158
- MINOR: "minor",
159
- PATCH: "patch"
160
- };
161
-
162
149
  //#endregion
163
150
  //#region src/types/VersionNumber.ts
164
151
  /**
@@ -805,11 +792,16 @@ var parseZodSchema_default = parseZodSchema;
805
792
 
806
793
  //#endregion
807
794
  //#region src/functions/parsers/parseEnv.ts
808
- const envSchema = z$1.enum([
809
- "test",
810
- "development",
811
- "production"
812
- ]);
795
+ /**
796
+ * Represents the three common development environments.
797
+ *
798
+ * @category Types
799
+ */
800
+ const Env = {
801
+ TEST: "test",
802
+ DEVELOPMENT: "development",
803
+ PRODUCTION: "production"
804
+ };
813
805
  /**
814
806
  * Parses the input and verifies it matches one of the environments allowed by the Env types ("test" | "development" | "production").
815
807
  *
@@ -822,7 +814,7 @@ const envSchema = z$1.enum([
822
814
  * @returns The specified environment if allowed.
823
815
  */
824
816
  function parseEnv(data) {
825
- return parseZodSchema_default(envSchema, data, new DataError_default(data, "INVALID_ENV", "The provided environment type must be one of `test | development | production`"));
817
+ return parseZodSchema_default(z$1.enum(Env), data, new DataError_default(data, "INVALID_ENV", "The provided environment type must be one of `test | development | production`"));
826
818
  }
827
819
  var parseEnv_default = parseEnv;
828
820
 
@@ -853,6 +845,16 @@ var parseFormData_default = parseFormData;
853
845
  //#endregion
854
846
  //#region src/functions/parsers/parseVersionType.ts
855
847
  /**
848
+ * Represents the three common software version types.
849
+ *
850
+ * @category Types
851
+ */
852
+ const VersionType = {
853
+ MAJOR: "major",
854
+ MINOR: "minor",
855
+ PATCH: "patch"
856
+ };
857
+ /**
856
858
  * Parses the input and verifies it is a valid software version type (i.e. `"major" | "minor" | "patch"`)
857
859
  *
858
860
  * @category Parsers
@@ -1094,6 +1096,28 @@ function createTemplateStringsArray(strings) {
1094
1096
  }
1095
1097
  var createTemplateStringsArray_default = createTemplateStringsArray;
1096
1098
 
1099
+ //#endregion
1100
+ //#region src/functions/taggedTemplate/getInterpolations.ts
1101
+ /**
1102
+ * Gets the strings and interpolations separately from a template string.
1103
+ * You can pass a template string directly by doing:
1104
+ *
1105
+ * ```typescript
1106
+ * getInterpolations`Template string here`.
1107
+ * ```
1108
+ *
1109
+ * @category Tagged Template
1110
+ *
1111
+ * @param strings - The strings from the template to process.
1112
+ * @param interpolations - An array of all interpolations from the template.
1113
+ *
1114
+ * @returns A tuple where the first item is the strings from the template, and the second is the interpolations.
1115
+ */
1116
+ function getInterpolations(strings, ...interpolations) {
1117
+ return [strings, interpolations];
1118
+ }
1119
+ var getInterpolations_default = getInterpolations;
1120
+
1097
1121
  //#endregion
1098
1122
  //#region src/functions/taggedTemplate/interpolate.ts
1099
1123
  /**
@@ -1101,7 +1125,9 @@ var createTemplateStringsArray_default = createTemplateStringsArray;
1101
1125
  *
1102
1126
  * You can pass a template string directly by doing:
1103
1127
  *
1104
- * interpolate`Template string here`.
1128
+ * ```
1129
+ * interpolate`Template string here`.
1130
+ * ```
1105
1131
  *
1106
1132
  * In this case, it will be functionally the same as if you just wrote the template string by itself.
1107
1133
  *
@@ -1126,7 +1152,9 @@ var interpolate_default = interpolate;
1126
1152
  *
1127
1153
  * You can pass a template string directly by doing:
1128
1154
  *
1129
- * interpolateObjects`Template string here ${{ my: "object" }}`.
1155
+ * ```typescript
1156
+ * interpolateObjects`Template string here ${{ my: "object" }}`.
1157
+ * ```
1130
1158
  *
1131
1159
  * @category Tagged Template
1132
1160
  *
@@ -1176,15 +1204,19 @@ function reduceLines(lines, { preserveTabs = true }) {
1176
1204
  *
1177
1205
  * You can pass a template string directly by doing:
1178
1206
  *
1179
- * normaliseIndents`Template string here
1180
- * with a new line
1181
- * and another new line`.
1207
+ * ```typescript
1208
+ * normaliseIndents`Template string here
1209
+ * with a new line
1210
+ * and another new line`.
1211
+ * ```
1182
1212
  *
1183
1213
  * You may also pass the options first, then invoke the resulting function with a template string:
1184
1214
  *
1185
- * normaliseIndents({ preserveTabs: false })`Template string here
1186
- * with a new line
1187
- * and another new line`.
1215
+ * ```typescript
1216
+ * normaliseIndents({ preserveTabs: false })`Template string here
1217
+ * with a new line
1218
+ * and another new line`.
1219
+ * ```
1188
1220
  *
1189
1221
  *@category Tagged Template
1190
1222
  *
@@ -1209,15 +1241,19 @@ function normaliseIndents(first, ...args) {
1209
1241
  *
1210
1242
  * You can pass a template string directly by doing:
1211
1243
  *
1212
- * normalizeIndents`Template string here
1213
- * with a new line
1214
- * and another new line`.
1244
+ * ```typescript
1245
+ * normalizeIndents`Template string here
1246
+ * with a new line
1247
+ * and another new line`.
1248
+ * ```
1215
1249
  *
1216
1250
  * You may also pass the options first, then invoke the resulting function with a template string:
1217
1251
  *
1218
- * normalizeIndents({ preserveTabs: false })`Template string here
1219
- * with a new line
1220
- * and another new line`.
1252
+ * ```typescript
1253
+ * normalizeIndents({ preserveTabs: false })`Template string here
1254
+ * with a new line
1255
+ * and another new line`.
1256
+ * ```
1221
1257
  *
1222
1258
  * @param first - The strings from the template to process, or the options to apply.
1223
1259
  * @param args - An array of all interpolations from the template.
@@ -1320,4 +1356,4 @@ function incrementVersion(version, incrementType, options) {
1320
1356
  var incrementVersion_default = incrementVersion;
1321
1357
 
1322
1358
  //#endregion
1323
- export { APIError_default as APIError, DataError_default as DataError, NAMESPACE_EXPORT_REGEX_default as NAMESPACE_EXPORT_REGEX, VERSION_NUMBER_REGEX_default as VERSION_NUMBER_REGEX, VersionNumber_default as VersionNumber, VersionType, addDaysToDate_default as addDaysToDate, appendSemicolon_default as appendSemicolon, camelToKebab_default as camelToKebab, convertFileToBase64_default as convertFileToBase64, createFormData_default as createFormData, createTemplateStringsArray_default as createTemplateStringsArray, deepCopy_default as deepCopy, deepFreeze_default as deepFreeze, determineVersionType_default as determineVersionType, fillArray_default as fillArray, formatDateAndTime_default as formatDateAndTime, getIndividualVersionNumbers_default as getIndividualVersionNumbers, getRandomNumber_default as getRandomNumber, getRecordKeys_default as getRecordKeys, httpErrorCodeLookup, incrementVersion_default as incrementVersion, interpolate_default as interpolate, interpolateObjects_default as interpolateObjects, isAnniversary_default as isAnniversary, isLeapYear_default as isLeapYear, isMonthlyMultiple_default as isMonthlyMultiple, isOrdered_default as isOrdered, isSameDate_default as isSameDate, kebabToCamel_default as kebabToCamel, normaliseImportPath, normaliseIndents_default as normaliseIndents, normalizeImportPath_default as normalizeImportPath, normalizeIndents, omitProperties_default as omitProperties, paralleliseArrays_default as paralleliseArrays, parseBoolean_default as parseBoolean, parseEnv_default as parseEnv, parseFormData_default as parseFormData, parseIntStrict_default as parseIntStrict, parseVersion_default as parseVersion, parseVersionType_default as parseVersionType, parseZodSchema_default as parseZodSchema, randomiseArray_default as randomiseArray, range_default as range, removeDuplicates_default as removeDuplicates, stringListToArray_default as stringListToArray, truncate_default as truncate, wait_default as wait };
1359
+ export { APIError_default as APIError, DataError_default as DataError, Env, NAMESPACE_EXPORT_REGEX_default as NAMESPACE_EXPORT_REGEX, VERSION_NUMBER_REGEX_default as VERSION_NUMBER_REGEX, VersionNumber_default as VersionNumber, VersionType, addDaysToDate_default as addDaysToDate, appendSemicolon_default as appendSemicolon, camelToKebab_default as camelToKebab, convertFileToBase64_default as convertFileToBase64, createFormData_default as createFormData, createTemplateStringsArray_default as createTemplateStringsArray, deepCopy_default as deepCopy, deepFreeze_default as deepFreeze, determineVersionType_default as determineVersionType, fillArray_default as fillArray, formatDateAndTime_default as formatDateAndTime, getIndividualVersionNumbers_default as getIndividualVersionNumbers, getInterpolations_default as getInterpolations, getRandomNumber_default as getRandomNumber, getRecordKeys_default as getRecordKeys, httpErrorCodeLookup, incrementVersion_default as incrementVersion, interpolate_default as interpolate, interpolateObjects_default as interpolateObjects, isAnniversary_default as isAnniversary, isLeapYear_default as isLeapYear, isMonthlyMultiple_default as isMonthlyMultiple, isOrdered_default as isOrdered, isSameDate_default as isSameDate, kebabToCamel_default as kebabToCamel, normaliseImportPath, normaliseIndents_default as normaliseIndents, normalizeImportPath_default as normalizeImportPath, normalizeIndents, omitProperties_default as omitProperties, paralleliseArrays_default as paralleliseArrays, parseBoolean_default as parseBoolean, parseEnv_default as parseEnv, parseFormData_default as parseFormData, parseIntStrict_default as parseIntStrict, parseVersion_default as parseVersion, parseVersionType_default as parseVersionType, parseZodSchema_default as parseZodSchema, randomiseArray_default as randomiseArray, range_default as range, removeDuplicates_default as removeDuplicates, stringListToArray_default as stringListToArray, truncate_default as truncate, wait_default as wait };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "zod": "^4.2.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@alextheman/eslint-plugin": "^5.2.0",
22
+ "@alextheman/eslint-plugin": "^5.2.1",
23
23
  "@types/node": "^25.0.3",
24
24
  "alex-c-line": "^1.10.0",
25
25
  "dotenv-cli": "^11.0.0",