@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/LICENSE +21 -0
- package/dist/index.cjs +152 -183
- package/dist/index.d.cts +19 -49
- package/dist/index.d.ts +19 -49
- package/dist/index.js +151 -178
- package/package.json +11 -10
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ declare const VERSION_NUMBER_REGEX: string;
|
|
|
20
20
|
*
|
|
21
21
|
* @returns A Promise resolving to an array of the callback results.
|
|
22
22
|
*/
|
|
23
|
-
declare function fillArray<ItemType
|
|
23
|
+
declare function fillArray<ItemType>(callback: (index: number) => Promise<ItemType>, length?: number): Promise<ItemType[]>;
|
|
24
24
|
/**
|
|
25
25
|
* Creates a new array where each element is the result of the provided synchronous callback.
|
|
26
26
|
*
|
|
@@ -34,7 +34,7 @@ declare function fillArray<ItemType$1>(callback: (index: number) => Promise<Item
|
|
|
34
34
|
*
|
|
35
35
|
* @returns An array of the callback results.
|
|
36
36
|
*/
|
|
37
|
-
declare function fillArray<ItemType
|
|
37
|
+
declare function fillArray<ItemType>(callback: (index: number) => ItemType, length?: number): ItemType[];
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/functions/arrayHelpers/paralleliseArrays.d.ts
|
|
40
40
|
type ParallelTuple<A, B> = [A, B | undefined];
|
|
@@ -64,7 +64,7 @@ declare function paralleliseArrays<FirstArrayItem, SecondArrayItem>(firstArray:
|
|
|
64
64
|
*
|
|
65
65
|
* @returns A new array with the items randomised.
|
|
66
66
|
*/
|
|
67
|
-
declare function randomiseArray<ItemType
|
|
67
|
+
declare function randomiseArray<ItemType>(array: ItemType[]): ItemType[];
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region src/functions/arrayHelpers/range.d.ts
|
|
70
70
|
/**
|
|
@@ -94,7 +94,7 @@ declare function range(start: number, stop: number, step?: number): number[];
|
|
|
94
94
|
*
|
|
95
95
|
* @returns A new array with a different reference in memory, with the duplicates removed.
|
|
96
96
|
*/
|
|
97
|
-
declare function removeDuplicates<ItemType
|
|
97
|
+
declare function removeDuplicates<ItemType>(array: ItemType[] | readonly ItemType[]): ItemType[];
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/functions/date/addDaysToDate.d.ts
|
|
100
100
|
/**
|
|
@@ -207,11 +207,11 @@ declare class DataError extends Error {
|
|
|
207
207
|
code: string;
|
|
208
208
|
/**
|
|
209
209
|
* @param data - The data that caused the error.
|
|
210
|
-
* @param message - A human-readable error message (e.g. The data provided is invalid).
|
|
211
210
|
* @param code - A standardised code (e.g. UNEXPECTED_DATA).
|
|
211
|
+
* @param message - A human-readable error message (e.g. The data provided is invalid).
|
|
212
212
|
* @param options - Extra options to pass to super Error constructor.
|
|
213
213
|
*/
|
|
214
|
-
constructor(data: unknown,
|
|
214
|
+
constructor(data: unknown, code?: string, message?: string, options?: ErrorOptions);
|
|
215
215
|
/**
|
|
216
216
|
* Checks whether the given input may have been caused by a DataError.
|
|
217
217
|
*
|
|
@@ -222,20 +222,6 @@ declare class DataError extends Error {
|
|
|
222
222
|
static check(input: unknown): input is DataError;
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
225
|
-
//#region src/types/Email.d.ts
|
|
226
|
-
declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
|
|
227
|
-
/** @deprecated Please use the inferred type from `z.email() from Zod instead.` */
|
|
228
|
-
type Email = z.infer<typeof emailSchema>;
|
|
229
|
-
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
230
|
-
declare function parseEmail(data: unknown): Email;
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/types/UUID.d.ts
|
|
233
|
-
declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
234
|
-
/** @deprecated Please use the inferred type from `z.uuid() from Zod instead.` */
|
|
235
|
-
type UUID = z.infer<typeof uuidSchema>;
|
|
236
|
-
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
237
|
-
declare function parseUUID(UUID: unknown): UUID;
|
|
238
|
-
//#endregion
|
|
239
225
|
//#region src/types/ArrayElement.d.ts
|
|
240
226
|
/**
|
|
241
227
|
* Gets the individual element types from an array type.
|
|
@@ -244,10 +230,6 @@ declare function parseUUID(UUID: unknown): UUID;
|
|
|
244
230
|
*/
|
|
245
231
|
type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
246
232
|
//#endregion
|
|
247
|
-
//#region src/types/DeepReadonly.d.ts
|
|
248
|
-
/** @deprecated This type did not work with the deepFreeze function as intended and therefore should not be used. */
|
|
249
|
-
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;
|
|
250
|
-
//#endregion
|
|
251
233
|
//#region src/types/DisallowUndefined.d.ts
|
|
252
234
|
/**
|
|
253
235
|
* Resolves to an error message type if the type argument could potentially be undefined.
|
|
@@ -406,13 +388,11 @@ declare function omitProperties<ObjectType extends Record<string, unknown> | Rea
|
|
|
406
388
|
*
|
|
407
389
|
* @param inputString - The string to parse.
|
|
408
390
|
*
|
|
409
|
-
* @throws {
|
|
391
|
+
* @throws {DataError} If the string is not either `true` or `false` (case insensitive).
|
|
410
392
|
*
|
|
411
393
|
* @returns The string parsed as an actual boolean.
|
|
412
394
|
*/
|
|
413
395
|
declare function parseBoolean(inputString: string): boolean;
|
|
414
|
-
/** @deprecated This function has been renamed to parseBoolean. */
|
|
415
|
-
declare const stringToBoolean: typeof parseBoolean;
|
|
416
396
|
//#endregion
|
|
417
397
|
//#region src/functions/parsers/parseEnv.d.ts
|
|
418
398
|
declare const envSchema: z$1.ZodEnum<{
|
|
@@ -427,7 +407,7 @@ type Env = z$1.infer<typeof envSchema>;
|
|
|
427
407
|
*
|
|
428
408
|
* @param data - The data to parse.
|
|
429
409
|
*
|
|
430
|
-
* @throws {
|
|
410
|
+
* @throws {DataError} If the data does not match one of the environments allowed by the Env types ("test" | "development" | "production").
|
|
431
411
|
*
|
|
432
412
|
* @returns The specified environment if allowed.
|
|
433
413
|
*/
|
|
@@ -461,7 +441,7 @@ declare function parseFormData(formData: FormData): Record<string, string | Blob
|
|
|
461
441
|
* @param string - A string to convert into a number.
|
|
462
442
|
* @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.
|
|
463
443
|
*
|
|
464
|
-
* @throws {
|
|
444
|
+
* @throws {DataError} If the provided string cannot safely be converted to an integer.
|
|
465
445
|
*
|
|
466
446
|
* @returns The integer parsed from the input string.
|
|
467
447
|
*/
|
|
@@ -492,15 +472,17 @@ declare function parseVersionType(data: unknown): VersionType;
|
|
|
492
472
|
* @template Output - The Zod output type.
|
|
493
473
|
* @template Input - The Zod input type.
|
|
494
474
|
* @template Internals - The Zod internal types based on the output and input types.
|
|
475
|
+
* @template ErrorType - The type of error to throw on invalid data.
|
|
495
476
|
*
|
|
496
477
|
* @param schema - The Zod schema to use in parsing.
|
|
497
478
|
* @param data - The data to parse.
|
|
479
|
+
* @param error - A custom error to throw on invalid data (defaults to `DataError`).
|
|
498
480
|
*
|
|
499
481
|
* @throws {DataError} If the given data cannot be parsed according to the schema.
|
|
500
482
|
*
|
|
501
483
|
* @returns The parsed data from the Zod schema.
|
|
502
484
|
*/
|
|
503
|
-
declare function parseZodSchema<Output, Input, Internals extends core.$ZodTypeInternals<Output, Input
|
|
485
|
+
declare function parseZodSchema<Output, Input, Internals extends core.$ZodTypeInternals<Output, Input>, ErrorType extends Error>(schema: ZodType<Output, Input, Internals>, data: unknown, error?: ErrorType): core.output<ZodType<Output, Input, Internals>>;
|
|
504
486
|
//#endregion
|
|
505
487
|
//#region src/functions/recursive/deepCopy.d.ts
|
|
506
488
|
/**
|
|
@@ -542,14 +524,19 @@ declare function deepFreeze<ObjectType extends object>(object: ObjectType): Read
|
|
|
542
524
|
declare function appendSemicolon(stringToAppendTo: string): string;
|
|
543
525
|
//#endregion
|
|
544
526
|
//#region src/functions/stringHelpers/camelToKebab.d.ts
|
|
527
|
+
interface CamelToKebabOptions {
|
|
528
|
+
/** 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`) */
|
|
529
|
+
preserveConsecutiveCapitals?: boolean;
|
|
530
|
+
}
|
|
545
531
|
/**
|
|
546
532
|
* Converts a string from camelCase to kebab-case
|
|
547
533
|
*
|
|
548
534
|
* @param string - The string to convert.
|
|
535
|
+
* @param options - Options to apply to the conversion.
|
|
549
536
|
*
|
|
550
537
|
* @returns The string converted to kebab-case.
|
|
551
538
|
*/
|
|
552
|
-
declare function camelToKebab(string: string): string;
|
|
539
|
+
declare function camelToKebab(string: string, options?: CamelToKebabOptions): string;
|
|
553
540
|
//#endregion
|
|
554
541
|
//#region src/functions/stringHelpers/kebabToCamel.d.ts
|
|
555
542
|
interface KebabToCamelOptions {
|
|
@@ -702,23 +689,6 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
|
|
|
702
689
|
*/
|
|
703
690
|
declare const normalizeIndents: typeof normaliseIndents;
|
|
704
691
|
//#endregion
|
|
705
|
-
//#region src/functions/taggedTemplate/removeIndents.d.ts
|
|
706
|
-
interface RemoveIndentsOptions {
|
|
707
|
-
preserveTabs?: boolean;
|
|
708
|
-
}
|
|
709
|
-
type RemoveIndentsFunction = (strings: TemplateStringsArray, ...interpolations: unknown[]) => string;
|
|
710
|
-
/**
|
|
711
|
-
* @param options
|
|
712
|
-
* @deprecated This function has been renamed to normaliseIndents
|
|
713
|
-
*/
|
|
714
|
-
declare function removeIndents(options: RemoveIndentsOptions): RemoveIndentsFunction;
|
|
715
|
-
/**
|
|
716
|
-
* @param strings
|
|
717
|
-
* @param interpolations
|
|
718
|
-
* @deprecated This function has been renamed to normaliseIndents
|
|
719
|
-
*/
|
|
720
|
-
declare function removeIndents(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
|
|
721
|
-
//#endregion
|
|
722
692
|
//#region src/functions/versioning/determineVersionType.d.ts
|
|
723
693
|
/**
|
|
724
694
|
* Determines whether the given version is a major, minor, or patch version.
|
|
@@ -777,4 +747,4 @@ interface ParseVersionOptions {
|
|
|
777
747
|
*/
|
|
778
748
|
declare function parseVersion(input: string, options?: ParseVersionOptions): string;
|
|
779
749
|
//#endregion
|
|
780
|
-
export { APIError, ArrayElement, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError,
|
|
750
|
+
export { APIError, ArrayElement, CamelToKebabOptions, 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, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const VERSION_NUMBER_REGEX: string;
|
|
|
20
20
|
*
|
|
21
21
|
* @returns A Promise resolving to an array of the callback results.
|
|
22
22
|
*/
|
|
23
|
-
declare function fillArray<ItemType
|
|
23
|
+
declare function fillArray<ItemType>(callback: (index: number) => Promise<ItemType>, length?: number): Promise<ItemType[]>;
|
|
24
24
|
/**
|
|
25
25
|
* Creates a new array where each element is the result of the provided synchronous callback.
|
|
26
26
|
*
|
|
@@ -34,7 +34,7 @@ declare function fillArray<ItemType$1>(callback: (index: number) => Promise<Item
|
|
|
34
34
|
*
|
|
35
35
|
* @returns An array of the callback results.
|
|
36
36
|
*/
|
|
37
|
-
declare function fillArray<ItemType
|
|
37
|
+
declare function fillArray<ItemType>(callback: (index: number) => ItemType, length?: number): ItemType[];
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/functions/arrayHelpers/paralleliseArrays.d.ts
|
|
40
40
|
type ParallelTuple<A, B> = [A, B | undefined];
|
|
@@ -64,7 +64,7 @@ declare function paralleliseArrays<FirstArrayItem, SecondArrayItem>(firstArray:
|
|
|
64
64
|
*
|
|
65
65
|
* @returns A new array with the items randomised.
|
|
66
66
|
*/
|
|
67
|
-
declare function randomiseArray<ItemType
|
|
67
|
+
declare function randomiseArray<ItemType>(array: ItemType[]): ItemType[];
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region src/functions/arrayHelpers/range.d.ts
|
|
70
70
|
/**
|
|
@@ -94,7 +94,7 @@ declare function range(start: number, stop: number, step?: number): number[];
|
|
|
94
94
|
*
|
|
95
95
|
* @returns A new array with a different reference in memory, with the duplicates removed.
|
|
96
96
|
*/
|
|
97
|
-
declare function removeDuplicates<ItemType
|
|
97
|
+
declare function removeDuplicates<ItemType>(array: ItemType[] | readonly ItemType[]): ItemType[];
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/functions/date/addDaysToDate.d.ts
|
|
100
100
|
/**
|
|
@@ -207,11 +207,11 @@ declare class DataError extends Error {
|
|
|
207
207
|
code: string;
|
|
208
208
|
/**
|
|
209
209
|
* @param data - The data that caused the error.
|
|
210
|
-
* @param message - A human-readable error message (e.g. The data provided is invalid).
|
|
211
210
|
* @param code - A standardised code (e.g. UNEXPECTED_DATA).
|
|
211
|
+
* @param message - A human-readable error message (e.g. The data provided is invalid).
|
|
212
212
|
* @param options - Extra options to pass to super Error constructor.
|
|
213
213
|
*/
|
|
214
|
-
constructor(data: unknown,
|
|
214
|
+
constructor(data: unknown, code?: string, message?: string, options?: ErrorOptions);
|
|
215
215
|
/**
|
|
216
216
|
* Checks whether the given input may have been caused by a DataError.
|
|
217
217
|
*
|
|
@@ -222,20 +222,6 @@ declare class DataError extends Error {
|
|
|
222
222
|
static check(input: unknown): input is DataError;
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
225
|
-
//#region src/types/Email.d.ts
|
|
226
|
-
declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
|
|
227
|
-
/** @deprecated Please use the inferred type from `z.email() from Zod instead.` */
|
|
228
|
-
type Email = z.infer<typeof emailSchema>;
|
|
229
|
-
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
230
|
-
declare function parseEmail(data: unknown): Email;
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/types/UUID.d.ts
|
|
233
|
-
declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
234
|
-
/** @deprecated Please use the inferred type from `z.uuid() from Zod instead.` */
|
|
235
|
-
type UUID = z.infer<typeof uuidSchema>;
|
|
236
|
-
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
237
|
-
declare function parseUUID(UUID: unknown): UUID;
|
|
238
|
-
//#endregion
|
|
239
225
|
//#region src/types/ArrayElement.d.ts
|
|
240
226
|
/**
|
|
241
227
|
* Gets the individual element types from an array type.
|
|
@@ -244,10 +230,6 @@ declare function parseUUID(UUID: unknown): UUID;
|
|
|
244
230
|
*/
|
|
245
231
|
type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
246
232
|
//#endregion
|
|
247
|
-
//#region src/types/DeepReadonly.d.ts
|
|
248
|
-
/** @deprecated This type did not work with the deepFreeze function as intended and therefore should not be used. */
|
|
249
|
-
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;
|
|
250
|
-
//#endregion
|
|
251
233
|
//#region src/types/DisallowUndefined.d.ts
|
|
252
234
|
/**
|
|
253
235
|
* Resolves to an error message type if the type argument could potentially be undefined.
|
|
@@ -406,13 +388,11 @@ declare function omitProperties<ObjectType extends Record<string, unknown> | Rea
|
|
|
406
388
|
*
|
|
407
389
|
* @param inputString - The string to parse.
|
|
408
390
|
*
|
|
409
|
-
* @throws {
|
|
391
|
+
* @throws {DataError} If the string is not either `true` or `false` (case insensitive).
|
|
410
392
|
*
|
|
411
393
|
* @returns The string parsed as an actual boolean.
|
|
412
394
|
*/
|
|
413
395
|
declare function parseBoolean(inputString: string): boolean;
|
|
414
|
-
/** @deprecated This function has been renamed to parseBoolean. */
|
|
415
|
-
declare const stringToBoolean: typeof parseBoolean;
|
|
416
396
|
//#endregion
|
|
417
397
|
//#region src/functions/parsers/parseEnv.d.ts
|
|
418
398
|
declare const envSchema: z$1.ZodEnum<{
|
|
@@ -427,7 +407,7 @@ type Env = z$1.infer<typeof envSchema>;
|
|
|
427
407
|
*
|
|
428
408
|
* @param data - The data to parse.
|
|
429
409
|
*
|
|
430
|
-
* @throws {
|
|
410
|
+
* @throws {DataError} If the data does not match one of the environments allowed by the Env types ("test" | "development" | "production").
|
|
431
411
|
*
|
|
432
412
|
* @returns The specified environment if allowed.
|
|
433
413
|
*/
|
|
@@ -461,7 +441,7 @@ declare function parseFormData(formData: FormData): Record<string, string | Blob
|
|
|
461
441
|
* @param string - A string to convert into a number.
|
|
462
442
|
* @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.
|
|
463
443
|
*
|
|
464
|
-
* @throws {
|
|
444
|
+
* @throws {DataError} If the provided string cannot safely be converted to an integer.
|
|
465
445
|
*
|
|
466
446
|
* @returns The integer parsed from the input string.
|
|
467
447
|
*/
|
|
@@ -492,15 +472,17 @@ declare function parseVersionType(data: unknown): VersionType;
|
|
|
492
472
|
* @template Output - The Zod output type.
|
|
493
473
|
* @template Input - The Zod input type.
|
|
494
474
|
* @template Internals - The Zod internal types based on the output and input types.
|
|
475
|
+
* @template ErrorType - The type of error to throw on invalid data.
|
|
495
476
|
*
|
|
496
477
|
* @param schema - The Zod schema to use in parsing.
|
|
497
478
|
* @param data - The data to parse.
|
|
479
|
+
* @param error - A custom error to throw on invalid data (defaults to `DataError`).
|
|
498
480
|
*
|
|
499
481
|
* @throws {DataError} If the given data cannot be parsed according to the schema.
|
|
500
482
|
*
|
|
501
483
|
* @returns The parsed data from the Zod schema.
|
|
502
484
|
*/
|
|
503
|
-
declare function parseZodSchema<Output, Input, Internals extends core.$ZodTypeInternals<Output, Input
|
|
485
|
+
declare function parseZodSchema<Output, Input, Internals extends core.$ZodTypeInternals<Output, Input>, ErrorType extends Error>(schema: ZodType<Output, Input, Internals>, data: unknown, error?: ErrorType): core.output<ZodType<Output, Input, Internals>>;
|
|
504
486
|
//#endregion
|
|
505
487
|
//#region src/functions/recursive/deepCopy.d.ts
|
|
506
488
|
/**
|
|
@@ -542,14 +524,19 @@ declare function deepFreeze<ObjectType extends object>(object: ObjectType): Read
|
|
|
542
524
|
declare function appendSemicolon(stringToAppendTo: string): string;
|
|
543
525
|
//#endregion
|
|
544
526
|
//#region src/functions/stringHelpers/camelToKebab.d.ts
|
|
527
|
+
interface CamelToKebabOptions {
|
|
528
|
+
/** 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`) */
|
|
529
|
+
preserveConsecutiveCapitals?: boolean;
|
|
530
|
+
}
|
|
545
531
|
/**
|
|
546
532
|
* Converts a string from camelCase to kebab-case
|
|
547
533
|
*
|
|
548
534
|
* @param string - The string to convert.
|
|
535
|
+
* @param options - Options to apply to the conversion.
|
|
549
536
|
*
|
|
550
537
|
* @returns The string converted to kebab-case.
|
|
551
538
|
*/
|
|
552
|
-
declare function camelToKebab(string: string): string;
|
|
539
|
+
declare function camelToKebab(string: string, options?: CamelToKebabOptions): string;
|
|
553
540
|
//#endregion
|
|
554
541
|
//#region src/functions/stringHelpers/kebabToCamel.d.ts
|
|
555
542
|
interface KebabToCamelOptions {
|
|
@@ -702,23 +689,6 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
|
|
|
702
689
|
*/
|
|
703
690
|
declare const normalizeIndents: typeof normaliseIndents;
|
|
704
691
|
//#endregion
|
|
705
|
-
//#region src/functions/taggedTemplate/removeIndents.d.ts
|
|
706
|
-
interface RemoveIndentsOptions {
|
|
707
|
-
preserveTabs?: boolean;
|
|
708
|
-
}
|
|
709
|
-
type RemoveIndentsFunction = (strings: TemplateStringsArray, ...interpolations: unknown[]) => string;
|
|
710
|
-
/**
|
|
711
|
-
* @param options
|
|
712
|
-
* @deprecated This function has been renamed to normaliseIndents
|
|
713
|
-
*/
|
|
714
|
-
declare function removeIndents(options: RemoveIndentsOptions): RemoveIndentsFunction;
|
|
715
|
-
/**
|
|
716
|
-
* @param strings
|
|
717
|
-
* @param interpolations
|
|
718
|
-
* @deprecated This function has been renamed to normaliseIndents
|
|
719
|
-
*/
|
|
720
|
-
declare function removeIndents(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
|
|
721
|
-
//#endregion
|
|
722
692
|
//#region src/functions/versioning/determineVersionType.d.ts
|
|
723
693
|
/**
|
|
724
694
|
* Determines whether the given version is a major, minor, or patch version.
|
|
@@ -777,4 +747,4 @@ interface ParseVersionOptions {
|
|
|
777
747
|
*/
|
|
778
748
|
declare function parseVersion(input: string, options?: ParseVersionOptions): string;
|
|
779
749
|
//#endregion
|
|
780
|
-
export { APIError,
|
|
750
|
+
export { APIError, ArrayElement, CamelToKebabOptions, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, type Env, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, type IncrementVersionOptions, KebabToCamelOptions, NAMESPACE_EXPORT_REGEX, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, OptionalOnCondition, type ParseVersionOptions, RecordKey, StringListToArrayOptions, VERSION_NUMBER_REGEX, type 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 };
|