@vinicunca/perkakas 0.3.6 → 0.4.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/commonjs/array/index.js +0 -4
- package/dist/commonjs/guard/has-sub-object.js +19 -0
- package/dist/commonjs/guard/index.js +3 -0
- package/dist/commonjs/guard/is-deep-equal.js +55 -0
- package/dist/commonjs/guard/is-included-in.js +11 -0
- package/dist/commonjs/object/from-keys.js +15 -0
- package/dist/commonjs/object/index.js +1 -1
- package/dist/commonjs/object/merge.js +2 -2
- package/dist/commonjs/object/omit-by.js +3 -2
- package/dist/commonjs/object/pick-by.js +3 -2
- package/dist/es/array/index.js +0 -4
- package/dist/es/guard/has-sub-object.js +15 -0
- package/dist/es/guard/index.js +3 -0
- package/dist/es/guard/is-deep-equal.js +51 -0
- package/dist/es/guard/is-included-in.js +7 -0
- package/dist/es/object/from-keys.js +11 -0
- package/dist/es/object/index.js +1 -1
- package/dist/es/object/merge.js +2 -2
- package/dist/es/object/omit-by.js +3 -2
- package/dist/es/object/pick-by.js +3 -2
- package/dist/metadata.json +6976 -6506
- package/dist/types/array/difference-with.d.ts +3 -3
- package/dist/types/array/drop-first-by.d.ts +0 -1
- package/dist/types/array/drop-first-by.d.ts.map +1 -1
- package/dist/types/array/drop-last.d.ts +2 -1
- package/dist/types/array/drop-last.d.ts.map +1 -1
- package/dist/types/array/drop.d.ts +2 -1
- package/dist/types/array/drop.d.ts.map +1 -1
- package/dist/types/array/filter.d.ts +14 -0
- package/dist/types/array/filter.d.ts.map +1 -1
- package/dist/types/array/find-index.d.ts +2 -0
- package/dist/types/array/find-index.d.ts.map +1 -1
- package/dist/types/array/find-last-index.d.ts +2 -0
- package/dist/types/array/find-last-index.d.ts.map +1 -1
- package/dist/types/array/first-by.d.ts +0 -1
- package/dist/types/array/first-by.d.ts.map +1 -1
- package/dist/types/array/flat-map.d.ts +2 -0
- package/dist/types/array/flat-map.d.ts.map +1 -1
- package/dist/types/array/flatten-deep.d.ts +5 -4
- package/dist/types/array/flatten-deep.d.ts.map +1 -1
- package/dist/types/array/flatten.d.ts +7 -6
- package/dist/types/array/flatten.d.ts.map +1 -1
- package/dist/types/array/group-by.d.ts +1 -0
- package/dist/types/array/group-by.d.ts.map +1 -1
- package/dist/types/array/has-at-least.d.ts +0 -1
- package/dist/types/array/has-at-least.d.ts.map +1 -1
- package/dist/types/array/index-by.d.ts +0 -1
- package/dist/types/array/index-by.d.ts.map +1 -1
- package/dist/types/array/index.d.ts +0 -4
- package/dist/types/array/index.d.ts.map +1 -1
- package/dist/types/array/last.d.ts +2 -1
- package/dist/types/array/last.d.ts.map +1 -1
- package/dist/types/array/length.d.ts +1 -0
- package/dist/types/array/length.d.ts.map +1 -1
- package/dist/types/array/nth-by.d.ts +0 -1
- package/dist/types/array/nth-by.d.ts.map +1 -1
- package/dist/types/array/only.d.ts +2 -1
- package/dist/types/array/only.d.ts.map +1 -1
- package/dist/types/array/rank-by.d.ts +0 -1
- package/dist/types/array/rank-by.d.ts.map +1 -1
- package/dist/types/array/reduce.d.ts +2 -0
- package/dist/types/array/reduce.d.ts.map +1 -1
- package/dist/types/array/reverse.d.ts +4 -2
- package/dist/types/array/reverse.d.ts.map +1 -1
- package/dist/types/array/sort-by.d.ts +2 -3
- package/dist/types/array/sort-by.d.ts.map +1 -1
- package/dist/types/array/sorted-index-by.d.ts +0 -1
- package/dist/types/array/sorted-index-by.d.ts.map +1 -1
- package/dist/types/array/sorted-index-with.d.ts +0 -1
- package/dist/types/array/sorted-index-with.d.ts.map +1 -1
- package/dist/types/array/sorted-index.d.ts +0 -1
- package/dist/types/array/sorted-index.d.ts.map +1 -1
- package/dist/types/array/sorted-last-index-by.d.ts +0 -1
- package/dist/types/array/sorted-last-index-by.d.ts.map +1 -1
- package/dist/types/array/sorted-last-index.d.ts +0 -1
- package/dist/types/array/sorted-last-index.d.ts.map +1 -1
- package/dist/types/array/splice.d.ts +2 -1
- package/dist/types/array/splice.d.ts.map +1 -1
- package/dist/types/array/split-at.d.ts +2 -0
- package/dist/types/array/split-at.d.ts.map +1 -1
- package/dist/types/array/take-first-by.d.ts +0 -1
- package/dist/types/array/take-first-by.d.ts.map +1 -1
- package/dist/types/array/uniq-with.d.ts +3 -3
- package/dist/types/function/conditional.d.ts +0 -1
- package/dist/types/function/conditional.d.ts.map +1 -1
- package/dist/types/function/purry.d.ts +1 -0
- package/dist/types/function/purry.d.ts.map +1 -1
- package/dist/types/function/times.d.ts +0 -1
- package/dist/types/function/times.d.ts.map +1 -1
- package/dist/types/guard/has-sub-object.d.ts +35 -0
- package/dist/types/guard/has-sub-object.d.ts.map +1 -0
- package/dist/types/guard/index.d.ts +3 -0
- package/dist/types/guard/index.d.ts.map +1 -1
- package/dist/types/guard/is-deep-equal.d.ts +50 -0
- package/dist/types/guard/is-deep-equal.d.ts.map +1 -0
- package/dist/types/guard/is-included-in.d.ts +54 -0
- package/dist/types/guard/is-included-in.d.ts.map +1 -0
- package/dist/types/number/add.d.ts +0 -1
- package/dist/types/number/add.d.ts.map +1 -1
- package/dist/types/number/ceil.d.ts +2 -1
- package/dist/types/number/ceil.d.ts.map +1 -1
- package/dist/types/number/clamp.d.ts +6 -6
- package/dist/types/number/divide.d.ts +0 -1
- package/dist/types/number/divide.d.ts.map +1 -1
- package/dist/types/number/floor.d.ts +2 -1
- package/dist/types/number/floor.d.ts.map +1 -1
- package/dist/types/number/multiply.d.ts +2 -1
- package/dist/types/number/multiply.d.ts.map +1 -1
- package/dist/types/number/round.d.ts +2 -1
- package/dist/types/number/round.d.ts.map +1 -1
- package/dist/types/number/subtract.d.ts +2 -1
- package/dist/types/number/subtract.d.ts.map +1 -1
- package/dist/types/object/from-keys.d.ts +42 -0
- package/dist/types/object/from-keys.d.ts.map +1 -0
- package/dist/types/object/from-pairs.d.ts +1 -1
- package/dist/types/object/index.d.ts +1 -1
- package/dist/types/object/index.d.ts.map +1 -1
- package/dist/types/object/invert.d.ts +2 -0
- package/dist/types/object/invert.d.ts.map +1 -1
- package/dist/types/object/keys.d.ts +1 -0
- package/dist/types/object/keys.d.ts.map +1 -1
- package/dist/types/object/merge.d.ts +39 -12
- package/dist/types/object/merge.d.ts.map +1 -1
- package/dist/types/object/path-or.d.ts +2 -0
- package/dist/types/object/path-or.d.ts.map +1 -1
- package/dist/types/object/pick-by.d.ts +2 -0
- package/dist/types/object/pick-by.d.ts.map +1 -1
- package/dist/types/object/set-path.d.ts +2 -0
- package/dist/types/object/set-path.d.ts.map +1 -1
- package/dist/types/object/values.d.ts +1 -0
- package/dist/types/object/values.d.ts.map +1 -1
- package/dist/types/string/cases-types.d.ts +13 -13
- package/dist/types/string/cases-types.d.ts.map +1 -1
- package/dist/types/string/cases.d.ts +9 -9
- package/dist/types/string/cases.d.ts.map +1 -1
- package/dist/types/string/random-string.d.ts +1 -0
- package/dist/types/string/random-string.d.ts.map +1 -1
- package/dist/types/utils/purry-order-rules.d.ts +4 -4
- package/dist/types/utils/purry-order-rules.d.ts.map +1 -1
- package/package.json +11 -10
- package/dist/commonjs/array/compact.js +0 -8
- package/dist/commonjs/array/count-by.js +0 -24
- package/dist/commonjs/array/difference.js +0 -22
- package/dist/commonjs/array/intersection.js +0 -22
- package/dist/commonjs/object/equals.js +0 -67
- package/dist/es/array/compact.js +0 -4
- package/dist/es/array/count-by.js +0 -20
- package/dist/es/array/difference.js +0 -18
- package/dist/es/array/intersection.js +0 -18
- package/dist/es/object/equals.js +0 -63
- package/dist/types/array/compact.d.ts +0 -12
- package/dist/types/array/compact.d.ts.map +0 -1
- package/dist/types/array/count-by.d.ts +0 -20
- package/dist/types/array/count-by.d.ts.map +0 -1
- package/dist/types/array/difference.d.ts +0 -35
- package/dist/types/array/difference.d.ts.map +0 -1
- package/dist/types/array/intersection.d.ts +0 -30
- package/dist/types/array/intersection.d.ts.map +0 -1
- package/dist/types/object/equals.d.ts +0 -30
- package/dist/types/object/equals.d.ts.map +0 -1
|
@@ -43,7 +43,6 @@ export declare function sortedIndexWith<T>(data: ReadonlyArray<T>, predicate: (i
|
|
|
43
43
|
* for a specific item in a sorted array, and it could be used to perform
|
|
44
44
|
* similar efficient searches.
|
|
45
45
|
*
|
|
46
|
-
* @param data - Array, "sorted" by `predicate`
|
|
47
46
|
* @param predicate - A predicate which also defines the array's order
|
|
48
47
|
* @return - Index (In the range 0..data.length)
|
|
49
48
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted-index-with.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-index-with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC9B,MAAM,CAAC;AAEV
|
|
1
|
+
{"version":3,"file":"sorted-index-with.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-index-with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC9B,MAAM,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC9B,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAMtC,yBAAiB,eAAe,CAAC;IAC/B,SAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,GAC1D,MAAM,CAAC;IACV,SAAgB,OAAO,CAAC,CAAC,EACvB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,GAC1D,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;CAIvC"}
|
|
@@ -30,7 +30,6 @@ export declare function sortedIndex<T>(data: ReadonlyArray<T>, item: T): number;
|
|
|
30
30
|
*
|
|
31
31
|
* Runs in O(logN) time.
|
|
32
32
|
*
|
|
33
|
-
* @param data - The (ascending) sorted array.
|
|
34
33
|
* @param item - The item to insert.
|
|
35
34
|
* @return - Insertion index (In the range 0..array.length)
|
|
36
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted-index.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"sorted-index.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC"}
|
|
@@ -37,7 +37,6 @@ export declare function sortedLastIndexBy<T>(data: ReadonlyArray<T>, item: T, va
|
|
|
37
37
|
*
|
|
38
38
|
* Runs in O(logN) time.
|
|
39
39
|
*
|
|
40
|
-
* @param data - The (ascending) sorted array.
|
|
41
40
|
* @param item - The item to insert.
|
|
42
41
|
* @param valueFunction - All comparisons would be performed on the result of
|
|
43
42
|
* calling this function on each compared item. Preferably this function should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted-last-index-by.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-last-index-by.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAC/C,MAAM,CAAC;AAEV
|
|
1
|
+
{"version":3,"file":"sorted-last-index-by.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-last-index-by.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAC/C,MAAM,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAC/C,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAMtC,yBAAiB,iBAAiB,CAAC;IACjC,SAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,GAC/D,MAAM,CAAC;IACV,SAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,GAC/D,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;CAIvC"}
|
|
@@ -30,7 +30,6 @@ export declare function sortedLastIndex<T>(data: ReadonlyArray<T>, item: T): num
|
|
|
30
30
|
*
|
|
31
31
|
* Runs in O(logN) time.
|
|
32
32
|
*
|
|
33
|
-
* @param data - The (ascending) sorted array.
|
|
34
33
|
* @param item - The item to insert.
|
|
35
34
|
* @return - Insertion index (In the range 0..data.length)
|
|
36
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted-last-index.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-last-index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC;AAE5E
|
|
1
|
+
{"version":3,"file":"sorted-last-index.d.ts","sourceRoot":"","sources":["../../../src/array/sorted-last-index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes elements from an array and, inserts new elements in their place.
|
|
3
|
+
*
|
|
3
4
|
* @param items the array to splice.
|
|
4
5
|
* @param start the index from which to start removing elements.
|
|
5
6
|
* @param deleteCount the number of elements to remove.
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
export declare function splice<T>(items: ReadonlyArray<T>, start: number, deleteCount: number, replacement: ReadonlyArray<T>): Array<T>;
|
|
16
17
|
/**
|
|
17
18
|
* Removes elements from an array and, inserts new elements in their place.
|
|
18
|
-
*
|
|
19
|
+
*
|
|
19
20
|
* @param start the index from which to start removing elements.
|
|
20
21
|
* @param deleteCount the number of elements to remove.
|
|
21
22
|
* @param replacement the elements to insert into the array in place of the deleted elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splice.d.ts","sourceRoot":"","sources":["../../../src/array/splice.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"splice.d.ts","sourceRoot":"","sources":["../../../src/array/splice.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,GAC5B,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,GAC5B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Splits a given array at a given index.
|
|
3
|
+
*
|
|
3
4
|
* @param array the array to split
|
|
4
5
|
* @param index the index to split at
|
|
5
6
|
* @signature
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
export declare function splitAt<T>(array: ReadonlyArray<T>, index: number): [Array<T>, Array<T>];
|
|
14
15
|
/**
|
|
15
16
|
* Splits a given array at a given index.
|
|
17
|
+
*
|
|
16
18
|
* @param index the index to split at
|
|
17
19
|
* @signature
|
|
18
20
|
* P.splitAt(index)(array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-at.d.ts","sourceRoot":"","sources":["../../../src/array/split-at.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"split-at.d.ts","sourceRoot":"","sources":["../../../src/array/split-at.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,MAAM,GACZ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,MAAM,GACZ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -27,7 +27,6 @@ export declare function takeFirstBy<T>(data: ReadonlyArray<T>, n: number, ...rul
|
|
|
27
27
|
*
|
|
28
28
|
* For the opposite operation (to drop `n` elements) see `dropFirstBy`.
|
|
29
29
|
*
|
|
30
|
-
* @params data - the input array
|
|
31
30
|
* @params n - the number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.
|
|
32
31
|
* @param rules - A variadic array of order rules defining the sorting criteria.
|
|
33
32
|
* Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, "desc"]` for descending order.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"take-first-by.d.ts","sourceRoot":"","sources":["../../../src/array/take-first-by.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrE,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,4BAA4B,CAAC;AAEzF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,CAAC,EAAE,MAAM,EACT,GAAG,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ
|
|
1
|
+
{"version":3,"file":"take-first-by.d.ts","sourceRoot":"","sources":["../../../src/array/take-first-by.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrE,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,4BAA4B,CAAC;AAEzF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,CAAC,EAAE,MAAM,EACT,GAAG,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAM,EACT,GAAG,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -10,7 +10,7 @@ type IsEquals<T> = (a: T, b: T) => boolean;
|
|
|
10
10
|
* @example
|
|
11
11
|
* P.uniqWith(
|
|
12
12
|
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}],
|
|
13
|
-
* P.
|
|
13
|
+
* P.isDeepEqual,
|
|
14
14
|
* ) // => [{a: 1}, {a: 2}, {a: 5}, {a: 6}, {a: 7}]
|
|
15
15
|
* @dataFirst
|
|
16
16
|
* @category Array
|
|
@@ -22,12 +22,12 @@ export declare function uniqWith<T>(array: ReadonlyArray<T>, isEquals: IsEquals<
|
|
|
22
22
|
* @param isEquals the comparator
|
|
23
23
|
* @signature P.uniqWith(isEquals)(array)
|
|
24
24
|
* @example
|
|
25
|
-
* P.uniqWith(P.
|
|
25
|
+
* P.uniqWith(P.isDeepEqual)(
|
|
26
26
|
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}],
|
|
27
27
|
* ) // => [{a: 1}, {a: 2}, {a: 5}, {a: 6}, {a: 7}]
|
|
28
28
|
* P.pipe(
|
|
29
29
|
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}], // only 4 iterations
|
|
30
|
-
* P.uniqWith(P.
|
|
30
|
+
* P.uniqWith(P.isDeepEqual),
|
|
31
31
|
* P.take(3)
|
|
32
32
|
* ) // => [{a: 1}, {a: 2}, {a: 5}]
|
|
33
33
|
* @dataLast
|
|
@@ -23,7 +23,6 @@ type Case<In, Out, Thru extends In = In> = readonly [
|
|
|
23
23
|
* is recommended for more precise type control when such type narrowing is
|
|
24
24
|
* needed.
|
|
25
25
|
*
|
|
26
|
-
* @param data - The input data to be evaluated against the provided cases.
|
|
27
26
|
* @param cases - A list of (up to 10) tuples, each defining a case. Each tuple
|
|
28
27
|
* consists of a predicate (or a type-predicate) and a transformer function that
|
|
29
28
|
* processes the data if its case matches.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/function/conditional.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,SAAS;IAClD,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC;IAC5D,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG;CAC1B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/function/conditional.ts"],"names":[],"mappings":"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"}
|
|
@@ -20,6 +20,7 @@ interface MaybeLazyFunction {
|
|
|
20
20
|
*
|
|
21
21
|
* @param fn the function to purry.
|
|
22
22
|
* @param args the arguments
|
|
23
|
+
* @param lazyFactory - A lazy version of the function to purry.
|
|
23
24
|
* @signature P.purry(fn, arguments);
|
|
24
25
|
* @exampleRaw
|
|
25
26
|
* function findIndex_(array, fn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purry.d.ts","sourceRoot":"","sources":["../../../src/function/purry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,oBAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,aAAa,CAAC;AAE5D,UAAU,iBAAiB;IACzB,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED
|
|
1
|
+
{"version":3,"file":"purry.d.ts","sourceRoot":"","sources":["../../../src/function/purry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,oBAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,aAAa,CAAC;AAE5D,UAAU,iBAAiB;IACzB,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,KAAK,CACnB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,EACzC,WAAW,CAAC,EAAE,oBAAoB,WAmBnC"}
|
|
@@ -20,7 +20,6 @@ export declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
|
20
20
|
* and is gradually incremented to `n - 1`.
|
|
21
21
|
*
|
|
22
22
|
* @param fn The function to invoke. Passed one argument, the current value of `n`.
|
|
23
|
-
* @param count A value between `0` and `n - 1`. Increments after each function call.
|
|
24
23
|
* @return An array containing the return values of all calls to `fn`.
|
|
25
24
|
* @example P.times(identity)(5); //=> [0, 1, 2, 3, 4]
|
|
26
25
|
* @dataLast
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../../src/function/times.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../../src/function/times.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Simplify } from 'type-fest';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
4
|
+
* property and value in `subObject`, there's the same property in `object`
|
|
5
|
+
* with an equal value. Equality is checked with `isDeepEqual`.
|
|
6
|
+
*
|
|
7
|
+
* @param data - The object to test.
|
|
8
|
+
* @param subObject - The sub-object to test against.
|
|
9
|
+
* @signature
|
|
10
|
+
* P.hasSubObject(data, subObject)
|
|
11
|
+
* @example
|
|
12
|
+
* P.hasSubObject({ a: 1, b: 2, c: 3 }, { a: 1, c: 3 }) //=> true
|
|
13
|
+
* P.hasSubObject({ a: 1, b: 2, c: 3 }, { b: 4 }) //=> false
|
|
14
|
+
* P.hasSubObject({ a: 1, b: 2, c: 3 }, {}) //=> true
|
|
15
|
+
* @dataFirst
|
|
16
|
+
* @category Guard
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasSubObject<T, S extends Partial<T>>(data: T, subObject: S): data is Simplify<S & T>;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
21
|
+
* property and value in `subObject`, there's the same property in `object`
|
|
22
|
+
* with an equal value. Equality is checked with `isDeepEqual`.
|
|
23
|
+
*
|
|
24
|
+
* @param subObject - The sub-object to test against.
|
|
25
|
+
* @signature
|
|
26
|
+
* P.hasSubObject(subObject)(data)
|
|
27
|
+
* @example
|
|
28
|
+
* P.hasSubObject({ a: 1, c: 3 })({ a: 1, b: 2, c: 3 }) //=> true
|
|
29
|
+
* P.hasSubObject({ b: 4 })({ a: 1, b: 2, c: 3 }) //=> false
|
|
30
|
+
* P.hasSubObject({})({ a: 1, b: 2, c: 3 }) //=> true
|
|
31
|
+
* @dataLast
|
|
32
|
+
* @category Guard
|
|
33
|
+
*/
|
|
34
|
+
export declare function hasSubObject<T, S extends Partial<T>>(subObject: S): (data: T) => data is Simplify<S & T>;
|
|
35
|
+
//# sourceMappingURL=has-sub-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-sub-object.d.ts","sourceRoot":"","sources":["../../../src/guard/has-sub-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAI1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAClD,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,GAEd,IAAI,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAClD,SAAS,EAAE,CAAC,GACX,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
export * from './has-sub-object';
|
|
1
2
|
export * from './is-array';
|
|
2
3
|
export * from './is-boolean';
|
|
3
4
|
export * from './is-date';
|
|
5
|
+
export * from './is-deep-equal';
|
|
4
6
|
export * from './is-defined';
|
|
5
7
|
export * from './is-empty';
|
|
6
8
|
export * from './is-error';
|
|
7
9
|
export * from './is-function';
|
|
10
|
+
export * from './is-included-in';
|
|
8
11
|
export * from './is-nil';
|
|
9
12
|
export * from './is-non-null';
|
|
10
13
|
export * from './is-not';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/guard/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/guard/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a deep *semantic* comparison between two values to determine if they
|
|
3
|
+
* are equivalent. For primitive values this is equivalent to `===`, for arrays
|
|
4
|
+
* the check would be performed on every item recursively, in order, and for
|
|
5
|
+
* objects all props will be compared recursively. The built-in Date and RegExp
|
|
6
|
+
* are special-cased and will be compared by their values.
|
|
7
|
+
*
|
|
8
|
+
* !IMPORTANT: Maps, Sets and TypedArrays, and symbol properties of objects are
|
|
9
|
+
* not supported right now and might result in unexpected behavior.
|
|
10
|
+
*
|
|
11
|
+
* The result would be narrowed to the second value so that the function can be
|
|
12
|
+
* used as a type guard.
|
|
13
|
+
*
|
|
14
|
+
* @param data - The first value to compare.
|
|
15
|
+
* @param other - The second value to compare.
|
|
16
|
+
* @signature
|
|
17
|
+
* P.isDeepEqual(data, other)
|
|
18
|
+
* @example
|
|
19
|
+
* P.isDeepEqual(1, 1) //=> true
|
|
20
|
+
* P.isDeepEqual(1, '1') //=> false
|
|
21
|
+
* P.isDeepEqual([1, 2, 3], [1, 2, 3]) //=> true
|
|
22
|
+
* @dataFirst
|
|
23
|
+
* @category Guard
|
|
24
|
+
*/
|
|
25
|
+
export declare function isDeepEqual<T, S extends T = T>(data: T, other: S): data is S;
|
|
26
|
+
/**
|
|
27
|
+
* Performs a deep *semantic* comparison between two values to determine if they
|
|
28
|
+
* are equivalent. For primitive values this is equivalent to `===`, for arrays
|
|
29
|
+
* the check would be performed on every item recursively, in order, and for
|
|
30
|
+
* objects all props will be compared recursively. The built-in Date and RegExp
|
|
31
|
+
* are special-cased and will be compared by their values.
|
|
32
|
+
*
|
|
33
|
+
* !IMPORTANT: Maps, Sets and TypedArrays, and symbol properties of objects are
|
|
34
|
+
* not supported right now and might result in unexpected behavior.
|
|
35
|
+
*
|
|
36
|
+
* The result would be narrowed to the second value so that the function can be
|
|
37
|
+
* used as a type guard.
|
|
38
|
+
*
|
|
39
|
+
* @param other - The second value to compare.
|
|
40
|
+
* @signature
|
|
41
|
+
* P.isDeepEqual(other)(data)
|
|
42
|
+
* @example
|
|
43
|
+
* P.pipe(1, P.isDeepEqual(1)); //=> true
|
|
44
|
+
* P.pipe(1, P.isDeepEqual('1')); //=> false
|
|
45
|
+
* P.pipe([1, 2, 3], P.isDeepEqual([1, 2, 3])); //=> true
|
|
46
|
+
* @dataLast
|
|
47
|
+
* @category Guard
|
|
48
|
+
*/
|
|
49
|
+
export declare function isDeepEqual<T, S extends T = T>(other: S): (data: T) => data is S;
|
|
50
|
+
//# sourceMappingURL=is-deep-equal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-deep-equal.d.ts","sourceRoot":"","sources":["../../../src/guard/is-deep-equal.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC5C,KAAK,EAAE,CAAC,GACP,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IterableContainer } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the item is included in the container. This is a wrapper around
|
|
4
|
+
* `Array.prototype.includes` and `Set.prototype.has` and thus relies on the
|
|
5
|
+
* same equality checks that those functions do (which is reference equality,
|
|
6
|
+
* e.g. `===`). The input's type is narrowed to the container's type if
|
|
7
|
+
* possible.
|
|
8
|
+
*
|
|
9
|
+
* Notice that unlike most functions, this function takes a generic item as it's
|
|
10
|
+
* data and **an array** as it's parameter.
|
|
11
|
+
*
|
|
12
|
+
* @param data - The item that is checked.
|
|
13
|
+
* @param container - The items that are checked against.
|
|
14
|
+
* @returns A narrowed version of the input data on success, `false` otherwise.
|
|
15
|
+
* @signature
|
|
16
|
+
* P.isIncludedIn(data, container);
|
|
17
|
+
* @example
|
|
18
|
+
* P.isIncludedIn(2, [1, 2, 3]); // => true
|
|
19
|
+
* P.isIncludedIn(4, [1, 2, 3]); // => false
|
|
20
|
+
*
|
|
21
|
+
* const data = "cat" as "cat" | "dog" | "mouse";
|
|
22
|
+
* P.isIncludedIn(data, ["cat", "dog"] as const); // true (typed "cat" | "dog");
|
|
23
|
+
* @dataFirst
|
|
24
|
+
* @category Guard
|
|
25
|
+
*/
|
|
26
|
+
export declare function isIncludedIn<T, S extends T>(data: T, container: IterableContainer<S>): data is S;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the item is included in the container. This is a wrapper around
|
|
29
|
+
* `Array.prototype.includes` and `Set.prototype.has` and thus relies on the
|
|
30
|
+
* same equality checks that those functions do (which is reference equality,
|
|
31
|
+
* e.g. `===`). The input's type is narrowed to the container's type if
|
|
32
|
+
* possible.
|
|
33
|
+
*
|
|
34
|
+
* Notice that unlike most functions, this function takes a generic item as it's
|
|
35
|
+
* data and **an array** as it's parameter.
|
|
36
|
+
*
|
|
37
|
+
* @param container - The items that are checked against.
|
|
38
|
+
* @returns A narrowed version of the input data on success, `false` otherwise.
|
|
39
|
+
* @signature
|
|
40
|
+
* P.isIncludedIn(container)(data);
|
|
41
|
+
* @example
|
|
42
|
+
* P.pipe(2, P.isIncludedIn([1, 2, 3])); // => true
|
|
43
|
+
* P.pipe(4, P.isIncludedIn([1, 2, 3])); // => false
|
|
44
|
+
*
|
|
45
|
+
* const data = "cat" as "cat" | "dog" | "mouse";
|
|
46
|
+
* P.pipe(
|
|
47
|
+
* data,
|
|
48
|
+
* P.isIncludedIn(["cat", "dog"] as const),
|
|
49
|
+
* ); // => true (typed "cat" | "dog");
|
|
50
|
+
* @dataLast
|
|
51
|
+
* @category Guard
|
|
52
|
+
*/
|
|
53
|
+
export declare function isIncludedIn<T, S extends T>(container: IterableContainer<S>): (data: T) => data is S;
|
|
54
|
+
//# sourceMappingURL=is-included-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-included-in.d.ts","sourceRoot":"","sources":["../../../src/guard/is-included-in.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACzC,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC9B,IAAI,IAAI,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACzC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC9B,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/number/add.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/number/add.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Rounds up a given number to a specific precision.
|
|
3
3
|
* If you'd like to round up to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
4
|
* use `Math.ceil` instead, as it won't incur the additional library overhead.
|
|
5
|
+
*
|
|
5
6
|
* @param value The number to round up.
|
|
6
7
|
* @param precision The precision to round up to. Must be an integer between -15 and 15.
|
|
7
8
|
* @signature
|
|
@@ -19,7 +20,7 @@ export declare function ceil(value: number, precision: number): number;
|
|
|
19
20
|
* Rounds up a given number to a specific precision.
|
|
20
21
|
* If you'd like to round up to an integer (i.e. use this function with constant `precision === 0`),
|
|
21
22
|
* use `Math.ceil` instead, as it won't incur the additional library overhead.
|
|
22
|
-
*
|
|
23
|
+
*
|
|
23
24
|
* @param precision The precision to round up to. Must be an integer between -15 and 15.
|
|
24
25
|
* @signature
|
|
25
26
|
* P.ceil(precision)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ceil.d.ts","sourceRoot":"","sources":["../../../src/number/ceil.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"ceil.d.ts","sourceRoot":"","sources":["../../../src/number/ceil.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -11,9 +11,9 @@ interface Limits {
|
|
|
11
11
|
* @signature
|
|
12
12
|
* P.clamp(value, { min, max });
|
|
13
13
|
* @example
|
|
14
|
-
* clamp(10, { min: 20 }) // => 20
|
|
15
|
-
* clamp(10, { max: 5 }) // => 5
|
|
16
|
-
* clamp(10, { max: 20, min: 5 }) // => 10
|
|
14
|
+
* P.clamp(10, { min: 20 }) // => 20
|
|
15
|
+
* P.clamp(10, { max: 5 }) // => 5
|
|
16
|
+
* P.clamp(10, { max: 20, min: 5 }) // => 10
|
|
17
17
|
* @dataFirst
|
|
18
18
|
* @category Number
|
|
19
19
|
*/
|
|
@@ -26,9 +26,9 @@ export declare function clamp(value: number, limits: Limits): number;
|
|
|
26
26
|
* @signature
|
|
27
27
|
* P.clamp({ min, max })(value);
|
|
28
28
|
* @example
|
|
29
|
-
* clamp({ min: 20 })(10) // => 20
|
|
30
|
-
* clamp({ max: 5 })(10) // => 5
|
|
31
|
-
* clamp({ max: 20, min: 5 })(10) // => 10
|
|
29
|
+
* P.clamp({ min: 20 })(10) // => 20
|
|
30
|
+
* P.clamp({ max: 5 })(10) // => 5
|
|
31
|
+
* P.clamp({ max: 20, min: 5 })(10) // => 10
|
|
32
32
|
* @dataLast
|
|
33
33
|
* @category Number
|
|
34
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divide.d.ts","sourceRoot":"","sources":["../../../src/number/divide.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"divide.d.ts","sourceRoot":"","sources":["../../../src/number/divide.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Rounds down a given number to a specific precision.
|
|
3
3
|
* If you'd like to round down to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
4
|
* use `Math.floor` instead, as it won't incur the additional library overhead.
|
|
5
|
+
*
|
|
5
6
|
* @param value The number to round down.
|
|
6
7
|
* @param precision The precision to round down to. Must be an integer between -15 and 15.
|
|
7
8
|
* @signature
|
|
@@ -19,7 +20,7 @@ export declare function floor(value: number, precision: number): number;
|
|
|
19
20
|
* Rounds down a given number to a specific precision.
|
|
20
21
|
* If you'd like to round down to an integer (i.e. use this function with constant `precision === 0`),
|
|
21
22
|
* use `Math.floor` instead, as it won't incur the additional library overhead.
|
|
22
|
-
*
|
|
23
|
+
*
|
|
23
24
|
* @param precision The precision to round down to. Must be an integer between -15 and 15.
|
|
24
25
|
* @signature
|
|
25
26
|
* P.floor(precision)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floor.d.ts","sourceRoot":"","sources":["../../../src/number/floor.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"floor.d.ts","sourceRoot":"","sources":["../../../src/number/floor.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Multiplies two numbers.
|
|
3
|
+
*
|
|
3
4
|
* @param value The number.
|
|
4
5
|
* @param multiplicand The number to multiply the value by.
|
|
5
6
|
* @signature
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
export declare function multiply(value: number, multiplicand: number): number;
|
|
14
15
|
/**
|
|
15
16
|
* Multiplies two numbers.
|
|
16
|
-
*
|
|
17
|
+
*
|
|
17
18
|
* @param multiplicand The number to multiply the value by.
|
|
18
19
|
* @signature
|
|
19
20
|
* P.multiply(multiplicand)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/number/multiply.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/number/multiply.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Rounds a given number to a specific precision.
|
|
3
3
|
* If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
4
|
* use `Math.round` instead, as it won't incur the additional library overhead.
|
|
5
|
+
*
|
|
5
6
|
* @param value The number to round.
|
|
6
7
|
* @param precision The precision to round to. Must be an integer between -15 and 15.
|
|
7
8
|
* @signature
|
|
@@ -19,7 +20,7 @@ export declare function round(value: number, precision: number): number;
|
|
|
19
20
|
* Rounds a given number to a specific precision.
|
|
20
21
|
* If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),
|
|
21
22
|
* use `Math.round` instead, as it won't incur the additional library overhead.
|
|
22
|
-
*
|
|
23
|
+
*
|
|
23
24
|
* @param precision The precision to round to. Must be an integer between -15 and 15.
|
|
24
25
|
* @signature
|
|
25
26
|
* P.round(precision)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/number/round.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/number/round.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Subtracts two numbers.
|
|
3
|
+
*
|
|
3
4
|
* @param value The number.
|
|
4
5
|
* @param subtrahend The number to subtract from the value.
|
|
5
6
|
* @signature
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
export declare function subtract(value: number, subtrahend: number): number;
|
|
15
16
|
/**
|
|
16
17
|
* Subtracts two numbers.
|
|
17
|
-
*
|
|
18
|
+
*
|
|
18
19
|
* @param subtrahend The number to subtract from the value.
|
|
19
20
|
* @signature
|
|
20
21
|
* P.subtract(subtrahend)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subtract.d.ts","sourceRoot":"","sources":["../../../src/number/subtract.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"subtract.d.ts","sourceRoot":"","sources":["../../../src/number/subtract.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Simplify } from 'type-fest';
|
|
2
|
+
import type { IterableContainer } from '../utils/types';
|
|
3
|
+
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
4
|
+
[P in T]: V;
|
|
5
|
+
} : never;
|
|
6
|
+
type FromKeys<T extends IterableContainer, V> = T extends readonly [] ? {} : T extends readonly [infer Head, ...infer Rest] ? ExactlyOneKey<Head, V> & FromKeys<Rest, V> : T[number] extends PropertyKey ? Partial<Record<T[number], V>> : never;
|
|
7
|
+
/**
|
|
8
|
+
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
9
|
+
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
|
10
|
+
* for each item in `data`.
|
|
11
|
+
*
|
|
12
|
+
* @param data - An array of keys of the output object. All items in the array
|
|
13
|
+
* would be keys in the output array.
|
|
14
|
+
* @param mapper - Takes a key and returns the value that would be associated
|
|
15
|
+
* with that key.
|
|
16
|
+
* @signature
|
|
17
|
+
* P.fromKeys(data, mapper);
|
|
18
|
+
* @example
|
|
19
|
+
* P.fromKeys(["cat", "dog"], P.length()); // { cat: 3, dog: 3 } (typed as Partial<Record<"cat" | "dog", number>>)
|
|
20
|
+
* P.fromKeys([1, 2], P.add(1)); // { 1: 2, 2: 3 } (typed as Partial<Record<1 | 2, number>>)
|
|
21
|
+
* @dataFirst
|
|
22
|
+
* @category Object
|
|
23
|
+
*/
|
|
24
|
+
export declare function fromKeys<T extends IterableContainer<PropertyKey>, V>(data: T, mapper: (item: T[number]) => V): Simplify<FromKeys<T, V>>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
27
|
+
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
|
28
|
+
* for each item in `data`.
|
|
29
|
+
*
|
|
30
|
+
* @param mapper - Takes a key and returns the value that would be associated
|
|
31
|
+
* with that key.
|
|
32
|
+
* @signature
|
|
33
|
+
* P.fromKeys(mapper)(data);
|
|
34
|
+
* @example
|
|
35
|
+
* P.pipe(["cat", "dog"], P.fromKeys(P.length())); // { cat: 3, dog: 3 } (typed as Partial<Record<"cat" | "dog", number>>)
|
|
36
|
+
* P.pipe([1, 2], P.fromKeys(P.add(1))); // { 1: 2, 2: 3 } (typed as Partial<Record<1 | 2, number>>)
|
|
37
|
+
* @dataLast
|
|
38
|
+
* @category Object
|
|
39
|
+
*/
|
|
40
|
+
export declare function fromKeys<T extends IterableContainer<PropertyKey>, V>(mapper: (item: T[number]) => V): (data: T) => Simplify<FromKeys<T, V>>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=from-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-keys.d.ts","sourceRoot":"","sources":["../../../src/object/from-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,WAAW,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,GAAG,KAAK,CAAC;AAE3E,KAAK,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAAE,CAAC,IAAI,CAAC,SAAS,SAAS,EAAE,GAEjE,EAAE,GACF,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GAC5C,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,GAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,WAAW,GAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAC7B,KAAK,CAAC;AAEd;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,EAClE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC7B,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,EAClE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC7B,CAAC,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ type Entry<Key extends PropertyKey = PropertyKey, Value = unknown> = readonly [
|
|
|
4
4
|
value: Value
|
|
5
5
|
];
|
|
6
6
|
/**
|
|
7
|
-
* Creates a new object from an array of tuples by pairing up first and second elements as {[key]: value}
|
|
7
|
+
* Creates a new object from an array of tuples by pairing up first and second elements as `{[key]: value}`.
|
|
8
8
|
* If a tuple is not supplied for any element in the array, the element will be ignored
|
|
9
9
|
* If duplicate keys exist, the tuple with the greatest index in the input array will be preferred.
|
|
10
10
|
*
|