@vinicunca/perkakas 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-prop.d.cts +1 -1
- package/dist/add-prop.d.ts +1 -1
- package/dist/{chunk-LG37S75J.js → chunk-23TPDBES.js} +1 -1
- package/dist/chunk-46GBCFAG.js +1 -0
- package/dist/chunk-5SEDUH3U.cjs +1 -0
- package/dist/{chunk-A62OZTSJ.js → chunk-6B6SBF6V.js} +1 -1
- package/dist/chunk-AFO7BV2X.js +1 -0
- package/dist/chunk-AQRYBCA3.cjs +1 -0
- package/dist/{chunk-7IYJC2PM.cjs → chunk-C6NFG7IS.cjs} +1 -1
- package/dist/chunk-CRWFVSUP.cjs +1 -0
- package/dist/{chunk-U32YSACL.cjs → chunk-CT4EPN4Q.cjs} +1 -1
- package/dist/{chunk-A6WT2DZU.cjs → chunk-D774SJZI.cjs} +1 -1
- package/dist/chunk-DQ5MWM7I.cjs +1 -0
- package/dist/{chunk-BF6VQFQK.js → chunk-FFGIG2SO.js} +1 -1
- package/dist/{chunk-6ALZHU2N.js → chunk-FOP5KNRT.js} +1 -1
- package/dist/chunk-G5M5BNF3.cjs +1 -0
- package/dist/{chunk-PKGL5JK6.js → chunk-HBSV33EM.js} +1 -1
- package/dist/chunk-HXYRD63B.cjs +1 -0
- package/dist/chunk-IOSBDH5J.cjs +1 -0
- package/dist/{chunk-IZZFU26S.cjs → chunk-K43ZLBUS.cjs} +1 -1
- package/dist/{chunk-Z5UEQBZP.cjs → chunk-LBLAWGUH.cjs} +1 -1
- package/dist/chunk-LCHZ57HW.js +1 -0
- package/dist/chunk-LWCPA2K5.cjs +1 -0
- package/dist/chunk-MUD45PL6.js +1 -0
- package/dist/chunk-NWEPH7CD.cjs +1 -0
- package/dist/chunk-QIZDLB7Z.js +1 -0
- package/dist/chunk-QT66COHU.js +1 -0
- package/dist/chunk-RJ4SY2RW.js +1 -0
- package/dist/chunk-S4XCRT2B.cjs +1 -0
- package/dist/{chunk-BGPRJNRQ.js → chunk-SOCUEKNU.js} +1 -1
- package/dist/{chunk-C6L5NLLB.js → chunk-SS3ILCPB.js} +1 -1
- package/dist/{chunk-NLX7PGPI.cjs → chunk-SU7H3HVP.cjs} +1 -1
- package/dist/{chunk-3X6SAJDQ.cjs → chunk-SW6GJ7UA.cjs} +1 -1
- package/dist/chunk-T4LCVT74.js +1 -0
- package/dist/chunk-TYOJTJP6.js +1 -0
- package/dist/chunk-VPLMRR25.cjs +1 -0
- package/dist/{chunk-EPHUNAE5.js → chunk-WDT4BJAH.js} +1 -1
- package/dist/{chunk-MLLA7SGZ.cjs → chunk-WYRK6YJU.cjs} +1 -1
- package/dist/chunk-XYMW4QIS.js +1 -0
- package/dist/chunk-Y5OLUMVB.js +1 -0
- package/dist/{chunk-LSXNPOLD.js → chunk-Y7ACNJIO.js} +1 -1
- package/dist/{chunk-I6VXEY44.cjs → chunk-Y7L64OLN.cjs} +1 -1
- package/dist/chunk.d.cts +1 -1
- package/dist/chunk.d.ts +1 -1
- package/dist/concat.d.cts +1 -1
- package/dist/concat.d.ts +1 -1
- package/dist/conditional.d.cts +1 -1
- package/dist/conditional.d.ts +1 -1
- package/dist/conditional.spec-d.cjs +1 -1
- package/dist/conditional.spec-d.js +1 -1
- package/dist/debounce.spec-d.cjs +1 -1
- package/dist/debounce.spec-d.js +1 -1
- package/dist/difference-with.cjs +1 -1
- package/dist/difference-with.js +1 -1
- package/dist/difference.cjs +1 -1
- package/dist/difference.js +1 -1
- package/dist/do-nothing.cjs +1 -1
- package/dist/do-nothing.d.cts +1 -1
- package/dist/do-nothing.d.ts +1 -1
- package/dist/do-nothing.js +1 -1
- package/dist/do-nothing.spec-d.cjs +1 -1
- package/dist/do-nothing.spec-d.js +1 -1
- package/dist/drop-first-by.d.cts +1 -1
- package/dist/drop-first-by.d.ts +1 -1
- package/dist/drop-last-while.d.cts +1 -1
- package/dist/drop-last-while.d.ts +1 -1
- package/dist/drop-last-while.spec-d.cjs +1 -1
- package/dist/drop-last-while.spec-d.js +1 -1
- package/dist/drop-last.d.cts +1 -1
- package/dist/drop-last.d.ts +1 -1
- package/dist/drop-last.spec-d.cjs +1 -1
- package/dist/drop-last.spec-d.js +1 -1
- package/dist/drop-while.d.cts +1 -1
- package/dist/drop-while.d.ts +1 -1
- package/dist/drop-while.spec-d.cjs +1 -1
- package/dist/drop-while.spec-d.js +1 -1
- package/dist/drop.cjs +1 -1
- package/dist/drop.d.cts +20 -7
- package/dist/drop.d.ts +20 -7
- package/dist/drop.js +1 -1
- package/dist/drop.spec-d.cjs +1 -1
- package/dist/drop.spec-d.js +1 -1
- package/dist/evolve.d.cts +1 -1
- package/dist/evolve.d.ts +1 -1
- package/dist/evolve.spec-d.cjs +1 -1
- package/dist/evolve.spec-d.js +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.spec-d.cjs +1 -1
- package/dist/filter.spec-d.js +1 -1
- package/dist/find.cjs +1 -1
- package/dist/find.js +1 -1
- package/dist/find.spec-d.cjs +1 -1
- package/dist/find.spec-d.js +1 -1
- package/dist/first-by.d.cts +1 -1
- package/dist/first-by.d.ts +1 -1
- package/dist/first-by.spec-d.cjs +1 -1
- package/dist/first-by.spec-d.js +1 -1
- package/dist/first.d.cts +1 -1
- package/dist/first.d.ts +1 -1
- package/dist/flat.cjs +1 -1
- package/dist/flat.d.cts +1 -1
- package/dist/flat.d.ts +1 -1
- package/dist/flat.js +1 -1
- package/dist/flat.spec-d.cjs +1 -1
- package/dist/flat.spec-d.js +1 -1
- package/dist/for-each-obj.d.cts +1 -1
- package/dist/for-each-obj.d.ts +1 -1
- package/dist/for-each-obj.spec-d.cjs +1 -1
- package/dist/for-each-obj.spec-d.js +1 -1
- package/dist/for-each.d.cts +1 -1
- package/dist/for-each.d.ts +1 -1
- package/dist/for-each.spec-d.cjs +1 -1
- package/dist/for-each.spec-d.js +1 -1
- package/dist/from-entries.d.cts +1 -1
- package/dist/from-entries.d.ts +1 -1
- package/dist/from-keys.d.cts +1 -1
- package/dist/from-keys.d.ts +1 -1
- package/dist/from-keys.spec-d.cjs +1 -1
- package/dist/from-keys.spec-d.js +1 -1
- package/dist/group-by.d.cts +1 -1
- package/dist/group-by.d.ts +1 -1
- package/dist/has-at-least.d.cts +1 -1
- package/dist/has-at-least.d.ts +1 -1
- package/dist/has-sub-object.d.cts +1 -1
- package/dist/has-sub-object.d.ts +1 -1
- package/dist/has-sub-object.spec-d.cjs +1 -1
- package/dist/has-sub-object.spec-d.js +1 -1
- package/dist/human-readable-file-size.d.cts +1 -0
- package/dist/human-readable-file-size.d.ts +1 -0
- package/dist/identity.cjs +1 -1
- package/dist/identity.d.cts +1 -1
- package/dist/identity.d.ts +1 -1
- package/dist/identity.js +1 -1
- package/dist/identity.spec-d.cjs +1 -1
- package/dist/identity.spec-d.js +1 -1
- package/dist/index-by.d.cts +1 -1
- package/dist/index-by.d.ts +1 -1
- package/dist/index-by.spec-d.cjs +1 -1
- package/dist/index-by.spec-d.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/intersection-with.cjs +1 -1
- package/dist/intersection-with.js +1 -1
- package/dist/intersection.cjs +1 -1
- package/dist/intersection.js +1 -1
- package/dist/intersection.spec-d.cjs +1 -1
- package/dist/intersection.spec-d.js +1 -1
- package/dist/is-array.d.cts +1 -1
- package/dist/is-array.d.ts +1 -1
- package/dist/is-big-int.d.cts +1 -1
- package/dist/is-big-int.d.ts +1 -1
- package/dist/is-boolean.d.cts +1 -1
- package/dist/is-boolean.d.ts +1 -1
- package/dist/is-deep-equal.spec-d.cjs +1 -1
- package/dist/is-deep-equal.spec-d.js +1 -1
- package/dist/is-empty.d.cts +1 -1
- package/dist/is-empty.d.ts +1 -1
- package/dist/is-included-in.d.cts +1 -1
- package/dist/is-included-in.d.ts +1 -1
- package/dist/is-nullish.d.cts +1 -1
- package/dist/is-nullish.d.ts +1 -1
- package/dist/is-number.d.cts +1 -1
- package/dist/is-number.d.ts +1 -1
- package/dist/is-object-type.d.cts +1 -1
- package/dist/is-object-type.d.ts +1 -1
- package/dist/is-plain-object.d.cts +1 -1
- package/dist/is-plain-object.d.ts +1 -1
- package/dist/is-shallow-equal.spec-d.cjs +1 -1
- package/dist/is-shallow-equal.spec-d.js +1 -1
- package/dist/is-strict-equal.spec-d.cjs +1 -1
- package/dist/is-strict-equal.spec-d.js +1 -1
- package/dist/is-string.d.cts +1 -1
- package/dist/is-string.d.ts +1 -1
- package/dist/is-symbol.d.cts +1 -1
- package/dist/is-symbol.d.ts +1 -1
- package/dist/keys.d.cts +1 -1
- package/dist/keys.d.ts +1 -1
- package/dist/keys.spec-d.cjs +1 -1
- package/dist/keys.spec-d.js +1 -1
- package/dist/last.d.cts +1 -1
- package/dist/last.d.ts +1 -1
- package/dist/last.spec-d.cjs +1 -1
- package/dist/last.spec-d.js +1 -1
- package/dist/map-keys.d.cts +1 -1
- package/dist/map-keys.d.ts +1 -1
- package/dist/map-keys.spec-d.cjs +1 -1
- package/dist/map-keys.spec-d.js +1 -1
- package/dist/map-values.d.cts +1 -1
- package/dist/map-values.d.ts +1 -1
- package/dist/map-values.spec-d.cjs +1 -1
- package/dist/map-values.spec-d.js +1 -1
- package/dist/map-with-feedback.cjs +1 -1
- package/dist/map-with-feedback.d.cts +1 -1
- package/dist/map-with-feedback.d.ts +1 -1
- package/dist/map-with-feedback.js +1 -1
- package/dist/map-with-feedback.spec-d.cjs +1 -1
- package/dist/map-with-feedback.spec-d.js +1 -1
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/nth-by.d.cts +1 -1
- package/dist/nth-by.d.ts +1 -1
- package/dist/nth-by.spec-d.cjs +1 -1
- package/dist/nth-by.spec-d.js +1 -1
- package/dist/omit-by.d.cts +1 -1
- package/dist/omit-by.d.ts +1 -1
- package/dist/omit-by.spec-d.cjs +1 -1
- package/dist/omit-by.spec-d.js +1 -1
- package/dist/omit.spec-d.cjs +1 -1
- package/dist/omit.spec-d.js +1 -1
- package/dist/only.d.cts +1 -1
- package/dist/only.d.ts +1 -1
- package/dist/partition.spec-d.cjs +1 -1
- package/dist/partition.spec-d.js +1 -1
- package/dist/pick-by.d.cts +1 -1
- package/dist/pick-by.d.ts +1 -1
- package/dist/pick-by.spec-d.cjs +1 -1
- package/dist/pick-by.spec-d.js +1 -1
- package/dist/pick.spec-d.cjs +1 -1
- package/dist/pick.spec-d.js +1 -1
- package/dist/pipe.cjs +1 -1
- package/dist/pipe.js +1 -1
- package/dist/piped.cjs +1 -1
- package/dist/piped.js +1 -1
- package/dist/product.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/product.spec-d.cjs +1 -1
- package/dist/product.spec-d.js +1 -1
- package/dist/prop.spec-d.cjs +1 -1
- package/dist/prop.spec-d.js +1 -1
- package/dist/pull-object.d.cts +1 -1
- package/dist/pull-object.d.ts +1 -1
- package/dist/pull-object.spec-d.cjs +1 -1
- package/dist/pull-object.spec-d.js +1 -1
- package/dist/random-integer.cjs +1 -0
- package/dist/random-integer.d.cts +20 -0
- package/dist/random-integer.d.ts +20 -0
- package/dist/random-integer.js +1 -0
- package/dist/random-integer.spec-d.cjs +1 -0
- package/dist/random-integer.spec-d.d.cts +2 -0
- package/dist/random-integer.spec-d.d.ts +2 -0
- package/dist/random-integer.spec-d.js +1 -0
- package/dist/rank-by.d.cts +1 -1
- package/dist/rank-by.d.ts +1 -1
- package/dist/reverse.spec-d.cjs +1 -1
- package/dist/reverse.spec-d.js +1 -1
- package/dist/sample.d.cts +1 -1
- package/dist/sample.d.ts +1 -1
- package/dist/set-path.spec-d.cjs +1 -1
- package/dist/set-path.spec-d.js +1 -1
- package/dist/set.d.cts +1 -1
- package/dist/set.d.ts +1 -1
- package/dist/shuffle.d.cts +1 -1
- package/dist/shuffle.d.ts +1 -1
- package/dist/shuffle.spec-d.cjs +1 -1
- package/dist/shuffle.spec-d.js +1 -1
- package/dist/sort-by.d.cts +1 -1
- package/dist/sort-by.d.ts +1 -1
- package/dist/sort-by.spec-d.cjs +1 -1
- package/dist/sort-by.spec-d.js +1 -1
- package/dist/sort.d.cts +1 -1
- package/dist/sort.d.ts +1 -1
- package/dist/sum.d.cts +1 -1
- package/dist/sum.d.ts +1 -1
- package/dist/sum.spec-d.cjs +1 -1
- package/dist/sum.spec-d.js +1 -1
- package/dist/swap-indices.d.cts +1 -1
- package/dist/swap-indices.d.ts +1 -1
- package/dist/take-first-by.d.cts +1 -1
- package/dist/take-first-by.d.ts +1 -1
- package/dist/take-last-while.d.cts +1 -1
- package/dist/take-last-while.d.ts +1 -1
- package/dist/take-last-while.spec-d-.cjs +1 -1
- package/dist/take-last-while.spec-d-.js +1 -1
- package/dist/take-last.d.cts +1 -1
- package/dist/take-last.d.ts +1 -1
- package/dist/take-last.spec-d.cjs +1 -1
- package/dist/take-last.spec-d.js +1 -1
- package/dist/take-while.d.cts +1 -1
- package/dist/take-while.d.ts +1 -1
- package/dist/take-white.spec-d.cjs +1 -1
- package/dist/take-white.spec-d.js +1 -1
- package/dist/take.cjs +1 -1
- package/dist/take.d.cts +1 -1
- package/dist/take.d.ts +1 -1
- package/dist/take.js +1 -1
- package/dist/take.spec-d.cjs +1 -1
- package/dist/take.spec-d.js +1 -1
- package/dist/tap.spec-d.cjs +1 -1
- package/dist/tap.spec-d.js +1 -1
- package/dist/times.spec-d.cjs +1 -1
- package/dist/times.spec-d.js +1 -1
- package/dist/{types-BE3YOWVA.d.cts → types-CC8iZVKO.d.cts} +12 -2
- package/dist/{types-BE3YOWVA.d.ts → types-CC8iZVKO.d.ts} +12 -2
- package/dist/unique-by.cjs +1 -1
- package/dist/unique-by.d.cts +1 -1
- package/dist/unique-by.d.ts +1 -1
- package/dist/unique-by.js +1 -1
- package/dist/unique-with.cjs +1 -1
- package/dist/unique-with.d.cts +1 -1
- package/dist/unique-with.d.ts +1 -1
- package/dist/unique-with.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.d.cts +1 -1
- package/dist/unique.d.ts +1 -1
- package/dist/unique.js +1 -1
- package/dist/values.d.cts +1 -1
- package/dist/values.d.ts +1 -1
- package/dist/values.spec-d.cjs +1 -1
- package/dist/values.spec-d.js +1 -1
- package/dist/zip-with.d.cts +1 -1
- package/dist/zip-with.d.ts +1 -1
- package/dist/zip-with.spec-d.cjs +1 -1
- package/dist/zip-with.spec-d.js +1 -1
- package/dist/zip.d.cts +1 -1
- package/dist/zip.d.ts +1 -1
- package/dist/zip.spec-d.cjs +1 -1
- package/dist/zip.spec-d.js +1 -1
- package/package.json +14 -13
- package/dist/chunk-A535Z4LW.cjs +0 -1
- package/dist/chunk-AKGWT6GC.js +0 -1
- package/dist/chunk-BRLENORL.js +0 -1
- package/dist/chunk-E6RBEL5Z.cjs +0 -1
- package/dist/chunk-EKYCE7XE.cjs +0 -1
- package/dist/chunk-FNZCH7TN.cjs +0 -1
- package/dist/chunk-GNPFJJSC.cjs +0 -1
- package/dist/chunk-HTO3K3VA.cjs +0 -1
- package/dist/chunk-IRH6TGG5.js +0 -1
- package/dist/chunk-JLRJ44YR.js +0 -1
- package/dist/chunk-KITVKWLP.cjs +0 -1
- package/dist/chunk-MADDQNAR.cjs +0 -1
- package/dist/chunk-MYLYERXO.js +0 -1
- package/dist/chunk-NULDWRPD.cjs +0 -1
- package/dist/chunk-PHKKU45J.js +0 -1
- package/dist/chunk-RCENCAXY.cjs +0 -1
- package/dist/chunk-UNKQWZT6.js +0 -1
- package/dist/chunk-WQDEYM64.js +0 -1
- package/dist/chunk-WRKGH4XX.js +0 -1
- package/dist/chunk-WUAU3LTQ.js +0 -1
package/dist/drop.d.cts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { I as IterableContainer, T as TupleParts, N as NTuple } from './types-
|
|
1
|
+
import { IsNegative, IsInteger, Subtract } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer, T as TupleParts, N as NTuple, C as CoercedArray } from './types-CC8iZVKO.cjs';
|
|
3
3
|
|
|
4
|
-
type Drop<T extends IterableContainer, N extends number> =
|
|
5
|
-
...
|
|
6
|
-
...
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
type Drop<T extends IterableContainer, N extends number> = IsNegative<N> extends true ? T : IsInteger<N> extends false ? Array<T[number]> : TupleParts<T>['prefix'] extends [
|
|
5
|
+
...NTuple<unknown, N>,
|
|
6
|
+
...infer Remaining
|
|
7
|
+
] ? [
|
|
8
|
+
...Remaining,
|
|
9
|
+
...CoercedArray<TupleParts<T>['item']>,
|
|
10
|
+
...TupleParts<T>['suffix']
|
|
11
|
+
] : 0 extends TupleParts<T>['suffix']['length'] ? CoercedArray<TupleParts<T>['item']> : [...Array<TupleParts<T>['item']>, ...TupleParts<T>['suffix']] | DropUpTo<TupleParts<T>['suffix'], Subtract<N, TupleParts<T>['prefix']['length']>>;
|
|
12
|
+
/**
|
|
13
|
+
* Arrays with a fixed suffix will result in any number of items being dropped,
|
|
14
|
+
* up to N, and not just N itself. This is because we don't know during typing
|
|
15
|
+
* how many items the "rest" part of the tuple will have in runtime.
|
|
16
|
+
*
|
|
17
|
+
* !Important: This is an internal type and assumes that T is a fixed-size
|
|
18
|
+
* tuple! It will not work if T has a rest element.
|
|
19
|
+
*/
|
|
20
|
+
type DropUpTo<T, N, Dropped extends ReadonlyArray<unknown> = []> = Dropped['length'] extends N ? T : T extends [unknown, ...infer Rest] ? // Take the current value, and then recurse with the array where it is
|
|
21
|
+
DropUpTo<Rest, N, [...Dropped, unknown]> | T : T;
|
|
9
22
|
/**
|
|
10
23
|
* Removes first `n` elements from the `array`.
|
|
11
24
|
*
|
package/dist/drop.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { I as IterableContainer, T as TupleParts, N as NTuple } from './types-
|
|
1
|
+
import { IsNegative, IsInteger, Subtract } from 'type-fest';
|
|
2
|
+
import { I as IterableContainer, T as TupleParts, N as NTuple, C as CoercedArray } from './types-CC8iZVKO.js';
|
|
3
3
|
|
|
4
|
-
type Drop<T extends IterableContainer, N extends number> =
|
|
5
|
-
...
|
|
6
|
-
...
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
type Drop<T extends IterableContainer, N extends number> = IsNegative<N> extends true ? T : IsInteger<N> extends false ? Array<T[number]> : TupleParts<T>['prefix'] extends [
|
|
5
|
+
...NTuple<unknown, N>,
|
|
6
|
+
...infer Remaining
|
|
7
|
+
] ? [
|
|
8
|
+
...Remaining,
|
|
9
|
+
...CoercedArray<TupleParts<T>['item']>,
|
|
10
|
+
...TupleParts<T>['suffix']
|
|
11
|
+
] : 0 extends TupleParts<T>['suffix']['length'] ? CoercedArray<TupleParts<T>['item']> : [...Array<TupleParts<T>['item']>, ...TupleParts<T>['suffix']] | DropUpTo<TupleParts<T>['suffix'], Subtract<N, TupleParts<T>['prefix']['length']>>;
|
|
12
|
+
/**
|
|
13
|
+
* Arrays with a fixed suffix will result in any number of items being dropped,
|
|
14
|
+
* up to N, and not just N itself. This is because we don't know during typing
|
|
15
|
+
* how many items the "rest" part of the tuple will have in runtime.
|
|
16
|
+
*
|
|
17
|
+
* !Important: This is an internal type and assumes that T is a fixed-size
|
|
18
|
+
* tuple! It will not work if T has a rest element.
|
|
19
|
+
*/
|
|
20
|
+
type DropUpTo<T, N, Dropped extends ReadonlyArray<unknown> = []> = Dropped['length'] extends N ? T : T extends [unknown, ...infer Rest] ? // Take the current value, and then recurse with the array where it is
|
|
21
|
+
DropUpTo<Rest, N, [...Dropped, unknown]> | T : T;
|
|
9
22
|
/**
|
|
10
23
|
* Removes first `n` elements from the `array`.
|
|
11
24
|
*
|
package/dist/drop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-XYMW4QIS.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as drop};
|
package/dist/drop.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkG5M5BNF3cjs = require('./chunk-G5M5BNF3.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("prefixed array",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffixed array",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1],2);expectTypeOf(e).toEqualTypeOf()}),describe("arrays with a prefix (2) and a suffix (2)",()=>{test("N === 0 (no drop)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],0);expectTypeOf(e).toEqualTypeOf()}),test("N === 1 (drop from the prefix)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],1);expectTypeOf(e).toEqualTypeOf()}),test("N === 2 (remove the prefix)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],2);expectTypeOf(e).toEqualTypeOf()}),test("N === 3 (drop the whole prefix, remove from the suffix)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],3);expectTypeOf(e).toEqualTypeOf()}),test("N === 4 (drop the whole prefix, drop the whole suffix)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],4);expectTypeOf(e).toEqualTypeOf()}),test("N > 4 (drop more than the constant parts of the array)",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,2,"a","b"],5);expectTypeOf(e).toEqualTypeOf()})}),test("tuple",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [1,"a",!0],2);expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [],2);expectTypeOf(e).toEqualTypeOf()}),test("negative count",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, [],-1);expectTypeOf(e).toEqualTypeOf()}),test("generalized typed count",()=>{let e=_chunkG5M5BNF3cjs.a.call(void 0, ["a",1,!0],1);expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [1],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [1],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [1,"a"],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [1,"a",!0],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, 2));expectTypeOf(e).toEqualTypeOf()}),test("negative count",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, -1));expectTypeOf(e).toEqualTypeOf()}),test("generalized typed count",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, [],_chunkG5M5BNF3cjs.a.call(void 0, 1));expectTypeOf(e).toEqualTypeOf()})});
|
package/dist/drop.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-XYMW4QIS.js";import{a as t}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("prefixed array",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),test("suffixed array",()=>{let e=r([1],2);expectTypeOf(e).toEqualTypeOf()}),describe("arrays with a prefix (2) and a suffix (2)",()=>{test("N === 0 (no drop)",()=>{let e=r([1,2,"a","b"],0);expectTypeOf(e).toEqualTypeOf()}),test("N === 1 (drop from the prefix)",()=>{let e=r([1,2,"a","b"],1);expectTypeOf(e).toEqualTypeOf()}),test("N === 2 (remove the prefix)",()=>{let e=r([1,2,"a","b"],2);expectTypeOf(e).toEqualTypeOf()}),test("N === 3 (drop the whole prefix, remove from the suffix)",()=>{let e=r([1,2,"a","b"],3);expectTypeOf(e).toEqualTypeOf()}),test("N === 4 (drop the whole prefix, drop the whole suffix)",()=>{let e=r([1,2,"a","b"],4);expectTypeOf(e).toEqualTypeOf()}),test("N > 4 (drop more than the constant parts of the array)",()=>{let e=r([1,2,"a","b"],5);expectTypeOf(e).toEqualTypeOf()})}),test("tuple",()=>{let e=r([1,"a",!0],2);expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=r([],2);expectTypeOf(e).toEqualTypeOf()}),test("negative count",()=>{let e=r([],-1);expectTypeOf(e).toEqualTypeOf()}),test("generalized typed count",()=>{let e=r(["a",1,!0],1);expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=t([],r(2));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=t([],r(2));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=t([],r(2));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=t([1],r(2));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=t([1],r(2));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=t([1,"a"],r(2));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=t([1,"a",!0],r(2));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=t([],r(2));expectTypeOf(e).toEqualTypeOf()}),test("negative count",()=>{let e=t([],r(-1));expectTypeOf(e).toEqualTypeOf()}),test("generalized typed count",()=>{let e=t([],r(1));expectTypeOf(e).toEqualTypeOf()})});
|
package/dist/evolve.d.cts
CHANGED
package/dist/evolve.d.ts
CHANGED
package/dist/evolve.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunk7EJQW5L6cjs = require('./chunk-7EJQW5L6.cjs');var _chunkQVDYQ7ZEcjs = require('./chunk-QVDYQ7ZE.cjs');var _chunkINAPFYB2cjs = require('./chunk-INAPFYB2.cjs');var _chunkWW7P3TAUcjs = require('./chunk-WW7P3TAU.cjs');var _chunkQ4B5JNZScjs = require('./chunk-Q4B5JNZS.cjs');var _chunkMQ3SR4YOcjs = require('./chunk-MQ3SR4YO.cjs');var
|
|
1
|
+
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunk7EJQW5L6cjs = require('./chunk-7EJQW5L6.cjs');var _chunkQVDYQ7ZEcjs = require('./chunk-QVDYQ7ZE.cjs');var _chunkINAPFYB2cjs = require('./chunk-INAPFYB2.cjs');var _chunkWW7P3TAUcjs = require('./chunk-WW7P3TAU.cjs');var _chunkQ4B5JNZScjs = require('./chunk-Q4B5JNZS.cjs');var _chunkMQ3SR4YOcjs = require('./chunk-MQ3SR4YO.cjs');var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-G66EZBJS.cjs');var _chunkSRZSHSZDcjs = require('./chunk-SRZSHSZD.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');var c=_chunkQVDYQ7ZEcjs.a.call(void 0, (e,r)=>_chunkSRZSHSZDcjs.a.call(void 0, e,r),0);describe("data first",()=>{it("creates a new object by evolving the `data` according to the `transformation` functions",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{id:_chunkSRZSHSZDcjs.a.call(void 0, 1),quartile:c,time:{elapsed:_chunkSRZSHSZDcjs.a.call(void 0, 1),remaining:_chunkSRZSHSZDcjs.a.call(void 0, -1)}});expectTypeOf(e).toEqualTypeOf()}),it("is not destructive and is immutable",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {n:100},{n:_chunkSRZSHSZDcjs.a.call(void 0, 1)});expectTypeOf(e).toEqualTypeOf()}),it("is recursive",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {first:1,nested:{second:2,third:3}},{nested:{second:_chunkSRZSHSZDcjs.a.call(void 0, -1),third:_chunkSRZSHSZDcjs.a.call(void 0, 1)}});expectTypeOf(e).toEqualTypeOf()}),it("can handle data that is complex nested objects",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:0,b:0},{a:1,b:1}]},{array:_chunkQ4B5JNZScjs.a.call(void 0, ),nestedObj:{a:r=>_chunk7EJQW5L6cjs.a.call(void 0, r,"b","Set")},objAry:r=>_chunkWW7P3TAUcjs.a.call(void 0, r,_chunkINAPFYB2cjs.a.call(void 0, ["b"]))});expectTypeOf(e).toEqualTypeOf()}),describe("type reflection",()=>{it("can reflect type of data to function of evolver object",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{count:r=>r,quartile:r=>r,time:r=>r});expectTypeOf(e).toEqualTypeOf()}),it("can reflect type of data to function of nested evolver object",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{count:r=>r,quartile:r=>r,time:{elapsed:r=>r,remaining:r=>r}});expectTypeOf(e).toEqualTypeOf()})}),it("can detect mismatch of parameters and arguments",()=>{_chunkMQ3SR4YOcjs.a.call(void 0, {number:"1",array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:"0",b:0},{a:1,b:1}]},{number:_chunkSRZSHSZDcjs.a.call(void 0, 1),array:e=>e.length,nestedObj:{a:_chunk7EJQW5L6cjs.a.call(void 0, "b",0)},objAry:_chunkWW7P3TAUcjs.a.call(void 0, _chunkINAPFYB2cjs.a.call(void 0, ["b"]))})}),it("does not accept function that require multiple arguments",()=>{_chunkMQ3SR4YOcjs.a.call(void 0, {requiring2Args:1,requiring3Args:1},{requiring2Args:(e,r)=>e+r,requiring3Args:(e,r,i)=>e+(_nullishCoalesce(r, () => (0)))+i})}),it("accept function whose second and subsequent arguments are optional",()=>{let e=_chunkMQ3SR4YOcjs.a.call(void 0, {arg2Optional:1,arg2arg3Optional:1},{arg2Optional:(r,i)=>i===void 0,arg2arg3Optional:(r,i,b)=>i===void 0&&b===void 0});expectTypeOf(e).toEqualTypeOf()}),it("can not handle function arrays.",()=>{_chunkMQ3SR4YOcjs.a.call(void 0, {quartile:[1,2]},{quartile:[_chunkSRZSHSZDcjs.a.call(void 0, 1),_chunkSRZSHSZDcjs.a.call(void 0, -1)]})}),it("doesn't provide typing for symbol key evolvers",()=>{let e=Symbol("a");_chunkMQ3SR4YOcjs.a.call(void 0, {[e]:"hello"},{[e]:_chunkAQRYBCA3cjs.a.call(void 0, )})})});describe("data last",()=>{it("creates a new object by evolving the `data` according to the `transformation` functions",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},_chunkMQ3SR4YOcjs.a.call(void 0, {id:_chunkSRZSHSZDcjs.a.call(void 0, 1),quartile:c,time:{elapsed:_chunkSRZSHSZDcjs.a.call(void 0, 1),remaining:_chunkSRZSHSZDcjs.a.call(void 0, -1)}}));expectTypeOf(e).toEqualTypeOf()}),it("is not destructive and is immutable",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {n:100},_chunkMQ3SR4YOcjs.a.call(void 0, {n:_chunkSRZSHSZDcjs.a.call(void 0, 1)}));expectTypeOf(e).toEqualTypeOf()}),it("is recursive",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {first:1,nested:{second:2,third:3}},_chunkMQ3SR4YOcjs.a.call(void 0, {nested:{second:_chunkSRZSHSZDcjs.a.call(void 0, -1),third:_chunkSRZSHSZDcjs.a.call(void 0, 1)}}));expectTypeOf(e).toEqualTypeOf()}),it("ignores undefined transformations",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {n:0},_chunkMQ3SR4YOcjs.a.call(void 0, {}));expectTypeOf(e).toEqualTypeOf()}),it("can handle data that is complex nested objects",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:0,b:0},{a:1,b:1}]},_chunkMQ3SR4YOcjs.a.call(void 0, {array:_chunkQ4B5JNZScjs.a.call(void 0, ),nestedObj:{a:r=>_chunk7EJQW5L6cjs.a.call(void 0, r,"b","Set")},objAry:r=>_chunkWW7P3TAUcjs.a.call(void 0, r,_chunkINAPFYB2cjs.a.call(void 0, ["b"]))}));expectTypeOf(e).toEqualTypeOf()}),describe("it can detect mismatch of parameters and arguments",()=>{it('detect property "number" are incompatible',()=>{_chunkY7L64OLNcjs.a.call(void 0, {number:"1",array:["1","2","3"]},_chunkMQ3SR4YOcjs.a.call(void 0, {number:_chunkSRZSHSZDcjs.a.call(void 0, 1),array:_chunkQ4B5JNZScjs.a.call(void 0, )}))}),it('detect property "array" are incompatible',()=>{_chunkY7L64OLNcjs.a.call(void 0, {number:1,array:["1","2","3"]},_chunkMQ3SR4YOcjs.a.call(void 0, {number:_chunkSRZSHSZDcjs.a.call(void 0, 1),array:e=>e.length}))})}),it("does not accept function that require multiple arguments",()=>{_chunkY7L64OLNcjs.a.call(void 0, {requiring2Args:1},_chunkMQ3SR4YOcjs.a.call(void 0, {requiring2Args:(e,r)=>e+r}))}),it("accept function whose second and subsequent arguments are optional",()=>{let e=_chunkY7L64OLNcjs.a.call(void 0, {arg2Optional:1,arg2arg3Optional:1},_chunkMQ3SR4YOcjs.a.call(void 0, {arg2Optional:(r,i)=>i===void 0,arg2arg3Optional:(r,i,b)=>i===void 0&&b===void 0}));expectTypeOf(e).toEqualTypeOf()}),it("can not handle function arrays.",()=>{_chunkY7L64OLNcjs.a.call(void 0, {quartile:[1,2]},_chunkMQ3SR4YOcjs.a.call(void 0, {quartile:[_chunkSRZSHSZDcjs.a.call(void 0, 1),_chunkSRZSHSZDcjs.a.call(void 0, -1)]}))})});
|
package/dist/evolve.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-QIM2PMWS.js";import{a as l}from"./chunk-7DDJ7DZF.js";import{a as m}from"./chunk-KTMLSQQ7.js";import{a as o}from"./chunk-QRDGUNHT.js";import{a as u}from"./chunk-J6L2AOTY.js";import{a as t}from"./chunk-VJMHXGZD.js";import{a as d}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-QIM2PMWS.js";import{a as l}from"./chunk-7DDJ7DZF.js";import{a as m}from"./chunk-KTMLSQQ7.js";import{a as o}from"./chunk-QRDGUNHT.js";import{a as u}from"./chunk-J6L2AOTY.js";import{a as t}from"./chunk-VJMHXGZD.js";import{a as d}from"./chunk-46GBCFAG.js";import{a}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import"./chunk-73BYESBE.js";import{a as n}from"./chunk-SVOK32ZP.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";var c=l((e,r)=>n(e,r),0);describe("data first",()=>{it("creates a new object by evolving the `data` according to the `transformation` functions",()=>{let e=t({id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{id:n(1),quartile:c,time:{elapsed:n(1),remaining:n(-1)}});expectTypeOf(e).toEqualTypeOf()}),it("is not destructive and is immutable",()=>{let e=t({n:100},{n:n(1)});expectTypeOf(e).toEqualTypeOf()}),it("is recursive",()=>{let e=t({first:1,nested:{second:2,third:3}},{nested:{second:n(-1),third:n(1)}});expectTypeOf(e).toEqualTypeOf()}),it("can handle data that is complex nested objects",()=>{let e=t({array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:0,b:0},{a:1,b:1}]},{array:u(),nestedObj:{a:r=>s(r,"b","Set")},objAry:r=>o(r,m(["b"]))});expectTypeOf(e).toEqualTypeOf()}),describe("type reflection",()=>{it("can reflect type of data to function of evolver object",()=>{let e=t({id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{count:r=>r,quartile:r=>r,time:r=>r});expectTypeOf(e).toEqualTypeOf()}),it("can reflect type of data to function of nested evolver object",()=>{let e=t({id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},{count:r=>r,quartile:r=>r,time:{elapsed:r=>r,remaining:r=>r}});expectTypeOf(e).toEqualTypeOf()})}),it("can detect mismatch of parameters and arguments",()=>{t({number:"1",array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:"0",b:0},{a:1,b:1}]},{number:n(1),array:e=>e.length,nestedObj:{a:s("b",0)},objAry:o(m(["b"]))})}),it("does not accept function that require multiple arguments",()=>{t({requiring2Args:1,requiring3Args:1},{requiring2Args:(e,r)=>e+r,requiring3Args:(e,r,i)=>e+(r??0)+i})}),it("accept function whose second and subsequent arguments are optional",()=>{let e=t({arg2Optional:1,arg2arg3Optional:1},{arg2Optional:(r,i)=>i===void 0,arg2arg3Optional:(r,i,b)=>i===void 0&&b===void 0});expectTypeOf(e).toEqualTypeOf()}),it("can not handle function arrays.",()=>{t({quartile:[1,2]},{quartile:[n(1),n(-1)]})}),it("doesn't provide typing for symbol key evolvers",()=>{let e=Symbol("a");t({[e]:"hello"},{[e]:d()})})});describe("data last",()=>{it("creates a new object by evolving the `data` according to the `transformation` functions",()=>{let e=a({id:1,quartile:[1,2,3,4],time:{elapsed:100,remaining:1400}},t({id:n(1),quartile:c,time:{elapsed:n(1),remaining:n(-1)}}));expectTypeOf(e).toEqualTypeOf()}),it("is not destructive and is immutable",()=>{let e=a({n:100},t({n:n(1)}));expectTypeOf(e).toEqualTypeOf()}),it("is recursive",()=>{let e=a({first:1,nested:{second:2,third:3}},t({nested:{second:n(-1),third:n(1)}}));expectTypeOf(e).toEqualTypeOf()}),it("ignores undefined transformations",()=>{let e=a({n:0},t({}));expectTypeOf(e).toEqualTypeOf()}),it("can handle data that is complex nested objects",()=>{let e=a({array:["1","2","3"],nestedObj:{a:{b:"c"}},objAry:[{a:0,b:0},{a:1,b:1}]},t({array:u(),nestedObj:{a:r=>s(r,"b","Set")},objAry:r=>o(r,m(["b"]))}));expectTypeOf(e).toEqualTypeOf()}),describe("it can detect mismatch of parameters and arguments",()=>{it('detect property "number" are incompatible',()=>{a({number:"1",array:["1","2","3"]},t({number:n(1),array:u()}))}),it('detect property "array" are incompatible',()=>{a({number:1,array:["1","2","3"]},t({number:n(1),array:e=>e.length}))})}),it("does not accept function that require multiple arguments",()=>{a({requiring2Args:1},t({requiring2Args:(e,r)=>e+r}))}),it("accept function whose second and subsequent arguments are optional",()=>{let e=a({arg2Optional:1,arg2arg3Optional:1},t({arg2Optional:(r,i)=>i===void 0,arg2arg3Optional:(r,i,b)=>i===void 0&&b===void 0}));expectTypeOf(e).toEqualTypeOf()}),it("can not handle function arrays.",()=>{a({quartile:[1,2]},t({quartile:[n(1),n(-1)]}))})});
|
package/dist/filter.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkC6NFG7IScjs = require('./chunk-C6NFG7IS.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.filter = _chunkC6NFG7IScjs.a;
|
package/dist/filter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-SOCUEKNU.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as filter};
|
package/dist/filter.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkC6NFG7IScjs = require('./chunk-C6NFG7IS.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data_first",()=>{it("filter",()=>{let t=_chunkC6NFG7IScjs.a.call(void 0, [1,2,3],e=>e%2===1);expectTypeOf(t).toEqualTypeOf()}),it("data_first with typescript guard",()=>{let t=_chunkC6NFG7IScjs.a.call(void 0, [1,2,3,"abc",!0],i);expectTypeOf(t).toEqualTypeOf()}),it("filter indexed",()=>{let t=_chunkC6NFG7IScjs.a.call(void 0, [1,2,3],(e,a)=>e%2===1&&a!==1);expectTypeOf(t).toEqualTypeOf()})});describe("data_last",()=>{it("filter",()=>{let t=_chunkY7L64OLNcjs.a.call(void 0, [1,2,3],_chunkC6NFG7IScjs.a.call(void 0, e=>e%2===1));expectTypeOf(t).toEqualTypeOf()}),it("filter with typescript guard",()=>{let t=_chunkY7L64OLNcjs.a.call(void 0, [1,2,3,!1,"text"],_chunkC6NFG7IScjs.a.call(void 0, i));expectTypeOf(t).toEqualTypeOf()}),it("filter indexed",()=>{let t=_chunkY7L64OLNcjs.a.call(void 0, [1,2,3],_chunkC6NFG7IScjs.a.call(void 0, (e,a)=>e%2===1&&a!==1));expectTypeOf(t).toEqualTypeOf()})});function i(t){return typeof t=="number"}
|
package/dist/filter.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-SOCUEKNU.js";import{a as s}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data_first",()=>{it("filter",()=>{let t=r([1,2,3],e=>e%2===1);expectTypeOf(t).toEqualTypeOf()}),it("data_first with typescript guard",()=>{let t=r([1,2,3,"abc",!0],i);expectTypeOf(t).toEqualTypeOf()}),it("filter indexed",()=>{let t=r([1,2,3],(e,a)=>e%2===1&&a!==1);expectTypeOf(t).toEqualTypeOf()})});describe("data_last",()=>{it("filter",()=>{let t=s([1,2,3],r(e=>e%2===1));expectTypeOf(t).toEqualTypeOf()}),it("filter with typescript guard",()=>{let t=s([1,2,3,!1,"text"],r(i));expectTypeOf(t).toEqualTypeOf()}),it("filter indexed",()=>{let t=s([1,2,3],r((e,a)=>e%2===1&&a!==1));expectTypeOf(t).toEqualTypeOf()})});function i(t){return typeof t=="number"}
|
package/dist/find.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCT4EPN4Qcjs = require('./chunk-CT4EPN4Q.cjs');require('./chunk-GPGITOFN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.find = _chunkCT4EPN4Qcjs.a;
|
package/dist/find.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-FFGIG2SO.js";import"./chunk-SME5FGMA.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as find};
|
package/dist/find.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkCT4EPN4Qcjs = require('./chunk-CT4EPN4Q.cjs');require('./chunk-GPGITOFN.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');test("can narrow types",()=>{let r=_chunkCT4EPN4Qcjs.a.call(void 0, [1,"a"],_chunkEHJK4JRFcjs.a);expectTypeOf(r).toEqualTypeOf()});
|
package/dist/find.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-FFGIG2SO.js";import"./chunk-SME5FGMA.js";import{a as t}from"./chunk-UYLVIAK4.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";test("can narrow types",()=>{let r=e([1,"a"],t);expectTypeOf(r).toEqualTypeOf()});
|
package/dist/first-by.d.cts
CHANGED
package/dist/first-by.d.ts
CHANGED
package/dist/first-by.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkDHNCWVVTcjs = require('./chunk-DHNCWVVT.cjs');require('./chunk-FWQYL4Y4.cjs');require('./chunk-G66EZBJS.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("can return undefined on arrays",()=>{let t=_chunkDHNCWVVTcjs.a.call(void 0, [1,2,3],_chunkAQRYBCA3cjs.a.call(void 0, ));expectTypeOf(t).toBeNullable()});it("can't return undefined on non-empty array",()=>{let t=_chunkDHNCWVVTcjs.a.call(void 0, [1,2,3],_chunkAQRYBCA3cjs.a.call(void 0, ));expectTypeOf(t).not.toBeNullable()});it("only returns null on the empty array",()=>{let t=_chunkDHNCWVVTcjs.a.call(void 0, [],_chunkAQRYBCA3cjs.a.call(void 0, ));expectTypeOf(t).toBeUndefined()});
|
package/dist/first-by.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-46GBCFAG.js";import{a as e}from"./chunk-J5PNUDDU.js";import"./chunk-JXXXUJM5.js";import"./chunk-73BYESBE.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("can return undefined on arrays",()=>{let t=e([1,2,3],n());expectTypeOf(t).toBeNullable()});it("can't return undefined on non-empty array",()=>{let t=e([1,2,3],n());expectTypeOf(t).not.toBeNullable()});it("only returns null on the empty array",()=>{let t=e([],n());expectTypeOf(t).toBeUndefined()});
|
package/dist/first.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer } from './types-
|
|
1
|
+
import { I as IterableContainer } from './types-CC8iZVKO.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type First<T extends IterableContainer> = T extends [] ? undefined : T extends readonly [unknown, ...Array<unknown>] ? T[0] : T extends readonly [...infer Pre, infer Last] ? Last | Pre[0] : T[0] | undefined;
|
package/dist/first.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer } from './types-
|
|
1
|
+
import { I as IterableContainer } from './types-CC8iZVKO.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type First<T extends IterableContainer> = T extends [] ? undefined : T extends readonly [unknown, ...Array<unknown>] ? T[0] : T extends readonly [...infer Pre, infer Last] ? Last | Pre[0] : T[0] | undefined;
|
package/dist/flat.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK43ZLBUScjs = require('./chunk-K43ZLBUS.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-7T4AVFYJ.cjs');exports.flat = _chunkK43ZLBUScjs.a;
|
package/dist/flat.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-CC8iZVKO.cjs';
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_DEPTH = 1;
|
|
5
5
|
type FlatArray<T, Depth extends number, Iteration extends ReadonlyArray<unknown> = []> = Depth extends Iteration['length'] ? T : T extends readonly [] ? [
|
package/dist/flat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-CC8iZVKO.js';
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_DEPTH = 1;
|
|
5
5
|
type FlatArray<T, Depth extends number, Iteration extends ReadonlyArray<unknown> = []> = Depth extends Iteration['length'] ? T : T extends readonly [] ? [
|
package/dist/flat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-6B6SBF6V.js";import"./chunk-T4LCVT74.js";import"./chunk-KQGY2DBY.js";export{a as flat};
|
package/dist/flat.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkK43ZLBUScjs = require('./chunk-K43ZLBUS.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-7T4AVFYJ.cjs');it("works on empty arrays",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("works on already-flat arrays",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("works on a single level of nesting",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("stops after the first level of nesting (depth === 1)",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("stops after the first level of nesting (depth === 1)",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("works with mixed types",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("works with mixed levels of nesting",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],1);expectTypeOf(r).toEqualTypeOf()});it("works when depth is deeper than the array",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],10);expectTypeOf(r).toEqualTypeOf()});it("works when depth is really really really really big",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],9999999);expectTypeOf(r).toEqualTypeOf()});it("keeps the typing of trivial tuples",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [1,2],1);expectTypeOf(r).toEqualTypeOf()});it("Works on simple tuples",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[1,2],[3,4]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples with different levels of nesting",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [1,[2,3],[4,[5,6]]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples with depth>1",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [1,[2,3],[4,[5,6]]],2);expectTypeOf(r).toEqualTypeOf()});it("works with tuples with a lot of nesting",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[[[1]],[[[[2]]]]],[[[[3,4],5]]]],10);expectTypeOf(r).toEqualTypeOf()});it("works with a mix of simple arrays and tuples",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with multiple types nested in a tuple",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[],[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with a tuple with mixed array and non array items",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [1,[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with a tuple with mixed array and non array items, deeply",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[1],[]],2);expectTypeOf(r).toEqualTypeOf()});it("works on non-empty arrays",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[1]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples inside arrays",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()});it("works on tuples inside arrays",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [1,[],4],2);expectTypeOf(r).toEqualTypeOf()});it("works with depths beyond 20",()=>{let r=_chunkK43ZLBUScjs.a.call(void 0, [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[1]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],99);expectTypeOf(r).toEqualTypeOf()});it("doesn't accept non-literal depths",()=>{_chunkK43ZLBUScjs.a.call(void 0, [],1)});it("doesn't accept built-in 'infinite' numbers",()=>{_chunkK43ZLBUScjs.a.call(void 0, [],Number.POSITIVE_INFINITY),_chunkK43ZLBUScjs.a.call(void 0, [],Number.MAX_VALUE),_chunkK43ZLBUScjs.a.call(void 0, [],Number.POSITIVE_INFINITY)});
|
package/dist/flat.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-6B6SBF6V.js";import"./chunk-T4LCVT74.js";import"./chunk-KQGY2DBY.js";it("works on empty arrays",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("works on already-flat arrays",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("works on a single level of nesting",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("stops after the first level of nesting (depth === 1)",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("stops after the first level of nesting (depth === 1)",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("works with mixed types",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("works with mixed levels of nesting",()=>{let r=t([],1);expectTypeOf(r).toEqualTypeOf()});it("works when depth is deeper than the array",()=>{let r=t([],10);expectTypeOf(r).toEqualTypeOf()});it("works when depth is really really really really big",()=>{let r=t([],9999999);expectTypeOf(r).toEqualTypeOf()});it("keeps the typing of trivial tuples",()=>{let r=t([1,2],1);expectTypeOf(r).toEqualTypeOf()});it("Works on simple tuples",()=>{let r=t([[1,2],[3,4]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples with different levels of nesting",()=>{let r=t([1,[2,3],[4,[5,6]]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples with depth>1",()=>{let r=t([1,[2,3],[4,[5,6]]],2);expectTypeOf(r).toEqualTypeOf()});it("works with tuples with a lot of nesting",()=>{let r=t([[[[1]],[[[[2]]]]],[[[[3,4],5]]]],10);expectTypeOf(r).toEqualTypeOf()});it("works with a mix of simple arrays and tuples",()=>{let r=t([[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with multiple types nested in a tuple",()=>{let r=t([[],[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with a tuple with mixed array and non array items",()=>{let r=t([1,[]],1);expectTypeOf(r).toEqualTypeOf()});it("works with a tuple with mixed array and non array items, deeply",()=>{let r=t([[1],[]],2);expectTypeOf(r).toEqualTypeOf()});it("works on non-empty arrays",()=>{let r=t([[1]],1);expectTypeOf(r).toEqualTypeOf()});it("works on tuples inside arrays",()=>{let r=t([],2);expectTypeOf(r).toEqualTypeOf()});it("works on tuples inside arrays",()=>{let r=t([1,[],4],2);expectTypeOf(r).toEqualTypeOf()});it("works with depths beyond 20",()=>{let r=t([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[1]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],99);expectTypeOf(r).toEqualTypeOf()});it("doesn't accept non-literal depths",()=>{t([],1)});it("doesn't accept built-in 'infinite' numbers",()=>{t([],Number.POSITIVE_INFINITY),t([],Number.MAX_VALUE),t([],Number.POSITIVE_INFINITY)});
|
package/dist/for-each-obj.d.cts
CHANGED
package/dist/for-each-obj.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _chunkKODMZU4Jcjs = require('./chunk-KODMZU4J.cjs');var
|
|
1
|
+
"use strict";var _chunkKODMZU4Jcjs = require('./chunk-KODMZU4J.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');test("Typing is sound when only symbol keys",()=>{_chunkKODMZU4Jcjs.a.call(void 0, {[Symbol("a")]:4},(t,e)=>{expectTypeOf(e).toBeNever(),expectTypeOf(t).toBeNever()})});test("Symbol keys are ignored",()=>{_chunkKODMZU4Jcjs.a.call(void 0, {[Symbol("a")]:4,a:"hello",b:!0},(t,e)=>{expectTypeOf(e).toEqualTypeOf(),expectTypeOf(t).toEqualTypeOf()})});test("number keys are translated to strings",()=>{_chunkKODMZU4Jcjs.a.call(void 0, {123:"hello",456:!0},(t,e)=>{expectTypeOf(e).toEqualTypeOf(),expectTypeOf(t).toEqualTypeOf()})});test("union of records",()=>{let t={};_chunkKODMZU4Jcjs.a.call(void 0, t,(e,p)=>{expectTypeOf(p).toEqualTypeOf(),expectTypeOf(e).toEqualTypeOf()}),_chunkY7L64OLNcjs.a.call(void 0, t,_chunkKODMZU4Jcjs.a.call(void 0, (e,p)=>{expectTypeOf(p).toEqualTypeOf(),expectTypeOf(e).toEqualTypeOf()}))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-HLKCHMAO.js";import{a as r}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-HLKCHMAO.js";import{a as r}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";test("Typing is sound when only symbol keys",()=>{o({[Symbol("a")]:4},(t,e)=>{expectTypeOf(e).toBeNever(),expectTypeOf(t).toBeNever()})});test("Symbol keys are ignored",()=>{o({[Symbol("a")]:4,a:"hello",b:!0},(t,e)=>{expectTypeOf(e).toEqualTypeOf(),expectTypeOf(t).toEqualTypeOf()})});test("number keys are translated to strings",()=>{o({123:"hello",456:!0},(t,e)=>{expectTypeOf(e).toEqualTypeOf(),expectTypeOf(t).toEqualTypeOf()})});test("union of records",()=>{let t={};o(t,(e,p)=>{expectTypeOf(p).toEqualTypeOf(),expectTypeOf(e).toEqualTypeOf()}),r(t,o((e,p)=>{expectTypeOf(p).toEqualTypeOf(),expectTypeOf(e).toEqualTypeOf()}))});
|
package/dist/for-each.d.cts
CHANGED
package/dist/for-each.d.ts
CHANGED
package/dist/for-each.spec-d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _chunkUHUFGDIScjs = require('./chunk-UHUFGDIS.cjs');var
|
|
1
|
+
"use strict";var _chunkUHUFGDIScjs = require('./chunk-UHUFGDIS.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("doesn't return anything on dataFirst invocations",()=>{let t=_chunkUHUFGDIScjs.a.call(void 0, [1,2,3],_chunkWYRK6YJUcjs.a.call(void 0, ));expectTypeOf(t).toEqualTypeOf()});it("passes the item type to the callback",()=>{_chunkY7L64OLNcjs.a.call(void 0, [1,2,3],_chunkUHUFGDIScjs.a.call(void 0, t=>{expectTypeOf(t).toEqualTypeOf()}))});it("maintains the array shape",()=>{_chunkY7L64OLNcjs.a.call(void 0, [1,"a"],_chunkUHUFGDIScjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, )),r=>{expectTypeOf(r).toEqualTypeOf()})});it("makes the result mutable",()=>{_chunkY7L64OLNcjs.a.call(void 0, [],_chunkUHUFGDIScjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, )),r=>{expectTypeOf(r).toEqualTypeOf()})});
|
package/dist/for-each.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-T2LJNGWI.js";import{a as o}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-T2LJNGWI.js";import{a as o}from"./chunk-AFO7BV2X.js";import{a as e}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("doesn't return anything on dataFirst invocations",()=>{let t=a([1,2,3],o());expectTypeOf(t).toEqualTypeOf()});it("passes the item type to the callback",()=>{e([1,2,3],a(t=>{expectTypeOf(t).toEqualTypeOf()}))});it("maintains the array shape",()=>{e([1,"a"],a(o()),r=>{expectTypeOf(r).toEqualTypeOf()})});it("makes the result mutable",()=>{e([],a(o()),r=>{expectTypeOf(r).toEqualTypeOf()})});
|
package/dist/from-entries.d.cts
CHANGED
package/dist/from-entries.d.ts
CHANGED
package/dist/from-keys.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer, c as ExactRecord } from './types-
|
|
2
|
+
import { I as IterableContainer, c as ExactRecord } from './types-CC8iZVKO.cjs';
|
|
3
3
|
|
|
4
4
|
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
5
5
|
[P in T]: V;
|
package/dist/from-keys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer, c as ExactRecord } from './types-
|
|
2
|
+
import { I as IterableContainer, c as ExactRecord } from './types-CC8iZVKO.js';
|
|
3
3
|
|
|
4
4
|
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
5
5
|
[P in T]: V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _chunkGUZPDGVHcjs = require('./chunk-GUZPDGVH.cjs');var
|
|
1
|
+
"use strict";var _chunkGUZPDGVHcjs = require('./chunk-GUZPDGVH.cjs');var _chunkY7L64OLNcjs = require('./chunk-Y7L64OLN.cjs');require('./chunk-SW6GJ7UA.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');test("empty array",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()});test("fixed tuple",()=>{let e=["cat","dog"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()});describe("with simple keys",()=>{test("regular array",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["cat"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["cat","dog"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()})});describe("with literal union keys",()=>{test("regular array",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["cat"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["cat","mouse"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()})});describe("with string template keys",()=>{test("regular array",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["prefix_1"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["prefix_1","2_suffix"],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),describe("number keys",()=>{test("regular array",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=[1],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=[1,2],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()}),test("literals",()=>{let e=[1,2,3],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()})})});test("typescript doesn't choke on huge literal unions",()=>{let e=[],r=_chunkGUZPDGVHcjs.a.call(void 0, e,_chunkWLNQOMKLcjs.a.call(void 0, 1));expectTypeOf(r).toEqualTypeOf();let s=_chunkY7L64OLNcjs.a.call(void 0, e,_chunkGUZPDGVHcjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, 1)));expectTypeOf(s).toEqualTypeOf()});
|
package/dist/from-keys.spec-d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-TT2VLICK.js";import{a as o}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TT2VLICK.js";import{a as o}from"./chunk-FOP5KNRT.js";import"./chunk-T4LCVT74.js";import{a as t}from"./chunk-T5XG33UI.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";test("empty array",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()});test("fixed tuple",()=>{let e=["cat","dog"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()});describe("with simple keys",()=>{test("regular array",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["cat"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["cat","dog"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()})});describe("with literal union keys",()=>{test("regular array",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["cat"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["cat","mouse"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()})});describe("with string template keys",()=>{test("regular array",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=["prefix_1"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=["prefix_1","2_suffix"],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),describe("number keys",()=>{test("regular array",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("non-empty array",()=>{let e=[1],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("fixed tuple",()=>{let e=[1,2],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()}),test("literals",()=>{let e=[1,2,3],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()})})});test("typescript doesn't choke on huge literal unions",()=>{let e=[],r=a(e,t(1));expectTypeOf(r).toEqualTypeOf();let s=o(e,a(t(1)));expectTypeOf(s).toEqualTypeOf()});
|
package/dist/group-by.d.cts
CHANGED
package/dist/group-by.d.ts
CHANGED
package/dist/has-at-least.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-CC8iZVKO.cjs';
|
|
3
3
|
|
|
4
4
|
type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration['length'] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
|
|
5
5
|
Head,
|
package/dist/has-at-least.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsNumericLiteral } from 'type-fest';
|
|
2
|
-
import { I as IterableContainer } from './types-
|
|
2
|
+
import { I as IterableContainer } from './types-CC8iZVKO.js';
|
|
3
3
|
|
|
4
4
|
type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration['length'] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
|
|
5
5
|
Head,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { B as Branded } from './types-
|
|
2
|
+
import { B as Branded } from './types-CC8iZVKO.cjs';
|
|
3
3
|
|
|
4
4
|
declare const HAS_SUB_OBJECT_BRAND: unique symbol;
|
|
5
5
|
type HasSubObjectGuard<T, S> = Simplify<Branded<S & T, typeof HAS_SUB_OBJECT_BRAND>>;
|
package/dist/has-sub-object.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Simplify } from 'type-fest';
|
|
2
|
-
import { B as Branded } from './types-
|
|
2
|
+
import { B as Branded } from './types-CC8iZVKO.js';
|
|
3
3
|
|
|
4
4
|
declare const HAS_SUB_OBJECT_BRAND: unique symbol;
|
|
5
5
|
type HasSubObjectGuard<T, S> = Simplify<Branded<S & T, typeof HAS_SUB_OBJECT_BRAND>>;
|