@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
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-PFLGL4YP.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";test("regular array",()=>{let e=r([]);expectTypeOf(e).toEqualTypeOf()});test("non-empty tail-rest array",()=>{let e=r([1]);expectTypeOf(e).toEqualTypeOf()});test("non-empty head-rest array",()=>{let e=r([1]);expectTypeOf(e).toEqualTypeOf()});test("fixed size tuple",()=>{let e=r([1,"a",!0]);expectTypeOf(e).toEqualTypeOf()});it("removes readonlyness from array",()=>{let e=r([]);expectTypeOf(e).toEqualTypeOf()});it("infers type via a pipe",()=>{let e=t(["a",1,!0],r());expectTypeOf(e).toEqualTypeOf()});
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, N as NonEmptyArray, f as ReorderedArray } from './types-BMu1PIvo.cjs';
1
+ import { I as IterableContainer, a as NonEmptyArray, g as ReorderedArray } from './types-CC8iZVKO.cjs';
2
2
  import { O as OrderRule } from './curry-order-rules-DETxSzle.cjs';
3
3
  import 'type-fest';
4
4
 
package/dist/sort-by.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, N as NonEmptyArray, f as ReorderedArray } from './types-BMu1PIvo.js';
1
+ import { I as IterableContainer, a as NonEmptyArray, g as ReorderedArray } from './types-CC8iZVKO.js';
2
2
  import { O as OrderRule } from './curry-order-rules-DETxSzle.js';
3
3
  import 'type-fest';
4
4
 
package/dist/sort.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, f as ReorderedArray } from './types-BMu1PIvo.cjs';
1
+ import { I as IterableContainer, g as ReorderedArray } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/sort.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, f as ReorderedArray } from './types-BMu1PIvo.js';
1
+ import { I as IterableContainer, g as ReorderedArray } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/sum.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
  type Sum<T extends IterableContainer<bigint> | IterableContainer<number>> = T extends readonly [] ? 0 : T extends readonly [bigint, ...ReadonlyArray<unknown>] ? bigint : T[number] extends bigint ? 0 | bigint : number;
package/dist/sum.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
  type Sum<T extends IterableContainer<bigint> | IterableContainer<number>> = T extends readonly [] ? 0 : T extends readonly [bigint, ...ReadonlyArray<unknown>] ? bigint : T[number] extends bigint ? 0 | bigint : number;
@@ -1,5 +1,5 @@
1
1
  import { Join } from 'type-fest';
2
- import { I as IterableContainer } from './types-BMu1PIvo.cjs';
2
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
3
3
 
4
4
  /**
5
5
  * @see https://github.com/sindresorhus/type-fest/blob/main/source/is-equal.d.ts
@@ -1,5 +1,5 @@
1
1
  import { Join } from 'type-fest';
2
- import { I as IterableContainer } from './types-BMu1PIvo.js';
2
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
3
3
 
4
4
  /**
5
5
  * @see https://github.com/sindresorhus/type-fest/blob/main/source/is-equal.d.ts
@@ -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 _chunk3UUZWCRScjs = require('./chunk-3UUZWCRS.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeLastWhile = _chunk3UUZWCRScjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVPG3W5JHcjs = require('./chunk-VPG3W5JH.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeLastWhile = _chunkVPG3W5JHcjs.a;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns elements from the end of the array until the predicate returns false.
3
6
  * The returned elements will be in the same order as in the original array.
@@ -11,7 +14,7 @@
11
14
  * @dataFirst
12
15
  * @category Array
13
16
  */
14
- declare function takeLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
17
+ declare function takeLastWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
15
18
  /**
16
19
  * Returns elements from the end of the array until the predicate returns false.
17
20
  * The returned elements will be in the same order as in the original array.
@@ -24,6 +27,6 @@ declare function takeLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, i
24
27
  * @dataLast
25
28
  * @category Array
26
29
  */
27
- declare function takeLastWhile<T>(predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): (data: ReadonlyArray<T>) => Array<T>;
30
+ declare function takeLastWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (data: T) => Array<T[number]>;
28
31
 
29
32
  export { takeLastWhile };
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns elements from the end of the array until the predicate returns false.
3
6
  * The returned elements will be in the same order as in the original array.
@@ -11,7 +14,7 @@
11
14
  * @dataFirst
12
15
  * @category Array
13
16
  */
14
- declare function takeLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
17
+ declare function takeLastWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
15
18
  /**
16
19
  * Returns elements from the end of the array until the predicate returns false.
17
20
  * The returned elements will be in the same order as in the original array.
@@ -24,6 +27,6 @@ declare function takeLastWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, i
24
27
  * @dataLast
25
28
  * @category Array
26
29
  */
27
- declare function takeLastWhile<T>(predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): (data: ReadonlyArray<T>) => Array<T>;
30
+ declare function takeLastWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (data: T) => Array<T[number]>;
28
31
 
29
32
  export { takeLastWhile };
@@ -1 +1 @@
1
- import{a}from"./chunk-COBRSP66.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeLastWhile};
1
+ import{a}from"./chunk-KAA6IVBL.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeLastWhile};
@@ -0,0 +1 @@
1
+ "use strict";var _chunkVPG3W5JHcjs = require('./chunk-VPG3W5JH.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=_chunkVPG3W5JHcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [1,"a"],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkVPG3W5JHcjs.a.call(void 0, [1,"a",!0],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkVPG3W5JHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkVPG3W5JHcjs.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"],_chunkVPG3W5JHcjs.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],_chunkVPG3W5JHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.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],_chunkVPG3W5JHcjs.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],_chunkVPG3W5JHcjs.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"],_chunkVPG3W5JHcjs.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],_chunkVPG3W5JHcjs.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, [],_chunkVPG3W5JHcjs.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-KAA6IVBL.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 _chunkRSJJRJTHcjs = require('./chunk-RSJJRJTH.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeLast = _chunkRSJJRJTHcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3DFX2FQGcjs = require('./chunk-3DFX2FQG.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeLast = _chunk3DFX2FQGcjs.a;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Takes the last `n` elements from the `array`.
3
6
  *
@@ -10,7 +13,7 @@
10
13
  * @dataFirst
11
14
  * @category Array
12
15
  */
13
- declare function takeLast<T>(array: ReadonlyArray<T>, n: number): Array<T>;
16
+ declare function takeLast<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
14
17
  /**
15
18
  * Take the last `n` elements from the `array`.
16
19
  *
@@ -22,6 +25,6 @@ declare function takeLast<T>(array: ReadonlyArray<T>, n: number): Array<T>;
22
25
  * @dataLast
23
26
  * @category Array
24
27
  */
25
- declare function takeLast<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
28
+ declare function takeLast<T extends IterableContainer>(n: number): (array: T) => Array<T[number]>;
26
29
 
27
30
  export { takeLast };
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Takes the last `n` elements from the `array`.
3
6
  *
@@ -10,7 +13,7 @@
10
13
  * @dataFirst
11
14
  * @category Array
12
15
  */
13
- declare function takeLast<T>(array: ReadonlyArray<T>, n: number): Array<T>;
16
+ declare function takeLast<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
14
17
  /**
15
18
  * Take the last `n` elements from the `array`.
16
19
  *
@@ -22,6 +25,6 @@ declare function takeLast<T>(array: ReadonlyArray<T>, n: number): Array<T>;
22
25
  * @dataLast
23
26
  * @category Array
24
27
  */
25
- declare function takeLast<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
28
+ declare function takeLast<T extends IterableContainer>(n: number): (array: T) => Array<T[number]>;
26
29
 
27
30
  export { takeLast };
package/dist/take-last.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-CIF6WEFP.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeLast};
1
+ import{a}from"./chunk-OJ2QGTFS.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeLast};
@@ -0,0 +1 @@
1
+ "use strict";var _chunk3DFX2FQGcjs = require('./chunk-3DFX2FQG.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunk3DFX2FQGcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunk3DFX2FQGcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-OJ2QGTFS.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=e([1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=e([1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=t([1,"a"],e(2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=t([1,"a",!0],e(2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAE5HI6VGcjs = require('./chunk-AE5HI6VG.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeWhile = _chunkAE5HI6VGcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZO4ND36Ncjs = require('./chunk-ZO4ND36N.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.takeWhile = _chunkZO4ND36Ncjs.a;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns elements from the array until predicate returns false.
3
6
  *
@@ -10,7 +13,7 @@
10
13
  * @dataFirst
11
14
  * @category Array
12
15
  */
13
- declare function takeWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
16
+ declare function takeWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
14
17
  /**
15
18
  * Returns elements from the array until predicate returns false.
16
19
  *
@@ -22,6 +25,6 @@ declare function takeWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index
22
25
  * @dataLast
23
26
  * @category Array
24
27
  */
25
- declare function takeWhile<T>(predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): (array: ReadonlyArray<T>) => Array<T>;
28
+ declare function takeWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (array: T) => Array<T[number]>;
26
29
 
27
30
  export { takeWhile };
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns elements from the array until predicate returns false.
3
6
  *
@@ -10,7 +13,7 @@
10
13
  * @dataFirst
11
14
  * @category Array
12
15
  */
13
- declare function takeWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): Array<T>;
16
+ declare function takeWhile<T extends IterableContainer>(data: T, predicate: (item: T[number], index: number, data: T) => boolean): Array<T[number]>;
14
17
  /**
15
18
  * Returns elements from the array until predicate returns false.
16
19
  *
@@ -22,6 +25,6 @@ declare function takeWhile<T>(data: ReadonlyArray<T>, predicate: (item: T, index
22
25
  * @dataLast
23
26
  * @category Array
24
27
  */
25
- declare function takeWhile<T>(predicate: (item: T, index: number, data: ReadonlyArray<T>) => boolean): (array: ReadonlyArray<T>) => Array<T>;
28
+ declare function takeWhile<T extends IterableContainer>(predicate: (item: T[number], index: number, data: T) => boolean): (array: T) => Array<T[number]>;
26
29
 
27
30
  export { takeWhile };
@@ -1 +1 @@
1
- import{a}from"./chunk-LOPUNSWJ.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeWhile};
1
+ import{a}from"./chunk-VN2OAM2N.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeWhile};
@@ -0,0 +1 @@
1
+ "use strict";var _chunkZO4ND36Ncjs = require('./chunk-ZO4ND36N.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=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1,"a"],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1,"a",!0],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.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"],_chunkZO4ND36Ncjs.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],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.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],_chunkZO4ND36Ncjs.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],_chunkZO4ND36Ncjs.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"],_chunkZO4ND36Ncjs.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],_chunkZO4ND36Ncjs.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, [],_chunkZO4ND36Ncjs.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-VN2OAM2N.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/take.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkX6AB3I7Zcjs = require('./chunk-X6AB3I7Z.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.take = _chunkX6AB3I7Zcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ5UEQBZPcjs = require('./chunk-Z5UEQBZP.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.take = _chunkZ5UEQBZPcjs.a;
package/dist/take.d.cts CHANGED
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns the first `n` elements of `array`.
3
6
  *
@@ -11,7 +14,7 @@
11
14
  * @lazy
12
15
  * @category Array
13
16
  */
14
- declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
17
+ declare function take<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
15
18
  /**
16
19
  * Returns the first `n` elements of `array`.
17
20
  *
@@ -24,6 +27,6 @@ declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
24
27
  * @lazy
25
28
  * @category Array
26
29
  */
27
- declare function take<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
30
+ declare function take(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
28
31
 
29
32
  export { take };
package/dist/take.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns the first `n` elements of `array`.
3
6
  *
@@ -11,7 +14,7 @@
11
14
  * @lazy
12
15
  * @category Array
13
16
  */
14
- declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
17
+ declare function take<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
15
18
  /**
16
19
  * Returns the first `n` elements of `array`.
17
20
  *
@@ -24,6 +27,6 @@ declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
24
27
  * @lazy
25
28
  * @category Array
26
29
  */
27
- declare function take<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
30
+ declare function take(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
28
31
 
29
32
  export { take };
package/dist/take.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-LIKMH7XD.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as take};
1
+ import{a}from"./chunk-EPHUNAE5.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as take};
@@ -0,0 +1 @@
1
+ "use strict";var _chunkZ5UEQBZPcjs = require('./chunk-Z5UEQBZP.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-EPHUNAE5.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=e([1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=e([1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=t([1,"a"],e(2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=t([1,"a",!0],e(2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()})});
@@ -1 +1 @@
1
- "use strict";var _chunkYWO7TFODcjs = require('./chunk-YWO7TFOD.cjs');var _chunkKLQZU5J4cjs = require('./chunk-KLQZU5J4.cjs');var _chunk7IYJC2PMcjs = require('./chunk-7IYJC2PM.cjs');var _chunkWW7P3TAUcjs = require('./chunk-WW7P3TAU.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("should work in the middle of pipe sequence",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, e=>{expectTypeOf(e).toEqualTypeOf()}),_chunkWW7P3TAUcjs.a.call(void 0, _chunkKLQZU5J4cjs.a.call(void 0, 2)))});it("should infer types after tapping function reference with parameter type any",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, i),_chunkWW7P3TAUcjs.a.call(void 0, e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
1
+ "use strict";var _chunkYWO7TFODcjs = require('./chunk-YWO7TFOD.cjs');var _chunkKLQZU5J4cjs = require('./chunk-KLQZU5J4.cjs');var _chunkWW7P3TAUcjs = require('./chunk-WW7P3TAU.cjs');var _chunk7IYJC2PMcjs = require('./chunk-7IYJC2PM.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("should work in the middle of pipe sequence",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, e=>{expectTypeOf(e).toEqualTypeOf()}),_chunkWW7P3TAUcjs.a.call(void 0, _chunkKLQZU5J4cjs.a.call(void 0, 2)))});it("should infer types after tapping function reference with parameter type any",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, i),_chunkWW7P3TAUcjs.a.call(void 0, e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
@@ -1 +1 @@
1
- import{a as o}from"./chunk-ENIRKKU6.js";import{a as n}from"./chunk-MBYBX5B3.js";import{a as p}from"./chunk-BGPRJNRQ.js";import{a as t}from"./chunk-QRDGUNHT.js";import{a as r}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("should work in the middle of pipe sequence",()=>{r([-1,2],p(e=>e>0),o(e=>{expectTypeOf(e).toEqualTypeOf()}),t(n(2)))});it("should infer types after tapping function reference with parameter type any",()=>{r([-1,2],p(e=>e>0),o(i),t(e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
1
+ import{a as o}from"./chunk-ENIRKKU6.js";import{a as n}from"./chunk-MBYBX5B3.js";import{a as t}from"./chunk-QRDGUNHT.js";import{a as p}from"./chunk-BGPRJNRQ.js";import{a as r}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("should work in the middle of pipe sequence",()=>{r([-1,2],p(e=>e>0),o(e=>{expectTypeOf(e).toEqualTypeOf()}),t(n(2)))});it("should infer types after tapping function reference with parameter type any",()=>{r([-1,2],p(e=>e>0),o(i),t(e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
@@ -1,4 +1,4 @@
1
- import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split } from 'type-fest';
1
+ import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split, IfNever } from 'type-fest';
2
2
 
3
3
  declare const __brand: unique symbol;
4
4
  type Branded<T, Brand extends symbol> = T & {
@@ -19,7 +19,7 @@ type Mapped<T extends IterableContainer, K> = {
19
19
  * We would've named this `ArrayLike`, but that's already used by typescript...
20
20
  * @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
21
21
  */
22
- type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
22
+ type IterableContainer<T = unknown> = readonly [] | ReadonlyArray<T>;
23
23
  /**
24
24
  * Check if a type is guaranteed to be a bounded record: a record with a finite
25
25
  * set of keys.
@@ -111,5 +111,58 @@ type InternalIsUnion<T, U = T> = (IsNever<T> extends true ? false : T extends an
111
111
  * type Result = GuardType<TypeGuardFn>; // `string`
112
112
  */
113
113
  type GuardType<T, Fallback = never> = T extends (x: any, ...rest: any) => x is infer U ? U : Fallback;
114
+ /**
115
+ * An array with *exactly* N elements in it.
116
+ *
117
+ * Only literal N values are supported. For very large N the type might result
118
+ * in a recurse depth error. For negative N the type would result in an infinite
119
+ * recursion. None of these have protections because this is an internal type!
120
+ */
121
+ type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
122
+ /**
123
+ * Takes an array and returns the types that make up it's parts. The suffix is
124
+ * anything before the rest parameter (if any), the prefix is anything after the
125
+ * rest parameter (if any), and the item is the type of the rest parameter.
126
+ *
127
+ * The output could be used to reconstruct the input: `[
128
+ * ...TupleParts<T>["prefix"],
129
+ * ...Array<TupleParts<T>["item"]>,
130
+ * ...TupleParts<T>["suffix"],
131
+ * ]`.
132
+ */
133
+ type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unknown> = []> = T extends readonly [infer Head, ...infer Tail] ? TupleParts<Tail, [...Prefix, Head], Suffix> : T extends readonly [...infer Head, infer Tail] ? TupleParts<Head, Prefix, [Tail, ...Suffix]> : T extends ReadonlyArray<infer Item> ? {
134
+ prefix: Prefix;
135
+ item: Item;
136
+ suffix: Suffix;
137
+ } : never;
138
+ /**
139
+ * `never[]` and `[]` are not the same type, and in some cases they aren't
140
+ * interchangeable.
141
+ *
142
+ * This type makes it easier to use the result of TupleParts when the input is a
143
+ * fixed-length tuple but we still want to spread the rest of the array. e.g.
144
+ * `[...CoercedArray<TupleParts<T>["item"]>, ...TupleParts<T>["suffix"]]`.
145
+ *
146
+ */
147
+ type CoercedArray<T> = IfNever<T, [], Array<T>>;
148
+ /**
149
+ * The result of running a function that would dedupe an array (`unique`,
150
+ * `uniqueBy`, and `uniqueWith`).
151
+ *
152
+ * There are certain traits of the output which are unique to a deduped array
153
+ * that allow us to create a better type; see comments inline.
154
+ *
155
+ * !Note: We can build better types for each of the unique functions
156
+ * _separately_ by taking advantage of _other_ characteristics that are unique
157
+ * to each one (e.g. in `unique` we know that each item that has a disjoint type
158
+ * to all previous items would be part of the output, even when it isn't the
159
+ * first), but to make this utility the most useful we kept it simple and
160
+ * generic for now.
161
+ */
162
+ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
163
+ ] : T extends readonly [infer Head, ...infer Rest] ? [
164
+ Head,
165
+ ...Array<Rest[number]>
166
+ ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
114
167
 
115
- export type { Branded as B, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NonEmptyArray as N, ReconstructedRecord as R, UpsertProp as U, EnumerableStringKeyOf as a, ExactRecord as b, NarrowedTo as c, IsUnion as d, IfBoundedRecord as e, ReorderedArray as f };
168
+ export type { Branded as B, CoercedArray as C, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
@@ -1,4 +1,4 @@
1
- import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split } from 'type-fest';
1
+ import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split, IfNever } from 'type-fest';
2
2
 
3
3
  declare const __brand: unique symbol;
4
4
  type Branded<T, Brand extends symbol> = T & {
@@ -19,7 +19,7 @@ type Mapped<T extends IterableContainer, K> = {
19
19
  * We would've named this `ArrayLike`, but that's already used by typescript...
20
20
  * @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
21
21
  */
22
- type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
22
+ type IterableContainer<T = unknown> = readonly [] | ReadonlyArray<T>;
23
23
  /**
24
24
  * Check if a type is guaranteed to be a bounded record: a record with a finite
25
25
  * set of keys.
@@ -111,5 +111,58 @@ type InternalIsUnion<T, U = T> = (IsNever<T> extends true ? false : T extends an
111
111
  * type Result = GuardType<TypeGuardFn>; // `string`
112
112
  */
113
113
  type GuardType<T, Fallback = never> = T extends (x: any, ...rest: any) => x is infer U ? U : Fallback;
114
+ /**
115
+ * An array with *exactly* N elements in it.
116
+ *
117
+ * Only literal N values are supported. For very large N the type might result
118
+ * in a recurse depth error. For negative N the type would result in an infinite
119
+ * recursion. None of these have protections because this is an internal type!
120
+ */
121
+ type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
122
+ /**
123
+ * Takes an array and returns the types that make up it's parts. The suffix is
124
+ * anything before the rest parameter (if any), the prefix is anything after the
125
+ * rest parameter (if any), and the item is the type of the rest parameter.
126
+ *
127
+ * The output could be used to reconstruct the input: `[
128
+ * ...TupleParts<T>["prefix"],
129
+ * ...Array<TupleParts<T>["item"]>,
130
+ * ...TupleParts<T>["suffix"],
131
+ * ]`.
132
+ */
133
+ type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unknown> = []> = T extends readonly [infer Head, ...infer Tail] ? TupleParts<Tail, [...Prefix, Head], Suffix> : T extends readonly [...infer Head, infer Tail] ? TupleParts<Head, Prefix, [Tail, ...Suffix]> : T extends ReadonlyArray<infer Item> ? {
134
+ prefix: Prefix;
135
+ item: Item;
136
+ suffix: Suffix;
137
+ } : never;
138
+ /**
139
+ * `never[]` and `[]` are not the same type, and in some cases they aren't
140
+ * interchangeable.
141
+ *
142
+ * This type makes it easier to use the result of TupleParts when the input is a
143
+ * fixed-length tuple but we still want to spread the rest of the array. e.g.
144
+ * `[...CoercedArray<TupleParts<T>["item"]>, ...TupleParts<T>["suffix"]]`.
145
+ *
146
+ */
147
+ type CoercedArray<T> = IfNever<T, [], Array<T>>;
148
+ /**
149
+ * The result of running a function that would dedupe an array (`unique`,
150
+ * `uniqueBy`, and `uniqueWith`).
151
+ *
152
+ * There are certain traits of the output which are unique to a deduped array
153
+ * that allow us to create a better type; see comments inline.
154
+ *
155
+ * !Note: We can build better types for each of the unique functions
156
+ * _separately_ by taking advantage of _other_ characteristics that are unique
157
+ * to each one (e.g. in `unique` we know that each item that has a disjoint type
158
+ * to all previous items would be part of the output, even when it isn't the
159
+ * first), but to make this utility the most useful we kept it simple and
160
+ * generic for now.
161
+ */
162
+ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
163
+ ] : T extends readonly [infer Head, ...infer Rest] ? [
164
+ Head,
165
+ ...Array<Rest[number]>
166
+ ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
114
167
 
115
- export type { Branded as B, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NonEmptyArray as N, ReconstructedRecord as R, UpsertProp as U, EnumerableStringKeyOf as a, ExactRecord as b, NarrowedTo as c, IsUnion as d, IfBoundedRecord as e, ReorderedArray as f };
168
+ export type { Branded as B, CoercedArray as C, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDWPHE3F2cjs = require('./chunk-DWPHE3F2.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueBy = _chunkDWPHE3F2cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMADDQNARcjs = require('./chunk-MADDQNAR.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueBy = _chunkMADDQNARcjs.a;