@alextheman/utility 3.5.0 → 3.5.1

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
@@ -66,6 +66,12 @@ declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
66
66
  type UUID = z.infer<typeof uuidSchema>;
67
67
  declare function parseUUID(UUID: unknown): UUID;
68
68
  //#endregion
69
+ //#region src/types/ArrayElement.d.ts
70
+ type ArrayElement<T extends readonly unknown[]> = T extends readonly (infer ElementType)[] ? ElementType : never;
71
+ //#endregion
72
+ //#region src/types/DeepReadonly.d.ts
73
+ type DeepReadonly<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer ItemType)[] ? readonly DeepReadonly<ItemType>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
74
+ //#endregion
69
75
  //#region src/types/DisallowUndefined.d.ts
70
76
  type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot include undefined"] : T;
71
77
  //#endregion
@@ -124,9 +130,6 @@ declare function isSameDate(firstDate: Date, secondDate: Date): boolean;
124
130
  //#region src/functions/deepCopy.d.ts
125
131
  declare function deepCopy<T extends object>(object: T): T;
126
132
  //#endregion
127
- //#region src/types/DeepReadonly.d.ts
128
- type DeepReadonly<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer ItemType)[] ? readonly DeepReadonly<ItemType>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
129
- //#endregion
130
133
  //#region src/functions/deepFreeze.d.ts
131
134
  declare function deepFreeze<T extends object>(object: T): DeepReadonly<T>;
132
135
  //#endregion
@@ -213,4 +216,4 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
213
216
  //#region src/functions/wait.d.ts
214
217
  declare function wait(seconds: number): Promise<void>;
215
218
  //#endregion
216
- export { APIError, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Email, Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, RecordKey, RemoveIndentsFunction, RemoveIndentsOptions, StringListToArrayOptions, UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEmail, parseEnv, parseFormData, parseIntStrict, parseUUID, parseZodSchema, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, truncate, wait };
219
+ export { APIError, ArrayElement, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DeepReadonly, DisallowUndefined, Email, Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, RecordKey, RemoveIndentsFunction, RemoveIndentsOptions, StringListToArrayOptions, UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEmail, parseEnv, parseFormData, parseIntStrict, parseUUID, parseZodSchema, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -66,6 +66,12 @@ declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
66
66
  type UUID = z.infer<typeof uuidSchema>;
67
67
  declare function parseUUID(UUID: unknown): UUID;
68
68
  //#endregion
69
+ //#region src/types/ArrayElement.d.ts
70
+ type ArrayElement<T extends readonly unknown[]> = T extends readonly (infer ElementType)[] ? ElementType : never;
71
+ //#endregion
72
+ //#region src/types/DeepReadonly.d.ts
73
+ type DeepReadonly<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer ItemType)[] ? readonly DeepReadonly<ItemType>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
74
+ //#endregion
69
75
  //#region src/types/DisallowUndefined.d.ts
70
76
  type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot include undefined"] : T;
71
77
  //#endregion
@@ -124,9 +130,6 @@ declare function isSameDate(firstDate: Date, secondDate: Date): boolean;
124
130
  //#region src/functions/deepCopy.d.ts
125
131
  declare function deepCopy<T extends object>(object: T): T;
126
132
  //#endregion
127
- //#region src/types/DeepReadonly.d.ts
128
- type DeepReadonly<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer ItemType)[] ? readonly DeepReadonly<ItemType>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
129
- //#endregion
130
133
  //#region src/functions/deepFreeze.d.ts
131
134
  declare function deepFreeze<T extends object>(object: T): DeepReadonly<T>;
132
135
  //#endregion
@@ -213,4 +216,4 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
213
216
  //#region src/functions/wait.d.ts
214
217
  declare function wait(seconds: number): Promise<void>;
215
218
  //#endregion
216
- export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, type Email, type Env, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, type NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, type OptionalOnCondition, type RecordKey, RemoveIndentsFunction, RemoveIndentsOptions, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEmail, parseEnv, parseFormData, parseIntStrict, parseUUID, parseZodSchema, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, truncate, wait };
219
+ export { APIError, type ArrayElement, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DeepReadonly, type DisallowUndefined, type Email, type Env, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, type NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, type OptionalOnCondition, type RecordKey, RemoveIndentsFunction, RemoveIndentsOptions, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normaliseIndents, normalizeImportPath, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEmail, parseEnv, parseFormData, parseIntStrict, parseUUID, parseZodSchema, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, truncate, wait };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",