@alextheman/utility 3.10.1 → 4.1.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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import z, { z as z$1 } from "zod";
2
- import path from "path";
2
+ import path from "node:path";
3
3
 
4
4
  //#region src/constants/NAMESPACE_EXPORT_REGEX.ts
5
5
  const NAMESPACE_EXPORT_REGEX = "export\\s+\\*\\s+from";
@@ -59,27 +59,108 @@ function paralleliseArrays(firstArray, secondArray) {
59
59
  }
60
60
  var paralleliseArrays_default = paralleliseArrays;
61
61
 
62
+ //#endregion
63
+ //#region src/types/APIError.ts
64
+ const httpErrorCodeLookup = {
65
+ 400: "BAD_REQUEST",
66
+ 401: "UNAUTHORISED",
67
+ 403: "FORBIDDEN",
68
+ 404: "NOT_FOUND",
69
+ 418: "I_AM_A_TEAPOT",
70
+ 500: "INTERNAL_SERVER_ERROR"
71
+ };
72
+ /** Represents common errors you may get from a HTTP API request. */
73
+ var APIError = class extends Error {
74
+ status;
75
+ /**
76
+ * @param status - A HTTP status code. Can be any number, but numbers between 400 and 600 are encouraged to fit with HTTP status code conventions.
77
+ * @param message - An error message to display alongside the status code.
78
+ * @param options - Extra options to be passed to super Error constructor.
79
+ */
80
+ constructor(status = 500, message, options) {
81
+ super(message, options);
82
+ this.status = status;
83
+ if (message) this.message = message;
84
+ else this.message = httpErrorCodeLookup[this.status] ?? "API_ERROR";
85
+ Object.defineProperty(this, "message", { enumerable: true });
86
+ Object.setPrototypeOf(this, new.target.prototype);
87
+ }
88
+ /**
89
+ * Checks whether the given input may have been caused by an APIError.
90
+ *
91
+ * @param input - The input to check.
92
+ *
93
+ * @returns `true` if the input is an APIError, and `false` otherwise. The type of the input will also be narrowed down to APIError if `true`.
94
+ */
95
+ static check(input) {
96
+ const data = input;
97
+ return typeof data === "object" && data !== null && typeof data?.status === "number" && typeof data?.message === "string";
98
+ }
99
+ };
100
+ var APIError_default = APIError;
101
+
102
+ //#endregion
103
+ //#region src/types/DataError.ts
104
+ /** Represents errors you may get that may've been caused by a specific piece of data. */
105
+ var DataError = class extends Error {
106
+ data;
107
+ code;
108
+ /**
109
+ * @param data - The data that caused the error.
110
+ * @param code - A standardised code (e.g. UNEXPECTED_DATA).
111
+ * @param message - A human-readable error message (e.g. The data provided is invalid).
112
+ * @param options - Extra options to pass to super Error constructor.
113
+ */
114
+ constructor(data, code = "INVALID_DATA", message = "The data provided is invalid", options) {
115
+ super(message, options);
116
+ if (Error.captureStackTrace) Error.captureStackTrace(this, new.target);
117
+ this.name = new.target.name;
118
+ this.code = code;
119
+ this.data = data;
120
+ Object.defineProperty(this, "message", { enumerable: true });
121
+ Object.setPrototypeOf(this, new.target.prototype);
122
+ }
123
+ /**
124
+ * Checks whether the given input may have been caused by a DataError.
125
+ *
126
+ * @param input - The input to check.
127
+ *
128
+ * @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`.
129
+ */
130
+ static check(input) {
131
+ const data = input;
132
+ return typeof data === "object" && data !== null && typeof data.message === "string" && typeof data.code === "string" && "data" in data;
133
+ }
134
+ };
135
+ var DataError_default = DataError;
136
+
62
137
  //#endregion
63
138
  //#region src/functions/parsers/parseIntStrict.ts
64
- const IntegerParsingError = /* @__PURE__ */ new TypeError("INTEGER_PARSING_ERROR");
65
139
  /**
66
140
  * Converts a string to an integer and throws an error if it cannot be converted.
67
141
  *
68
142
  * @param string - A string to convert into a number.
69
143
  * @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.
70
144
  *
71
- * @throws {TypeError} If the provided string cannot safely be converted to an integer.
145
+ * @throws {DataError} If the provided string cannot safely be converted to an integer.
72
146
  *
73
147
  * @returns The integer parsed from the input string.
74
148
  */
75
149
  function parseIntStrict(string, radix) {
76
150
  const trimmedString = string.trim();
77
- if (!(radix && radix > 10 && radix <= 36 ? new RegExp(`^[+-]?[0-9a-${String.fromCharCode(87 + radix - 1)}]+$`, "i") : /^[+-]?\d+$/).test(trimmedString)) throw IntegerParsingError;
151
+ const maxAllowedAlphabeticalCharacter = radix && radix > 10 && radix <= 36 ? String.fromCharCode(87 + radix - 1) : void 0;
152
+ if (!(radix && radix > 10 && radix <= 36 ? new RegExp(`^[+-]?[0-9a-${maxAllowedAlphabeticalCharacter}]+$`, "i") : /^[+-]?\d+$/).test(trimmedString)) throw new DataError_default(radix ? {
153
+ string,
154
+ radix
155
+ } : string, "INTEGER_PARSING_ERROR", `Only numeric values${radix && radix > 10 && radix <= 36 ? ` or character${radix !== 11 ? "s" : ""} A${radix !== 11 ? `-${maxAllowedAlphabeticalCharacter?.toUpperCase()} ` : " "}` : " "}are allowed.`);
78
156
  if (radix && radix < 10 && [...trimmedString].some((character) => {
79
157
  return parseInt(character) >= radix;
80
- })) throw IntegerParsingError;
158
+ })) throw new DataError_default({
159
+ string,
160
+ radix
161
+ }, "INTEGER_PARSING_ERROR", "Value contains one or more digits outside of the range of the given radix.");
81
162
  const parseIntResult = parseInt(trimmedString, radix);
82
- if (isNaN(parseIntResult)) throw IntegerParsingError;
163
+ if (isNaN(parseIntResult)) throw new DataError_default(string, "INTEGER_PARSING_ERROR", "Value is not a valid integer.");
83
164
  return parseIntResult;
84
165
  }
85
166
  var parseIntStrict_default = parseIntStrict;
@@ -510,19 +591,42 @@ var omitProperties_default = omitProperties;
510
591
  *
511
592
  * @param inputString - The string to parse.
512
593
  *
513
- * @throws {TypeError} If the string is not either `true` or `false` (case insensitive).
594
+ * @throws {DataError} If the string is not either `true` or `false` (case insensitive).
514
595
  *
515
596
  * @returns The string parsed as an actual boolean.
516
597
  */
517
598
  function parseBoolean(inputString) {
518
599
  const normalisedString = inputString.toLowerCase();
519
- if (!["true", "false"].includes(normalisedString)) throw new TypeError("INVALID_BOOLEAN_STRING");
600
+ if (!["true", "false"].includes(normalisedString)) throw new DataError_default(inputString, "INVALID_BOOLEAN_STRING", "The provided boolean string must be one of `true | false`");
520
601
  return normalisedString === "true";
521
602
  }
522
- /** @deprecated This function has been renamed to parseBoolean. */
523
- const stringToBoolean = parseBoolean;
524
603
  var parseBoolean_default = parseBoolean;
525
604
 
605
+ //#endregion
606
+ //#region src/functions/parsers/parseZodSchema.ts
607
+ /**
608
+ * An alternative function to zodSchema.parse() that can be used to strictly parse Zod schemas.
609
+ *
610
+ * @template Output - The Zod output type.
611
+ * @template Input - The Zod input type.
612
+ * @template Internals - The Zod internal types based on the output and input types.
613
+ * @template ErrorType - The type of error to throw on invalid data.
614
+ *
615
+ * @param schema - The Zod schema to use in parsing.
616
+ * @param data - The data to parse.
617
+ * @param error - A custom error to throw on invalid data (defaults to `DataError`).
618
+ *
619
+ * @throws {DataError} If the given data cannot be parsed according to the schema.
620
+ *
621
+ * @returns The parsed data from the Zod schema.
622
+ */
623
+ function parseZodSchema(schema, data, error) {
624
+ const parsedResult = schema.safeParse(data);
625
+ if (!parsedResult.success) throw error ?? new DataError_default(data);
626
+ return parsedResult.data;
627
+ }
628
+ var parseZodSchema_default = parseZodSchema;
629
+
526
630
  //#endregion
527
631
  //#region src/functions/parsers/parseEnv.ts
528
632
  const envSchema = z$1.enum([
@@ -535,12 +639,12 @@ const envSchema = z$1.enum([
535
639
  *
536
640
  * @param data - The data to parse.
537
641
  *
538
- * @throws {ZodError} If the data does not match one of the environments allowed by the Env types ("test" | "development" | "production").
642
+ * @throws {DataError} If the data does not match one of the environments allowed by the Env types ("test" | "development" | "production").
539
643
  *
540
644
  * @returns The specified environment if allowed.
541
645
  */
542
646
  function parseEnv(data) {
543
- return envSchema.parse(data);
647
+ return parseZodSchema_default(envSchema, data, new DataError_default(data, "INVALID_ENV", "The provided environment type must be one of `test | development | production`"));
544
648
  }
545
649
  var parseEnv_default = parseEnv;
546
650
 
@@ -566,122 +670,6 @@ function parseFormData(formData, dataParser) {
566
670
  }
567
671
  var parseFormData_default = parseFormData;
568
672
 
569
- //#endregion
570
- //#region src/types/APIError.ts
571
- const httpErrorCodeLookup = {
572
- 400: "BAD_REQUEST",
573
- 401: "UNAUTHORISED",
574
- 403: "FORBIDDEN",
575
- 404: "NOT_FOUND",
576
- 418: "I_AM_A_TEAPOT",
577
- 500: "INTERNAL_SERVER_ERROR"
578
- };
579
- /** Represents common errors you may get from a HTTP API request. */
580
- var APIError = class extends Error {
581
- status;
582
- /**
583
- * @param status - A HTTP status code. Can be any number, but numbers between 400 and 600 are encouraged to fit with HTTP status code conventions.
584
- * @param message - An error message to display alongside the status code.
585
- * @param options - Extra options to be passed to super Error constructor.
586
- */
587
- constructor(status = 500, message, options) {
588
- super(message, options);
589
- this.status = status;
590
- if (message) this.message = message;
591
- else this.message = httpErrorCodeLookup[this.status] ?? "API_ERROR";
592
- Object.defineProperty(this, "message", { enumerable: true });
593
- Object.setPrototypeOf(this, new.target.prototype);
594
- }
595
- /**
596
- * Checks whether the given input may have been caused by an APIError.
597
- *
598
- * @param input - The input to check.
599
- *
600
- * @returns `true` if the input is an APIError, and `false` otherwise. The type of the input will also be narrowed down to APIError if `true`.
601
- */
602
- static check(input) {
603
- const data = input;
604
- return typeof data === "object" && data !== null && typeof data?.status === "number" && typeof data?.message === "string";
605
- }
606
- };
607
- var APIError_default = APIError;
608
-
609
- //#endregion
610
- //#region src/types/DataError.ts
611
- /** Represents errors you may get that may've been caused by a specific piece of data. */
612
- var DataError = class extends Error {
613
- data;
614
- code;
615
- /**
616
- * @param data - The data that caused the error.
617
- * @param message - A human-readable error message (e.g. The data provided is invalid).
618
- * @param code - A standardised code (e.g. UNEXPECTED_DATA).
619
- * @param options - Extra options to pass to super Error constructor.
620
- */
621
- constructor(data, message = "The data provided is invalid", code = "INVALID_DATA", options) {
622
- super(message, options);
623
- if (Error.captureStackTrace) Error.captureStackTrace(this, new.target);
624
- this.name = new.target.name;
625
- this.code = code;
626
- this.data = data;
627
- Object.defineProperty(this, "message", { enumerable: true });
628
- Object.setPrototypeOf(this, new.target.prototype);
629
- }
630
- /**
631
- * Checks whether the given input may have been caused by a DataError.
632
- *
633
- * @param input - The input to check.
634
- *
635
- * @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`.
636
- */
637
- static check(input) {
638
- const data = input;
639
- return typeof data === "object" && data !== null && typeof data.message === "string" && typeof data.code === "string" && "data" in data;
640
- }
641
- };
642
- var DataError_default = DataError;
643
-
644
- //#endregion
645
- //#region src/types/Email.ts
646
- const emailSchema = z.email().brand();
647
- /** @deprecated Please use `z.email().parse() from Zod instead.`*/
648
- function parseEmail(data) {
649
- return emailSchema.parse(data);
650
- }
651
- var Email_default = parseEmail;
652
-
653
- //#endregion
654
- //#region src/types/UUID.ts
655
- const uuidSchema = z.uuid().brand();
656
- /** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
657
- function parseUUID(UUID) {
658
- return uuidSchema.parse(UUID);
659
- }
660
- var UUID_default = parseUUID;
661
-
662
- //#endregion
663
- //#region src/functions/parsers/parseZodSchema.ts
664
- /**
665
- * An alternative function to zodSchema.parse() that can be used to strictly parse Zod schemas.
666
- *
667
- * @template Output - The Zod output type.
668
- * @template Input - The Zod input type.
669
- * @template Internals - The Zod internal types based on the output and input types.
670
- *
671
- * @param schema - The Zod schema to use in parsing.
672
- * @param data - The data to parse.
673
- *
674
- * @throws {DataError} If the given data cannot be parsed according to the schema.
675
- *
676
- * @returns The parsed data from the Zod schema.
677
- */
678
- function parseZodSchema(schema, data) {
679
- const parsedResult = schema.safeParse(data);
680
- if (!parsedResult.success) throw new DataError_default(data);
681
- return parsedResult.data;
682
- }
683
- var parseZodSchema_default = parseZodSchema;
684
-
685
673
  //#endregion
686
674
  //#region src/functions/parsers/parseVersionType.ts
687
675
  const versionTypeSchema = z.enum([
@@ -699,7 +687,7 @@ const versionTypeSchema = z.enum([
699
687
  * @returns The given version type if allowed.
700
688
  */
701
689
  function parseVersionType(data) {
702
- return parseZodSchema_default(versionTypeSchema, data);
690
+ return parseZodSchema_default(versionTypeSchema, data, new DataError_default(data, "INVALID_VERSION_TYPE", "The provided version type must be one of `major | minor | patch`"));
703
691
  }
704
692
  var parseVersionType_default = parseVersionType;
705
693
 
@@ -778,11 +766,35 @@ var appendSemicolon_default = appendSemicolon;
778
766
  * Converts a string from camelCase to kebab-case
779
767
  *
780
768
  * @param string - The string to convert.
769
+ * @param options - Options to apply to the conversion.
781
770
  *
782
771
  * @returns The string converted to kebab-case.
783
772
  */
784
- function camelToKebab(string) {
785
- return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
773
+ function camelToKebab(string, options = { preserveConsecutiveCapitals: true }) {
774
+ let result = "";
775
+ let outerIndex = 0;
776
+ while (outerIndex < string.length) {
777
+ const character = string[outerIndex];
778
+ if (/[A-Z]/.test(character)) {
779
+ let innerIndex = outerIndex + 1;
780
+ while (innerIndex < string.length && /[A-Z]/.test(string[innerIndex]) && (options.preserveConsecutiveCapitals ? innerIndex + 1 < string.length && /[a-z]/.test(string[innerIndex + 1]) ? false : true : true)) innerIndex++;
781
+ const sequenceOfCapitals = string.slice(outerIndex, innerIndex);
782
+ if (options.preserveConsecutiveCapitals) {
783
+ if (result) result += "-";
784
+ result += sequenceOfCapitals.toLowerCase();
785
+ } else {
786
+ if (result) result += "-";
787
+ result += sequenceOfCapitals.split("").map((character$1) => {
788
+ return character$1.toLowerCase();
789
+ }).join("-");
790
+ }
791
+ outerIndex = innerIndex;
792
+ } else {
793
+ result += character;
794
+ outerIndex++;
795
+ }
796
+ }
797
+ return result;
786
798
  }
787
799
  var camelToKebab_default = camelToKebab;
788
800
 
@@ -938,25 +950,25 @@ var interpolateObjects_default = interpolateObjects;
938
950
 
939
951
  //#endregion
940
952
  //#region src/functions/taggedTemplate/normaliseIndents.ts
941
- function calculateTabSize$1(line, whitespaceLength) {
953
+ function calculateTabSize(line, whitespaceLength) {
942
954
  const potentialWhitespacePart = line.slice(0, whitespaceLength);
943
955
  const trimmedString = line.trimStart();
944
956
  if (potentialWhitespacePart.trim() !== "") return 0;
945
957
  const tabSize = line.length - (trimmedString.length + whitespaceLength);
946
958
  return tabSize < 0 ? 0 : tabSize;
947
959
  }
948
- function getWhitespaceLength$1(lines) {
960
+ function getWhitespaceLength(lines) {
949
961
  const [firstNonEmptyLine] = lines.filter((line) => {
950
962
  return line.trim() !== "";
951
963
  });
952
964
  return firstNonEmptyLine.length - firstNonEmptyLine.trimStart().length;
953
965
  }
954
- function reduceLines$1(lines, { preserveTabs = true }) {
966
+ function reduceLines(lines, { preserveTabs = true }) {
955
967
  const slicedLines = lines.slice(1);
956
968
  const isFirstLineEmpty = lines[0].trim() === "";
957
- const whitespaceLength = getWhitespaceLength$1(isFirstLineEmpty ? lines : slicedLines);
969
+ const whitespaceLength = getWhitespaceLength(isFirstLineEmpty ? lines : slicedLines);
958
970
  return (isFirstLineEmpty ? slicedLines : lines).map((line) => {
959
- const tabSize = calculateTabSize$1(line, whitespaceLength);
971
+ const tabSize = calculateTabSize(line, whitespaceLength);
960
972
  return (preserveTabs ? fillArray_default(() => {
961
973
  return " ";
962
974
  }, tabSize).join("") : "") + line.trimStart();
@@ -991,7 +1003,7 @@ function normaliseIndents(first, ...args) {
991
1003
  }
992
1004
  const strings = first;
993
1005
  const options = typeof args[args.length - 1] === "object" && !Array.isArray(args[args.length - 1]) ? args.pop() : {};
994
- return reduceLines$1(interpolate_default(strings, ...[...args]).split("\n"), options);
1006
+ return reduceLines(interpolate_default(strings, ...[...args]).split("\n"), options);
995
1007
  }
996
1008
  /**
997
1009
  * Applies any options if provided, then removes any extraneous indents from a multi-line template string.
@@ -1016,45 +1028,6 @@ function normaliseIndents(first, ...args) {
1016
1028
  const normalizeIndents = normaliseIndents;
1017
1029
  var normaliseIndents_default = normaliseIndents;
1018
1030
 
1019
- //#endregion
1020
- //#region src/functions/taggedTemplate/removeIndents.ts
1021
- function calculateTabSize(line, whitespaceLength) {
1022
- const potentialWhitespacePart = line.slice(0, whitespaceLength);
1023
- const trimmedString = line.trimStart();
1024
- if (potentialWhitespacePart.trim() !== "") return 0;
1025
- const tabSize = line.length - (trimmedString.length + whitespaceLength);
1026
- return tabSize < 0 ? 0 : tabSize;
1027
- }
1028
- function getWhitespaceLength(lines) {
1029
- const [firstNonEmptyLine] = lines.filter((line) => {
1030
- return line.trim() !== "";
1031
- });
1032
- return firstNonEmptyLine.length - firstNonEmptyLine.trimStart().length;
1033
- }
1034
- function reduceLines(lines, { preserveTabs = true }) {
1035
- const slicedLines = lines.slice(1);
1036
- const isFirstLineEmpty = lines[0].trim() === "";
1037
- const whitespaceLength = getWhitespaceLength(isFirstLineEmpty ? lines : slicedLines);
1038
- return (isFirstLineEmpty ? slicedLines : lines).map((line) => {
1039
- const tabSize = calculateTabSize(line, whitespaceLength);
1040
- return (preserveTabs ? fillArray_default(() => {
1041
- return " ";
1042
- }, tabSize).join("") : "") + line.trimStart();
1043
- }).join("\n");
1044
- }
1045
- function removeIndents(first, ...args) {
1046
- if (typeof first === "object" && first !== null && !Array.isArray(first)) {
1047
- const options$1 = first;
1048
- return (strings$1, ...interpolations) => {
1049
- return removeIndents(strings$1, ...interpolations, options$1);
1050
- };
1051
- }
1052
- const strings = first;
1053
- const options = typeof args[args.length - 1] === "object" && !Array.isArray(args[args.length - 1]) ? args.pop() : {};
1054
- return reduceLines(interpolate_default(strings, ...[...args]).split("\n"), options);
1055
- }
1056
- var removeIndents_default = removeIndents;
1057
-
1058
1031
  //#endregion
1059
1032
  //#region src/functions/versioning/parseVersion.ts
1060
1033
  /**
@@ -1070,7 +1043,7 @@ var removeIndents_default = removeIndents;
1070
1043
  * @returns The validated version number, prefixed with `v` if it was not already.
1071
1044
  */
1072
1045
  function parseVersion(input, options) {
1073
- if (!RegExp(VERSION_NUMBER_REGEX_default).test(input)) throw new DataError_default(input, `"${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.`, "INVALID_VERSION");
1046
+ if (!RegExp(VERSION_NUMBER_REGEX_default).test(input)) throw new DataError_default(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.`);
1074
1047
  if (options?.omitPrefix) return input.startsWith("v") ? input.slice(1) : input;
1075
1048
  return input.startsWith("v") ? input : `v${input}`;
1076
1049
  }
@@ -1135,4 +1108,4 @@ function incrementVersion(version, incrementType, options) {
1135
1108
  var incrementVersion_default = incrementVersion;
1136
1109
 
1137
1110
  //#endregion
1138
- 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, 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, Email_default as parseEmail, parseEnv_default as parseEnv, parseFormData_default as parseFormData, parseIntStrict_default as parseIntStrict, UUID_default as parseUUID, parseVersion_default as parseVersion, parseVersionType_default as parseVersionType, parseZodSchema_default as parseZodSchema, randomiseArray_default as randomiseArray, range_default as range, removeDuplicates_default as removeDuplicates, removeIndents_default as removeIndents, stringListToArray_default as stringListToArray, stringToBoolean, truncate_default as truncate, wait_default as wait };
1111
+ 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, 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 };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "3.10.1",
3
+ "version": "4.1.0",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/AlexMan123456/utility.git"
8
8
  },
9
- "license": "ISC",
9
+ "license": "MIT",
10
10
  "author": "alextheman",
11
11
  "type": "module",
12
12
  "main": "dist/index.cjs",
@@ -16,22 +16,23 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "zod": "^4.1.13"
19
+ "zod": "^4.2.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@alextheman/eslint-plugin": "^4.8.6",
23
- "@types/node": "^25.0.1",
24
- "alex-c-line": "^1.8.0",
22
+ "@alextheman/eslint-plugin": "^4.10.0",
23
+ "@types/node": "^25.0.3",
24
+ "alex-c-line": "^1.10.0",
25
25
  "dotenv-cli": "^11.0.0",
26
- "eslint": "^9.39.1",
26
+ "eslint": "^9.39.2",
27
+ "eslint-plugin-perfectionist": "^5.0.0",
27
28
  "globals": "^16.5.0",
28
29
  "husky": "^9.1.7",
29
30
  "jsdom": "^27.3.0",
30
31
  "prettier": "^3.7.4",
31
- "tsdown": "^0.17.3",
32
+ "tsdown": "^0.18.1",
32
33
  "typescript": "^5.9.3",
33
- "vite-tsconfig-paths": "^5.1.4",
34
- "vitest": "^4.0.15"
34
+ "vite-tsconfig-paths": "^6.0.3",
35
+ "vitest": "^4.0.16"
35
36
  },
36
37
  "scripts": {
37
38
  "build": "tsdown",