@vinicunca/perkakas 1.0.3 → 1.0.4
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 +1 -1
- package/dist/add-prop.d.ts +1 -1
- package/dist/chunk-3DFX2FQG.cjs +1 -0
- package/dist/chunk-4WU7JGWS.cjs +1 -0
- package/dist/chunk-AACZ5UGG.cjs +1 -0
- package/dist/chunk-AKGWT6GC.js +1 -0
- package/dist/chunk-BT3FI7L7.js +1 -0
- package/dist/{chunk-XQOKSJ5R.cjs → chunk-E6RBEL5Z.cjs} +1 -1
- package/dist/chunk-EPHUNAE5.js +1 -0
- package/dist/chunk-G7BJFBAZ.cjs +1 -0
- package/dist/{chunk-YIUDV3OA.cjs → chunk-HTO3K3VA.cjs} +1 -1
- package/dist/chunk-IABWIMQT.js +1 -0
- package/dist/chunk-IRH6TGG5.js +1 -0
- package/dist/chunk-KAA6IVBL.js +1 -0
- package/dist/chunk-MADDQNAR.cjs +1 -0
- package/dist/chunk-OJ2QGTFS.js +1 -0
- package/dist/chunk-PFLGL4YP.js +1 -0
- package/dist/chunk-QTQTKNWA.js +1 -0
- package/dist/chunk-RCENCAXY.cjs +1 -0
- package/dist/chunk-RJAVPEJT.cjs +1 -0
- package/dist/chunk-U2BXIRBJ.js +1 -0
- package/dist/chunk-VN2OAM2N.js +1 -0
- package/dist/chunk-VPG3W5JH.cjs +1 -0
- package/dist/chunk-WQDEYM64.js +1 -0
- package/dist/chunk-WRKGH4XX.js +1 -0
- package/dist/chunk-Y3WI7FPB.cjs +1 -0
- package/dist/chunk-Z5UEQBZP.cjs +1 -0
- package/dist/chunk-ZO4ND36N.cjs +1 -0
- package/dist/chunk.cjs +1 -1
- package/dist/chunk.d.cts +91 -5
- package/dist/chunk.d.ts +91 -5
- package/dist/chunk.js +1 -1
- package/dist/chunk.spec-d.cjs +1 -1
- package/dist/chunk.spec-d.js +1 -1
- package/dist/concat.d.cts +1 -1
- package/dist/concat.d.ts +1 -1
- package/dist/conditional.d.cts +1 -1
- package/dist/conditional.d.ts +1 -1
- package/dist/conditional.spec-d.cjs +1 -1
- package/dist/conditional.spec-d.js +1 -1
- package/dist/drop-first-by.d.cts +1 -1
- package/dist/drop-first-by.d.ts +1 -1
- package/dist/drop-last-while.cjs +1 -1
- package/dist/drop-last-while.d.cts +5 -2
- package/dist/drop-last-while.d.ts +5 -2
- package/dist/drop-last-while.js +1 -1
- package/dist/drop-last-while.spec-d.cjs +1 -0
- package/dist/drop-last-while.spec-d.d.cts +2 -0
- package/dist/drop-last-while.spec-d.d.ts +2 -0
- package/dist/drop-last-while.spec-d.js +1 -0
- package/dist/drop-last.cjs +1 -1
- package/dist/drop-last.d.cts +5 -2
- package/dist/drop-last.d.ts +5 -2
- package/dist/drop-last.js +1 -1
- package/dist/drop-last.spec-d.cjs +1 -0
- package/dist/drop-last.spec-d.d.cts +2 -0
- package/dist/drop-last.spec-d.d.ts +2 -0
- package/dist/drop-last.spec-d.js +1 -0
- package/dist/drop-while.cjs +1 -1
- package/dist/drop-while.d.cts +5 -2
- package/dist/drop-while.d.ts +5 -2
- package/dist/drop-while.js +1 -1
- package/dist/drop-while.spec-d.cjs +1 -0
- package/dist/drop-while.spec-d.d.cts +2 -0
- package/dist/drop-while.spec-d.d.ts +2 -0
- package/dist/drop-while.spec-d.js +1 -0
- package/dist/drop.cjs +1 -1
- package/dist/drop.d.cts +10 -2
- package/dist/drop.d.ts +10 -2
- package/dist/drop.js +1 -1
- package/dist/drop.spec-d.cjs +1 -0
- package/dist/drop.spec-d.d.cts +2 -0
- package/dist/drop.spec-d.d.ts +2 -0
- package/dist/drop.spec-d.js +1 -0
- 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.d.cts +1 -1
- package/dist/for-each.d.ts +1 -1
- package/dist/from-entries.d.cts +1 -1
- package/dist/from-entries.d.ts +1 -1
- package/dist/from-keys.d.cts +1 -1
- package/dist/from-keys.d.ts +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.d.cts +1 -1
- package/dist/has-sub-object.d.ts +1 -1
- 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 +1 -1
- package/dist/index.d.ts +1 -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.d.cts +1 -1
- package/dist/is-object-type.d.ts +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.d.cts +1 -1
- package/dist/map-keys.d.ts +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.d.cts +1 -1
- package/dist/omit-by.d.ts +1 -1
- package/dist/only.d.cts +1 -1
- package/dist/only.d.ts +1 -1
- package/dist/pick-by.d.cts +1 -1
- package/dist/pick-by.d.ts +1 -1
- package/dist/product.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/pull-object.d.cts +1 -1
- package/dist/pull-object.d.ts +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/shuffle.cjs +1 -1
- package/dist/shuffle.d.cts +5 -2
- package/dist/shuffle.d.ts +5 -2
- package/dist/shuffle.js +1 -1
- package/dist/shuffle.spec-d.cjs +1 -0
- package/dist/shuffle.spec-d.d.cts +2 -0
- package/dist/shuffle.spec-d.d.ts +2 -0
- package/dist/shuffle.spec-d.js +1 -0
- 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/sum.d.cts +1 -1
- package/dist/sum.d.ts +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/take-last-while.cjs +1 -1
- package/dist/take-last-while.d.cts +5 -2
- package/dist/take-last-while.d.ts +5 -2
- package/dist/take-last-while.js +1 -1
- package/dist/take-last-while.spec-d-.cjs +1 -0
- package/dist/take-last-while.spec-d-.d.cts +2 -0
- package/dist/take-last-while.spec-d-.d.ts +2 -0
- package/dist/take-last-while.spec-d-.js +1 -0
- package/dist/take-last.cjs +1 -1
- package/dist/take-last.d.cts +5 -2
- package/dist/take-last.d.ts +5 -2
- package/dist/take-last.js +1 -1
- package/dist/take-last.spec-d.cjs +1 -0
- package/dist/take-last.spec-d.d.cts +2 -0
- package/dist/take-last.spec-d.d.ts +2 -0
- package/dist/take-last.spec-d.js +1 -0
- package/dist/take-while.cjs +1 -1
- package/dist/take-while.d.cts +5 -2
- package/dist/take-while.d.ts +5 -2
- package/dist/take-while.js +1 -1
- package/dist/take-white.spec-d.cjs +1 -0
- package/dist/take-white.spec-d.d.cts +2 -0
- package/dist/take-white.spec-d.d.ts +2 -0
- package/dist/take-white.spec-d.js +1 -0
- package/dist/take.cjs +1 -1
- package/dist/take.d.cts +5 -2
- package/dist/take.d.ts +5 -2
- package/dist/take.js +1 -1
- package/dist/take.spec-d.cjs +1 -0
- package/dist/take.spec-d.d.cts +2 -0
- package/dist/take.spec-d.d.ts +2 -0
- package/dist/take.spec-d.js +1 -0
- package/dist/tap.spec-d.cjs +1 -1
- package/dist/tap.spec-d.js +1 -1
- package/dist/{types-BMu1PIvo.d.cts → types-BE3YOWVA.d.cts} +45 -2
- package/dist/{types-BMu1PIvo.d.ts → types-BE3YOWVA.d.ts} +45 -2
- package/dist/unique-by.cjs +1 -1
- package/dist/unique-by.d.cts +5 -2
- package/dist/unique-by.d.ts +5 -2
- package/dist/unique-by.js +1 -1
- package/dist/unique-with.cjs +1 -1
- package/dist/unique-with.d.cts +5 -2
- package/dist/unique-with.d.ts +5 -2
- package/dist/unique-with.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.d.cts +6 -3
- package/dist/unique.d.ts +6 -3
- package/dist/unique.js +1 -1
- 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 +12 -12
- package/dist/chunk-3UUZWCRS.cjs +0 -1
- package/dist/chunk-65DHT5Z7.cjs +0 -1
- package/dist/chunk-66KQORMS.js +0 -1
- package/dist/chunk-AE5HI6VG.cjs +0 -1
- package/dist/chunk-CIF6WEFP.js +0 -1
- package/dist/chunk-COBRSP66.js +0 -1
- package/dist/chunk-DUKQ2ODK.js +0 -1
- package/dist/chunk-DWPHE3F2.cjs +0 -1
- package/dist/chunk-HUWRVMPE.js +0 -1
- package/dist/chunk-LIKMH7XD.js +0 -1
- package/dist/chunk-LOPUNSWJ.js +0 -1
- package/dist/chunk-MENOHSYF.js +0 -1
- package/dist/chunk-NNK6R67E.cjs +0 -1
- package/dist/chunk-P7OXTPPH.cjs +0 -1
- package/dist/chunk-QTCQZ7LU.js +0 -1
- package/dist/chunk-RSJJRJTH.cjs +0 -1
- package/dist/chunk-TR5T6KUC.js +0 -1
- package/dist/chunk-U5EQP4BO.cjs +0 -1
- package/dist/chunk-VNLOBA2B.cjs +0 -1
- package/dist/chunk-X6AB3I7Z.cjs +0 -1
- package/dist/chunk-YQKPA3BB.js +0 -1
- package/dist/chunk-YWSZXRUY.js +0 -1
- package/dist/chunk-Z7EBGO2B.js +0 -1
- package/dist/chunk-ZCFTW5HO.cjs +0 -1
package/dist/add-prop.d.cts
CHANGED
package/dist/add-prop.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function o(...e){return _chunkY74ER22Ocjs.a.call(void 0, t,e)}function t(e,n){return n>0?e.slice(Math.max(0,e.length-n)):[]}exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function u(...r){return _chunkY74ER22Ocjs.a.call(void 0, l,r)}function l(r){let n=[...r];for(let e=0;e<r.length;e++){let t=e+Math.floor(Math.random()*(r.length-e)),a=n[t];n[t]=n[e],n[e]=a}return n}exports.a = u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function a(...r){return _chunkY74ER22Ocjs.a.call(void 0, t,r)}function t(r,e){return e>0?r.slice(0,Math.max(0,r.length-e)):[...r]}exports.a = a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-C6L5NLLB.js";import{a as t}from"./chunk-MYLYERXO.js";function l(...e){return r(i,e)}function i(e){return(n,a,o)=>o.findIndex(u=>e(n,u))===a?{done:!1,hasNext:!0,next:n}:t}export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-JFXZ246Y.js";function o(...e){return a(s,e)}function s(e,n){if(n<1)throw new RangeError(`chunk: A chunk size of '${n}' would result in an infinite array`);if(e.length===0)return[];if(n>=e.length)return[[...e]];let i=Math.ceil(e.length/n),u=new Array(i);if(n===1)for(let[r,t]of e.entries())u[r]=[t];else for(let r=0;r<i;r+=1){let t=r*n;u[r]=e.slice(t,t+n)}return u}export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLX7PGPIcjs = require('./chunk-NLX7PGPI.cjs');var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');function l(...
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLX7PGPIcjs = require('./chunk-NLX7PGPI.cjs');var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');function l(...e){return _chunkNLX7PGPIcjs.a.call(void 0, i,e)}function i(e){return(n,a,o)=>o.findIndex(u=>e(n,u))===a?{done:!1,hasNext:!0,next:n}:_chunk3X6SAJDQcjs.a}exports.a = l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-MYLYERXO.js";import{a as n}from"./chunk-JFXZ246Y.js";function p(...r){return n(o,r,u)}function o(r,e){return e<0?[]:r.slice(0,e)}function u(r){if(r<=0)return t;let e=r;return a=>(e-=1,{done:e<=0,hasNext:!0,next:a})}export{p as a};
|
|
@@ -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, o,e)}function o(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r],r,e))return e.slice(0,r+1);return[]}exports.a = i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLX7PGPIcjs = require('./chunk-NLX7PGPI.cjs');var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLX7PGPIcjs = require('./chunk-NLX7PGPI.cjs');var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');function i(...e){return _chunkNLX7PGPIcjs.a.call(void 0, o,e)}function o(){let e=new Set;return t=>e.has(t)?_chunk3X6SAJDQcjs.a:(e.add(t),{done:!1,hasNext:!0,next:t})}exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-JFXZ246Y.js";function m(...e){return r(i,e)}function i(e,t){for(let[n,o]of e.entries())if(!t(o,n,e))return e.slice(n);return[]}export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,c as o}from"./chunk-MYLYERXO.js";import{a as t}from"./chunk-JFXZ246Y.js";function T(...e){return t(a,e,p)}function a(e,r){return r<0?[...e]:e.slice(r)}function p(e){if(e<=0)return o;let r=e;return u=>r>0?(r-=1,n):{done:!1,hasNext:!0,next:u}}export{T as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-JFXZ246Y.js";function o(...e){return r(a,e)}function a(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(n+1);return[...e]}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLX7PGPIcjs = require('./chunk-NLX7PGPI.cjs');var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');function p(...e){return _chunkNLX7PGPIcjs.a.call(void 0, d,e)}function d(e){let n=new Set;return(t,u,i)=>{let r=e(t,u,i);return n.has(r)?_chunk3X6SAJDQcjs.a:(n.add(r),{done:!1,hasNext:!0,next:t})}}exports.a = p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-JFXZ246Y.js";function o(...e){return r(t,e)}function t(e,n){return n>0?e.slice(Math.max(0,e.length-n)):[]}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-JFXZ246Y.js";function u(...r){return o(l,r)}function l(r){let n=[...r];for(let e=0;e<r.length;e++){let t=e+Math.floor(Math.random()*(r.length-e)),a=n[t];n[t]=n[e],n[e]=a}return n}export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-JFXZ246Y.js";function i(...e){return n(o,e)}function o(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r],r,e))return e.slice(0,r+1);return[]}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function T(...e){return _chunkY74ER22Ocjs.a.call(void 0, a,e,p)}function a(e,r){return r<0?[...e]:e.slice(r)}function p(e){if(e<=0)return _chunk3X6SAJDQcjs.c;let r=e;return u=>r>0?(r-=1,_chunk3X6SAJDQcjs.a):{done:!1,hasNext:!0,next:u}}exports.a = T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function m(...e){return _chunkY74ER22Ocjs.a.call(void 0, i,e)}function i(e,t){for(let[n,o]of e.entries())if(!t(o,n,e))return e.slice(n);return[]}exports.a = m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-JFXZ246Y.js";function a(...r){return n(t,r)}function t(r,e){return e>0?r.slice(0,Math.max(0,r.length-e)):[...r]}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-JFXZ246Y.js";function u(...e){return t(i,e)}function i(e,a){let n=[];for(let[o,r]of e.entries()){if(!a(r,o,e))break;n.push(r)}return n}export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function o(...e){return _chunkY74ER22Ocjs.a.call(void 0, a,e)}function a(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(n+1);return[...e]}exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-C6L5NLLB.js";import{a as n}from"./chunk-MYLYERXO.js";function i(...e){return r(o,e)}function o(){let e=new Set;return t=>e.has(t)?n:(e.add(t),{done:!1,hasNext:!0,next:t})}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-C6L5NLLB.js";import{a}from"./chunk-MYLYERXO.js";function p(...e){return o(d,e)}function d(e){let n=new Set;return(t,u,i)=>{let r=e(t,u,i);return n.has(r)?a:(n.add(r),{done:!1,hasNext:!0,next:t})}}export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function o(...e){return _chunkY74ER22Ocjs.a.call(void 0, s,e)}function s(e,n){if(n<1)throw new RangeError(`chunk: A chunk size of '${n}' would result in an infinite array`);if(e.length===0)return[];if(n>=e.length)return[[...e]];let i=Math.ceil(e.length/n),u=new Array(i);if(n===1)for(let[r,t]of e.entries())u[r]=[t];else for(let r=0;r<i;r+=1){let t=r*n;u[r]=e.slice(t,t+n)}return u}exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function p(...r){return _chunkY74ER22Ocjs.a.call(void 0, o,r,u)}function o(r,e){return e<0?[]:r.slice(0,e)}function u(r){if(r<=0)return _chunk3X6SAJDQcjs.b;let e=r;return a=>(e-=1,{done:e<=0,hasNext:!0,next:a})}exports.a = p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function u(...e){return _chunkY74ER22Ocjs.a.call(void 0, i,e)}function i(e,a){let n=[];for(let[o,r]of e.entries()){if(!a(r,o,e))break;n.push(r)}return n}exports.a = u;
|
package/dist/chunk.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY3WI7FPBcjs = require('./chunk-Y3WI7FPB.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.chunk = _chunkY3WI7FPBcjs.a;
|
package/dist/chunk.d.cts
CHANGED
|
@@ -1,7 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
1
|
+
import { IsNumericLiteral, LessThan, IfNever, Subtract, ValueOf, IntRange } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer, T as TupleParts, N as NTuple, a as NonEmptyArray } from './types-BE3YOWVA.cjs';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This prevents typescript from failing on complex arrays and large chunks.
|
|
6
|
+
* It allows the typing to remain useful even when very large chunks are needed,
|
|
7
|
+
* without loosing fidelity on smaller ones. It was chosen by trial-and-error,
|
|
8
|
+
* and given some more wiggle room because the complexity of the array also
|
|
9
|
+
* plays a role in when typescript fails to recurse.
|
|
10
|
+
* See the type tests for an example.
|
|
11
|
+
*/
|
|
12
|
+
type MAX_LITERAL_SIZE = 350;
|
|
13
|
+
type Chunk<T extends IterableContainer, N extends number> = T extends readonly [] ? [] : IsNumericLiteral<N> extends true ? LessThan<N, 1> extends true ? never : LessThan<N, MAX_LITERAL_SIZE> extends true ? [
|
|
14
|
+
...LiteralChunk<T, N>
|
|
15
|
+
] : GenericChunk<T> : GenericChunk<T>;
|
|
16
|
+
type LiteralChunk<T, N extends number, Parts extends TupleParts<T> = TupleParts<T>> = ([...Parts['prefix'], ...Parts['suffix']]['length'] extends 0 ? [] : never) | ChunkInfinite<ChunkFinite<Parts['prefix'], N>, Parts['item'], Parts['suffix'], N>;
|
|
17
|
+
/**
|
|
18
|
+
* This type **only** works if the input array `T` is a finite tuple (
|
|
19
|
+
* `[number, "abc", true, { a: "hello" }]` etc..., and it doesn't contain a rest
|
|
20
|
+
* parameter). For these inputs the chunked output could be computed as literal
|
|
21
|
+
* finite tuples too.
|
|
22
|
+
*/
|
|
23
|
+
type ChunkFinite<T, N extends number, Result = []> = T extends readonly [infer Head, ...infer Rest] ? ChunkFinite<Rest, N, Result extends [
|
|
24
|
+
...infer Previous extends Array<Array<unknown>>,
|
|
25
|
+
infer Current extends Array<unknown>
|
|
26
|
+
] ? Current['length'] extends N ? [
|
|
27
|
+
...Previous,
|
|
28
|
+
Current,
|
|
29
|
+
[Head]
|
|
30
|
+
] : [
|
|
31
|
+
...Previous,
|
|
32
|
+
[...Current, Head]
|
|
33
|
+
] : [
|
|
34
|
+
[Head]
|
|
35
|
+
]> : Result;
|
|
36
|
+
/**
|
|
37
|
+
* Here lies the main complexity of building the chunk type. It takes the prefix
|
|
38
|
+
* chunks, the rest param item type, and the suffix (not chunked!) and it
|
|
39
|
+
* creates all possible combinations of adding items to the prefix and suffix
|
|
40
|
+
* for all possible scenarios for how many items the rest param "represents".
|
|
41
|
+
*/
|
|
42
|
+
type ChunkInfinite<PrefixChunks, Item, Suffix extends Array<unknown>, N extends number> = IfNever<Item, PrefixChunks, PrefixChunks extends [
|
|
43
|
+
...infer PrefixFullChunks extends Array<Array<unknown>>,
|
|
44
|
+
infer LastPrefixChunk extends Array<unknown>
|
|
45
|
+
] ? [
|
|
46
|
+
...PrefixFullChunks,
|
|
47
|
+
[
|
|
48
|
+
...LastPrefixChunk,
|
|
49
|
+
...NTuple<Item, Subtract<N, LastPrefixChunk['length']>>
|
|
50
|
+
],
|
|
51
|
+
...Array<NTuple<Item, N>>,
|
|
52
|
+
...SuffixChunk<Suffix, Item, N>
|
|
53
|
+
] | ValueOf<{
|
|
54
|
+
[Padding in IntRangeInclusive<0, Subtract<N, LastPrefixChunk['length']>>]: [
|
|
55
|
+
...PrefixFullChunks,
|
|
56
|
+
...ChunkFinite<[
|
|
57
|
+
...LastPrefixChunk,
|
|
58
|
+
...NTuple<Item, Padding>,
|
|
59
|
+
...Suffix
|
|
60
|
+
], N>
|
|
61
|
+
];
|
|
62
|
+
}> : [
|
|
63
|
+
...Array<NTuple<Item, N>>,
|
|
64
|
+
...SuffixChunk<Suffix, Item, N>
|
|
65
|
+
]>;
|
|
66
|
+
/**
|
|
67
|
+
* This type assumes it takes a finite tuple that represents the suffix of our
|
|
68
|
+
* input array. It builds all possible combinations of adding items to the
|
|
69
|
+
* **head** of the suffix in order to pad the suffix until the last chunk is
|
|
70
|
+
* full.
|
|
71
|
+
*/
|
|
72
|
+
type SuffixChunk<T extends Array<unknown>, Item, N extends number> = T extends readonly [] ? [
|
|
73
|
+
ValueOf<{
|
|
74
|
+
[K in IntRangeInclusive<1, N>]: NTuple<Item, K>;
|
|
75
|
+
}>
|
|
76
|
+
] : ValueOf<{
|
|
77
|
+
[Padding in IntRange<0, N>]: ChunkFinite<[
|
|
78
|
+
...NTuple<Item, Padding>,
|
|
79
|
+
...T
|
|
80
|
+
], N>;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* This is the legacy type used when we don't know what N is. We can only adjust
|
|
84
|
+
* our output based on if we know for sure that the array is empty or not.
|
|
85
|
+
*/
|
|
86
|
+
type GenericChunk<T extends IterableContainer> = T extends readonly [...Array<unknown>, unknown] | readonly [unknown, ...Array<unknown>] ? NonEmptyArray<NonEmptyArray<T[number]>> : Array<NonEmptyArray<T[number]>>;
|
|
87
|
+
/**
|
|
88
|
+
* Type-fest's IntRange doesn't include the `To` value, but we need it!
|
|
89
|
+
*/
|
|
90
|
+
type IntRangeInclusive<From extends number, To extends number> = IntRange<From, To> | To;
|
|
5
91
|
/**
|
|
6
92
|
* Split an array into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements.
|
|
7
93
|
*
|
|
@@ -15,7 +101,7 @@ type Chunked<T extends IterableContainer> = T[number] extends never ? [] : T ext
|
|
|
15
101
|
* @dataFirst
|
|
16
102
|
* @category Array
|
|
17
103
|
*/
|
|
18
|
-
declare function chunk<T extends IterableContainer>(array: T, size:
|
|
104
|
+
declare function chunk<T extends IterableContainer, N extends number>(array: T, size: N): Chunk<T, N>;
|
|
19
105
|
/**
|
|
20
106
|
* Split an array into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements.
|
|
21
107
|
*
|
|
@@ -28,6 +114,6 @@ declare function chunk<T extends IterableContainer>(array: T, size: number): Chu
|
|
|
28
114
|
* @dataLast
|
|
29
115
|
* @category Array
|
|
30
116
|
*/
|
|
31
|
-
declare function chunk<
|
|
117
|
+
declare function chunk<N extends number>(size: N): <T extends IterableContainer>(array: T) => Chunk<T, N>;
|
|
32
118
|
|
|
33
119
|
export { chunk };
|
package/dist/chunk.d.ts
CHANGED
|
@@ -1,7 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
1
|
+
import { IsNumericLiteral, LessThan, IfNever, Subtract, ValueOf, IntRange } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer, T as TupleParts, N as NTuple, a as NonEmptyArray } from './types-BE3YOWVA.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This prevents typescript from failing on complex arrays and large chunks.
|
|
6
|
+
* It allows the typing to remain useful even when very large chunks are needed,
|
|
7
|
+
* without loosing fidelity on smaller ones. It was chosen by trial-and-error,
|
|
8
|
+
* and given some more wiggle room because the complexity of the array also
|
|
9
|
+
* plays a role in when typescript fails to recurse.
|
|
10
|
+
* See the type tests for an example.
|
|
11
|
+
*/
|
|
12
|
+
type MAX_LITERAL_SIZE = 350;
|
|
13
|
+
type Chunk<T extends IterableContainer, N extends number> = T extends readonly [] ? [] : IsNumericLiteral<N> extends true ? LessThan<N, 1> extends true ? never : LessThan<N, MAX_LITERAL_SIZE> extends true ? [
|
|
14
|
+
...LiteralChunk<T, N>
|
|
15
|
+
] : GenericChunk<T> : GenericChunk<T>;
|
|
16
|
+
type LiteralChunk<T, N extends number, Parts extends TupleParts<T> = TupleParts<T>> = ([...Parts['prefix'], ...Parts['suffix']]['length'] extends 0 ? [] : never) | ChunkInfinite<ChunkFinite<Parts['prefix'], N>, Parts['item'], Parts['suffix'], N>;
|
|
17
|
+
/**
|
|
18
|
+
* This type **only** works if the input array `T` is a finite tuple (
|
|
19
|
+
* `[number, "abc", true, { a: "hello" }]` etc..., and it doesn't contain a rest
|
|
20
|
+
* parameter). For these inputs the chunked output could be computed as literal
|
|
21
|
+
* finite tuples too.
|
|
22
|
+
*/
|
|
23
|
+
type ChunkFinite<T, N extends number, Result = []> = T extends readonly [infer Head, ...infer Rest] ? ChunkFinite<Rest, N, Result extends [
|
|
24
|
+
...infer Previous extends Array<Array<unknown>>,
|
|
25
|
+
infer Current extends Array<unknown>
|
|
26
|
+
] ? Current['length'] extends N ? [
|
|
27
|
+
...Previous,
|
|
28
|
+
Current,
|
|
29
|
+
[Head]
|
|
30
|
+
] : [
|
|
31
|
+
...Previous,
|
|
32
|
+
[...Current, Head]
|
|
33
|
+
] : [
|
|
34
|
+
[Head]
|
|
35
|
+
]> : Result;
|
|
36
|
+
/**
|
|
37
|
+
* Here lies the main complexity of building the chunk type. It takes the prefix
|
|
38
|
+
* chunks, the rest param item type, and the suffix (not chunked!) and it
|
|
39
|
+
* creates all possible combinations of adding items to the prefix and suffix
|
|
40
|
+
* for all possible scenarios for how many items the rest param "represents".
|
|
41
|
+
*/
|
|
42
|
+
type ChunkInfinite<PrefixChunks, Item, Suffix extends Array<unknown>, N extends number> = IfNever<Item, PrefixChunks, PrefixChunks extends [
|
|
43
|
+
...infer PrefixFullChunks extends Array<Array<unknown>>,
|
|
44
|
+
infer LastPrefixChunk extends Array<unknown>
|
|
45
|
+
] ? [
|
|
46
|
+
...PrefixFullChunks,
|
|
47
|
+
[
|
|
48
|
+
...LastPrefixChunk,
|
|
49
|
+
...NTuple<Item, Subtract<N, LastPrefixChunk['length']>>
|
|
50
|
+
],
|
|
51
|
+
...Array<NTuple<Item, N>>,
|
|
52
|
+
...SuffixChunk<Suffix, Item, N>
|
|
53
|
+
] | ValueOf<{
|
|
54
|
+
[Padding in IntRangeInclusive<0, Subtract<N, LastPrefixChunk['length']>>]: [
|
|
55
|
+
...PrefixFullChunks,
|
|
56
|
+
...ChunkFinite<[
|
|
57
|
+
...LastPrefixChunk,
|
|
58
|
+
...NTuple<Item, Padding>,
|
|
59
|
+
...Suffix
|
|
60
|
+
], N>
|
|
61
|
+
];
|
|
62
|
+
}> : [
|
|
63
|
+
...Array<NTuple<Item, N>>,
|
|
64
|
+
...SuffixChunk<Suffix, Item, N>
|
|
65
|
+
]>;
|
|
66
|
+
/**
|
|
67
|
+
* This type assumes it takes a finite tuple that represents the suffix of our
|
|
68
|
+
* input array. It builds all possible combinations of adding items to the
|
|
69
|
+
* **head** of the suffix in order to pad the suffix until the last chunk is
|
|
70
|
+
* full.
|
|
71
|
+
*/
|
|
72
|
+
type SuffixChunk<T extends Array<unknown>, Item, N extends number> = T extends readonly [] ? [
|
|
73
|
+
ValueOf<{
|
|
74
|
+
[K in IntRangeInclusive<1, N>]: NTuple<Item, K>;
|
|
75
|
+
}>
|
|
76
|
+
] : ValueOf<{
|
|
77
|
+
[Padding in IntRange<0, N>]: ChunkFinite<[
|
|
78
|
+
...NTuple<Item, Padding>,
|
|
79
|
+
...T
|
|
80
|
+
], N>;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* This is the legacy type used when we don't know what N is. We can only adjust
|
|
84
|
+
* our output based on if we know for sure that the array is empty or not.
|
|
85
|
+
*/
|
|
86
|
+
type GenericChunk<T extends IterableContainer> = T extends readonly [...Array<unknown>, unknown] | readonly [unknown, ...Array<unknown>] ? NonEmptyArray<NonEmptyArray<T[number]>> : Array<NonEmptyArray<T[number]>>;
|
|
87
|
+
/**
|
|
88
|
+
* Type-fest's IntRange doesn't include the `To` value, but we need it!
|
|
89
|
+
*/
|
|
90
|
+
type IntRangeInclusive<From extends number, To extends number> = IntRange<From, To> | To;
|
|
5
91
|
/**
|
|
6
92
|
* Split an array into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements.
|
|
7
93
|
*
|
|
@@ -15,7 +101,7 @@ type Chunked<T extends IterableContainer> = T[number] extends never ? [] : T ext
|
|
|
15
101
|
* @dataFirst
|
|
16
102
|
* @category Array
|
|
17
103
|
*/
|
|
18
|
-
declare function chunk<T extends IterableContainer>(array: T, size:
|
|
104
|
+
declare function chunk<T extends IterableContainer, N extends number>(array: T, size: N): Chunk<T, N>;
|
|
19
105
|
/**
|
|
20
106
|
* Split an array into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements.
|
|
21
107
|
*
|
|
@@ -28,6 +114,6 @@ declare function chunk<T extends IterableContainer>(array: T, size: number): Chu
|
|
|
28
114
|
* @dataLast
|
|
29
115
|
* @category Array
|
|
30
116
|
*/
|
|
31
|
-
declare function chunk<
|
|
117
|
+
declare function chunk<N extends number>(size: N): <T extends IterableContainer>(array: T) => Chunk<T, N>;
|
|
32
118
|
|
|
33
119
|
export { chunk };
|
package/dist/chunk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-BT3FI7L7.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as chunk};
|
package/dist/chunk.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkY3WI7FPBcjs = require('./chunk-Y3WI7FPB.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("edge-cases",()=>{test("0 chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],0);expectTypeOf(e).toEqualTypeOf()}),test("negative chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],-10);expectTypeOf(e).toEqualTypeOf()})});describe("regular (non-literal) size",()=>{describe("mutable",()=>{test("empty tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest tail",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest middle",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest head",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()})}),describe("readonly",()=>{test("empty tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest tail",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest middle",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest head",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456],2);expectTypeOf(e).toEqualTypeOf()})})});describe("literal size",()=>{describe("mutable",()=>{test("empty tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),describe("infinite tuples (rest/spread item)",()=>{describe("prefix arrays",()=>{test("prefix is shorter than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is same size as chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is longer than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),describe("suffix arrays",()=>{test("suffix is shorter than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is same size as chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is larger than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),test("both prefix and suffix",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,"abc"],2);expectTypeOf(e).toEqualTypeOf()})})}),describe("readonly",()=>{test("empty tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("const",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),describe("infinite tuples (rest/spread item)",()=>{describe("prefix arrays",()=>{test("prefix is shorter than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is same size as chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is longer than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),describe("suffix arrays",()=>{test("suffix is shorter than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is same size as chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is larger than chunk size",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),test("both prefix and suffix",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, [123,"abc"],2);expectTypeOf(e).toEqualTypeOf()})})}),describe("max literal chunk size",()=>{test("below max",()=>{let[[e,o,...n]]=_chunkY3WI7FPBcjs.a.call(void 0, ["abc",!0],200);expectTypeOf(e).toEqualTypeOf(),expectTypeOf(o).toEqualTypeOf(),expectTypeOf(n[197]).toEqualTypeOf(),expectTypeOf(n[198]).toEqualTypeOf()})}),test("above max",()=>{let e=_chunkY3WI7FPBcjs.a.call(void 0, ["abc",!0],1e3);expectTypeOf(e).toEqualTypeOf()})});
|
package/dist/chunk.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as r}from"./chunk-BT3FI7L7.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("edge-cases",()=>{test("0 chunk size",()=>{let e=r([1,2,3],0);expectTypeOf(e).toEqualTypeOf()}),test("negative chunk size",()=>{let e=r([1,2,3],-10);expectTypeOf(e).toEqualTypeOf()})});describe("regular (non-literal) size",()=>{describe("mutable",()=>{test("empty tuple",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest tail",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest middle",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest head",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()})}),describe("readonly",()=>{test("empty tuple",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest tail",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest middle",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest head",()=>{let e=r([123,456],2);expectTypeOf(e).toEqualTypeOf()})})});describe("literal size",()=>{describe("mutable",()=>{test("empty tuple",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),describe("infinite tuples (rest/spread item)",()=>{describe("prefix arrays",()=>{test("prefix is shorter than chunk size",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is same size as chunk size",()=>{let e=r([1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is longer than chunk size",()=>{let e=r([1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),describe("suffix arrays",()=>{test("suffix is shorter than chunk size",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is same size as chunk size",()=>{let e=r([1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is larger than chunk size",()=>{let e=r([1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),test("both prefix and suffix",()=>{let e=r([123,"abc"],2);expectTypeOf(e).toEqualTypeOf()})})}),describe("readonly",()=>{test("empty tuple",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),test("const",()=>{let e=r([123,456,789],2);expectTypeOf(e).toEqualTypeOf()}),describe("infinite tuples (rest/spread item)",()=>{describe("prefix arrays",()=>{test("prefix is shorter than chunk size",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is same size as chunk size",()=>{let e=r([1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("prefix is longer than chunk size",()=>{let e=r([1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),describe("suffix arrays",()=>{test("suffix is shorter than chunk size",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is same size as chunk size",()=>{let e=r([1,2],2);expectTypeOf(e).toEqualTypeOf()}),test("suffix is larger than chunk size",()=>{let e=r([1,2,3],2);expectTypeOf(e).toEqualTypeOf()})}),test("both prefix and suffix",()=>{let e=r([123,"abc"],2);expectTypeOf(e).toEqualTypeOf()})})}),describe("max literal chunk size",()=>{test("below max",()=>{let[[e,o,...n]]=r(["abc",!0],200);expectTypeOf(e).toEqualTypeOf(),expectTypeOf(o).toEqualTypeOf(),expectTypeOf(n[197]).toEqualTypeOf(),expectTypeOf(n[198]).toEqualTypeOf()})}),test("above max",()=>{let e=r(["abc",!0],1e3);expectTypeOf(e).toEqualTypeOf()})});
|
package/dist/concat.d.cts
CHANGED
package/dist/concat.d.ts
CHANGED
package/dist/conditional.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GuardType } from './types-
|
|
1
|
+
import { G as GuardType } from './types-BE3YOWVA.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Case<In, Out, When extends (x: In) => boolean = (x: In) => boolean> = readonly [when: When, then: (x: GuardType<When, In> & In) => Out];
|
package/dist/conditional.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GuardType } from './types-
|
|
1
|
+
import { G as GuardType } from './types-BE3YOWVA.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Case<In, Out, When extends (x: In) => boolean = (x: In) => boolean> = readonly [when: When, then: (x: GuardType<When, In> & In) => Out];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');var _chunkXUEOOIR6cjs = require('./chunk-XUEOOIR6.cjs');var _chunkSXTSJOEEcjs = require('./chunk-SXTSJOEE.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var _chunkDHNCWVVTcjs = require('./chunk-DHNCWVVT.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-FWQYL4Y4.cjs');require('./chunk-G66EZBJS.cjs');var _chunkE6JSDI5Scjs = require('./chunk-E6JSDI5S.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{it("narrows types in the transformers",()=>{_chunkE6JSDI5Scjs.a.call(void 0, 3,[_chunkEHJK4JRFcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkYWTY4X2Rcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkXUEOOIR6cjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkDAFN5EJRcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[e=>e===3,e=>{expectTypeOf(e).toEqualTypeOf()}])}),it("narrows types when using `isNullish`/`isNonNullish` with complex data",()=>{let t=_chunkDHNCWVVTcjs.a.call(void 0, [{x:10},{x:20}],_chunkSXTSJOEEcjs.a.call(void 0, "x"));_chunkE6JSDI5Scjs.a.call(void 0, t,[_chunkXUEOOIR6cjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkDAFN5EJRcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}])}),it("passes the trivial defaultCase's type to the output",()=>{let t=_chunkE6JSDI5Scjs.a.call(void 0, "Jokic",[_chunkEHJK4JRFcjs.a,()=>"hello"],_chunkE6JSDI5Scjs.a.defaultCase());expectTypeOf(t).toEqualTypeOf()}),it("passes the defaultCase's type to the output",()=>{let t=_chunkE6JSDI5Scjs.a.call(void 0, "Jokic",[_chunkEHJK4JRFcjs.a,()=>"hello"],_chunkE6JSDI5Scjs.a.defaultCase(()=>123));expectTypeOf(t).toEqualTypeOf()})});describe("data-last",()=>{it("narrows types in the transformers",()=>{_chunkI6VXEY44cjs.a.call(void 0, 3,_chunkE6JSDI5Scjs.a.call(void 0, [_chunkEHJK4JRFcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkYWTY4X2Rcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkXUEOOIR6cjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[_chunkDAFN5EJRcjs.a,e=>{expectTypeOf(e).toEqualTypeOf()}],[e=>e===3,e=>{expectTypeOf(e).toEqualTypeOf()}]))}),it("narrows types when using `isNullish`/`isNonNullish` with complex data",()=>{_chunkI6VXEY44cjs.a.call(void 0, [{x:10},{x:20}],_chunkDHNCWVVTcjs.a.call(void 0, _chunkSXTSJOEEcjs.a.call(void 0, "x")),_chunkE6JSDI5Scjs.a.call(void 0, [_chunkXUEOOIR6cjs.a,t=>{expectTypeOf(t).toEqualTypeOf()}],[_chunkDAFN5EJRcjs.a,t=>{expectTypeOf(t).toEqualTypeOf()}]))}),it("passes the trivial defaultCase's type to the output",()=>{let t=_chunkI6VXEY44cjs.a.call(void 0, "Jokic",_chunkE6JSDI5Scjs.a.call(void 0, [_chunkEHJK4JRFcjs.a,()=>"hello"],_chunkE6JSDI5Scjs.a.defaultCase()));expectTypeOf(t).toEqualTypeOf()}),it("passes the defaultCase's type to the output",()=>{let t=_chunkI6VXEY44cjs.a.call(void 0, "Jokic",_chunkE6JSDI5Scjs.a.call(void 0, [_chunkEHJK4JRFcjs.a,()=>"hello"],_chunkE6JSDI5Scjs.a.defaultCase(()=>123)));expectTypeOf(t).toEqualTypeOf()})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-Q2HW4RVT.js";import{a as o}from"./chunk-QPP664N4.js";import{a}from"./chunk-TBXEXWSK.js";import{a as f}from"./chunk-USNHLUEU.js";import{a as p}from"./chunk-UYLVIAK4.js";import{a as l}from"./chunk-J5PNUDDU.js";import{a as i}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JXXXUJM5.js";import"./chunk-73BYESBE.js";import{a as s}from"./chunk-H2E5GCCP.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{it("narrows types in the transformers",()=>{s(3,[p,e=>{expectTypeOf(e).toEqualTypeOf()}],[r,e=>{expectTypeOf(e).toEqualTypeOf()}],[a,e=>{expectTypeOf(e).toEqualTypeOf()}],[o,e=>{expectTypeOf(e).toEqualTypeOf()}],[e=>e===3,e=>{expectTypeOf(e).toEqualTypeOf()}])}),it("narrows types when using `isNullish`/`isNonNullish` with complex data",()=>{let t=l([{x:10},{x:20}],f("x"));s(t,[a,e=>{expectTypeOf(e).toEqualTypeOf()}],[o,e=>{expectTypeOf(e).toEqualTypeOf()}])}),it("passes the trivial defaultCase's type to the output",()=>{let t=s("Jokic",[p,()=>"hello"],s.defaultCase());expectTypeOf(t).toEqualTypeOf()}),it("passes the defaultCase's type to the output",()=>{let t=s("Jokic",[p,()=>"hello"],s.defaultCase(()=>123));expectTypeOf(t).toEqualTypeOf()})});describe("data-last",()=>{it("narrows types in the transformers",()=>{i(3,s([p,e=>{expectTypeOf(e).toEqualTypeOf()}],[r,e=>{expectTypeOf(e).toEqualTypeOf()}],[a,e=>{expectTypeOf(e).toEqualTypeOf()}],[o,e=>{expectTypeOf(e).toEqualTypeOf()}],[e=>e===3,e=>{expectTypeOf(e).toEqualTypeOf()}]))}),it("narrows types when using `isNullish`/`isNonNullish` with complex data",()=>{i([{x:10},{x:20}],l(f("x")),s([a,t=>{expectTypeOf(t).toEqualTypeOf()}],[o,t=>{expectTypeOf(t).toEqualTypeOf()}]))}),it("passes the trivial defaultCase's type to the output",()=>{let t=i("Jokic",s([p,()=>"hello"],s.defaultCase()));expectTypeOf(t).toEqualTypeOf()}),it("passes the defaultCase's type to the output",()=>{let t=i("Jokic",s([p,()=>"hello"],s.defaultCase(()=>123)));expectTypeOf(t).toEqualTypeOf()})});
|
package/dist/drop-first-by.d.cts
CHANGED
package/dist/drop-first-by.d.ts
CHANGED
package/dist/drop-last-while.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkG7BJFBAZcjs = require('./chunk-G7BJFBAZ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.dropLastWhile = _chunkG7BJFBAZcjs.a;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Removes elements from the end of the array until the predicate returns false.
|
|
3
6
|
*
|
|
@@ -12,7 +15,7 @@
|
|
|
12
15
|
* @dataFirst
|
|
13
16
|
* @category Array
|
|
14
17
|
*/
|
|
15
|
-
declare function dropLastWhile<T>(data:
|
|
18
|
+
declare function dropLastWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
|
|
16
19
|
/**
|
|
17
20
|
* Removes elements from the end of the array until the predicate returns false.
|
|
18
21
|
*
|
|
@@ -26,6 +29,6 @@ declare function dropLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, i
|
|
|
26
29
|
* @dataLast
|
|
27
30
|
* @category Array
|
|
28
31
|
*/
|
|
29
|
-
declare function dropLastWhile<T>(predicate: (item: T, index: number, data:
|
|
32
|
+
declare function dropLastWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (data: T) => Array<T[number]>;
|
|
30
33
|
|
|
31
34
|
export { dropLastWhile };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer } from './types-BE3YOWVA.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Removes elements from the end of the array until the predicate returns false.
|
|
3
6
|
*
|
|
@@ -12,7 +15,7 @@
|
|
|
12
15
|
* @dataFirst
|
|
13
16
|
* @category Array
|
|
14
17
|
*/
|
|
15
|
-
declare function dropLastWhile<T>(data:
|
|
18
|
+
declare function dropLastWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
|
|
16
19
|
/**
|
|
17
20
|
* Removes elements from the end of the array until the predicate returns false.
|
|
18
21
|
*
|
|
@@ -26,6 +29,6 @@ declare function dropLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, i
|
|
|
26
29
|
* @dataLast
|
|
27
30
|
* @category Array
|
|
28
31
|
*/
|
|
29
|
-
declare function dropLastWhile<T>(predicate: (item: T, index: number, data:
|
|
32
|
+
declare function dropLastWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (data: T) => Array<T[number]>;
|
|
30
33
|
|
|
31
34
|
export { dropLastWhile };
|
package/dist/drop-last-while.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-QTQTKNWA.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as dropLastWhile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkG7BJFBAZcjs = require('./chunk-G7BJFBAZ.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [1,"a"],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [1,"a",!0],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkG7BJFBAZcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),describe("predicate is typed correctly",()=>{test("empty array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array with union type",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("prefix array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("suffix array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("array with suffix and prefix",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("tuple",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("union of arrays",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkG7BJFBAZcjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-QTQTKNWA.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import{a}from"./chunk-T5XG33UI.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=r([1],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=r([1],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=r([1,"a"],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([1,"a",!0],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=t([1],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=t([1],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=t([1,"a"],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=t([1,"a",!0],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),describe("predicate is typed correctly",()=>{test("empty array",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array with union type",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("prefix array",()=>{t([1],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("suffix array",()=>{t([1],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("array with suffix and prefix",()=>{t([1,"a"],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("tuple",()=>{t([1,"a",!0],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("union of arrays",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))})})});
|
package/dist/drop-last.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAACZ5UGGcjs = require('./chunk-AACZ5UGG.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.dropLast = _chunkAACZ5UGGcjs.a;
|
package/dist/drop-last.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Removes last `n` elements from the `array`.
|
|
3
6
|
*
|
|
@@ -10,7 +13,7 @@
|
|
|
10
13
|
* @dataFirst
|
|
11
14
|
* @category Array
|
|
12
15
|
*/
|
|
13
|
-
declare function dropLast<T>(array:
|
|
16
|
+
declare function dropLast<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
|
|
14
17
|
/**
|
|
15
18
|
* Removes last `n` elements from the `array`.
|
|
16
19
|
*
|
|
@@ -22,6 +25,6 @@ declare function dropLast<T>(array: ReadonlyArray<T>, n: number): Array<T>;
|
|
|
22
25
|
* @dataLast
|
|
23
26
|
* @category Array
|
|
24
27
|
*/
|
|
25
|
-
declare function dropLast
|
|
28
|
+
declare function dropLast(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
|
|
26
29
|
|
|
27
30
|
export { dropLast };
|