@alextheman/utility 2.4.0 → 2.5.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.d.cts CHANGED
@@ -38,11 +38,13 @@ declare function wait(seconds: number): Promise<void>;
38
38
 
39
39
  declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
40
40
 
41
+ type HTTPErrorCode = 400 | 401 | 403 | 404 | 418 | 500;
42
+ /** @deprecated This type has been renamed to HTTPErrorCode (singular) */
41
43
  type HTTPErrorCodes = 400 | 401 | 403 | 404 | 418 | 500;
42
- declare const httpErrorCodeLookup: Record<HTTPErrorCodes, string>;
44
+ declare const httpErrorCodeLookup: Record<HTTPErrorCode, string>;
43
45
  declare class APIError extends Error {
44
46
  status: number;
45
- constructor(status?: HTTPErrorCodes | number, message?: string, options?: ErrorOptions);
47
+ constructor(status?: HTTPErrorCode | number, message?: string, options?: ErrorOptions);
46
48
  static check(input: unknown): input is APIError;
47
49
  }
48
50
 
@@ -66,4 +68,4 @@ type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot i
66
68
 
67
69
  type NonUndefined<T> = T extends undefined ? never : T;
68
70
 
69
- export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringToBoolean, truncate, wait };
71
+ export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringToBoolean, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -38,11 +38,13 @@ declare function wait(seconds: number): Promise<void>;
38
38
 
39
39
  declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
40
40
 
41
+ type HTTPErrorCode = 400 | 401 | 403 | 404 | 418 | 500;
42
+ /** @deprecated This type has been renamed to HTTPErrorCode (singular) */
41
43
  type HTTPErrorCodes = 400 | 401 | 403 | 404 | 418 | 500;
42
- declare const httpErrorCodeLookup: Record<HTTPErrorCodes, string>;
44
+ declare const httpErrorCodeLookup: Record<HTTPErrorCode, string>;
43
45
  declare class APIError extends Error {
44
46
  status: number;
45
- constructor(status?: HTTPErrorCodes | number, message?: string, options?: ErrorOptions);
47
+ constructor(status?: HTTPErrorCode | number, message?: string, options?: ErrorOptions);
46
48
  static check(input: unknown): input is APIError;
47
49
  }
48
50
 
@@ -66,4 +68,4 @@ type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot i
66
68
 
67
69
  type NonUndefined<T> = T extends undefined ? never : T;
68
70
 
69
- export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringToBoolean, truncate, wait };
71
+ export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringToBoolean, truncate, wait };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Helpful utility functions",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",