@vinicunca/perkakas 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) 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-XQOKSJ5R.cjs → chunk-E6RBEL5Z.cjs} +1 -1
  9. package/dist/chunk-EPHUNAE5.js +1 -0
  10. package/dist/chunk-G7BJFBAZ.cjs +1 -0
  11. package/dist/{chunk-YIUDV3OA.cjs → chunk-HTO3K3VA.cjs} +1 -1
  12. package/dist/chunk-IABWIMQT.js +1 -0
  13. package/dist/chunk-IRH6TGG5.js +1 -0
  14. package/dist/chunk-KAA6IVBL.js +1 -0
  15. package/dist/chunk-MADDQNAR.cjs +1 -0
  16. package/dist/chunk-OJ2QGTFS.js +1 -0
  17. package/dist/chunk-PFLGL4YP.js +1 -0
  18. package/dist/chunk-QTQTKNWA.js +1 -0
  19. package/dist/chunk-RCENCAXY.cjs +1 -0
  20. package/dist/chunk-RJAVPEJT.cjs +1 -0
  21. package/dist/chunk-U2BXIRBJ.js +1 -0
  22. package/dist/chunk-VN2OAM2N.js +1 -0
  23. package/dist/chunk-VPG3W5JH.cjs +1 -0
  24. package/dist/chunk-WQDEYM64.js +1 -0
  25. package/dist/chunk-WRKGH4XX.js +1 -0
  26. package/dist/chunk-Y3WI7FPB.cjs +1 -0
  27. package/dist/chunk-Z5UEQBZP.cjs +1 -0
  28. package/dist/chunk-ZO4ND36N.cjs +1 -0
  29. package/dist/chunk.cjs +1 -1
  30. package/dist/chunk.d.cts +91 -5
  31. package/dist/chunk.d.ts +91 -5
  32. package/dist/chunk.js +1 -1
  33. package/dist/chunk.spec-d.cjs +1 -1
  34. package/dist/chunk.spec-d.js +1 -1
  35. package/dist/concat.d.cts +1 -1
  36. package/dist/concat.d.ts +1 -1
  37. package/dist/conditional.d.cts +1 -1
  38. package/dist/conditional.d.ts +1 -1
  39. package/dist/conditional.spec-d.cjs +1 -1
  40. package/dist/conditional.spec-d.js +1 -1
  41. package/dist/drop-first-by.d.cts +1 -1
  42. package/dist/drop-first-by.d.ts +1 -1
  43. package/dist/drop-last-while.cjs +1 -1
  44. package/dist/drop-last-while.d.cts +5 -2
  45. package/dist/drop-last-while.d.ts +5 -2
  46. package/dist/drop-last-while.js +1 -1
  47. package/dist/drop-last-while.spec-d.cjs +1 -0
  48. package/dist/drop-last-while.spec-d.d.cts +2 -0
  49. package/dist/drop-last-while.spec-d.d.ts +2 -0
  50. package/dist/drop-last-while.spec-d.js +1 -0
  51. package/dist/drop-last.cjs +1 -1
  52. package/dist/drop-last.d.cts +5 -2
  53. package/dist/drop-last.d.ts +5 -2
  54. package/dist/drop-last.js +1 -1
  55. package/dist/drop-last.spec-d.cjs +1 -0
  56. package/dist/drop-last.spec-d.d.cts +2 -0
  57. package/dist/drop-last.spec-d.d.ts +2 -0
  58. package/dist/drop-last.spec-d.js +1 -0
  59. package/dist/drop-while.cjs +1 -1
  60. package/dist/drop-while.d.cts +5 -2
  61. package/dist/drop-while.d.ts +5 -2
  62. package/dist/drop-while.js +1 -1
  63. package/dist/drop-while.spec-d.cjs +1 -0
  64. package/dist/drop-while.spec-d.d.cts +2 -0
  65. package/dist/drop-while.spec-d.d.ts +2 -0
  66. package/dist/drop-while.spec-d.js +1 -0
  67. package/dist/drop.cjs +1 -1
  68. package/dist/drop.d.cts +10 -2
  69. package/dist/drop.d.ts +10 -2
  70. package/dist/drop.js +1 -1
  71. package/dist/drop.spec-d.cjs +1 -0
  72. package/dist/drop.spec-d.d.cts +2 -0
  73. package/dist/drop.spec-d.d.ts +2 -0
  74. package/dist/drop.spec-d.js +1 -0
  75. package/dist/evolve.d.cts +1 -1
  76. package/dist/evolve.d.ts +1 -1
  77. package/dist/first-by.d.cts +1 -1
  78. package/dist/first-by.d.ts +1 -1
  79. package/dist/first.d.cts +1 -1
  80. package/dist/first.d.ts +1 -1
  81. package/dist/flat.d.cts +1 -1
  82. package/dist/flat.d.ts +1 -1
  83. package/dist/for-each-obj.d.cts +1 -1
  84. package/dist/for-each-obj.d.ts +1 -1
  85. package/dist/for-each.d.cts +1 -1
  86. package/dist/for-each.d.ts +1 -1
  87. package/dist/from-entries.d.cts +1 -1
  88. package/dist/from-entries.d.ts +1 -1
  89. package/dist/from-keys.d.cts +1 -1
  90. package/dist/from-keys.d.ts +1 -1
  91. package/dist/group-by.d.cts +1 -1
  92. package/dist/group-by.d.ts +1 -1
  93. package/dist/has-at-least.d.cts +1 -1
  94. package/dist/has-at-least.d.ts +1 -1
  95. package/dist/has-sub-object.d.cts +1 -1
  96. package/dist/has-sub-object.d.ts +1 -1
  97. package/dist/index-by.d.cts +1 -1
  98. package/dist/index-by.d.ts +1 -1
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.d.cts +1 -1
  101. package/dist/index.d.ts +1 -1
  102. package/dist/index.js +1 -1
  103. package/dist/is-array.d.cts +1 -1
  104. package/dist/is-array.d.ts +1 -1
  105. package/dist/is-big-int.d.cts +1 -1
  106. package/dist/is-big-int.d.ts +1 -1
  107. package/dist/is-boolean.d.cts +1 -1
  108. package/dist/is-boolean.d.ts +1 -1
  109. package/dist/is-empty.d.cts +1 -1
  110. package/dist/is-empty.d.ts +1 -1
  111. package/dist/is-included-in.d.cts +1 -1
  112. package/dist/is-included-in.d.ts +1 -1
  113. package/dist/is-nullish.d.cts +1 -1
  114. package/dist/is-nullish.d.ts +1 -1
  115. package/dist/is-number.d.cts +1 -1
  116. package/dist/is-number.d.ts +1 -1
  117. package/dist/is-object-type.d.cts +1 -1
  118. package/dist/is-object-type.d.ts +1 -1
  119. package/dist/is-plain-object.d.cts +1 -1
  120. package/dist/is-plain-object.d.ts +1 -1
  121. package/dist/is-string.d.cts +1 -1
  122. package/dist/is-string.d.ts +1 -1
  123. package/dist/is-symbol.d.cts +1 -1
  124. package/dist/is-symbol.d.ts +1 -1
  125. package/dist/keys.d.cts +1 -1
  126. package/dist/keys.d.ts +1 -1
  127. package/dist/last.d.cts +1 -1
  128. package/dist/last.d.ts +1 -1
  129. package/dist/map-keys.d.cts +1 -1
  130. package/dist/map-keys.d.ts +1 -1
  131. package/dist/map-values.d.cts +1 -1
  132. package/dist/map-values.d.ts +1 -1
  133. package/dist/map-with-feedback.d.cts +1 -1
  134. package/dist/map-with-feedback.d.ts +1 -1
  135. package/dist/map.d.cts +1 -1
  136. package/dist/map.d.ts +1 -1
  137. package/dist/nth-by.d.cts +1 -1
  138. package/dist/nth-by.d.ts +1 -1
  139. package/dist/omit-by.d.cts +1 -1
  140. package/dist/omit-by.d.ts +1 -1
  141. package/dist/only.d.cts +1 -1
  142. package/dist/only.d.ts +1 -1
  143. package/dist/pick-by.d.cts +1 -1
  144. package/dist/pick-by.d.ts +1 -1
  145. package/dist/product.d.cts +1 -1
  146. package/dist/product.d.ts +1 -1
  147. package/dist/pull-object.d.cts +1 -1
  148. package/dist/pull-object.d.ts +1 -1
  149. package/dist/rank-by.d.cts +1 -1
  150. package/dist/rank-by.d.ts +1 -1
  151. package/dist/sample.d.cts +1 -1
  152. package/dist/sample.d.ts +1 -1
  153. package/dist/set.d.cts +1 -1
  154. package/dist/set.d.ts +1 -1
  155. package/dist/shuffle.cjs +1 -1
  156. package/dist/shuffle.d.cts +5 -2
  157. package/dist/shuffle.d.ts +5 -2
  158. package/dist/shuffle.js +1 -1
  159. package/dist/shuffle.spec-d.cjs +1 -0
  160. package/dist/shuffle.spec-d.d.cts +2 -0
  161. package/dist/shuffle.spec-d.d.ts +2 -0
  162. package/dist/shuffle.spec-d.js +1 -0
  163. package/dist/sort-by.d.cts +1 -1
  164. package/dist/sort-by.d.ts +1 -1
  165. package/dist/sort.d.cts +1 -1
  166. package/dist/sort.d.ts +1 -1
  167. package/dist/sum.d.cts +1 -1
  168. package/dist/sum.d.ts +1 -1
  169. package/dist/swap-indices.d.cts +1 -1
  170. package/dist/swap-indices.d.ts +1 -1
  171. package/dist/take-first-by.d.cts +1 -1
  172. package/dist/take-first-by.d.ts +1 -1
  173. package/dist/take-last-while.cjs +1 -1
  174. package/dist/take-last-while.d.cts +5 -2
  175. package/dist/take-last-while.d.ts +5 -2
  176. package/dist/take-last-while.js +1 -1
  177. package/dist/take-last-while.spec-d-.cjs +1 -0
  178. package/dist/take-last-while.spec-d-.d.cts +2 -0
  179. package/dist/take-last-while.spec-d-.d.ts +2 -0
  180. package/dist/take-last-while.spec-d-.js +1 -0
  181. package/dist/take-last.cjs +1 -1
  182. package/dist/take-last.d.cts +5 -2
  183. package/dist/take-last.d.ts +5 -2
  184. package/dist/take-last.js +1 -1
  185. package/dist/take-last.spec-d.cjs +1 -0
  186. package/dist/take-last.spec-d.d.cts +2 -0
  187. package/dist/take-last.spec-d.d.ts +2 -0
  188. package/dist/take-last.spec-d.js +1 -0
  189. package/dist/take-while.cjs +1 -1
  190. package/dist/take-while.d.cts +5 -2
  191. package/dist/take-while.d.ts +5 -2
  192. package/dist/take-while.js +1 -1
  193. package/dist/take-white.spec-d.cjs +1 -0
  194. package/dist/take-white.spec-d.d.cts +2 -0
  195. package/dist/take-white.spec-d.d.ts +2 -0
  196. package/dist/take-white.spec-d.js +1 -0
  197. package/dist/take.cjs +1 -1
  198. package/dist/take.d.cts +5 -2
  199. package/dist/take.d.ts +5 -2
  200. package/dist/take.js +1 -1
  201. package/dist/take.spec-d.cjs +1 -0
  202. package/dist/take.spec-d.d.cts +2 -0
  203. package/dist/take.spec-d.d.ts +2 -0
  204. package/dist/take.spec-d.js +1 -0
  205. package/dist/tap.spec-d.cjs +1 -1
  206. package/dist/tap.spec-d.js +1 -1
  207. package/dist/{types-BMu1PIvo.d.cts → types-BE3YOWVA.d.cts} +45 -2
  208. package/dist/{types-BMu1PIvo.d.ts → types-BE3YOWVA.d.ts} +45 -2
  209. package/dist/unique-by.cjs +1 -1
  210. package/dist/unique-by.d.cts +5 -2
  211. package/dist/unique-by.d.ts +5 -2
  212. package/dist/unique-by.js +1 -1
  213. package/dist/unique-with.cjs +1 -1
  214. package/dist/unique-with.d.cts +5 -2
  215. package/dist/unique-with.d.ts +5 -2
  216. package/dist/unique-with.js +1 -1
  217. package/dist/unique.cjs +1 -1
  218. package/dist/unique.d.cts +6 -3
  219. package/dist/unique.d.ts +6 -3
  220. package/dist/unique.js +1 -1
  221. package/dist/values.d.cts +1 -1
  222. package/dist/values.d.ts +1 -1
  223. package/dist/zip-with.d.cts +1 -1
  224. package/dist/zip-with.d.ts +1 -1
  225. package/dist/zip.d.cts +1 -1
  226. package/dist/zip.d.ts +1 -1
  227. package/package.json +12 -12
  228. package/dist/chunk-3UUZWCRS.cjs +0 -1
  229. package/dist/chunk-65DHT5Z7.cjs +0 -1
  230. package/dist/chunk-66KQORMS.js +0 -1
  231. package/dist/chunk-AE5HI6VG.cjs +0 -1
  232. package/dist/chunk-CIF6WEFP.js +0 -1
  233. package/dist/chunk-COBRSP66.js +0 -1
  234. package/dist/chunk-DUKQ2ODK.js +0 -1
  235. package/dist/chunk-DWPHE3F2.cjs +0 -1
  236. package/dist/chunk-HUWRVMPE.js +0 -1
  237. package/dist/chunk-LIKMH7XD.js +0 -1
  238. package/dist/chunk-LOPUNSWJ.js +0 -1
  239. package/dist/chunk-MENOHSYF.js +0 -1
  240. package/dist/chunk-NNK6R67E.cjs +0 -1
  241. package/dist/chunk-P7OXTPPH.cjs +0 -1
  242. package/dist/chunk-QTCQZ7LU.js +0 -1
  243. package/dist/chunk-RSJJRJTH.cjs +0 -1
  244. package/dist/chunk-TR5T6KUC.js +0 -1
  245. package/dist/chunk-U5EQP4BO.cjs +0 -1
  246. package/dist/chunk-VNLOBA2B.cjs +0 -1
  247. package/dist/chunk-X6AB3I7Z.cjs +0 -1
  248. package/dist/chunk-YQKPA3BB.js +0 -1
  249. package/dist/chunk-YWSZXRUY.js +0 -1
  250. package/dist/chunk-Z7EBGO2B.js +0 -1
  251. package/dist/chunk-ZCFTW5HO.cjs +0 -1
@@ -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-BE3YOWVA.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-BE3YOWVA.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-BE3YOWVA.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-BE3YOWVA.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-BE3YOWVA.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-BE3YOWVA.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}
@@ -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,48 @@ 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
+ * The result of running a function that would dedupe an array (`unique`,
140
+ * `uniqueBy`, and `uniqueWith`).
141
+ *
142
+ * There are certain traits of the output which are unique to a deduped array
143
+ * that allow us to create a better type; see comments inline.
144
+ *
145
+ * !Note: We can build better types for each of the unique functions
146
+ * _separately_ by taking advantage of _other_ characteristics that are unique
147
+ * to each one (e.g. in `unique` we know that each item that has a disjoint type
148
+ * to all previous items would be part of the output, even when it isn't the
149
+ * first), but to make this utility the most useful we kept it simple and
150
+ * generic for now.
151
+ */
152
+ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
153
+ ] : T extends readonly [infer Head, ...infer Rest] ? [
154
+ Head,
155
+ ...Array<Rest[number]>
156
+ ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
114
157
 
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 };
158
+ export type { Branded as B, 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 };
@@ -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,48 @@ 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
+ * The result of running a function that would dedupe an array (`unique`,
140
+ * `uniqueBy`, and `uniqueWith`).
141
+ *
142
+ * There are certain traits of the output which are unique to a deduped array
143
+ * that allow us to create a better type; see comments inline.
144
+ *
145
+ * !Note: We can build better types for each of the unique functions
146
+ * _separately_ by taking advantage of _other_ characteristics that are unique
147
+ * to each one (e.g. in `unique` we know that each item that has a disjoint type
148
+ * to all previous items would be part of the output, even when it isn't the
149
+ * first), but to make this utility the most useful we kept it simple and
150
+ * generic for now.
151
+ */
152
+ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
153
+ ] : T extends readonly [infer Head, ...infer Rest] ? [
154
+ Head,
155
+ ...Array<Rest[number]>
156
+ ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
114
157
 
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 };
158
+ export type { Branded as B, 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;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns a new array containing only one copy of each element in the original
3
6
  * list transformed by a function. Elements are compared by reference using Set.
@@ -15,7 +18,7 @@
15
18
  * @lazy
16
19
  * @category Array
17
20
  */
18
- declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, index: number, data: ReadonlyArray<T>) => K): Array<T>;
21
+ declare function uniqueBy<T extends IterableContainer, K>(data: T, keyFunction: (item: T[number], index: number, data: T) => K): Deduped<T>;
19
22
  /**
20
23
  * Returns a new array containing only one copy of each element in the original
21
24
  * list transformed by a function. Elements are compared by reference using Set.
@@ -33,6 +36,6 @@ declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, i
33
36
  * @lazy
34
37
  * @category Array
35
38
  */
36
- declare function uniqueBy<T, K>(keyFunction: (item: T, index: number, data: ReadonlyArray<T>) => K): (data: ReadonlyArray<T>) => Array<T>;
39
+ declare function uniqueBy<T extends IterableContainer, K>(keyFunction: (item: T[number], index: number, data: T) => K): (data: T) => Deduped<T>;
37
40
 
38
41
  export { uniqueBy };
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns a new array containing only one copy of each element in the original
3
6
  * list transformed by a function. Elements are compared by reference using Set.
@@ -15,7 +18,7 @@
15
18
  * @lazy
16
19
  * @category Array
17
20
  */
18
- declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, index: number, data: ReadonlyArray<T>) => K): Array<T>;
21
+ declare function uniqueBy<T extends IterableContainer, K>(data: T, keyFunction: (item: T[number], index: number, data: T) => K): Deduped<T>;
19
22
  /**
20
23
  * Returns a new array containing only one copy of each element in the original
21
24
  * list transformed by a function. Elements are compared by reference using Set.
@@ -33,6 +36,6 @@ declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, i
33
36
  * @lazy
34
37
  * @category Array
35
38
  */
36
- declare function uniqueBy<T, K>(keyFunction: (item: T, index: number, data: ReadonlyArray<T>) => K): (data: ReadonlyArray<T>) => Array<T>;
39
+ declare function uniqueBy<T extends IterableContainer, K>(keyFunction: (item: T[number], index: number, data: T) => K): (data: T) => Deduped<T>;
37
40
 
38
41
  export { uniqueBy };
package/dist/unique-by.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-DUKQ2ODK.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueBy};
1
+ import{a}from"./chunk-WRKGH4XX.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueBy};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXQOKSJ5Rcjs = require('./chunk-XQOKSJ5R.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueWith = _chunkXQOKSJ5Rcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RBEL5Zcjs = require('./chunk-E6RBEL5Z.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueWith = _chunkE6RBEL5Zcjs.a;
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
2
+ import 'type-fest';
3
+
1
4
  type IsEquals<T> = (a: T, b: T) => boolean;
2
5
  /**
3
6
  * Returns a new array containing only one copy of each element in the original
@@ -16,7 +19,7 @@ type IsEquals<T> = (a: T, b: T) => boolean;
16
19
  * @lazy
17
20
  * @category Array
18
21
  */
19
- declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): Array<T>;
22
+ declare function uniqueWith<T extends IterableContainer>(data: T, isEquals: IsEquals<T[number]>): Deduped<T>;
20
23
  /**
21
24
  * Returns a new array containing only one copy of each element in the original
22
25
  * list. Elements are compared by custom comparator isEquals.
@@ -36,6 +39,6 @@ declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): A
36
39
  * @lazy
37
40
  * @category Array
38
41
  */
39
- declare function uniqueWith<T>(isEquals: IsEquals<T>): (data: ReadonlyArray<T>) => Array<T>;
42
+ declare function uniqueWith<T extends IterableContainer>(isEquals: IsEquals<T[number]>): (data: T) => Deduped<T>;
40
43
 
41
44
  export { uniqueWith };
@@ -1,3 +1,6 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
2
+ import 'type-fest';
3
+
1
4
  type IsEquals<T> = (a: T, b: T) => boolean;
2
5
  /**
3
6
  * Returns a new array containing only one copy of each element in the original
@@ -16,7 +19,7 @@ type IsEquals<T> = (a: T, b: T) => boolean;
16
19
  * @lazy
17
20
  * @category Array
18
21
  */
19
- declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): Array<T>;
22
+ declare function uniqueWith<T extends IterableContainer>(data: T, isEquals: IsEquals<T[number]>): Deduped<T>;
20
23
  /**
21
24
  * Returns a new array containing only one copy of each element in the original
22
25
  * list. Elements are compared by custom comparator isEquals.
@@ -36,6 +39,6 @@ declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): A
36
39
  * @lazy
37
40
  * @category Array
38
41
  */
39
- declare function uniqueWith<T>(isEquals: IsEquals<T>): (data: ReadonlyArray<T>) => Array<T>;
42
+ declare function uniqueWith<T extends IterableContainer>(isEquals: IsEquals<T[number]>): (data: T) => Deduped<T>;
40
43
 
41
44
  export { uniqueWith };
@@ -1 +1 @@
1
- import{a}from"./chunk-YQKPA3BB.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueWith};
1
+ import{a}from"./chunk-AKGWT6GC.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueWith};
package/dist/unique.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYIUDV3OAcjs = require('./chunk-YIUDV3OA.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.unique = _chunkYIUDV3OAcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHTO3K3VAcjs = require('./chunk-HTO3K3VA.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.unique = _chunkHTO3K3VAcjs.a;
package/dist/unique.d.cts CHANGED
@@ -1,8 +1,11 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns a new array containing only one copy of each element in the original
3
6
  * list. Elements are compared by reference using Set.
4
7
  *
5
- * @param array - The array to filter.
8
+ * @param data - The array to filter.
6
9
  * @signature
7
10
  * P.unique(array)
8
11
  * @example
@@ -11,7 +14,7 @@
11
14
  * @lazy
12
15
  * @category Array
13
16
  */
14
- declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
17
+ declare function unique<T extends IterableContainer>(data: T): Deduped<T>;
15
18
  /**
16
19
  * Returns a new array containing only one copy of each element in the original
17
20
  * list. Elements are compared by reference using Set.
@@ -28,6 +31,6 @@ declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
28
31
  * @lazy
29
32
  * @category Array
30
33
  */
31
- declare function unique<T>(): (array: ReadonlyArray<T>) => Array<T>;
34
+ declare function unique(): <T extends IterableContainer>(data: T) => Deduped<T>;
32
35
 
33
36
  export { unique };
package/dist/unique.d.ts CHANGED
@@ -1,8 +1,11 @@
1
+ import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
2
+ import 'type-fest';
3
+
1
4
  /**
2
5
  * Returns a new array containing only one copy of each element in the original
3
6
  * list. Elements are compared by reference using Set.
4
7
  *
5
- * @param array - The array to filter.
8
+ * @param data - The array to filter.
6
9
  * @signature
7
10
  * P.unique(array)
8
11
  * @example
@@ -11,7 +14,7 @@
11
14
  * @lazy
12
15
  * @category Array
13
16
  */
14
- declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
17
+ declare function unique<T extends IterableContainer>(data: T): Deduped<T>;
15
18
  /**
16
19
  * Returns a new array containing only one copy of each element in the original
17
20
  * list. Elements are compared by reference using Set.
@@ -28,6 +31,6 @@ declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
28
31
  * @lazy
29
32
  * @category Array
30
33
  */
31
- declare function unique<T>(): (array: ReadonlyArray<T>) => Array<T>;
34
+ declare function unique(): <T extends IterableContainer>(data: T) => Deduped<T>;
32
35
 
33
36
  export { unique };
package/dist/unique.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-MENOHSYF.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as unique};
1
+ import{a}from"./chunk-WQDEYM64.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as unique};
package/dist/values.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BMu1PIvo.cjs';
1
+ import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
package/dist/values.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BMu1PIvo.js';
1
+ import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.js';
2
2
  import 'type-fest';
3
3
 
4
4
  type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BMu1PIvo.cjs';
1
+ import { I as IterableContainer } from './types-BE3YOWVA.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type ZippingFunction<T1 extends IterableContainer = IterableContainer, T2 extends IterableContainer = IterableContainer, Value = unknown> = (first: T1[number], second: T2[number], index: number, data: readonly [first: T1, second: T2]) => Value;