nhb-toolbox 3.1.2 → 3.1.3

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.
@@ -1,16 +1,22 @@
1
1
  import type { GenericObject } from '../object/types';
2
- import type { SortOptions } from './types';
2
+ import type { OrderOption, SortByOption } from './types';
3
3
  /**
4
- * * Sorts an array of strings, numbers, booleans, or objects based on the provided options.
4
+ * * Sorts an array of objects.
5
5
  *
6
- * - If the array contains strings, it sorts them alphabetically.
7
- * - If the array contains numbers, it sorts them numerically.
8
- * - If the array contains booleans, it sorts them by their boolean value.
9
- * - If the array contains objects, it sorts them by the specified field in the options `sortByField`.
6
+ * - Sorts array by the specified field.
10
7
  *
11
- * @param array - The array to sort.
12
- * @param options - Sorting options for objects.
8
+ * @template T - The type of objects in the array.
9
+ * @param array - The array of objects to sort.
10
+ * @param options - Sorting options.
13
11
  * @returns The sorted array.
14
12
  */
15
- export declare function sortAnArray<T extends number | string | boolean | GenericObject>(array: T[], options?: SortOptions<T>): T[];
13
+ export declare function sortAnArray<T extends GenericObject>(array: T[], options: SortByOption<T>): T[];
14
+ /**
15
+ * * Sorts an array of `strings`, `numbers` or `boolean`.
16
+ *
17
+ * @param array - The array of `strings`, `numbers` or `boolean` to sort.
18
+ * @param options - Sorting options.
19
+ * @returns The sorted array.
20
+ */
21
+ export declare function sortAnArray<T extends string | number | boolean>(array: T[], options?: OrderOption): T[];
16
22
  //# sourceMappingURL=sort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/array/sort.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAC1B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,EAClD,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAsE3C"}
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/array/sort.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AAEtE;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,aAAa,EAClD,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,CAAC,EAAE,CAAC;AAEP;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EAC9D,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,WAAW,GACnB,CAAC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",