@vinicunca/perkakas 1.0.0 → 1.0.2
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/add-prop.d.cts +5 -9
- package/dist/add-prop.d.ts +5 -9
- package/dist/chunk-2T576V7A.js +1 -0
- package/dist/chunk-5NG5PDAH.js +1 -0
- package/dist/{chunk-4PHYW76J.cjs → chunk-64KL2FA2.cjs} +1 -1
- package/dist/chunk-6TRXWRYJ.cjs +1 -0
- package/dist/chunk-CIZWCFSY.cjs +1 -0
- package/dist/chunk-E6JSDI5S.cjs +1 -0
- package/dist/chunk-EBS4GCKX.js +1 -0
- package/dist/{chunk-WN5RHRS6.cjs → chunk-GUZPDGVH.cjs} +1 -1
- package/dist/chunk-GXVKH5OX.cjs +1 -0
- package/dist/chunk-H2E5GCCP.js +1 -0
- package/dist/chunk-KG2TAX4E.js +1 -0
- package/dist/chunk-LWPEZ7RI.js +1 -0
- package/dist/chunk-MKM3UJUV.js +1 -0
- package/dist/chunk-R3TYGYBQ.cjs +1 -0
- package/dist/chunk-RBODUO3Q.js +1 -0
- package/dist/chunk-T2LJNGWI.js +1 -0
- package/dist/chunk-TFN3JWPS.cjs +1 -0
- package/dist/chunk-TKJ7YEHS.cjs +1 -0
- package/dist/chunk-TT2VLICK.js +1 -0
- package/dist/chunk-UHUFGDIS.cjs +1 -0
- package/dist/chunk-VEG55EJ6.cjs +1 -0
- package/dist/chunk-XXU2FTTA.cjs +1 -0
- package/dist/chunk-ZIF7K2PC.js +1 -0
- package/dist/chunk-ZSI3ZTMX.js +1 -0
- package/dist/chunk.d.cts +1 -1
- package/dist/chunk.d.ts +1 -1
- package/dist/concat.d.cts +1 -1
- package/dist/concat.d.ts +1 -1
- package/dist/conditional.cjs +1 -1
- package/dist/conditional.d.cts +6 -6
- package/dist/conditional.d.ts +6 -6
- package/dist/conditional.js +1 -1
- package/dist/drop-first-by.d.cts +1 -1
- package/dist/drop-first-by.d.ts +1 -1
- package/dist/evolve.d.cts +1 -1
- package/dist/evolve.d.ts +1 -1
- package/dist/first-by.d.cts +1 -1
- package/dist/first-by.d.ts +1 -1
- package/dist/first.d.cts +1 -1
- package/dist/first.d.ts +1 -1
- package/dist/flat.d.cts +1 -1
- package/dist/flat.d.ts +1 -1
- package/dist/for-each-obj.d.cts +1 -1
- package/dist/for-each-obj.d.ts +1 -1
- package/dist/for-each.cjs +1 -1
- package/dist/for-each.d.cts +5 -2
- package/dist/for-each.d.ts +5 -2
- package/dist/for-each.js +1 -1
- package/dist/from-entries.d.cts +5 -5
- package/dist/from-entries.d.ts +5 -5
- package/dist/from-keys.cjs +1 -1
- package/dist/from-keys.d.cts +2 -2
- package/dist/from-keys.d.ts +2 -2
- package/dist/from-keys.js +1 -1
- package/dist/group-by.d.cts +1 -1
- package/dist/group-by.d.ts +1 -1
- package/dist/has-at-least.d.cts +1 -1
- package/dist/has-at-least.d.ts +1 -1
- package/dist/has-sub-object.cjs +1 -1
- package/dist/has-sub-object.d.cts +18 -3
- package/dist/has-sub-object.d.ts +18 -3
- package/dist/has-sub-object.js +1 -1
- package/dist/human-readable-file-size.d.cts +3 -5
- package/dist/human-readable-file-size.d.ts +3 -5
- package/dist/index-by.d.cts +1 -1
- package/dist/index-by.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/is-array.d.cts +1 -1
- package/dist/is-array.d.ts +1 -1
- package/dist/is-big-int.d.cts +1 -1
- package/dist/is-big-int.d.ts +1 -1
- package/dist/is-boolean.d.cts +1 -1
- package/dist/is-boolean.d.ts +1 -1
- package/dist/is-empty.d.cts +1 -1
- package/dist/is-empty.d.ts +1 -1
- package/dist/is-included-in.d.cts +1 -1
- package/dist/is-included-in.d.ts +1 -1
- package/dist/is-nullish.d.cts +1 -1
- package/dist/is-nullish.d.ts +1 -1
- package/dist/is-number.d.cts +1 -1
- package/dist/is-number.d.ts +1 -1
- package/dist/is-object-type.cjs +1 -1
- package/dist/is-object-type.d.cts +6 -4
- package/dist/is-object-type.d.ts +6 -4
- package/dist/is-object-type.js +1 -1
- package/dist/is-plain-object.d.cts +1 -1
- package/dist/is-plain-object.d.ts +1 -1
- package/dist/is-string.d.cts +1 -1
- package/dist/is-string.d.ts +1 -1
- package/dist/is-symbol.d.cts +1 -1
- package/dist/is-symbol.d.ts +1 -1
- package/dist/keys.d.cts +1 -1
- package/dist/keys.d.ts +1 -1
- package/dist/last.d.cts +1 -1
- package/dist/last.d.ts +1 -1
- package/dist/map-keys.cjs +1 -1
- package/dist/map-keys.d.cts +3 -3
- package/dist/map-keys.d.ts +3 -3
- package/dist/map-keys.js +1 -1
- package/dist/map-values.d.cts +1 -1
- package/dist/map-values.d.ts +1 -1
- package/dist/map-with-feedback.d.cts +1 -1
- package/dist/map-with-feedback.d.ts +1 -1
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/nth-by.d.cts +1 -1
- package/dist/nth-by.d.ts +1 -1
- package/dist/omit-by.cjs +1 -1
- package/dist/omit-by.d.cts +3 -3
- package/dist/omit-by.d.ts +3 -3
- package/dist/omit-by.js +1 -1
- package/dist/only.d.cts +1 -1
- package/dist/only.d.ts +1 -1
- package/dist/pick-by.cjs +1 -1
- package/dist/pick-by.d.cts +3 -3
- package/dist/pick-by.d.ts +3 -3
- package/dist/pick-by.js +1 -1
- package/dist/product.cjs +1 -1
- package/dist/product.d.cts +22 -5
- package/dist/product.d.ts +22 -5
- package/dist/product.js +1 -1
- package/dist/pull-object.cjs +1 -1
- package/dist/pull-object.d.cts +3 -3
- package/dist/pull-object.d.ts +3 -3
- package/dist/pull-object.js +1 -1
- package/dist/rank-by.d.cts +1 -1
- package/dist/rank-by.d.ts +1 -1
- package/dist/sample.d.cts +1 -1
- package/dist/sample.d.ts +1 -1
- package/dist/set.d.cts +1 -1
- package/dist/set.d.ts +1 -1
- package/dist/sleep.d.cts +3 -4
- package/dist/sleep.d.ts +3 -4
- package/dist/slugify.d.cts +3 -5
- package/dist/slugify.d.ts +3 -5
- package/dist/sort-by.d.cts +1 -1
- package/dist/sort-by.d.ts +1 -1
- package/dist/sort.d.cts +1 -1
- package/dist/sort.d.ts +1 -1
- package/dist/split.cjs +1 -0
- package/dist/split.d.cts +60 -0
- package/dist/split.d.ts +60 -0
- package/dist/split.js +1 -0
- package/dist/string-to-path.d.cts +5 -2
- package/dist/string-to-path.d.ts +5 -2
- package/dist/sum.cjs +1 -1
- package/dist/sum.d.cts +22 -5
- package/dist/sum.d.ts +22 -5
- package/dist/sum.js +1 -1
- package/dist/swap-indices.d.cts +1 -1
- package/dist/swap-indices.d.ts +1 -1
- package/dist/take-first-by.d.cts +1 -1
- package/dist/take-first-by.d.ts +1 -1
- package/dist/times.d.cts +13 -4
- package/dist/times.d.ts +13 -4
- package/dist/{types-DCY4LHuA.d.cts → types-BMu1PIvo.d.cts} +41 -28
- package/dist/{types-DCY4LHuA.d.ts → types-BMu1PIvo.d.ts} +41 -28
- package/dist/values.d.cts +1 -1
- package/dist/values.d.ts +1 -1
- package/dist/zip-with.d.cts +1 -1
- package/dist/zip-with.d.ts +1 -1
- package/dist/zip.d.cts +1 -1
- package/dist/zip.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-2G3P6PPR.js +0 -1
- package/dist/chunk-2SALTIYD.js +0 -1
- package/dist/chunk-5OVP2TQW.js +0 -1
- package/dist/chunk-67PSL457.cjs +0 -1
- package/dist/chunk-6LV46ASN.cjs +0 -1
- package/dist/chunk-6SQ2YEMB.js +0 -1
- package/dist/chunk-775ZQ6M4.js +0 -1
- package/dist/chunk-BH4FVL5M.js +0 -1
- package/dist/chunk-DQPVQH4H.cjs +0 -1
- package/dist/chunk-EIHJRQSP.js +0 -1
- package/dist/chunk-I237OF5R.cjs +0 -1
- package/dist/chunk-IF5LD7K5.js +0 -1
- package/dist/chunk-LNPZR2QM.cjs +0 -1
- package/dist/chunk-S2HXZ3NZ.cjs +0 -1
- package/dist/chunk-T43Q6JL2.js +0 -1
- package/dist/chunk-TUUS6PD5.cjs +0 -1
- package/dist/chunk-U5RGUZNM.js +0 -1
- package/dist/chunk-VD6VNORF.cjs +0 -1
- package/dist/chunk-YZNFAANS.cjs +0 -1
- package/dist/chunk-Z6SSEPER.js +0 -1
package/dist/add-prop.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UpsertProp } from './types-
|
|
1
|
+
import { U as UpsertProp } from './types-BMu1PIvo.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,11 +8,9 @@ import 'type-fest';
|
|
|
8
8
|
* @param prop the property name
|
|
9
9
|
* @param value the property value
|
|
10
10
|
* @signature
|
|
11
|
-
* addProp(obj, prop, value)
|
|
11
|
+
* P.addProp(obj, prop, value)
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* addProp({ firstName: 'john' }, 'lastName', 'doe'); // => {firstName: 'john', lastName: 'doe'}
|
|
13
|
+
* P.addProp({ firstName: 'john' }, 'lastName', 'doe'); // => {firstName: 'john', lastName: 'doe'}
|
|
16
14
|
* @dataFirst
|
|
17
15
|
* @category Object
|
|
18
16
|
*/
|
|
@@ -23,11 +21,9 @@ declare function addProp<T, K extends PropertyKey, V>(obj: T, prop: K, value: V)
|
|
|
23
21
|
* @param prop the property name
|
|
24
22
|
* @param value the property value
|
|
25
23
|
* @signature
|
|
26
|
-
* addProp(prop, value)(obj)
|
|
24
|
+
* P.addProp(prop, value)(obj)
|
|
27
25
|
* @example
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* addProp('lastName', 'doe')({ firstName: 'john' }); // => {firstName: 'john', lastName: 'doe'}
|
|
26
|
+
* P.addProp('lastName', 'doe')({ firstName: 'john' }); // => {firstName: 'john', lastName: 'doe'}
|
|
31
27
|
* @dataLast
|
|
32
28
|
* @category Object
|
|
33
29
|
*/
|
package/dist/add-prop.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UpsertProp } from './types-
|
|
1
|
+
import { U as UpsertProp } from './types-BMu1PIvo.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,11 +8,9 @@ import 'type-fest';
|
|
|
8
8
|
* @param prop the property name
|
|
9
9
|
* @param value the property value
|
|
10
10
|
* @signature
|
|
11
|
-
* addProp(obj, prop, value)
|
|
11
|
+
* P.addProp(obj, prop, value)
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* addProp({ firstName: 'john' }, 'lastName', 'doe'); // => {firstName: 'john', lastName: 'doe'}
|
|
13
|
+
* P.addProp({ firstName: 'john' }, 'lastName', 'doe'); // => {firstName: 'john', lastName: 'doe'}
|
|
16
14
|
* @dataFirst
|
|
17
15
|
* @category Object
|
|
18
16
|
*/
|
|
@@ -23,11 +21,9 @@ declare function addProp<T, K extends PropertyKey, V>(obj: T, prop: K, value: V)
|
|
|
23
21
|
* @param prop the property name
|
|
24
22
|
* @param value the property value
|
|
25
23
|
* @signature
|
|
26
|
-
* addProp(prop, value)(obj)
|
|
24
|
+
* P.addProp(prop, value)(obj)
|
|
27
25
|
* @example
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* addProp('lastName', 'doe')({ firstName: 'john' }); // => {firstName: 'john', lastName: 'doe'}
|
|
26
|
+
* P.addProp('lastName', 'doe')({ firstName: 'john' }); // => {firstName: 'john', lastName: 'doe'}
|
|
31
27
|
* @dataLast
|
|
32
28
|
* @category Object
|
|
33
29
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-JFXZ246Y.js";function a(...n){return t(i,n)}function i(n){let e=typeof n[0]=="bigint"?0n:0;for(let r of n)e+=r;return e}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-JFXZ246Y.js";function l(...e){return t(y,e)}function y(e,a){let n={};for(let[o,r]of Object.entries(e)){let u=a(o,r,e);n[u]=r}return n}export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD32D4HMPcjs = require('./chunk-D32D4HMP.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD32D4HMPcjs = require('./chunk-D32D4HMP.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function o(...e){return _chunkY74ER22Ocjs.a.call(void 0, c,e)}function c(e,y){for(let[t,u]of Object.entries(y))if(!Object.hasOwn(e,t)||!_chunkD32D4HMPcjs.a.call(void 0, u,e[t]))return!1;return!0}exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function a(...n){return _chunkY74ER22Ocjs.a.call(void 0, i,n)}function i(n){let e=typeof n[0]=="bigint"?0n:0;for(let r of n)e+=r;return e}exports.a = a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function s(...e){return _chunkY74ER22Ocjs.a.call(void 0, l,e)}function l(e,a){let t={...e};for(let[n,o]of Object.entries(t))a(o,n,e)&&delete t[n];return t}exports.a = s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function u(n,t,e){return n(e[0])?r=>t(r,...e):t(...e)}var x=Object.assign(a,{defaultCase:R});function a(...n){return u(s,o,n)}function o(n,...t){for(let[e,r]of t)if(e(n))return r(n);throw new Error("conditional: data failed for all cases")}function s(n){if(!Array.isArray(n))return!1;let[t,e,...r]=n;return typeof t=="function"&&t.length<=1&&typeof e=="function"&&e.length<=1&&r.length===0}function R(n=c){return[T,n]}function T(){return!0}function c(){}exports.a = x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(e){return typeof e=="object"&&e!==null}export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function i(...e){return _chunkY74ER22Ocjs.a.call(void 0, m,e)}function m(e,o){let r={};for(let[y,
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function i(...e){return _chunkY74ER22Ocjs.a.call(void 0, m,e)}function m(e,o){let r={};for(let[y,t]of e.entries())r[t]=o(t,y,e);return r}exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function i(...e){return _chunkY74ER22Ocjs.a.call(void 0, u,e)}function u(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u(n,t,e){return n(e[0])?r=>t(r,...e):t(...e)}var x=Object.assign(a,{defaultCase:R});function a(...n){return u(s,o,n)}function o(n,...t){for(let[e,r]of t)if(e(n))return r(n);throw new Error("conditional: data failed for all cases")}function s(n){if(!Array.isArray(n))return!1;let[t,e,...r]=n;return typeof t=="function"&&t.length<=1&&typeof e=="function"&&e.length<=1&&r.length===0}function R(n=c){return[T,n]}function T(){return!0}function c(){}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-JFXZ246Y.js";function a(...n){return t(o,n)}function o(n){let e=typeof n[0]=="bigint"?1n:1;for(let r of n)e*=r;return e}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-JFXZ246Y.js";function i(...e){return a(u,e)}function u(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-JFXZ246Y.js";function x(...e){return a(d,e)}function d(e,o,u){let t={};for(let[r,n]of e.entries()){let i=o(n,r,e),c=u(n,r,e);t[i]=c}return t}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function o(e){return typeof e=="object"&&e!==null}exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(t,e,n){return typeof e=="number"||e===void 0?r=>r.split(t,e):t.split(e,n)}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-JFXZ246Y.js";function l(...e){return a(o,e,i)}function o(e,r){return e.forEach(r),e}function i(e){return(r,n,t)=>(e(r,n,t),{done:!1,hasNext:!0,next:r})}export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function i(t,e,n){return typeof e=="number"||e===void 0?r=>r.split(t,e):t.split(e,n)}exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function a(...n){return _chunkY74ER22Ocjs.a.call(void 0, o,n)}function o(n){let e=typeof n[0]=="bigint"?1n:1;for(let r of n)e*=r;return e}exports.a = a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-JFXZ246Y.js";function i(...e){return n(m,e)}function m(e,o){let r={};for(let[y,t]of e.entries())r[t]=o(t,y,e);return r}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function l(...e){return _chunkY74ER22Ocjs.a.call(void 0, o,e,i)}function o(e,r){return e.forEach(r),e}function i(e){return(r,n,t)=>(e(r,n,t),{done:!1,hasNext:!0,next:r})}exports.a = l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function x(...e){return _chunkY74ER22Ocjs.a.call(void 0, d,e)}function d(e,o,u){let t={};for(let[r,n]of e.entries()){let i=o(n,r,e),c=u(n,r,e);t[i]=c}return t}exports.a = x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function l(...e){return _chunkY74ER22Ocjs.a.call(void 0, y,e)}function y(e,a){let n={};for(let[o,r]of Object.entries(e)){let u=a(o,r,e);n[u]=r}return n}exports.a = l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-JFXZ246Y.js";function s(...e){return r(l,e)}function l(e,a){let t={...e};for(let[n,o]of Object.entries(t))a(o,n,e)&&delete t[n];return t}export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-YTNT635N.js";import{a as b}from"./chunk-JFXZ246Y.js";function o(...e){return b(c,e)}function c(e,y){for(let[t,u]of Object.entries(y))if(!Object.hasOwn(e,t)||!a(u,e[t]))return!1;return!0}export{o as a};
|
package/dist/chunk.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer, N as NonEmptyArray } from './types-
|
|
1
|
+
import { I as IterableContainer, N as NonEmptyArray } from './types-BMu1PIvo.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Chunked<T extends IterableContainer> = T[number] extends never ? [] : T extends readonly [...Array<unknown>, unknown] | readonly [unknown, ...Array<unknown>] ? NonEmptyArray<NonEmptyArray<T[number]>> : Array<NonEmptyArray<T[number]>>;
|
package/dist/chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer, N as NonEmptyArray } from './types-
|
|
1
|
+
import { I as IterableContainer, N as NonEmptyArray } from './types-BMu1PIvo.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Chunked<T extends IterableContainer> = T[number] extends never ? [] : T extends readonly [...Array<unknown>, unknown] | readonly [unknown, ...Array<unknown>] ? NonEmptyArray<NonEmptyArray<T[number]>> : Array<NonEmptyArray<T[number]>>;
|
package/dist/concat.d.cts
CHANGED
package/dist/concat.d.ts
CHANGED
package/dist/conditional.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6JSDI5Scjs = require('./chunk-E6JSDI5S.cjs');exports.conditional = _chunkE6JSDI5Scjs.a;
|
package/dist/conditional.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
];
|
|
1
|
+
import { G as GuardType } from './types-BMu1PIvo.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
4
|
+
type Case<In, Out, When extends (x: In) => boolean = (x: In) => boolean> = readonly [when: When, then: (x: GuardType<When, In> & In) => Out];
|
|
5
5
|
declare const conditionalPlus: typeof conditional & {
|
|
6
6
|
defaultCase: typeof defaultCase;
|
|
7
7
|
};
|
|
@@ -50,7 +50,7 @@ declare const conditionalPlus: typeof conditional & {
|
|
|
50
50
|
* @dataLast
|
|
51
51
|
* @category Function
|
|
52
52
|
*/
|
|
53
|
-
declare function conditional<T,
|
|
53
|
+
declare function conditional<T, Fn0 extends (x: T) => boolean, Fn1 extends (x: T) => boolean, Fn2 extends (x: T) => boolean, Fn3 extends (x: T) => boolean, Fn4 extends (x: T) => boolean, Fn5 extends (x: T) => boolean, Fn6 extends (x: T) => boolean, Fn7 extends (x: T) => boolean, Fn8 extends (x: T) => boolean, Fn9 extends (x: T) => boolean, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never>(case0: Case<T, Return0, Fn0>, case1?: Case<T, Return1, Fn1>, case2?: Case<T, Return2, Fn2>, case3?: Case<T, Return3, Fn3>, case4?: Case<T, Return4, Fn4>, case5?: Case<T, Return5, Fn5>, case6?: Case<T, Return6, Fn6>, case7?: Case<T, Return7, Fn7>, case8?: Case<T, Return8, Fn8>, case9?: Case<T, Return9, Fn9>): (data: T) => Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
54
54
|
/**
|
|
55
55
|
* Executes a transformer function based on the first matching predicate,
|
|
56
56
|
* functioning like a series of `if...else if...` statements. It sequentially
|
|
@@ -94,7 +94,7 @@ declare function conditional<T, Return0, Return1 = never, Return2 = never, Retur
|
|
|
94
94
|
* @dataFirst
|
|
95
95
|
* @category Function
|
|
96
96
|
*/
|
|
97
|
-
declare function conditional<T,
|
|
97
|
+
declare function conditional<T, Fn0 extends (x: T) => boolean, Fn1 extends (x: T) => boolean, Fn2 extends (x: T) => boolean, Fn3 extends (x: T) => boolean, Fn4 extends (x: T) => boolean, Fn5 extends (x: T) => boolean, Fn6 extends (x: T) => boolean, Fn7 extends (x: T) => boolean, Fn8 extends (x: T) => boolean, Fn9 extends (x: T) => boolean, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never>(data: T, case0: Case<T, Return0, Fn0>, case1?: Case<T, Return1, Fn1>, case2?: Case<T, Return2, Fn2>, case3?: Case<T, Return3, Fn3>, case4?: Case<T, Return4, Fn4>, case5?: Case<T, Return5, Fn5>, case6?: Case<T, Return6, Fn6>, case7?: Case<T, Return7, Fn7>, case8?: Case<T, Return8, Fn8>, case9?: Case<T, Return9, Fn9>): Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
98
98
|
/**
|
|
99
99
|
* A simplified case that accepts all data. Put this as the last case to
|
|
100
100
|
* prevent an exception from being thrown when none of the previous cases
|
package/dist/conditional.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
];
|
|
1
|
+
import { G as GuardType } from './types-BMu1PIvo.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
4
|
+
type Case<In, Out, When extends (x: In) => boolean = (x: In) => boolean> = readonly [when: When, then: (x: GuardType<When, In> & In) => Out];
|
|
5
5
|
declare const conditionalPlus: typeof conditional & {
|
|
6
6
|
defaultCase: typeof defaultCase;
|
|
7
7
|
};
|
|
@@ -50,7 +50,7 @@ declare const conditionalPlus: typeof conditional & {
|
|
|
50
50
|
* @dataLast
|
|
51
51
|
* @category Function
|
|
52
52
|
*/
|
|
53
|
-
declare function conditional<T,
|
|
53
|
+
declare function conditional<T, Fn0 extends (x: T) => boolean, Fn1 extends (x: T) => boolean, Fn2 extends (x: T) => boolean, Fn3 extends (x: T) => boolean, Fn4 extends (x: T) => boolean, Fn5 extends (x: T) => boolean, Fn6 extends (x: T) => boolean, Fn7 extends (x: T) => boolean, Fn8 extends (x: T) => boolean, Fn9 extends (x: T) => boolean, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never>(case0: Case<T, Return0, Fn0>, case1?: Case<T, Return1, Fn1>, case2?: Case<T, Return2, Fn2>, case3?: Case<T, Return3, Fn3>, case4?: Case<T, Return4, Fn4>, case5?: Case<T, Return5, Fn5>, case6?: Case<T, Return6, Fn6>, case7?: Case<T, Return7, Fn7>, case8?: Case<T, Return8, Fn8>, case9?: Case<T, Return9, Fn9>): (data: T) => Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
54
54
|
/**
|
|
55
55
|
* Executes a transformer function based on the first matching predicate,
|
|
56
56
|
* functioning like a series of `if...else if...` statements. It sequentially
|
|
@@ -94,7 +94,7 @@ declare function conditional<T, Return0, Return1 = never, Return2 = never, Retur
|
|
|
94
94
|
* @dataFirst
|
|
95
95
|
* @category Function
|
|
96
96
|
*/
|
|
97
|
-
declare function conditional<T,
|
|
97
|
+
declare function conditional<T, Fn0 extends (x: T) => boolean, Fn1 extends (x: T) => boolean, Fn2 extends (x: T) => boolean, Fn3 extends (x: T) => boolean, Fn4 extends (x: T) => boolean, Fn5 extends (x: T) => boolean, Fn6 extends (x: T) => boolean, Fn7 extends (x: T) => boolean, Fn8 extends (x: T) => boolean, Fn9 extends (x: T) => boolean, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never>(data: T, case0: Case<T, Return0, Fn0>, case1?: Case<T, Return1, Fn1>, case2?: Case<T, Return2, Fn2>, case3?: Case<T, Return3, Fn3>, case4?: Case<T, Return4, Fn4>, case5?: Case<T, Return5, Fn5>, case6?: Case<T, Return6, Fn6>, case7?: Case<T, Return7, Fn7>, case8?: Case<T, Return8, Fn8>, case9?: Case<T, Return9, Fn9>): Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
98
98
|
/**
|
|
99
99
|
* A simplified case that accepts all data. Put this as the last case to
|
|
100
100
|
* prevent an exception from being thrown when none of the previous cases
|
package/dist/conditional.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-H2E5GCCP.js";export{a as conditional};
|
package/dist/drop-first-by.d.cts
CHANGED
package/dist/drop-first-by.d.ts
CHANGED
package/dist/evolve.d.cts
CHANGED
package/dist/evolve.d.ts
CHANGED
package/dist/first-by.d.cts
CHANGED
package/dist/first-by.d.ts
CHANGED
package/dist/first.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer } from './types-
|
|
1
|
+
import { I as IterableContainer } from './types-BMu1PIvo.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type First<T extends IterableContainer> = T extends [] ? undefined : T extends readonly [unknown, ...Array<unknown>] ? T[0] : T extends readonly [...infer Pre, infer Last] ? Last | Pre[0] : T[0] | undefined;
|
package/dist/first.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer } from './types-
|
|
1
|
+
import { I as IterableContainer } from './types-BMu1PIvo.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type First<T extends IterableContainer> = T extends [] ? undefined : T extends readonly [unknown, ...Array<unknown>] ? T[0] : T extends readonly [...infer Pre, infer Last] ? Last | Pre[0] : T[0] | undefined;
|
package/dist/flat.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.cjs';
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_DEPTH = 1;
|
|
5
5
|
type FlatArray<T, Depth extends number, Iteration extends ReadonlyArray<unknown> = []> = Depth extends Iteration['length'] ? T : T extends readonly [] ? [
|
package/dist/flat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.js';
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_DEPTH = 1;
|
|
5
5
|
type FlatArray<T, Depth extends number, Iteration extends ReadonlyArray<unknown> = []> = Depth extends Iteration['length'] ? T : T extends readonly [] ? [
|
package/dist/for-each-obj.d.cts
CHANGED
package/dist/for-each-obj.d.ts
CHANGED
package/dist/for-each.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUHUFGDIScjs = require('./chunk-UHUFGDIS.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.forEach = _chunkUHUFGDIScjs.a;
|
package/dist/for-each.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Writable } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.cjs';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Executes a provided function once for each array element. Equivalent to
|
|
3
6
|
* `Array.prototype.forEach`.
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
* @lazy
|
|
20
23
|
* @category Array
|
|
21
24
|
*/
|
|
22
|
-
declare function forEach<T>(data:
|
|
25
|
+
declare function forEach<T extends IterableContainer>(data: T, callbackfn: (value: T[number], index: number, data: T) => void): void;
|
|
23
26
|
/**
|
|
24
27
|
* Executes a provided function once for each array element. Equivalent to
|
|
25
28
|
* `Array.prototype.forEach`.
|
|
@@ -43,6 +46,6 @@ declare function forEach<T>(data: ReadonlyArray<T>, callbackfn: (value: T, index
|
|
|
43
46
|
* @lazy
|
|
44
47
|
* @category Array
|
|
45
48
|
*/
|
|
46
|
-
declare function forEach<T>(callbackfn: (value: T, index: number, data:
|
|
49
|
+
declare function forEach<T extends IterableContainer>(callbackfn: (value: T[number], index: number, data: T) => void): (data: T) => Writable<T>;
|
|
47
50
|
|
|
48
51
|
export { forEach };
|
package/dist/for-each.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Writable } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.js';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Executes a provided function once for each array element. Equivalent to
|
|
3
6
|
* `Array.prototype.forEach`.
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
* @lazy
|
|
20
23
|
* @category Array
|
|
21
24
|
*/
|
|
22
|
-
declare function forEach<T>(data:
|
|
25
|
+
declare function forEach<T extends IterableContainer>(data: T, callbackfn: (value: T[number], index: number, data: T) => void): void;
|
|
23
26
|
/**
|
|
24
27
|
* Executes a provided function once for each array element. Equivalent to
|
|
25
28
|
* `Array.prototype.forEach`.
|
|
@@ -43,6 +46,6 @@ declare function forEach<T>(data: ReadonlyArray<T>, callbackfn: (value: T, index
|
|
|
43
46
|
* @lazy
|
|
44
47
|
* @category Array
|
|
45
48
|
*/
|
|
46
|
-
declare function forEach<T>(callbackfn: (value: T, index: number, data:
|
|
49
|
+
declare function forEach<T extends IterableContainer>(callbackfn: (value: T[number], index: number, data: T) => void): (data: T) => Writable<T>;
|
|
47
50
|
|
|
48
51
|
export { forEach };
|
package/dist/for-each.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-T2LJNGWI.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as forEach};
|
package/dist/from-entries.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.cjs';
|
|
3
3
|
|
|
4
4
|
type Entry<Key extends PropertyKey = PropertyKey, Value = unknown> = readonly [
|
|
5
5
|
key: Key,
|
|
@@ -26,10 +26,10 @@ type ValueForKey<Entries extends IterableContainer<Entry>, K extends PropertyKey
|
|
|
26
26
|
*
|
|
27
27
|
* There are several other functions that could be used to build an object from
|
|
28
28
|
* an array:
|
|
29
|
-
* `fromKeys
|
|
30
|
-
* `indexBy
|
|
31
|
-
* `pullObject
|
|
32
|
-
* `mapToObj
|
|
29
|
+
* - `fromKeys`: Builds an object from an array of *keys* and a mapper for values.
|
|
30
|
+
* - `indexBy`: Builds an object from an array of *values* and a mapper for keys.
|
|
31
|
+
* - `pullObject`: Builds an object from an array of items with mappers for *both* keys and values.
|
|
32
|
+
* - `mapToObj`: Builds an object from an array of items and a single mapper for key-value pairs.
|
|
33
33
|
* Refer to the docs for more details.
|
|
34
34
|
*
|
|
35
35
|
* @param entries - An array of key-value pairs.
|
package/dist/from-entries.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.js';
|
|
3
3
|
|
|
4
4
|
type Entry<Key extends PropertyKey = PropertyKey, Value = unknown> = readonly [
|
|
5
5
|
key: Key,
|
|
@@ -26,10 +26,10 @@ type ValueForKey<Entries extends IterableContainer<Entry>, K extends PropertyKey
|
|
|
26
26
|
*
|
|
27
27
|
* There are several other functions that could be used to build an object from
|
|
28
28
|
* an array:
|
|
29
|
-
* `fromKeys
|
|
30
|
-
* `indexBy
|
|
31
|
-
* `pullObject
|
|
32
|
-
* `mapToObj
|
|
29
|
+
* - `fromKeys`: Builds an object from an array of *keys* and a mapper for values.
|
|
30
|
+
* - `indexBy`: Builds an object from an array of *values* and a mapper for keys.
|
|
31
|
+
* - `pullObject`: Builds an object from an array of items with mappers for *both* keys and values.
|
|
32
|
+
* - `mapToObj`: Builds an object from an array of items and a single mapper for key-value pairs.
|
|
33
33
|
* Refer to the docs for more details.
|
|
34
34
|
*
|
|
35
35
|
* @param entries - An array of key-value pairs.
|
package/dist/from-keys.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGUZPDGVHcjs = require('./chunk-GUZPDGVH.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.fromKeys = _chunkGUZPDGVHcjs.a;
|
package/dist/from-keys.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer, b as ExactRecord } from './types-BMu1PIvo.cjs';
|
|
3
3
|
|
|
4
4
|
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
5
5
|
[P in T]: V;
|
|
6
6
|
} : never;
|
|
7
|
-
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 ?
|
|
7
|
+
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 ? ExactRecord<T[number], V> : never;
|
|
8
8
|
/**
|
|
9
9
|
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
10
10
|
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
package/dist/from-keys.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer, b as ExactRecord } from './types-BMu1PIvo.js';
|
|
3
3
|
|
|
4
4
|
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
5
5
|
[P in T]: V;
|
|
6
6
|
} : never;
|
|
7
|
-
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 ?
|
|
7
|
+
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 ? ExactRecord<T[number], V> : never;
|
|
8
8
|
/**
|
|
9
9
|
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
10
10
|
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
package/dist/from-keys.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TT2VLICK.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as fromKeys};
|
package/dist/group-by.d.cts
CHANGED
package/dist/group-by.d.ts
CHANGED
package/dist/has-at-least.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.cjs';
|
|
3
3
|
|
|
4
4
|
type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration['length'] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
|
|
5
5
|
Head,
|
package/dist/has-at-least.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-BMu1PIvo.js';
|
|
3
3
|
|
|
4
4
|
type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration['length'] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
|
|
5
5
|
Head,
|
package/dist/has-sub-object.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk64KL2FA2cjs = require('./chunk-64KL2FA2.cjs');require('./chunk-D32D4HMP.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.hasSubObject = _chunk64KL2FA2cjs.a;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { B as Branded } from './types-
|
|
2
|
+
import { B as Branded } from './types-BMu1PIvo.cjs';
|
|
3
3
|
|
|
4
4
|
declare const HAS_SUB_OBJECT_BRAND: unique symbol;
|
|
5
5
|
type HasSubObjectGuard<T, S> = Simplify<Branded<S & T, typeof HAS_SUB_OBJECT_BRAND>>;
|
|
6
|
+
type HasSubObjectObjectValue<A, B> = Partial<{
|
|
7
|
+
[Key in keyof A & keyof B]: A[Key] & B[Key] extends never ? B[Key] : A[Key] | B[Key] extends object ? HasSubObjectObjectValue<A[Key], B[Key]> : A[Key] & B[Key] extends object ? B[Key] : A[Key];
|
|
8
|
+
}> & {
|
|
9
|
+
[Key in Exclude<keyof A, keyof B> | Exclude<keyof B, keyof A>]: Key extends keyof B ? B[Key] : never;
|
|
10
|
+
};
|
|
11
|
+
type HasSubObjectData<Data, SubObject, RData = Required<Data>, RSubObject = Required<SubObject>> = Partial<{
|
|
12
|
+
[Key in keyof RData & keyof RSubObject]: RData[Key] & RSubObject[Key] extends never ? RSubObject[Key] : RData[Key] | RSubObject[Key] extends object ? HasSubObjectObjectValue<RData[Key], RSubObject[Key]> : RData[Key] & RSubObject[Key] extends object ? RSubObject[Key] : RData[Key];
|
|
13
|
+
}> & {
|
|
14
|
+
[Key in Exclude<keyof SubObject, keyof Data>]: SubObject[Key];
|
|
15
|
+
};
|
|
16
|
+
type HasSubObjectSubObject<SubObject, Data, RSubObject = Required<SubObject>, RData = Required<Data>> = Partial<{
|
|
17
|
+
[Key in keyof RData & keyof RSubObject]: RData[Key] & RSubObject[Key] extends never ? RData[Key] : RData[Key] | RSubObject[Key] extends object ? HasSubObjectObjectValue<RSubObject[Key], RData[Key]> : RData[Key] & RSubObject[Key] extends object ? RData[Key] : RSubObject[Key];
|
|
18
|
+
}> & {
|
|
19
|
+
[Key in Exclude<keyof SubObject, keyof Data>]: never;
|
|
20
|
+
};
|
|
6
21
|
/**
|
|
7
22
|
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
8
23
|
* property and value in `subObject`, there's the same property in `object`
|
|
@@ -19,7 +34,7 @@ type HasSubObjectGuard<T, S> = Simplify<Branded<S & T, typeof HAS_SUB_OBJECT_BRA
|
|
|
19
34
|
* @dataFirst
|
|
20
35
|
* @category Guard
|
|
21
36
|
*/
|
|
22
|
-
declare function hasSubObject<T, S extends
|
|
37
|
+
declare function hasSubObject<T extends Record<PropertyKey, unknown>, S extends HasSubObjectSubObject<S, T>>(data: T, subObject: S): data is HasSubObjectGuard<T, S>;
|
|
23
38
|
/**
|
|
24
39
|
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
25
40
|
* property and value in `subObject`, there's the same property in `object`
|
|
@@ -35,6 +50,6 @@ declare function hasSubObject<T, S extends Partial<T>>(data: T, subObject: S): d
|
|
|
35
50
|
* @dataLast
|
|
36
51
|
* @category Guard
|
|
37
52
|
*/
|
|
38
|
-
declare function hasSubObject<
|
|
53
|
+
declare function hasSubObject<S extends Record<PropertyKey, unknown>>(subObject: S): <T extends HasSubObjectData<T, S>>(data: T) => data is HasSubObjectGuard<T, S>;
|
|
39
54
|
|
|
40
55
|
export { hasSubObject };
|