@alextheman/utility 3.5.0 → 3.5.2
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 +8 -5
- package/dist/index.d.ts +8 -5
- package/package.json +1 -1
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,11 +130,8 @@ 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
|
-
declare function deepFreeze<T extends object>(object: T):
|
|
134
|
+
declare function deepFreeze<T extends object>(object: T): Readonly<T>;
|
|
132
135
|
//#endregion
|
|
133
136
|
//#region src/functions/getRandomNumber.d.ts
|
|
134
137
|
declare function getRandomNumber(lowerBound: number, upperBound: number): number;
|
|
@@ -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,11 +130,8 @@ 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
|
-
declare function deepFreeze<T extends object>(object: T):
|
|
134
|
+
declare function deepFreeze<T extends object>(object: T): Readonly<T>;
|
|
132
135
|
//#endregion
|
|
133
136
|
//#region src/functions/getRandomNumber.d.ts
|
|
134
137
|
declare function getRandomNumber(lowerBound: number, upperBound: number): number;
|
|
@@ -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 };
|