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.
- package/dist/array/sort.d.ts +15 -9
- package/dist/array/sort.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/array/sort.d.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import type { GenericObject } from '../object/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OrderOption, SortByOption } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* * Sorts an array of
|
|
4
|
+
* * Sorts an array of objects.
|
|
5
5
|
*
|
|
6
|
-
* -
|
|
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
|
-
* @
|
|
12
|
-
* @param
|
|
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
|
|
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
|
package/dist/array/sort.d.ts.map
CHANGED
|
@@ -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;
|
|
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