@alextheman/utility 2.15.1 → 2.16.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.cjs CHANGED
@@ -63,6 +63,7 @@ __export(index_exports, {
63
63
  isSameDate: () => isSameDate_default,
64
64
  kebabToCamel: () => kebabToCamel_default,
65
65
  omitProperties: () => omitProperties_default,
66
+ paralleliseArrays: () => paralleliseArrays_default,
66
67
  parseEmail: () => Email_default,
67
68
  parseEnv: () => Env_default,
68
69
  parseIntStrict: () => parseIntStrict_default,
@@ -390,6 +391,16 @@ function omitProperties(object, keysToOmit) {
390
391
  }
391
392
  var omitProperties_default = omitProperties;
392
393
 
394
+ // src/functions/paralleliseArrays.ts
395
+ function paralleliseArrays(firstArray, secondArray) {
396
+ const outputArray = [];
397
+ for (let i = 0; i < firstArray.length; i++) {
398
+ outputArray.push([firstArray[i], secondArray[i]]);
399
+ }
400
+ return outputArray;
401
+ }
402
+ var paralleliseArrays_default = paralleliseArrays;
403
+
393
404
  // src/functions/randomiseArray.ts
394
405
  function randomiseArray(array) {
395
406
  const mutableArray = [...array];
@@ -564,6 +575,7 @@ var UUID_default = parseUUID;
564
575
  isSameDate,
565
576
  kebabToCamel,
566
577
  omitProperties,
578
+ paralleliseArrays,
567
579
  parseEmail,
568
580
  parseEnv,
569
581
  parseIntStrict,
package/dist/index.d.cts CHANGED
@@ -86,6 +86,9 @@ declare function kebabToCamel(string: string, options?: KebabToCamelOptions): st
86
86
 
87
87
  declare function omitProperties<T extends Record<string, unknown> | Readonly<Record<string, unknown>>, K extends keyof T>(object: T, keysToOmit: K | readonly K[]): Omit<T, K>;
88
88
 
89
+ type ParallelTuple<A, B> = [A, B | undefined];
90
+ declare function paralleliseArrays<FirstArrayItem, SecondArrayItem>(firstArray: FirstArrayItem[], secondArray: SecondArrayItem[]): ParallelTuple<FirstArrayItem, SecondArrayItem>[];
91
+
89
92
  declare function parseIntStrict(...[string, radix]: Parameters<typeof parseInt>): number;
90
93
 
91
94
  declare function randomiseArray<T>(array: T[]): T[];
@@ -108,4 +111,4 @@ declare function wait(seconds: number): Promise<void>;
108
111
 
109
112
  declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
110
113
 
111
- export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
114
+ export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -86,6 +86,9 @@ declare function kebabToCamel(string: string, options?: KebabToCamelOptions): st
86
86
 
87
87
  declare function omitProperties<T extends Record<string, unknown> | Readonly<Record<string, unknown>>, K extends keyof T>(object: T, keysToOmit: K | readonly K[]): Omit<T, K>;
88
88
 
89
+ type ParallelTuple<A, B> = [A, B | undefined];
90
+ declare function paralleliseArrays<FirstArrayItem, SecondArrayItem>(firstArray: FirstArrayItem[], secondArray: SecondArrayItem[]): ParallelTuple<FirstArrayItem, SecondArrayItem>[];
91
+
89
92
  declare function parseIntStrict(...[string, radix]: Parameters<typeof parseInt>): number;
90
93
 
91
94
  declare function randomiseArray<T>(array: T[]): T[];
@@ -108,4 +111,4 @@ declare function wait(seconds: number): Promise<void>;
108
111
 
109
112
  declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
110
113
 
111
- export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
114
+ export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
package/dist/index.js CHANGED
@@ -329,6 +329,16 @@ function omitProperties(object, keysToOmit) {
329
329
  }
330
330
  var omitProperties_default = omitProperties;
331
331
 
332
+ // src/functions/paralleliseArrays.ts
333
+ function paralleliseArrays(firstArray, secondArray) {
334
+ const outputArray = [];
335
+ for (let i = 0; i < firstArray.length; i++) {
336
+ outputArray.push([firstArray[i], secondArray[i]]);
337
+ }
338
+ return outputArray;
339
+ }
340
+ var paralleliseArrays_default = paralleliseArrays;
341
+
332
342
  // src/functions/randomiseArray.ts
333
343
  function randomiseArray(array) {
334
344
  const mutableArray = [...array];
@@ -502,6 +512,7 @@ export {
502
512
  isSameDate_default as isSameDate,
503
513
  kebabToCamel_default as kebabToCamel,
504
514
  omitProperties_default as omitProperties,
515
+ paralleliseArrays_default as paralleliseArrays,
505
516
  Email_default as parseEmail,
506
517
  Env_default as parseEnv,
507
518
  parseIntStrict_default as parseIntStrict,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "2.15.1",
3
+ "version": "2.16.0",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,20 +40,16 @@
40
40
  "zod": "^4.1.12"
41
41
  },
42
42
  "devDependencies": {
43
- "@alextheman/eslint-plugin": "^2.6.2",
44
- "@eslint/js": "^9.39.1",
45
- "@types/node": "^24.10.0",
43
+ "@alextheman/eslint-plugin": "^3.0.0",
44
+ "@types/node": "^24.10.1",
46
45
  "eslint": "^9.39.1",
47
- "eslint-import-resolver-typescript": "^4.4.4",
48
- "eslint-plugin-import": "^2.32.0",
49
46
  "globals": "^16.5.0",
50
47
  "husky": "^9.1.7",
51
- "jsdom": "^27.1.0",
48
+ "jsdom": "^27.2.0",
52
49
  "prettier": "^3.6.2",
53
- "tsup": "^8.5.0",
50
+ "tsup": "^8.5.1",
54
51
  "typescript": "^5.9.3",
55
- "typescript-eslint": "^8.46.3",
56
52
  "vite-tsconfig-paths": "^5.1.4",
57
- "vitest": "^4.0.8"
53
+ "vitest": "^4.0.9"
58
54
  }
59
55
  }