@vinicunca/perkakas 1.0.3 → 1.0.5

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.
Files changed (261) hide show
  1. package/dist/add-prop.d.cts +1 -1
  2. package/dist/add-prop.d.ts +1 -1
  3. package/dist/chunk-3DFX2FQG.cjs +1 -0
  4. package/dist/chunk-4WU7JGWS.cjs +1 -0
  5. package/dist/chunk-AACZ5UGG.cjs +1 -0
  6. package/dist/chunk-AKGWT6GC.js +1 -0
  7. package/dist/chunk-BT3FI7L7.js +1 -0
  8. package/dist/chunk-D5B5IQRS.js +1 -0
  9. package/dist/{chunk-XQOKSJ5R.cjs → chunk-E6RBEL5Z.cjs} +1 -1
  10. package/dist/chunk-EPHUNAE5.js +1 -0
  11. package/dist/chunk-G7BJFBAZ.cjs +1 -0
  12. package/dist/{chunk-YIUDV3OA.cjs → chunk-HTO3K3VA.cjs} +1 -1
  13. package/dist/chunk-IABWIMQT.js +1 -0
  14. package/dist/chunk-IOSBDH5J.cjs +1 -0
  15. package/dist/chunk-KAA6IVBL.js +1 -0
  16. package/dist/chunk-MADDQNAR.cjs +1 -0
  17. package/dist/chunk-OJ2QGTFS.js +1 -0
  18. package/dist/chunk-PFLGL4YP.js +1 -0
  19. package/dist/chunk-QT66COHU.js +1 -0
  20. package/dist/chunk-QTQTKNWA.js +1 -0
  21. package/dist/chunk-RJAVPEJT.cjs +1 -0
  22. package/dist/chunk-U2BXIRBJ.js +1 -0
  23. package/dist/chunk-VN2OAM2N.js +1 -0
  24. package/dist/chunk-VPG3W5JH.cjs +1 -0
  25. package/dist/chunk-WQDEYM64.js +1 -0
  26. package/dist/chunk-WRKGH4XX.js +1 -0
  27. package/dist/chunk-Y3WI7FPB.cjs +1 -0
  28. package/dist/chunk-Z5UEQBZP.cjs +1 -0
  29. package/dist/chunk-Z6HCXPKS.cjs +1 -0
  30. package/dist/chunk-ZO4ND36N.cjs +1 -0
  31. package/dist/chunk.cjs +1 -1
  32. package/dist/chunk.d.cts +91 -5
  33. package/dist/chunk.d.ts +91 -5
  34. package/dist/chunk.js +1 -1
  35. package/dist/chunk.spec-d.cjs +1 -1
  36. package/dist/chunk.spec-d.js +1 -1
  37. package/dist/concat.d.cts +1 -1
  38. package/dist/concat.d.ts +1 -1
  39. package/dist/conditional.d.cts +1 -1
  40. package/dist/conditional.d.ts +1 -1
  41. package/dist/conditional.spec-d.cjs +1 -1
  42. package/dist/conditional.spec-d.js +1 -1
  43. package/dist/drop-first-by.d.cts +1 -1
  44. package/dist/drop-first-by.d.ts +1 -1
  45. package/dist/drop-last-while.cjs +1 -1
  46. package/dist/drop-last-while.d.cts +5 -2
  47. package/dist/drop-last-while.d.ts +5 -2
  48. package/dist/drop-last-while.js +1 -1
  49. package/dist/drop-last-while.spec-d.cjs +1 -0
  50. package/dist/drop-last-while.spec-d.d.cts +2 -0
  51. package/dist/drop-last-while.spec-d.d.ts +2 -0
  52. package/dist/drop-last-while.spec-d.js +1 -0
  53. package/dist/drop-last.cjs +1 -1
  54. package/dist/drop-last.d.cts +5 -2
  55. package/dist/drop-last.d.ts +5 -2
  56. package/dist/drop-last.js +1 -1
  57. package/dist/drop-last.spec-d.cjs +1 -0
  58. package/dist/drop-last.spec-d.d.cts +2 -0
  59. package/dist/drop-last.spec-d.d.ts +2 -0
  60. package/dist/drop-last.spec-d.js +1 -0
  61. package/dist/drop-while.cjs +1 -1
  62. package/dist/drop-while.d.cts +5 -2
  63. package/dist/drop-while.d.ts +5 -2
  64. package/dist/drop-while.js +1 -1
  65. package/dist/drop-while.spec-d.cjs +1 -0
  66. package/dist/drop-while.spec-d.d.cts +2 -0
  67. package/dist/drop-while.spec-d.d.ts +2 -0
  68. package/dist/drop-while.spec-d.js +1 -0
  69. package/dist/drop.cjs +1 -1
  70. package/dist/drop.d.cts +23 -2
  71. package/dist/drop.d.ts +23 -2
  72. package/dist/drop.js +1 -1
  73. package/dist/drop.spec-d.cjs +1 -0
  74. package/dist/drop.spec-d.d.cts +2 -0
  75. package/dist/drop.spec-d.d.ts +2 -0
  76. package/dist/drop.spec-d.js +1 -0
  77. package/dist/evolve.d.cts +1 -1
  78. package/dist/evolve.d.ts +1 -1
  79. package/dist/first-by.d.cts +1 -1
  80. package/dist/first-by.d.ts +1 -1
  81. package/dist/first.d.cts +1 -1
  82. package/dist/first.d.ts +1 -1
  83. package/dist/flat.d.cts +1 -1
  84. package/dist/flat.d.ts +1 -1
  85. package/dist/for-each-obj.d.cts +1 -1
  86. package/dist/for-each-obj.d.ts +1 -1
  87. package/dist/for-each.d.cts +1 -1
  88. package/dist/for-each.d.ts +1 -1
  89. package/dist/from-entries.d.cts +1 -1
  90. package/dist/from-entries.d.ts +1 -1
  91. package/dist/from-keys.d.cts +1 -1
  92. package/dist/from-keys.d.ts +1 -1
  93. package/dist/group-by.d.cts +1 -1
  94. package/dist/group-by.d.ts +1 -1
  95. package/dist/has-at-least.d.cts +1 -1
  96. package/dist/has-at-least.d.ts +1 -1
  97. package/dist/has-sub-object.d.cts +1 -1
  98. package/dist/has-sub-object.d.ts +1 -1
  99. package/dist/index-by.d.cts +1 -1
  100. package/dist/index-by.d.ts +1 -1
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.d.cts +2 -1
  103. package/dist/index.d.ts +2 -1
  104. package/dist/index.js +1 -1
  105. package/dist/is-array.d.cts +1 -1
  106. package/dist/is-array.d.ts +1 -1
  107. package/dist/is-big-int.d.cts +1 -1
  108. package/dist/is-big-int.d.ts +1 -1
  109. package/dist/is-boolean.d.cts +1 -1
  110. package/dist/is-boolean.d.ts +1 -1
  111. package/dist/is-empty.d.cts +1 -1
  112. package/dist/is-empty.d.ts +1 -1
  113. package/dist/is-included-in.d.cts +1 -1
  114. package/dist/is-included-in.d.ts +1 -1
  115. package/dist/is-nullish.d.cts +1 -1
  116. package/dist/is-nullish.d.ts +1 -1
  117. package/dist/is-number.d.cts +1 -1
  118. package/dist/is-number.d.ts +1 -1
  119. package/dist/is-object-type.d.cts +1 -1
  120. package/dist/is-object-type.d.ts +1 -1
  121. package/dist/is-plain-object.d.cts +1 -1
  122. package/dist/is-plain-object.d.ts +1 -1
  123. package/dist/is-string.d.cts +1 -1
  124. package/dist/is-string.d.ts +1 -1
  125. package/dist/is-symbol.d.cts +1 -1
  126. package/dist/is-symbol.d.ts +1 -1
  127. package/dist/keys.d.cts +1 -1
  128. package/dist/keys.d.ts +1 -1
  129. package/dist/last.d.cts +1 -1
  130. package/dist/last.d.ts +1 -1
  131. package/dist/map-keys.d.cts +1 -1
  132. package/dist/map-keys.d.ts +1 -1
  133. package/dist/map-values.d.cts +1 -1
  134. package/dist/map-values.d.ts +1 -1
  135. package/dist/map-with-feedback.d.cts +1 -1
  136. package/dist/map-with-feedback.d.ts +1 -1
  137. package/dist/map.d.cts +1 -1
  138. package/dist/map.d.ts +1 -1
  139. package/dist/nth-by.d.cts +1 -1
  140. package/dist/nth-by.d.ts +1 -1
  141. package/dist/omit-by.d.cts +1 -1
  142. package/dist/omit-by.d.ts +1 -1
  143. package/dist/only.d.cts +1 -1
  144. package/dist/only.d.ts +1 -1
  145. package/dist/pick-by.d.cts +1 -1
  146. package/dist/pick-by.d.ts +1 -1
  147. package/dist/product.d.cts +1 -1
  148. package/dist/product.d.ts +1 -1
  149. package/dist/pull-object.d.cts +1 -1
  150. package/dist/pull-object.d.ts +1 -1
  151. package/dist/random-integer.cjs +1 -0
  152. package/dist/random-integer.d.cts +20 -0
  153. package/dist/random-integer.d.ts +20 -0
  154. package/dist/random-integer.js +1 -0
  155. package/dist/random-integer.spec-d.cjs +1 -0
  156. package/dist/random-integer.spec-d.d.cts +2 -0
  157. package/dist/random-integer.spec-d.d.ts +2 -0
  158. package/dist/random-integer.spec-d.js +1 -0
  159. package/dist/rank-by.d.cts +1 -1
  160. package/dist/rank-by.d.ts +1 -1
  161. package/dist/sample.d.cts +1 -1
  162. package/dist/sample.d.ts +1 -1
  163. package/dist/set.d.cts +1 -1
  164. package/dist/set.d.ts +1 -1
  165. package/dist/shuffle.cjs +1 -1
  166. package/dist/shuffle.d.cts +5 -2
  167. package/dist/shuffle.d.ts +5 -2
  168. package/dist/shuffle.js +1 -1
  169. package/dist/shuffle.spec-d.cjs +1 -0
  170. package/dist/shuffle.spec-d.d.cts +2 -0
  171. package/dist/shuffle.spec-d.d.ts +2 -0
  172. package/dist/shuffle.spec-d.js +1 -0
  173. package/dist/sort-by.d.cts +1 -1
  174. package/dist/sort-by.d.ts +1 -1
  175. package/dist/sort.d.cts +1 -1
  176. package/dist/sort.d.ts +1 -1
  177. package/dist/sum.d.cts +1 -1
  178. package/dist/sum.d.ts +1 -1
  179. package/dist/swap-indices.d.cts +1 -1
  180. package/dist/swap-indices.d.ts +1 -1
  181. package/dist/take-first-by.d.cts +1 -1
  182. package/dist/take-first-by.d.ts +1 -1
  183. package/dist/take-last-while.cjs +1 -1
  184. package/dist/take-last-while.d.cts +5 -2
  185. package/dist/take-last-while.d.ts +5 -2
  186. package/dist/take-last-while.js +1 -1
  187. package/dist/take-last-while.spec-d-.cjs +1 -0
  188. package/dist/take-last-while.spec-d-.d.cts +2 -0
  189. package/dist/take-last-while.spec-d-.d.ts +2 -0
  190. package/dist/take-last-while.spec-d-.js +1 -0
  191. package/dist/take-last.cjs +1 -1
  192. package/dist/take-last.d.cts +5 -2
  193. package/dist/take-last.d.ts +5 -2
  194. package/dist/take-last.js +1 -1
  195. package/dist/take-last.spec-d.cjs +1 -0
  196. package/dist/take-last.spec-d.d.cts +2 -0
  197. package/dist/take-last.spec-d.d.ts +2 -0
  198. package/dist/take-last.spec-d.js +1 -0
  199. package/dist/take-while.cjs +1 -1
  200. package/dist/take-while.d.cts +5 -2
  201. package/dist/take-while.d.ts +5 -2
  202. package/dist/take-while.js +1 -1
  203. package/dist/take-white.spec-d.cjs +1 -0
  204. package/dist/take-white.spec-d.d.cts +2 -0
  205. package/dist/take-white.spec-d.d.ts +2 -0
  206. package/dist/take-white.spec-d.js +1 -0
  207. package/dist/take.cjs +1 -1
  208. package/dist/take.d.cts +5 -2
  209. package/dist/take.d.ts +5 -2
  210. package/dist/take.js +1 -1
  211. package/dist/take.spec-d.cjs +1 -0
  212. package/dist/take.spec-d.d.cts +2 -0
  213. package/dist/take.spec-d.d.ts +2 -0
  214. package/dist/take.spec-d.js +1 -0
  215. package/dist/tap.spec-d.cjs +1 -1
  216. package/dist/tap.spec-d.js +1 -1
  217. package/dist/{types-BMu1PIvo.d.cts → types-CC8iZVKO.d.cts} +56 -3
  218. package/dist/{types-BMu1PIvo.d.ts → types-CC8iZVKO.d.ts} +56 -3
  219. package/dist/unique-by.cjs +1 -1
  220. package/dist/unique-by.d.cts +5 -2
  221. package/dist/unique-by.d.ts +5 -2
  222. package/dist/unique-by.js +1 -1
  223. package/dist/unique-with.cjs +1 -1
  224. package/dist/unique-with.d.cts +5 -2
  225. package/dist/unique-with.d.ts +5 -2
  226. package/dist/unique-with.js +1 -1
  227. package/dist/unique.cjs +1 -1
  228. package/dist/unique.d.cts +6 -3
  229. package/dist/unique.d.ts +6 -3
  230. package/dist/unique.js +1 -1
  231. package/dist/values.d.cts +1 -1
  232. package/dist/values.d.ts +1 -1
  233. package/dist/zip-with.d.cts +1 -1
  234. package/dist/zip-with.d.ts +1 -1
  235. package/dist/zip.d.cts +1 -1
  236. package/dist/zip.d.ts +1 -1
  237. package/package.json +12 -12
  238. package/dist/chunk-3UUZWCRS.cjs +0 -1
  239. package/dist/chunk-65DHT5Z7.cjs +0 -1
  240. package/dist/chunk-66KQORMS.js +0 -1
  241. package/dist/chunk-AE5HI6VG.cjs +0 -1
  242. package/dist/chunk-CIF6WEFP.js +0 -1
  243. package/dist/chunk-COBRSP66.js +0 -1
  244. package/dist/chunk-DUKQ2ODK.js +0 -1
  245. package/dist/chunk-DWPHE3F2.cjs +0 -1
  246. package/dist/chunk-HUWRVMPE.js +0 -1
  247. package/dist/chunk-LIKMH7XD.js +0 -1
  248. package/dist/chunk-LOPUNSWJ.js +0 -1
  249. package/dist/chunk-MENOHSYF.js +0 -1
  250. package/dist/chunk-NNK6R67E.cjs +0 -1
  251. package/dist/chunk-P7OXTPPH.cjs +0 -1
  252. package/dist/chunk-QTCQZ7LU.js +0 -1
  253. package/dist/chunk-RSJJRJTH.cjs +0 -1
  254. package/dist/chunk-TR5T6KUC.js +0 -1
  255. package/dist/chunk-U5EQP4BO.cjs +0 -1
  256. package/dist/chunk-VNLOBA2B.cjs +0 -1
  257. package/dist/chunk-X6AB3I7Z.cjs +0 -1
  258. package/dist/chunk-YQKPA3BB.js +0 -1
  259. package/dist/chunk-YWSZXRUY.js +0 -1
  260. package/dist/chunk-Z7EBGO2B.js +0 -1
  261. package/dist/chunk-ZCFTW5HO.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { U as UpsertProp } from './types-BMu1PIvo.cjs';
1
+ import { U as UpsertProp } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { U as UpsertProp } from './types-BMu1PIvo.js';
1
+ import { U as UpsertProp } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -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};
@@ -0,0 +1 @@
1
+ import{a as n,c as o}from"./chunk-MYLYERXO.js";import{a as t}from"./chunk-JFXZ246Y.js";function i(...e){return t(p,e,u)}function p(e,r){return r<0?[...e]:e.slice(r)}function u(e){if(e<=0)return o;let r=e;return a=>r>0?(r-=1,n):{done:!1,hasNext:!0,next:a}}export{i 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(...a){return _chunkNLX7PGPIcjs.a.call(void 0, i,a)}function i(a){return(n,o,u)=>u.findIndex(e=>a(n,e))===o?{done:!1,hasNext:!0,next:n}:_chunk3X6SAJDQcjs.a}exports.a = 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 y(...r){return _chunkNLX7PGPIcjs.a.call(void 0, a,r)}function a(){let r=new Set;return n=>r.has(n)?_chunk3X6SAJDQcjs.a:(r.add(n),{done:!1,hasNext:!0,next:n})}exports.a = y;
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
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});function t(r,n){let e=Math.ceil(r),o=Math.floor(n);if(o<e)throw new RangeError(`randomInt: The range [${r},${n}] contains no integer`);return Math.floor(Math.random()*(o-e+1)+e)}exports.a = t;
@@ -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
+ function t(r,n){let e=Math.ceil(r),o=Math.floor(n);if(o<e)throw new RangeError(`randomInt: The range [${r},${n}] contains no integer`);return Math.floor(Math.random()*(o-e+1)+e)}export{t 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 _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 _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function i(...e){return _chunkY74ER22Ocjs.a.call(void 0, p,e,u)}function p(e,r){return r<0?[...e]:e.slice(r)}function u(e){if(e<=0)return _chunk3X6SAJDQcjs.c;let r=e;return a=>r>0?(r-=1,_chunk3X6SAJDQcjs.a):{done:!1,hasNext:!0,next:a}}exports.a = i;
@@ -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 _chunkVNLOBA2Bcjs = require('./chunk-VNLOBA2B.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.chunk = _chunkVNLOBA2Bcjs.a;
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 { I as IterableContainer, N as NonEmptyArray } from './types-BMu1PIvo.cjs';
2
- import 'type-fest';
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-CC8iZVKO.cjs';
3
3
 
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]>>;
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: number): Chunked<T>;
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<T extends IterableContainer>(size: number): (array: T) => Chunked<T>;
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 { I as IterableContainer, N as NonEmptyArray } from './types-BMu1PIvo.js';
2
- import 'type-fest';
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-CC8iZVKO.js';
3
3
 
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]>>;
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: number): Chunked<T>;
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<T extends IterableContainer>(size: number): (array: T) => Chunked<T>;
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-TR5T6KUC.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as chunk};
1
+ import{a}from"./chunk-BT3FI7L7.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as chunk};
@@ -1 +1 @@
1
- "use strict";var _chunkVNLOBA2Bcjs = require('./chunk-VNLOBA2B.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');test("empty tuple",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [],2);expectTypeOf(t).toEqualTypeOf()});test("readonly empty tuple",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [],2);expectTypeOf(t).toEqualTypeOf()});test("array",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [],2);expectTypeOf(t).toEqualTypeOf()});test("readonly array",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [],2);expectTypeOf(t).toEqualTypeOf()});test("tuple",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456,789],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456,789],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest tail",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest tail",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest middle",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest middle",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest head",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest head",()=>{let t=_chunkVNLOBA2Bcjs.a.call(void 0, [123,456],2);expectTypeOf(t).toEqualTypeOf()});
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()})});
@@ -1 +1 @@
1
- import{a as e}from"./chunk-TR5T6KUC.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";test("empty tuple",()=>{let t=e([],2);expectTypeOf(t).toEqualTypeOf()});test("readonly empty tuple",()=>{let t=e([],2);expectTypeOf(t).toEqualTypeOf()});test("array",()=>{let t=e([],2);expectTypeOf(t).toEqualTypeOf()});test("readonly array",()=>{let t=e([],2);expectTypeOf(t).toEqualTypeOf()});test("tuple",()=>{let t=e([123,456,789],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple",()=>{let t=e([123,456,789],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest tail",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest tail",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest middle",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest middle",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});test("tuple with rest head",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});test("readonly tuple with rest head",()=>{let t=e([123,456],2);expectTypeOf(t).toEqualTypeOf()});
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
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BMu1PIvo.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/concat.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BMu1PIvo.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { G as GuardType } from './types-BMu1PIvo.cjs';
1
+ import { G as GuardType } from './types-CC8iZVKO.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];
@@ -1,4 +1,4 @@
1
- import { G as GuardType } from './types-BMu1PIvo.js';
1
+ import { G as GuardType } from './types-CC8iZVKO.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 _chunkXUEOOIR6cjs = require('./chunk-XUEOOIR6.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.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
+ "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-TBXEXWSK.js";import{a as r}from"./chunk-Q2HW4RVT.js";import{a as o}from"./chunk-QPP664N4.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()})});
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()})});
@@ -1,4 +1,4 @@
1
- import { N as NonEmptyArray } from './types-BMu1PIvo.cjs';
1
+ import { a as NonEmptyArray } from './types-CC8iZVKO.cjs';
2
2
  import { O as OrderRule } from './curry-order-rules-DETxSzle.cjs';
3
3
  import 'type-fest';
4
4
 
@@ -1,4 +1,4 @@
1
- import { N as NonEmptyArray } from './types-BMu1PIvo.js';
1
+ import { a as NonEmptyArray } from './types-CC8iZVKO.js';
2
2
  import { O as OrderRule } from './curry-order-rules-DETxSzle.js';
3
3
  import 'type-fest';
4
4
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkP7OXTPPHcjs = require('./chunk-P7OXTPPH.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.dropLastWhile = _chunkP7OXTPPHcjs.a;
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-CC8iZVKO.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: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
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: ReadonlyArray<T>) => boolean): (data: ReadonlyArray<T>) => Array<T>;
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-CC8iZVKO.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: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
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: ReadonlyArray<T>) => boolean): (data: ReadonlyArray<T>) => Array<T>;
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 +1 @@
1
- import{a}from"./chunk-QTCQZ7LU.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as dropLastWhile};
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,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -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)))})})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZCFTW5HOcjs = require('./chunk-ZCFTW5HO.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.dropLast = _chunkZCFTW5HOcjs.a;
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;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.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: ReadonlyArray<T>, n: number): Array<T>;
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<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
28
+ declare function dropLast(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
26
29
 
27
30
  export { dropLast };