@vinicunca/perkakas 0.4.0 → 0.4.3
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/index.cjs +2375 -0
- package/dist/index.d.cts +4603 -0
- package/dist/index.d.mts +4603 -0
- package/dist/index.d.ts +4603 -0
- package/dist/index.mjs +2231 -0
- package/dist/metadata.json +6 -6
- package/package.json +17 -7
- package/dist/commonjs/aria/index.js +0 -17
- package/dist/commonjs/aria/key-codes.js +0 -25
- package/dist/commonjs/array/all-pass.js +0 -11
- package/dist/commonjs/array/any-pass.js +0 -11
- package/dist/commonjs/array/chunk.js +0 -17
- package/dist/commonjs/array/concat.js +0 -11
- package/dist/commonjs/array/difference-with.js +0 -21
- package/dist/commonjs/array/drop-first-by.js +0 -26
- package/dist/commonjs/array/drop-last-while.js +0 -16
- package/dist/commonjs/array/drop-last.js +0 -15
- package/dist/commonjs/array/drop-while.js +0 -16
- package/dist/commonjs/array/drop.js +0 -25
- package/dist/commonjs/array/filter.js +0 -28
- package/dist/commonjs/array/find-index.js +0 -33
- package/dist/commonjs/array/find-last-index.js +0 -24
- package/dist/commonjs/array/find-last.js +0 -24
- package/dist/commonjs/array/find.js +0 -26
- package/dist/commonjs/array/first-by.js +0 -22
- package/dist/commonjs/array/first.js +0 -20
- package/dist/commonjs/array/flat-map-to-obj.js +0 -26
- package/dist/commonjs/array/flat-map.js +0 -23
- package/dist/commonjs/array/flatten-deep.js +0 -38
- package/dist/commonjs/array/flatten.js +0 -20
- package/dist/commonjs/array/for-each.js +0 -36
- package/dist/commonjs/array/group-by.js +0 -33
- package/dist/commonjs/array/has-at-least.js +0 -11
- package/dist/commonjs/array/index-by.js +0 -37
- package/dist/commonjs/array/index.js +0 -81
- package/dist/commonjs/array/intersection-with.js +0 -21
- package/dist/commonjs/array/join.js +0 -11
- package/dist/commonjs/array/last.js +0 -11
- package/dist/commonjs/array/length.js +0 -11
- package/dist/commonjs/array/map-to-obj.js +0 -24
- package/dist/commonjs/array/map.js +0 -31
- package/dist/commonjs/array/max-by.js +0 -28
- package/dist/commonjs/array/mean-by.js +0 -26
- package/dist/commonjs/array/merge-all.js +0 -11
- package/dist/commonjs/array/min-by.js +0 -28
- package/dist/commonjs/array/nth-by.js +0 -12
- package/dist/commonjs/array/only.js +0 -11
- package/dist/commonjs/array/partition.js +0 -24
- package/dist/commonjs/array/range.js +0 -15
- package/dist/commonjs/array/rank-by.js +0 -17
- package/dist/commonjs/array/reduce.js +0 -19
- package/dist/commonjs/array/reject.js +0 -28
- package/dist/commonjs/array/reverse.js +0 -11
- package/dist/commonjs/array/sample.js +0 -34
- package/dist/commonjs/array/shuffle.js +0 -18
- package/dist/commonjs/array/sort-by.js +0 -14
- package/dist/commonjs/array/sort.js +0 -16
- package/dist/commonjs/array/sorted-index-by.js +0 -19
- package/dist/commonjs/array/sorted-index-with.js +0 -15
- package/dist/commonjs/array/sorted-index.js +0 -12
- package/dist/commonjs/array/sorted-last-index-by.js +0 -19
- package/dist/commonjs/array/sorted-last-index.js +0 -12
- package/dist/commonjs/array/splice.js +0 -13
- package/dist/commonjs/array/split-at.js +0 -13
- package/dist/commonjs/array/split-when.js +0 -17
- package/dist/commonjs/array/sum-by.js +0 -24
- package/dist/commonjs/array/swap-indices.js +0 -34
- package/dist/commonjs/array/take-first-by.js +0 -24
- package/dist/commonjs/array/take-while.js +0 -18
- package/dist/commonjs/array/take.js +0 -25
- package/dist/commonjs/array/uniq-by.js +0 -23
- package/dist/commonjs/array/uniq-with.js +0 -23
- package/dist/commonjs/array/uniq.js +0 -25
- package/dist/commonjs/array/zip-obj.js +0 -16
- package/dist/commonjs/array/zip-with.js +0 -23
- package/dist/commonjs/array/zip.js +0 -19
- package/dist/commonjs/function/conditional.js +0 -34
- package/dist/commonjs/function/create-pipe.js +0 -8
- package/dist/commonjs/function/debounce.js +0 -88
- package/dist/commonjs/function/identity.js +0 -7
- package/dist/commonjs/function/index.js +0 -26
- package/dist/commonjs/function/noop.js +0 -7
- package/dist/commonjs/function/once.js +0 -15
- package/dist/commonjs/function/pipe.js +0 -100
- package/dist/commonjs/function/purry.js +0 -19
- package/dist/commonjs/function/sleep.js +0 -9
- package/dist/commonjs/function/times.js +0 -18
- package/dist/commonjs/guard/has-sub-object.js +0 -19
- package/dist/commonjs/guard/index.js +0 -35
- package/dist/commonjs/guard/is-array.js +0 -7
- package/dist/commonjs/guard/is-boolean.js +0 -7
- package/dist/commonjs/guard/is-date.js +0 -7
- package/dist/commonjs/guard/is-deep-equal.js +0 -55
- package/dist/commonjs/guard/is-defined.js +0 -13
- package/dist/commonjs/guard/is-empty.js +0 -19
- package/dist/commonjs/guard/is-error.js +0 -7
- package/dist/commonjs/guard/is-function.js +0 -7
- package/dist/commonjs/guard/is-included-in.js +0 -11
- package/dist/commonjs/guard/is-nil.js +0 -7
- package/dist/commonjs/guard/is-non-null.js +0 -7
- package/dist/commonjs/guard/is-not.js +0 -7
- package/dist/commonjs/guard/is-number.js +0 -7
- package/dist/commonjs/guard/is-object.js +0 -11
- package/dist/commonjs/guard/is-promise.js +0 -7
- package/dist/commonjs/guard/is-string.js +0 -7
- package/dist/commonjs/guard/is-symbol.js +0 -7
- package/dist/commonjs/guard/is-truthy.js +0 -7
- package/dist/commonjs/index.js +0 -26
- package/dist/commonjs/number/add.js +0 -11
- package/dist/commonjs/number/ceil.js +0 -9
- package/dist/commonjs/number/clamp.js +0 -17
- package/dist/commonjs/number/divide.js +0 -11
- package/dist/commonjs/number/floor.js +0 -9
- package/dist/commonjs/number/index.js +0 -24
- package/dist/commonjs/number/multiply.js +0 -11
- package/dist/commonjs/number/round.js +0 -9
- package/dist/commonjs/number/subtract.js +0 -11
- package/dist/commonjs/object/add-prop.js +0 -14
- package/dist/commonjs/object/clone.js +0 -49
- package/dist/commonjs/object/for-each-obj.js +0 -30
- package/dist/commonjs/object/from-keys.js +0 -15
- package/dist/commonjs/object/from-pairs.js +0 -18
- package/dist/commonjs/object/index.js +0 -39
- package/dist/commonjs/object/invert.js +0 -17
- package/dist/commonjs/object/keys.js +0 -11
- package/dist/commonjs/object/map-keys.js +0 -16
- package/dist/commonjs/object/map-values.js +0 -16
- package/dist/commonjs/object/merge-deep.js +0 -31
- package/dist/commonjs/object/merge.js +0 -11
- package/dist/commonjs/object/omit-by.js +0 -22
- package/dist/commonjs/object/omit.js +0 -25
- package/dist/commonjs/object/path-or.js +0 -18
- package/dist/commonjs/object/pick-by.js +0 -22
- package/dist/commonjs/object/pick.js +0 -17
- package/dist/commonjs/object/prop.js +0 -7
- package/dist/commonjs/object/set-path.js +0 -25
- package/dist/commonjs/object/set.js +0 -14
- package/dist/commonjs/object/swap-props.js +0 -16
- package/dist/commonjs/object/to-pairs.js +0 -11
- package/dist/commonjs/object/values.js +0 -7
- package/dist/commonjs/string/cases-types.js +0 -2
- package/dist/commonjs/string/cases.js +0 -107
- package/dist/commonjs/string/human-readable-file-size.js +0 -16
- package/dist/commonjs/string/index.js +0 -21
- package/dist/commonjs/string/random-string.js +0 -16
- package/dist/commonjs/string/slugify.js +0 -13
- package/dist/commonjs/string/string-to-path.js +0 -18
- package/dist/commonjs/type/index.js +0 -17
- package/dist/commonjs/type/type.js +0 -13
- package/dist/commonjs/utils/binary-search-cutoff-index.js +0 -19
- package/dist/commonjs/utils/heap.js +0 -43
- package/dist/commonjs/utils/narrow.js +0 -2
- package/dist/commonjs/utils/paths.js +0 -2
- package/dist/commonjs/utils/purry-on.js +0 -10
- package/dist/commonjs/utils/purry-order-rules.js +0 -66
- package/dist/commonjs/utils/quick-select.js +0 -31
- package/dist/commonjs/utils/reduce-lazy.js +0 -21
- package/dist/commonjs/utils/swap-in-place.js +0 -7
- package/dist/commonjs/utils/to-lazy-indexed.js +0 -7
- package/dist/commonjs/utils/to-single.js +0 -7
- package/dist/commonjs/utils/types.js +0 -2
- package/dist/commonjs/utils/with-precision.js +0 -23
- package/dist/es/aria/index.js +0 -1
- package/dist/es/aria/key-codes.js +0 -22
- package/dist/es/array/all-pass.js +0 -7
- package/dist/es/array/any-pass.js +0 -7
- package/dist/es/array/chunk.js +0 -13
- package/dist/es/array/concat.js +0 -7
- package/dist/es/array/difference-with.js +0 -17
- package/dist/es/array/drop-first-by.js +0 -22
- package/dist/es/array/drop-last-while.js +0 -12
- package/dist/es/array/drop-last.js +0 -11
- package/dist/es/array/drop-while.js +0 -12
- package/dist/es/array/drop.js +0 -21
- package/dist/es/array/filter.js +0 -24
- package/dist/es/array/find-index.js +0 -29
- package/dist/es/array/find-last-index.js +0 -20
- package/dist/es/array/find-last.js +0 -20
- package/dist/es/array/find.js +0 -22
- package/dist/es/array/first-by.js +0 -18
- package/dist/es/array/first.js +0 -16
- package/dist/es/array/flat-map-to-obj.js +0 -22
- package/dist/es/array/flat-map.js +0 -19
- package/dist/es/array/flatten-deep.js +0 -34
- package/dist/es/array/flatten.js +0 -16
- package/dist/es/array/for-each.js +0 -32
- package/dist/es/array/group-by.js +0 -29
- package/dist/es/array/has-at-least.js +0 -7
- package/dist/es/array/index-by.js +0 -33
- package/dist/es/array/index.js +0 -65
- package/dist/es/array/intersection-with.js +0 -17
- package/dist/es/array/join.js +0 -7
- package/dist/es/array/last.js +0 -7
- package/dist/es/array/length.js +0 -7
- package/dist/es/array/map-to-obj.js +0 -20
- package/dist/es/array/map.js +0 -27
- package/dist/es/array/max-by.js +0 -24
- package/dist/es/array/mean-by.js +0 -22
- package/dist/es/array/merge-all.js +0 -7
- package/dist/es/array/min-by.js +0 -24
- package/dist/es/array/nth-by.js +0 -8
- package/dist/es/array/only.js +0 -7
- package/dist/es/array/partition.js +0 -20
- package/dist/es/array/range.js +0 -11
- package/dist/es/array/rank-by.js +0 -13
- package/dist/es/array/reduce.js +0 -15
- package/dist/es/array/reject.js +0 -24
- package/dist/es/array/reverse.js +0 -7
- package/dist/es/array/sample.js +0 -30
- package/dist/es/array/shuffle.js +0 -14
- package/dist/es/array/sort-by.js +0 -10
- package/dist/es/array/sort.js +0 -12
- package/dist/es/array/sorted-index-by.js +0 -15
- package/dist/es/array/sorted-index-with.js +0 -11
- package/dist/es/array/sorted-index.js +0 -8
- package/dist/es/array/sorted-last-index-by.js +0 -15
- package/dist/es/array/sorted-last-index.js +0 -8
- package/dist/es/array/splice.js +0 -9
- package/dist/es/array/split-at.js +0 -9
- package/dist/es/array/split-when.js +0 -13
- package/dist/es/array/sum-by.js +0 -20
- package/dist/es/array/swap-indices.js +0 -30
- package/dist/es/array/take-first-by.js +0 -20
- package/dist/es/array/take-while.js +0 -14
- package/dist/es/array/take.js +0 -21
- package/dist/es/array/uniq-by.js +0 -19
- package/dist/es/array/uniq-with.js +0 -19
- package/dist/es/array/uniq.js +0 -21
- package/dist/es/array/zip-obj.js +0 -12
- package/dist/es/array/zip-with.js +0 -19
- package/dist/es/array/zip.js +0 -15
- package/dist/es/function/conditional.js +0 -30
- package/dist/es/function/create-pipe.js +0 -4
- package/dist/es/function/debounce.js +0 -84
- package/dist/es/function/identity.js +0 -3
- package/dist/es/function/index.js +0 -10
- package/dist/es/function/noop.js +0 -3
- package/dist/es/function/once.js +0 -11
- package/dist/es/function/pipe.js +0 -96
- package/dist/es/function/purry.js +0 -15
- package/dist/es/function/sleep.js +0 -5
- package/dist/es/function/times.js +0 -14
- package/dist/es/guard/has-sub-object.js +0 -15
- package/dist/es/guard/index.js +0 -19
- package/dist/es/guard/is-array.js +0 -3
- package/dist/es/guard/is-boolean.js +0 -3
- package/dist/es/guard/is-date.js +0 -3
- package/dist/es/guard/is-deep-equal.js +0 -51
- package/dist/es/guard/is-defined.js +0 -9
- package/dist/es/guard/is-empty.js +0 -15
- package/dist/es/guard/is-error.js +0 -3
- package/dist/es/guard/is-function.js +0 -3
- package/dist/es/guard/is-included-in.js +0 -7
- package/dist/es/guard/is-nil.js +0 -3
- package/dist/es/guard/is-non-null.js +0 -3
- package/dist/es/guard/is-not.js +0 -3
- package/dist/es/guard/is-number.js +0 -3
- package/dist/es/guard/is-object.js +0 -7
- package/dist/es/guard/is-promise.js +0 -3
- package/dist/es/guard/is-string.js +0 -3
- package/dist/es/guard/is-symbol.js +0 -3
- package/dist/es/guard/is-truthy.js +0 -3
- package/dist/es/index.js +0 -9
- package/dist/es/number/add.js +0 -7
- package/dist/es/number/ceil.js +0 -5
- package/dist/es/number/clamp.js +0 -13
- package/dist/es/number/divide.js +0 -7
- package/dist/es/number/floor.js +0 -5
- package/dist/es/number/index.js +0 -8
- package/dist/es/number/multiply.js +0 -7
- package/dist/es/number/round.js +0 -5
- package/dist/es/number/subtract.js +0 -7
- package/dist/es/object/add-prop.js +0 -10
- package/dist/es/object/clone.js +0 -45
- package/dist/es/object/for-each-obj.js +0 -26
- package/dist/es/object/from-keys.js +0 -11
- package/dist/es/object/from-pairs.js +0 -14
- package/dist/es/object/index.js +0 -23
- package/dist/es/object/invert.js +0 -13
- package/dist/es/object/keys.js +0 -7
- package/dist/es/object/map-keys.js +0 -12
- package/dist/es/object/map-values.js +0 -12
- package/dist/es/object/merge-deep.js +0 -27
- package/dist/es/object/merge.js +0 -7
- package/dist/es/object/omit-by.js +0 -18
- package/dist/es/object/omit.js +0 -21
- package/dist/es/object/path-or.js +0 -14
- package/dist/es/object/pick-by.js +0 -18
- package/dist/es/object/pick.js +0 -13
- package/dist/es/object/prop.js +0 -3
- package/dist/es/object/set-path.js +0 -20
- package/dist/es/object/set.js +0 -10
- package/dist/es/object/swap-props.js +0 -12
- package/dist/es/object/to-pairs.js +0 -7
- package/dist/es/object/values.js +0 -3
- package/dist/es/string/cases-types.js +0 -1
- package/dist/es/string/cases.js +0 -93
- package/dist/es/string/human-readable-file-size.js +0 -12
- package/dist/es/string/index.js +0 -5
- package/dist/es/string/random-string.js +0 -12
- package/dist/es/string/slugify.js +0 -9
- package/dist/es/string/string-to-path.js +0 -14
- package/dist/es/type/index.js +0 -1
- package/dist/es/type/type.js +0 -9
- package/dist/es/utils/binary-search-cutoff-index.js +0 -15
- package/dist/es/utils/heap.js +0 -38
- package/dist/es/utils/narrow.js +0 -1
- package/dist/es/utils/paths.js +0 -1
- package/dist/es/utils/purry-on.js +0 -6
- package/dist/es/utils/purry-order-rules.js +0 -61
- package/dist/es/utils/quick-select.js +0 -27
- package/dist/es/utils/reduce-lazy.js +0 -17
- package/dist/es/utils/swap-in-place.js +0 -3
- package/dist/es/utils/to-lazy-indexed.js +0 -3
- package/dist/es/utils/to-single.js +0 -3
- package/dist/es/utils/types.js +0 -1
- package/dist/es/utils/with-precision.js +0 -19
- package/dist/types/aria/index.d.ts +0 -2
- package/dist/types/aria/index.d.ts.map +0 -1
- package/dist/types/aria/key-codes.d.ts +0 -26
- package/dist/types/aria/key-codes.d.ts.map +0 -1
- package/dist/types/array/all-pass.d.ts +0 -32
- package/dist/types/array/all-pass.d.ts.map +0 -1
- package/dist/types/array/any-pass.d.ts +0 -32
- package/dist/types/array/any-pass.d.ts.map +0 -1
- package/dist/types/array/chunk.d.ts +0 -29
- package/dist/types/array/chunk.d.ts.map +0 -1
- package/dist/types/array/concat.d.ts +0 -24
- package/dist/types/array/concat.d.ts.map +0 -1
- package/dist/types/array/difference-with.d.ts +0 -48
- package/dist/types/array/difference-with.d.ts.map +0 -1
- package/dist/types/array/drop-first-by.d.ts +0 -38
- package/dist/types/array/drop-first-by.d.ts.map +0 -1
- package/dist/types/array/drop-last-while.d.ts +0 -30
- package/dist/types/array/drop-last-while.d.ts.map +0 -1
- package/dist/types/array/drop-last.d.ts +0 -26
- package/dist/types/array/drop-last.d.ts.map +0 -1
- package/dist/types/array/drop-while.d.ts +0 -33
- package/dist/types/array/drop-while.d.ts.map +0 -1
- package/dist/types/array/drop.d.ts +0 -32
- package/dist/types/array/drop.d.ts.map +0 -1
- package/dist/types/array/filter.d.ts +0 -63
- package/dist/types/array/filter.d.ts.map +0 -1
- package/dist/types/array/find-index.d.ts +0 -54
- package/dist/types/array/find-index.d.ts.map +0 -1
- package/dist/types/array/find-last-index.d.ts +0 -45
- package/dist/types/array/find-last-index.d.ts.map +0 -1
- package/dist/types/array/find-last.d.ts +0 -45
- package/dist/types/array/find-last.d.ts.map +0 -1
- package/dist/types/array/find.d.ts +0 -52
- package/dist/types/array/find.d.ts.map +0 -1
- package/dist/types/array/first-by.d.ts +0 -56
- package/dist/types/array/first-by.d.ts.map +0 -1
- package/dist/types/array/first.d.ts +0 -32
- package/dist/types/array/first.d.ts.map +0 -1
- package/dist/types/array/flat-map-to-obj.d.ts +0 -50
- package/dist/types/array/flat-map-to-obj.d.ts.map +0 -1
- package/dist/types/array/flat-map.d.ts +0 -32
- package/dist/types/array/flat-map.d.ts.map +0 -1
- package/dist/types/array/flatten-deep.d.ts +0 -37
- package/dist/types/array/flatten-deep.d.ts.map +0 -1
- package/dist/types/array/flatten.d.ts +0 -39
- package/dist/types/array/flatten.d.ts.map +0 -1
- package/dist/types/array/for-each.d.ts +0 -57
- package/dist/types/array/for-each.d.ts.map +0 -1
- package/dist/types/array/group-by.d.ts +0 -37
- package/dist/types/array/group-by.d.ts.map +0 -1
- package/dist/types/array/has-at-least.d.ts +0 -46
- package/dist/types/array/has-at-least.d.ts.map +0 -1
- package/dist/types/array/index-by.d.ts +0 -52
- package/dist/types/array/index-by.d.ts.map +0 -1
- package/dist/types/array/index.d.ts +0 -66
- package/dist/types/array/index.d.ts.map +0 -1
- package/dist/types/array/intersection-with.d.ts +0 -54
- package/dist/types/array/intersection-with.d.ts.map +0 -1
- package/dist/types/array/join.d.ts +0 -45
- package/dist/types/array/join.d.ts.map +0 -1
- package/dist/types/array/last.d.ts +0 -34
- package/dist/types/array/last.d.ts.map +0 -1
- package/dist/types/array/length.d.ts +0 -15
- package/dist/types/array/length.d.ts.map +0 -1
- package/dist/types/array/map-to-obj.d.ts +0 -42
- package/dist/types/array/map-to-obj.d.ts.map +0 -1
- package/dist/types/array/map.d.ts +0 -62
- package/dist/types/array/map.d.ts.map +0 -1
- package/dist/types/array/max-by.d.ts +0 -39
- package/dist/types/array/max-by.d.ts.map +0 -1
- package/dist/types/array/mean-by.d.ts +0 -39
- package/dist/types/array/mean-by.d.ts.map +0 -1
- package/dist/types/array/merge-all.d.ts +0 -16
- package/dist/types/array/merge-all.d.ts.map +0 -1
- package/dist/types/array/min-by.d.ts +0 -39
- package/dist/types/array/min-by.d.ts.map +0 -1
- package/dist/types/array/nth-by.d.ts +0 -44
- package/dist/types/array/nth-by.d.ts.map +0 -1
- package/dist/types/array/only.d.ts +0 -37
- package/dist/types/array/only.d.ts.map +0 -1
- package/dist/types/array/partition.d.ts +0 -60
- package/dist/types/array/partition.d.ts.map +0 -1
- package/dist/types/array/range.d.ts +0 -22
- package/dist/types/array/range.d.ts.map +0 -1
- package/dist/types/array/rank-by.d.ts +0 -40
- package/dist/types/array/rank-by.d.ts.map +0 -1
- package/dist/types/array/reduce.d.ts +0 -37
- package/dist/types/array/reduce.d.ts.map +0 -1
- package/dist/types/array/reject.d.ts +0 -42
- package/dist/types/array/reject.d.ts.map +0 -1
- package/dist/types/array/reverse.d.ts +0 -27
- package/dist/types/array/reverse.d.ts.map +0 -1
- package/dist/types/array/sample.d.ts +0 -54
- package/dist/types/array/sample.d.ts.map +0 -1
- package/dist/types/array/shuffle.d.ts +0 -22
- package/dist/types/array/shuffle.d.ts.map +0 -1
- package/dist/types/array/sort-by.d.ts +0 -98
- package/dist/types/array/sort-by.d.ts.map +0 -1
- package/dist/types/array/sort.d.ts +0 -52
- package/dist/types/array/sort.d.ts.map +0 -1
- package/dist/types/array/sorted-index-by.d.ts +0 -62
- package/dist/types/array/sorted-index-by.d.ts.map +0 -1
- package/dist/types/array/sorted-index-with.d.ts +0 -64
- package/dist/types/array/sorted-index-with.d.ts.map +0 -1
- package/dist/types/array/sorted-index.d.ts +0 -46
- package/dist/types/array/sorted-index.d.ts.map +0 -1
- package/dist/types/array/sorted-last-index-by.d.ts +0 -62
- package/dist/types/array/sorted-last-index-by.d.ts.map +0 -1
- package/dist/types/array/sorted-last-index.d.ts +0 -46
- package/dist/types/array/sorted-last-index.d.ts.map +0 -1
- package/dist/types/array/splice.d.ts +0 -32
- package/dist/types/array/splice.d.ts.map +0 -1
- package/dist/types/array/split-at.d.ts +0 -28
- package/dist/types/array/split-at.d.ts.map +0 -1
- package/dist/types/array/split-when.d.ts +0 -24
- package/dist/types/array/split-when.d.ts.map +0 -1
- package/dist/types/array/sum-by.d.ts +0 -39
- package/dist/types/array/sum-by.d.ts.map +0 -1
- package/dist/types/array/swap-indices.d.ts +0 -68
- package/dist/types/array/swap-indices.d.ts.map +0 -1
- package/dist/types/array/take-first-by.d.ts +0 -42
- package/dist/types/array/take-first-by.d.ts.map +0 -1
- package/dist/types/array/take-while.d.ts +0 -24
- package/dist/types/array/take-while.d.ts.map +0 -1
- package/dist/types/array/take.d.ts +0 -30
- package/dist/types/array/take.d.ts.map +0 -1
- package/dist/types/array/uniq-by.d.ts +0 -22
- package/dist/types/array/uniq-by.d.ts.map +0 -1
- package/dist/types/array/uniq-with.d.ts +0 -44
- package/dist/types/array/uniq-with.d.ts.map +0 -1
- package/dist/types/array/uniq.d.ts +0 -35
- package/dist/types/array/uniq.d.ts.map +0 -1
- package/dist/types/array/zip-obj.d.ts +0 -26
- package/dist/types/array/zip-obj.d.ts.map +0 -1
- package/dist/types/array/zip-with.d.ts +0 -42
- package/dist/types/array/zip-with.d.ts.map +0 -1
- package/dist/types/array/zip.d.ts +0 -52
- package/dist/types/array/zip.d.ts.map +0 -1
- package/dist/types/function/conditional.d.ts +0 -107
- package/dist/types/function/conditional.d.ts.map +0 -1
- package/dist/types/function/create-pipe.d.ts +0 -19
- package/dist/types/function/create-pipe.d.ts.map +0 -1
- package/dist/types/function/debounce.d.ts +0 -92
- package/dist/types/function/debounce.d.ts.map +0 -1
- package/dist/types/function/identity.d.ts +0 -10
- package/dist/types/function/identity.d.ts.map +0 -1
- package/dist/types/function/index.d.ts +0 -11
- package/dist/types/function/index.d.ts.map +0 -1
- package/dist/types/function/noop.d.ts +0 -10
- package/dist/types/function/noop.d.ts.map +0 -1
- package/dist/types/function/once.d.ts +0 -13
- package/dist/types/function/once.d.ts.map +0 -1
- package/dist/types/function/pipe.d.ts +0 -53
- package/dist/types/function/pipe.d.ts.map +0 -1
- package/dist/types/function/purry.d.ts +0 -48
- package/dist/types/function/purry.d.ts.map +0 -1
- package/dist/types/function/sleep.d.ts +0 -12
- package/dist/types/function/sleep.d.ts.map +0 -1
- package/dist/types/function/times.d.ts +0 -28
- package/dist/types/function/times.d.ts.map +0 -1
- package/dist/types/guard/has-sub-object.d.ts +0 -35
- package/dist/types/guard/has-sub-object.d.ts.map +0 -1
- package/dist/types/guard/index.d.ts +0 -20
- package/dist/types/guard/index.d.ts.map +0 -1
- package/dist/types/guard/is-array.d.ts +0 -15
- package/dist/types/guard/is-array.d.ts.map +0 -1
- package/dist/types/guard/is-boolean.d.ts +0 -15
- package/dist/types/guard/is-boolean.d.ts.map +0 -1
- package/dist/types/guard/is-date.d.ts +0 -13
- package/dist/types/guard/is-date.d.ts.map +0 -1
- package/dist/types/guard/is-deep-equal.d.ts +0 -50
- package/dist/types/guard/is-deep-equal.d.ts.map +0 -1
- package/dist/types/guard/is-defined.d.ts +0 -22
- package/dist/types/guard/is-defined.d.ts.map +0 -1
- package/dist/types/guard/is-empty.d.ts +0 -30
- package/dist/types/guard/is-empty.d.ts.map +0 -1
- package/dist/types/guard/is-error.d.ts +0 -15
- package/dist/types/guard/is-error.d.ts.map +0 -1
- package/dist/types/guard/is-function.d.ts +0 -15
- package/dist/types/guard/is-function.d.ts.map +0 -1
- package/dist/types/guard/is-included-in.d.ts +0 -54
- package/dist/types/guard/is-included-in.d.ts.map +0 -1
- package/dist/types/guard/is-nil.d.ts +0 -14
- package/dist/types/guard/is-nil.d.ts.map +0 -1
- package/dist/types/guard/is-non-null.d.ts +0 -15
- package/dist/types/guard/is-non-null.d.ts.map +0 -1
- package/dist/types/guard/is-not.d.ts +0 -15
- package/dist/types/guard/is-not.d.ts.map +0 -1
- package/dist/types/guard/is-number.d.ts +0 -14
- package/dist/types/guard/is-number.d.ts.map +0 -1
- package/dist/types/guard/is-object.d.ts +0 -28
- package/dist/types/guard/is-object.d.ts.map +0 -1
- package/dist/types/guard/is-promise.d.ts +0 -14
- package/dist/types/guard/is-promise.d.ts.map +0 -1
- package/dist/types/guard/is-string.d.ts +0 -14
- package/dist/types/guard/is-string.d.ts.map +0 -1
- package/dist/types/guard/is-symbol.d.ts +0 -14
- package/dist/types/guard/is-symbol.d.ts.map +0 -1
- package/dist/types/guard/is-truthy.d.ts +0 -17
- package/dist/types/guard/is-truthy.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/number/add.d.ts +0 -28
- package/dist/types/number/add.d.ts.map +0 -1
- package/dist/types/number/ceil.d.ts +0 -36
- package/dist/types/number/ceil.d.ts.map +0 -1
- package/dist/types/number/clamp.d.ts +0 -37
- package/dist/types/number/clamp.d.ts.map +0 -1
- package/dist/types/number/divide.d.ts +0 -26
- package/dist/types/number/divide.d.ts.map +0 -1
- package/dist/types/number/floor.d.ts +0 -36
- package/dist/types/number/floor.d.ts.map +0 -1
- package/dist/types/number/index.d.ts +0 -9
- package/dist/types/number/index.d.ts.map +0 -1
- package/dist/types/number/multiply.d.ts +0 -28
- package/dist/types/number/multiply.d.ts.map +0 -1
- package/dist/types/number/round.d.ts +0 -36
- package/dist/types/number/round.d.ts.map +0 -1
- package/dist/types/number/subtract.d.ts +0 -30
- package/dist/types/number/subtract.d.ts.map +0 -1
- package/dist/types/object/add-prop.d.ts +0 -30
- package/dist/types/object/add-prop.d.ts.map +0 -1
- package/dist/types/object/clone.d.ts +0 -10
- package/dist/types/object/clone.d.ts.map +0 -1
- package/dist/types/object/for-each-obj.d.ts +0 -44
- package/dist/types/object/for-each-obj.d.ts.map +0 -1
- package/dist/types/object/from-keys.d.ts +0 -42
- package/dist/types/object/from-keys.d.ts.map +0 -1
- package/dist/types/object/from-pairs.d.ts +0 -47
- package/dist/types/object/from-pairs.d.ts.map +0 -1
- package/dist/types/object/index.d.ts +0 -24
- package/dist/types/object/index.d.ts.map +0 -1
- package/dist/types/object/invert.d.ts +0 -30
- package/dist/types/object/invert.d.ts.map +0 -1
- package/dist/types/object/keys.d.ts +0 -39
- package/dist/types/object/keys.d.ts.map +0 -1
- package/dist/types/object/map-keys.d.ts +0 -24
- package/dist/types/object/map-keys.d.ts.map +0 -1
- package/dist/types/object/map-values.d.ts +0 -25
- package/dist/types/object/map-values.d.ts.map +0 -1
- package/dist/types/object/merge-deep.d.ts +0 -32
- package/dist/types/object/merge-deep.d.ts.map +0 -1
- package/dist/types/object/merge.d.ts +0 -52
- package/dist/types/object/merge.d.ts.map +0 -1
- package/dist/types/object/omit-by.d.ts +0 -22
- package/dist/types/object/omit-by.d.ts.map +0 -1
- package/dist/types/object/omit.d.ts +0 -24
- package/dist/types/object/omit.d.ts.map +0 -1
- package/dist/types/object/path-or.d.ts +0 -78
- package/dist/types/object/path-or.d.ts.map +0 -1
- package/dist/types/object/pick-by.d.ts +0 -24
- package/dist/types/object/pick-by.d.ts.map +0 -1
- package/dist/types/object/pick.d.ts +0 -22
- package/dist/types/object/pick.d.ts.map +0 -1
- package/dist/types/object/prop.d.ts +0 -11
- package/dist/types/object/prop.d.ts.map +0 -1
- package/dist/types/object/set-path.d.ts +0 -31
- package/dist/types/object/set-path.d.ts.map +0 -1
- package/dist/types/object/set.d.ts +0 -26
- package/dist/types/object/set.d.ts.map +0 -1
- package/dist/types/object/swap-props.d.ts +0 -44
- package/dist/types/object/swap-props.d.ts.map +0 -1
- package/dist/types/object/to-pairs.d.ts +0 -33
- package/dist/types/object/to-pairs.d.ts.map +0 -1
- package/dist/types/object/values.d.ts +0 -21
- package/dist/types/object/values.d.ts.map +0 -1
- package/dist/types/string/cases-types.d.ts +0 -36
- package/dist/types/string/cases-types.d.ts.map +0 -1
- package/dist/types/string/cases.d.ts +0 -22
- package/dist/types/string/cases.d.ts.map +0 -1
- package/dist/types/string/human-readable-file-size.d.ts +0 -13
- package/dist/types/string/human-readable-file-size.d.ts.map +0 -1
- package/dist/types/string/index.d.ts +0 -6
- package/dist/types/string/index.d.ts.map +0 -1
- package/dist/types/string/random-string.d.ts +0 -15
- package/dist/types/string/random-string.d.ts.map +0 -1
- package/dist/types/string/slugify.d.ts +0 -12
- package/dist/types/string/slugify.d.ts.map +0 -1
- package/dist/types/string/string-to-path.d.ts +0 -11
- package/dist/types/string/string-to-path.d.ts.map +0 -1
- package/dist/types/type/index.d.ts +0 -2
- package/dist/types/type/index.d.ts.map +0 -1
- package/dist/types/type/type.d.ts +0 -19
- package/dist/types/type/type.d.ts.map +0 -1
- package/dist/types/utils/binary-search-cutoff-index.d.ts +0 -2
- package/dist/types/utils/binary-search-cutoff-index.d.ts.map +0 -1
- package/dist/types/utils/heap.d.ts +0 -24
- package/dist/types/utils/heap.d.ts.map +0 -1
- package/dist/types/utils/narrow.d.ts +0 -52
- package/dist/types/utils/narrow.d.ts.map +0 -1
- package/dist/types/utils/paths.d.ts +0 -9
- package/dist/types/utils/paths.d.ts.map +0 -1
- package/dist/types/utils/purry-on.d.ts +0 -7
- package/dist/types/utils/purry-on.d.ts.map +0 -1
- package/dist/types/utils/purry-order-rules.d.ts +0 -52
- package/dist/types/utils/purry-order-rules.d.ts.map +0 -1
- package/dist/types/utils/quick-select.d.ts +0 -18
- package/dist/types/utils/quick-select.d.ts.map +0 -1
- package/dist/types/utils/reduce-lazy.d.ts +0 -3
- package/dist/types/utils/reduce-lazy.d.ts.map +0 -1
- package/dist/types/utils/swap-in-place.d.ts +0 -5
- package/dist/types/utils/swap-in-place.d.ts.map +0 -1
- package/dist/types/utils/to-lazy-indexed.d.ts +0 -4
- package/dist/types/utils/to-lazy-indexed.d.ts.map +0 -1
- package/dist/types/utils/to-single.d.ts +0 -6
- package/dist/types/utils/to-single.d.ts.map +0 -1
- package/dist/types/utils/types.d.ts +0 -32
- package/dist/types/utils/types.d.ts.map +0 -1
- package/dist/types/utils/with-precision.d.ts +0 -2
- package/dist/types/utils/with-precision.d.ts.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { IterableContainer } from '../utils/types';
|
|
2
|
-
import type { Joined } from './join';
|
|
3
|
-
/**
|
|
4
|
-
* @link https://github.com/sindresorhus/type-fest/blob/main/source/is-equal.d.ts
|
|
5
|
-
*/
|
|
6
|
-
type isEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2 ? true : false;
|
|
7
|
-
type Difference<A extends number, B extends number> = TupleOfLength<A> extends [
|
|
8
|
-
...infer U,
|
|
9
|
-
...TupleOfLength<B>
|
|
10
|
-
] ? U['length'] : never;
|
|
11
|
-
type isLessThan<A extends number, B extends number> = isEqual<A, B> extends true ? false : 0 extends A ? true : 0 extends B ? false : isLessThan<Difference<A, 1>, Difference<B, 1>>;
|
|
12
|
-
type TupleOfLength<L extends number, T extends IterableContainer = []> = T['length'] extends L ? T : TupleOfLength<L, [...T, unknown]>;
|
|
13
|
-
type IsNonNegative<T extends number> = number extends T ? false : `${T}` extends `-${string}` ? false : true;
|
|
14
|
-
type CharactersTuple<T extends string> = string extends T ? Array<string> : T extends `${infer C}${infer R}` ? [C, ...CharactersTuple<R>] : [];
|
|
15
|
-
type SwapArrayInternal<T extends IterableContainer, Index1 extends number, Index2 extends number, Position extends ReadonlyArray<unknown> = [], Original extends IterableContainer = T> = T extends readonly [infer AtPosition, ...infer Rest] ? [
|
|
16
|
-
Position['length'] extends Index1 ? Original[Index2] : Position['length'] extends Index2 ? Original[Index1] : AtPosition,
|
|
17
|
-
...SwapArrayInternal<Rest, Index1, Index2, [
|
|
18
|
-
unknown,
|
|
19
|
-
...Position
|
|
20
|
-
], Original>
|
|
21
|
-
] : T;
|
|
22
|
-
type SwapString<T extends string, K1 extends number, K2 extends number> = Joined<SwapArray<CharactersTuple<T>, K1, K2>, ''>;
|
|
23
|
-
type SwapArray<T extends IterableContainer, K1 extends number, K2 extends number> = IsNonNegative<K1> extends false ? Array<T[number]> : IsNonNegative<K2> extends false ? Array<T[number]> : isLessThan<K1, T['length']> extends false ? T : isLessThan<K2, T['length']> extends false ? T : SwapArrayInternal<T, K1, K2>;
|
|
24
|
-
type SwappedIndices<T extends IterableContainer | string, K1 extends number, K2 extends number> = T extends string ? SwapString<T, K1, K2> : T extends IterableContainer ? SwapArray<T, K1, K2> : never;
|
|
25
|
-
/**
|
|
26
|
-
* Swaps the positions of two elements in an array or string at the provided indices.
|
|
27
|
-
*
|
|
28
|
-
* Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.
|
|
29
|
-
*
|
|
30
|
-
* If either index is out of bounds the result would be a shallow copy of the input, as-is.
|
|
31
|
-
*
|
|
32
|
-
* @param data the item to be manipulated. This can be an array, or a string.
|
|
33
|
-
* @param index1 the first index
|
|
34
|
-
* @param index2 the second index
|
|
35
|
-
*
|
|
36
|
-
* @signature
|
|
37
|
-
* swapIndices(data, index1, index2)
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']
|
|
41
|
-
* swapIndices(['a', 'b', 'c'], 1, -1) // => ['c', 'b', 'a']
|
|
42
|
-
* swapIndices('abc', 0, 1) // => 'bac'
|
|
43
|
-
*
|
|
44
|
-
* @category Array
|
|
45
|
-
*
|
|
46
|
-
* @returns Returns the manipulated array or string.
|
|
47
|
-
*
|
|
48
|
-
* @dataFirst
|
|
49
|
-
*/
|
|
50
|
-
export declare function swapIndices<T extends IterableContainer | string, K1 extends number, K2 extends number>(data: T, index1: K1, index2: K2): SwappedIndices<T, K1, K2>;
|
|
51
|
-
/**
|
|
52
|
-
* @param index1 the first index
|
|
53
|
-
* @param index2 the second index
|
|
54
|
-
*
|
|
55
|
-
* @signature
|
|
56
|
-
* swapIndices(index1, index2)(data)
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* swapIndices(0, 1)(['a', 'b', 'c']) // => ['b', 'a', 'c']
|
|
60
|
-
* swapIndices(0, -1)('abc') // => 'cba'
|
|
61
|
-
*
|
|
62
|
-
* @category Array
|
|
63
|
-
* @returns Returns the manipulated array or string.
|
|
64
|
-
* @dataLast
|
|
65
|
-
*/
|
|
66
|
-
export declare function swapIndices<K1 extends number, K2 extends number>(index1: K1, index2: K2): <T extends IterableContainer | string>(data: T) => SwappedIndices<T, K1, K2>;
|
|
67
|
-
export {};
|
|
68
|
-
//# sourceMappingURL=swap-indices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"swap-indices.d.ts","sourceRoot":"","sources":["../../../src/array/swap-indices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC;;GAEG;AACH,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAC5E,CAAC,GACD,CAAC,GACD,IAAI,GACJ,KAAK,CAAC;AAEV,KAAK,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,SAAS;IAC7E,GAAG,MAAM,CAAC;IACV,GAAG,aAAa,CAAC,CAAC,CAAC;CACpB,GACG,CAAC,CAAC,QAAQ,CAAC,GACX,KAAK,CAAC;AAEV,KAAK,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,GAC5E,KAAK,GACL,CAAC,SAAS,CAAC,GACT,IAAI,GACJ,CAAC,SAAS,CAAC,GACT,KAAK,GACL,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEv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;GAcG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAC9D,MAAM,EAAE,EAAE,EACV,MAAM,EAAE,EAAE,GACT,CAAC,CAAC,SAAS,iBAAiB,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { NonEmptyArray } from '../utils/types';
|
|
2
|
-
import { type OrderRule } from '../utils/purry-order-rules';
|
|
3
|
-
/**
|
|
4
|
-
* Take the first `n` items from `data` based on the provided ordering criteria.
|
|
5
|
-
* This allows you to avoid sorting the array before taking the items.
|
|
6
|
-
* The complexity of this function is *O(Nlogn)* where `N` is the length of the array.
|
|
7
|
-
*
|
|
8
|
-
* For the opposite operation (to drop `n` elements) see `dropFirstBy`.
|
|
9
|
-
*
|
|
10
|
-
* @params data - the input array
|
|
11
|
-
* @params n - the number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.
|
|
12
|
-
* @param rules - A variadic array of order rules defining the sorting criteria.
|
|
13
|
-
* Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, "desc"]` for descending order.
|
|
14
|
-
* @returns a subset of the input array.
|
|
15
|
-
* @signature
|
|
16
|
-
* P.takeFirstBy(data, n, ...rules);
|
|
17
|
-
* @example
|
|
18
|
-
* P.takeFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['a', 'aa']
|
|
19
|
-
* @dataFirst
|
|
20
|
-
* @category Array
|
|
21
|
-
*/
|
|
22
|
-
export declare function takeFirstBy<T>(data: ReadonlyArray<T>, n: number, ...rules: Readonly<NonEmptyArray<OrderRule<T>>>): Array<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Take the first `n` items from `data` based on the provided ordering criteria.
|
|
25
|
-
* This allows you to avoid sorting the array before taking the items.
|
|
26
|
-
* The complexity of this function is *O(Nlogn)* where `N` is the length of the array.
|
|
27
|
-
*
|
|
28
|
-
* For the opposite operation (to drop `n` elements) see `dropFirstBy`.
|
|
29
|
-
*
|
|
30
|
-
* @params n - the number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.
|
|
31
|
-
* @param rules - A variadic array of order rules defining the sorting criteria.
|
|
32
|
-
* Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, "desc"]` for descending order.
|
|
33
|
-
* @returns a subset of the input array.
|
|
34
|
-
* @signature
|
|
35
|
-
* P.takeFirstBy(n, ...rules)(data);
|
|
36
|
-
* @example
|
|
37
|
-
* R.pipe(['aa', 'aaaa', 'a', 'aaa'], P.takeFirstBy(2, x => x.length)); // => ['a', 'aa']
|
|
38
|
-
* @dataLast
|
|
39
|
-
* @category Array
|
|
40
|
-
*/
|
|
41
|
-
export declare function takeFirstBy<T>(n: number, ...rules: Readonly<NonEmptyArray<OrderRule<T>>>): (data: ReadonlyArray<T>) => Array<T>;
|
|
42
|
-
//# sourceMappingURL=take-first-by.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"take-first-by.d.ts","sourceRoot":"","sources":["../../../src/array/take-first-by.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrE,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,4BAA4B,CAAC;AAEzF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,CAAC,EAAE,MAAM,EACT,GAAG,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAM,EACT,GAAG,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns elements from the array until predicate returns false.
|
|
3
|
-
* @param array the array
|
|
4
|
-
* @param fn the predicate
|
|
5
|
-
* @signature
|
|
6
|
-
* P.takeWhile(array, fn)
|
|
7
|
-
* @example
|
|
8
|
-
* P.takeWhile([1, 2, 3, 4, 3, 2, 1], x => x !== 4) // => [1, 2, 3]
|
|
9
|
-
* @dataFirst
|
|
10
|
-
* @category Array
|
|
11
|
-
*/
|
|
12
|
-
export declare function takeWhile<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): Array<T>;
|
|
13
|
-
/**
|
|
14
|
-
* Returns elements from the array until predicate returns false.
|
|
15
|
-
* @param fn the predicate
|
|
16
|
-
* @signature
|
|
17
|
-
* P.takeWhile(fn)(array)
|
|
18
|
-
* @example
|
|
19
|
-
* P.pipe([1, 2, 3, 4, 3, 2, 1], P.takeWhile(x => x !== 4)) // => [1, 2, 3]
|
|
20
|
-
* @dataLast
|
|
21
|
-
* @category Array
|
|
22
|
-
*/
|
|
23
|
-
export declare function takeWhile<T>(fn: (item: T) => boolean): (array: ReadonlyArray<T>) => Array<T>;
|
|
24
|
-
//# sourceMappingURL=take-while.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"take-while.d.ts","sourceRoot":"","sources":["../../../src/array/take-while.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GACvB,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GACvB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { LazyEvaluator } from '../function/pipe';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the first `n` elements of `array`.
|
|
4
|
-
* @param array the array
|
|
5
|
-
* @param n the number of elements to take
|
|
6
|
-
* @signature
|
|
7
|
-
* P.take(array, n)
|
|
8
|
-
* @example
|
|
9
|
-
* P.take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]
|
|
10
|
-
* @dataFirst
|
|
11
|
-
* @pipeable
|
|
12
|
-
* @category Array
|
|
13
|
-
*/
|
|
14
|
-
export declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Returns the first `n` elements of `array`.
|
|
17
|
-
* @param n the number of elements to take
|
|
18
|
-
* @signature
|
|
19
|
-
* P.take(n)(array)
|
|
20
|
-
* @example
|
|
21
|
-
* P.pipe([1, 2, 3, 4, 3, 2, 1], P.take(n)) // => [1, 2, 3]
|
|
22
|
-
* @dataLast
|
|
23
|
-
* @pipeable
|
|
24
|
-
* @category Array
|
|
25
|
-
*/
|
|
26
|
-
export declare function take<T>(n: number): (array: ReadonlyArray<T>) => Array<T>;
|
|
27
|
-
export declare namespace take {
|
|
28
|
-
function lazy<T>(n: number): LazyEvaluator<T>;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=take.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"take.d.ts","sourceRoot":"","sources":["../../../src/array/take.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKtD;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAU1E,yBAAiB,IAAI,CAAC;IACpB,SAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAUnD;CACF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare function uniqBy<T, K>(array: ReadonlyArray<T>, transformer: (item: T) => K): Array<T>;
|
|
2
|
-
/**
|
|
3
|
-
* Returns a new array containing only one copy of each element in the original list transformed by a function.
|
|
4
|
-
* Elements are compared by reference using Set.
|
|
5
|
-
* @param array
|
|
6
|
-
* @signature
|
|
7
|
-
* P.uniqBy(array, fn)
|
|
8
|
-
* @example
|
|
9
|
-
* P.uniqBy(
|
|
10
|
-
* [{ n: 1 }, { n: 2 }, { n: 2 }, { n: 5 }, { n: 1 }, { n: 6 }, { n: 7 }],
|
|
11
|
-
* (obj) => obj.n,
|
|
12
|
-
* ) // => [{n: 1}, {n: 2}, {n: 5}, {n: 6}, {n: 7}]
|
|
13
|
-
* P.pipe(
|
|
14
|
-
* [{n: 1}, {n: 2}, {n: 2}, {n: 5}, {n: 1}, {n: 6}, {n: 7}], // only 4 iterations
|
|
15
|
-
* P.uniqBy(obj => obj.n),
|
|
16
|
-
* P.take(3)
|
|
17
|
-
* ) // => [{n: 1}, {n: 2}, {n: 5}]
|
|
18
|
-
* @pipeable
|
|
19
|
-
* @category Array
|
|
20
|
-
*/
|
|
21
|
-
export declare function uniqBy<T, K>(transformer: (item: T) => K): (array: ReadonlyArray<T>) => Array<T>;
|
|
22
|
-
//# sourceMappingURL=uniq-by.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq-by.d.ts","sourceRoot":"","sources":["../../../src/array/uniq-by.ts"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EACzB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAC1B,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EACzB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { LazyEvaluator } from '../function/pipe';
|
|
2
|
-
type IsEquals<T> = (a: T, b: T) => boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Returns a new array containing only one copy of each element in the original list.
|
|
5
|
-
* Elements are compared by custom comparator isEquals.
|
|
6
|
-
* @param array
|
|
7
|
-
* @param isEquals the comparator
|
|
8
|
-
* @signature
|
|
9
|
-
* P.uniqWith(array, isEquals)
|
|
10
|
-
* @example
|
|
11
|
-
* P.uniqWith(
|
|
12
|
-
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}],
|
|
13
|
-
* P.isDeepEqual,
|
|
14
|
-
* ) // => [{a: 1}, {a: 2}, {a: 5}, {a: 6}, {a: 7}]
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Array
|
|
17
|
-
*/
|
|
18
|
-
export declare function uniqWith<T>(array: ReadonlyArray<T>, isEquals: IsEquals<T>): Array<T>;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a new array containing only one copy of each element in the original list.
|
|
21
|
-
* Elements are compared by custom comparator isEquals.
|
|
22
|
-
* @param isEquals the comparator
|
|
23
|
-
* @signature P.uniqWith(isEquals)(array)
|
|
24
|
-
* @example
|
|
25
|
-
* P.uniqWith(P.isDeepEqual)(
|
|
26
|
-
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}],
|
|
27
|
-
* ) // => [{a: 1}, {a: 2}, {a: 5}, {a: 6}, {a: 7}]
|
|
28
|
-
* P.pipe(
|
|
29
|
-
* [{a: 1}, {a: 2}, {a: 2}, {a: 5}, {a: 1}, {a: 6}, {a: 7}], // only 4 iterations
|
|
30
|
-
* P.uniqWith(P.isDeepEqual),
|
|
31
|
-
* P.take(3)
|
|
32
|
-
* ) // => [{a: 1}, {a: 2}, {a: 5}]
|
|
33
|
-
* @dataLast
|
|
34
|
-
* @category Object
|
|
35
|
-
*/
|
|
36
|
-
export declare function uniqWith<T>(isEquals: IsEquals<T>): (array: ReadonlyArray<T>) => Array<T>;
|
|
37
|
-
declare function lazy_<T>(isEquals: IsEquals<T>): LazyEvaluator<T>;
|
|
38
|
-
export declare namespace uniqWith {
|
|
39
|
-
const lazy: typeof lazy_ & {
|
|
40
|
-
readonly indexed: true;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=uniq-with.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq-with.d.ts","sourceRoot":"","sources":["../../../src/array/uniq-with.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAczC,iBAAS,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAMzD;AAED,yBAAiB,QAAQ,CAAC;IACjB,MAAM,IAAI;;KAAuB,CAAC;CAC1C"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { LazyEvaluator } from '../function/pipe';
|
|
2
|
-
/**
|
|
3
|
-
* Returns a new array containing only one copy of each element in the original list.
|
|
4
|
-
* Elements are compared by reference using Set.
|
|
5
|
-
* @param array
|
|
6
|
-
* @signature
|
|
7
|
-
* P.uniq(array)
|
|
8
|
-
* @example
|
|
9
|
-
* P.uniq([1, 2, 2, 5, 1, 6, 7]) // => [1, 2, 5, 6, 7]
|
|
10
|
-
* @pipeable
|
|
11
|
-
* @category Array
|
|
12
|
-
* @dataFirst
|
|
13
|
-
*/
|
|
14
|
-
export declare function uniq<T>(array: ReadonlyArray<T>): Array<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Returns a new array containing only one copy of each element in the original list.
|
|
17
|
-
* Elements are compared by reference using Set.
|
|
18
|
-
* @param array
|
|
19
|
-
* @signature
|
|
20
|
-
* P.uniq()(array)
|
|
21
|
-
* @example
|
|
22
|
-
* P.pipe(
|
|
23
|
-
* [1, 2, 2, 5, 1, 6, 7], // only 4 iterations
|
|
24
|
-
* P.uniq(),
|
|
25
|
-
* P.take(3)
|
|
26
|
-
* ) // => [1, 2, 5]
|
|
27
|
-
* @pipeable
|
|
28
|
-
* @category Array
|
|
29
|
-
* @dataLast
|
|
30
|
-
*/
|
|
31
|
-
export declare function uniq<T>(): (array: ReadonlyArray<T>) => Array<T>;
|
|
32
|
-
export declare namespace uniq {
|
|
33
|
-
function lazy<T>(): LazyEvaluator<T>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=uniq.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq.d.ts","sourceRoot":"","sources":["../../../src/array/uniq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKtD;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAUjE,yBAAiB,IAAI,CAAC;IACpB,SAAgB,IAAI,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAS1C;CACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a new object from two supplied lists by pairing up equally-positioned items.
|
|
3
|
-
* Key/value pairing is truncated to the length of the shorter of the two lists
|
|
4
|
-
* @param first the first input list
|
|
5
|
-
* @param second the second input list
|
|
6
|
-
* @signature
|
|
7
|
-
* P.zipObj(first, second)
|
|
8
|
-
* @example
|
|
9
|
-
* P.zipObj(['a', 'b'], [1, 2]) // => {a: 1, b: 2}
|
|
10
|
-
* @dataFirst
|
|
11
|
-
* @category Array
|
|
12
|
-
*/
|
|
13
|
-
export declare function zipObj<F extends PropertyKey, S>(first: ReadonlyArray<F>, second: ReadonlyArray<S>): Record<F, S>;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a new object from two supplied lists by pairing up equally-positioned items.
|
|
16
|
-
* Key/value pairing is truncated to the length of the shorter of the two lists
|
|
17
|
-
* @param second the second input list
|
|
18
|
-
* @signature
|
|
19
|
-
* P.zipObj(second)(first)
|
|
20
|
-
* @example
|
|
21
|
-
* P.zipObj([1, 2])(['a', 'b']) // => {a: 1, b: 2}
|
|
22
|
-
* @dataLast
|
|
23
|
-
* @category Array
|
|
24
|
-
*/
|
|
25
|
-
export declare function zipObj<S>(second: ReadonlyArray<S>): <F extends PropertyKey>(first: ReadonlyArray<F>) => Record<F, S>;
|
|
26
|
-
//# sourceMappingURL=zip-obj.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip-obj.d.ts","sourceRoot":"","sources":["../../../src/array/zip-obj.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAC7C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhB;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
type ZippingFunction<F = unknown, S = unknown, R = unknown> = (f: F, s: S) => R;
|
|
2
|
-
/**
|
|
3
|
-
* Creates a new list from two supplied lists by calling the supplied function
|
|
4
|
-
* with the same-positioned element from each list.
|
|
5
|
-
* @param first the first input list
|
|
6
|
-
* @param second the second input list
|
|
7
|
-
* @param fn the function applied to each position of the list
|
|
8
|
-
* @signature
|
|
9
|
-
* P.zipWith(first, second, fn)
|
|
10
|
-
* @example
|
|
11
|
-
* P.zipWith(['1', '2', '3'], ['a', 'b', 'c'], (a, b) => a + b) // => ['1a', '2b', '3c']
|
|
12
|
-
* @dataFirst
|
|
13
|
-
* @category Array
|
|
14
|
-
*/
|
|
15
|
-
export declare function zipWith<F, S, R>(first: ReadonlyArray<F>, second: ReadonlyArray<S>, fn: ZippingFunction<F, S, R>): Array<R>;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new list from two supplied lists by calling the supplied function
|
|
18
|
-
* with the same-positioned element from each list.
|
|
19
|
-
* @param fn the function applied to each position of the list
|
|
20
|
-
* @signature
|
|
21
|
-
* P.zipWith(fn)(first, second)
|
|
22
|
-
* @example
|
|
23
|
-
* P.zipWith((a, b) => a + b)(['1', '2', '3'], ['a', 'b', 'c']) // => ['1a', '2b', '3c']
|
|
24
|
-
* @dataLast
|
|
25
|
-
* @category Array
|
|
26
|
-
*/
|
|
27
|
-
export declare function zipWith<F, S, R>(fn: ZippingFunction<F, S, R>): (first: ReadonlyArray<F>, second: ReadonlyArray<S>) => Array<R>;
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new list from two supplied lists by calling the supplied function
|
|
30
|
-
* with the same-positioned element from each list.
|
|
31
|
-
* @param fn the function applied to each position of the list
|
|
32
|
-
* @param second the second input list
|
|
33
|
-
* @signature
|
|
34
|
-
* P.zipWith(fn)(first, second)
|
|
35
|
-
* @example
|
|
36
|
-
* P.zipWith((a, b) => a + b, ['a', 'b', 'c'])(['1', '2', '3']) // => ['1a', '2b', '3c']
|
|
37
|
-
* @dataLast
|
|
38
|
-
* @category Array
|
|
39
|
-
*/
|
|
40
|
-
export declare function zipWith<F, S, R>(fn: ZippingFunction<F, S, R>, second: ReadonlyArray<S>): (first: ReadonlyArray<F>) => Array<R>;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=zip-with.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip-with.d.ts","sourceRoot":"","sources":["../../../src/array/zip-with.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC3B,KAAK,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7B,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC3B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7B,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { IterableContainer } from '../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a new list from two supplied lists by pairing up equally-positioned items.
|
|
4
|
-
* The length of the returned list will match the shortest of the two inputs.
|
|
5
|
-
*
|
|
6
|
-
* If the input array are tuples, you can use the strict option
|
|
7
|
-
* to get another tuple instead of a generic array type.
|
|
8
|
-
* @param first the first input list
|
|
9
|
-
* @param second the second input list
|
|
10
|
-
* @signature
|
|
11
|
-
* P.zip(first, second)
|
|
12
|
-
* @example
|
|
13
|
-
* P.zip([1, 2], ['a', 'b']) // => [[1, 'a'], [2, 'b']] (type: [number, string][])
|
|
14
|
-
* P.zip.strict([1, 2] as const, ['a', 'b'] as const) // => [[1, 'a'], [2, 'b']] (type: [[1, 'a'], [2, 'b']])
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Array
|
|
17
|
-
* @strict
|
|
18
|
-
*/
|
|
19
|
-
export declare function zip<F, S>(first: ReadonlyArray<F>, second: ReadonlyArray<S>): Array<[F, S]>;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new list from two supplied lists by pairing up equally-positioned items.
|
|
22
|
-
* The length of the returned list will match the shortest of the two inputs.
|
|
23
|
-
*
|
|
24
|
-
* If the input array are tuples, you can use the strict option
|
|
25
|
-
* to get another tuple instead of a generic array type.
|
|
26
|
-
* @param second the second input list
|
|
27
|
-
* @signature
|
|
28
|
-
* P.zip(second)(first)
|
|
29
|
-
* @example
|
|
30
|
-
* P.zip(['a', 'b'])([1, 2]) // => [[1, 'a'], [2, 'b']] (type: [number, string][])
|
|
31
|
-
* P.zip.strict(['a', 'b'] as const)([1, 2] as const) // => [[1, 'a'], [2, 'b']] (type: [[1, 'a'], [2, 'b']])
|
|
32
|
-
* @dataLast
|
|
33
|
-
* @category Array
|
|
34
|
-
* @strict
|
|
35
|
-
*/
|
|
36
|
-
export declare function zip<S>(second: ReadonlyArray<S>): <F>(first: ReadonlyArray<F>) => Array<[F, S]>;
|
|
37
|
-
interface Strict {
|
|
38
|
-
<F extends IterableContainer, S extends IterableContainer>(first: F, second: S): Zip<F, S>;
|
|
39
|
-
<S extends IterableContainer>(second: S): <F extends IterableContainer>(first: F) => Zip<F, S>;
|
|
40
|
-
}
|
|
41
|
-
type Zip<Left extends IterableContainer, Right extends IterableContainer> = Left extends readonly [] ? [] : Right extends readonly [] ? [] : Left extends readonly [infer LeftHead, ...infer LeftRest] ? Right extends readonly [infer RightHead, ...infer RightRest] ? [
|
|
42
|
-
[LeftHead, RightHead],
|
|
43
|
-
...Zip<LeftRest, RightRest>
|
|
44
|
-
] : [
|
|
45
|
-
[LeftHead, Right[number]],
|
|
46
|
-
...Zip<LeftRest, Right>
|
|
47
|
-
] : Right extends readonly [infer RightHead, ...infer RightRest] ? [[Left[number], RightHead], ...Zip<Left, RightRest>] : Array<[Left[number], Right[number]]>;
|
|
48
|
-
export declare namespace zip {
|
|
49
|
-
const strict: Strict;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../../src/array/zip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EACtB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,CAAC,EACnB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAoBjD,UAAU,MAAM;IACd,CAAC,CAAC,SAAS,iBAAiB,EAAE,CAAC,SAA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((data: In) => boolean) | ((data: In) => data is Thru),
|
|
3
|
-
then: (data: Thru) => Out
|
|
4
|
-
];
|
|
5
|
-
/**
|
|
6
|
-
* Executes a transformer function based on the first matching predicate,
|
|
7
|
-
* functioning like a series of `if...else if...` statements. It sequentially
|
|
8
|
-
* evaluates each case and, upon finding a truthy predicate, runs the
|
|
9
|
-
* corresponding transformer, and returns, ignoring any further cases, even if
|
|
10
|
-
* they would match.
|
|
11
|
-
*
|
|
12
|
-
* !IMPORTANT! - Unlike similar implementations in frameworks like Lodash and
|
|
13
|
-
* Ramda, this implementation does **NOT** return a default/fallback
|
|
14
|
-
* `undefined` value when none of the cases match; and instead will **throw** an
|
|
15
|
-
* exception in those cases.
|
|
16
|
-
* To add a default case use the `conditional.defaultCase` helper as the final
|
|
17
|
-
* case of your implementation. By default it returns `undefined`, but could be
|
|
18
|
-
* provided a transformer in order to return something else.
|
|
19
|
-
*
|
|
20
|
-
* Due to TypeScript's inability to infer the result of negating a type-
|
|
21
|
-
* predicate we can't refine the types used in subsequent cases based on
|
|
22
|
-
* previous conditions. Using a `switch (true)` statement or ternary operators
|
|
23
|
-
* is recommended for more precise type control when such type narrowing is
|
|
24
|
-
* needed.
|
|
25
|
-
*
|
|
26
|
-
* @param cases - A list of (up to 10) tuples, each defining a case. Each tuple
|
|
27
|
-
* consists of a predicate (or a type-predicate) and a transformer function that
|
|
28
|
-
* processes the data if its case matches.
|
|
29
|
-
* @returns The output of the matched transformer. If no cases match, an
|
|
30
|
-
* exception is thrown. The return type is a union of the return types of all
|
|
31
|
-
* provided transformers.
|
|
32
|
-
* @signature
|
|
33
|
-
* P.conditional(...cases)(data);
|
|
34
|
-
* @example
|
|
35
|
-
* const nameOrId = 3 as string | number;
|
|
36
|
-
* P.pipe(
|
|
37
|
-
* nameOrId,
|
|
38
|
-
* P.conditional(
|
|
39
|
-
* [P.isString, (name) => `Hello ${name}`],
|
|
40
|
-
* [P.isNumber, (id) => `Hello ID: ${id}`],
|
|
41
|
-
* P.conditional.defaultCase(
|
|
42
|
-
* (something) => `Hello something (${JSON.stringify(something)})`,
|
|
43
|
-
* ),
|
|
44
|
-
* ),
|
|
45
|
-
* ); //=> 'Hello ID: 3'
|
|
46
|
-
* @dataLast
|
|
47
|
-
* @category Function
|
|
48
|
-
*/
|
|
49
|
-
export declare function conditional<T, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never, Thru0 extends T = T, Thru1 extends T = T, Thru2 extends T = T, Thru3 extends T = T, Thru4 extends T = T, Thru5 extends T = T, Thru6 extends T = T, Thru7 extends T = T, Thru8 extends T = T, Thru9 extends T = T>(case0: Case<T, Return0, Thru0>, case1?: Case<T, Return1, Thru1>, case2?: Case<T, Return2, Thru2>, case3?: Case<T, Return3, Thru3>, case4?: Case<T, Return4, Thru4>, case5?: Case<T, Return5, Thru5>, case6?: Case<T, Return6, Thru6>, case7?: Case<T, Return7, Thru7>, case8?: Case<T, Return8, Thru8>, case9?: Case<T, Return9, Thru9>): (data: T) => Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
50
|
-
/**
|
|
51
|
-
* Executes a transformer function based on the first matching predicate,
|
|
52
|
-
* functioning like a series of `if...else if...` statements. It sequentially
|
|
53
|
-
* evaluates each case and, upon finding a truthy predicate, runs the
|
|
54
|
-
* corresponding transformer, and returns, ignoring any further cases, even if
|
|
55
|
-
* they would match.
|
|
56
|
-
*
|
|
57
|
-
* !IMPORTANT! - Unlike similar implementations in frameworks like Lodash and
|
|
58
|
-
* Ramda, this implementation does **NOT** return a default/fallback
|
|
59
|
-
* `undefined` value when none of the cases match; and instead will **throw** an
|
|
60
|
-
* exception in those cases.
|
|
61
|
-
* To add a default case use the `conditional.defaultCase` helper as the final
|
|
62
|
-
* case of your implementation. By default it returns `undefined`, but could be
|
|
63
|
-
* provided a transformer in order to return something else.
|
|
64
|
-
*
|
|
65
|
-
* Due to TypeScript's inability to infer the result of negating a type-
|
|
66
|
-
* predicate we can't refine the types used in subsequent cases based on
|
|
67
|
-
* previous conditions. Using a `switch (true)` statement or ternary operators
|
|
68
|
-
* is recommended for more precise type control when such type narrowing is
|
|
69
|
-
* needed.
|
|
70
|
-
*
|
|
71
|
-
* @param data - The input data to be evaluated against the provided cases.
|
|
72
|
-
* @param cases - A list of (up to 10) tuples, each defining a case. Each tuple
|
|
73
|
-
* consists of a predicate (or a type-predicate) and a transformer function that
|
|
74
|
-
* processes the data if its case matches.
|
|
75
|
-
* @returns The output of the matched transformer. If no cases match, an
|
|
76
|
-
* exception is thrown. The return type is a union of the return types of all
|
|
77
|
-
* provided transformers.
|
|
78
|
-
* @signature
|
|
79
|
-
* P.conditional(data, ...cases);
|
|
80
|
-
* @example
|
|
81
|
-
* const nameOrId = 3 as string | number;
|
|
82
|
-
* P.conditional(
|
|
83
|
-
* nameOrId,
|
|
84
|
-
* [P.isString, (name) => `Hello ${name}`],
|
|
85
|
-
* [P.isNumber, (id) => `Hello ID: ${id}`],
|
|
86
|
-
* P.conditional.defaultCase(
|
|
87
|
-
* (something) => `Hello something (${JSON.stringify(something)})`,
|
|
88
|
-
* ),
|
|
89
|
-
* ); //=> 'Hello ID: 3'
|
|
90
|
-
* @dataFirst
|
|
91
|
-
* @category Function
|
|
92
|
-
*/
|
|
93
|
-
export declare function conditional<T, Return0, Return1 = never, Return2 = never, Return3 = never, Return4 = never, Return5 = never, Return6 = never, Return7 = never, Return8 = never, Return9 = never, Thru0 extends T = T, Thru1 extends T = T, Thru2 extends T = T, Thru3 extends T = T, Thru4 extends T = T, Thru5 extends T = T, Thru6 extends T = T, Thru7 extends T = T, Thru8 extends T = T, Thru9 extends T = T>(data: T, case0: Case<T, Return0, Thru0>, case1?: Case<T, Return1, Thru1>, case2?: Case<T, Return2, Thru2>, case3?: Case<T, Return3, Thru3>, case4?: Case<T, Return4, Thru4>, case5?: Case<T, Return5, Thru5>, case6?: Case<T, Return6, Thru6>, case7?: Case<T, Return7, Thru7>, case8?: Case<T, Return8, Thru8>, case9?: Case<T, Return9, Thru9>): Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Return6 | Return7 | Return8 | Return9;
|
|
94
|
-
export declare namespace conditional {
|
|
95
|
-
/**
|
|
96
|
-
* A simplified case that accepts all data. Put this as the last case to
|
|
97
|
-
* prevent an exception from being thrown when none of the previous cases
|
|
98
|
-
* match.
|
|
99
|
-
* If this is not the last case it will short-circuit anything after it.
|
|
100
|
-
* @param then - You only need to provide the transformer, the predicate is
|
|
101
|
-
* implicit. @default () => undefined, which is how Lodash and Ramda handle
|
|
102
|
-
* the final fallback case.
|
|
103
|
-
*/
|
|
104
|
-
function defaultCase<In>(then?: (data: In) => unknown): readonly [() => boolean, (data: In) => unknown];
|
|
105
|
-
}
|
|
106
|
-
export {};
|
|
107
|
-
//# sourceMappingURL=conditional.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/function/conditional.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,SAAS;IAClD,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC;IAC5D,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,WAAW,CACzB,CAAC,EACD,OAAO,EACP,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,K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C/B,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAC/B,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAC/B,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GAE7B,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAsCZ,yBAAiB,WAAW,CAAC;IAC3B;;;;;;;;OAQG;IACH,SAAgB,WAAW,CAAC,EAAE,EAAE,IAAI,GAAE,CAAC,IAAI,EAAE,EAAE,KAAK,OAA4B,mCAAnC,EAAE,KAAK,OAAO,EAE1D;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a data-last pipe function. First function must be always annotated. Other functions are automatically inferred.
|
|
3
|
-
* @signature
|
|
4
|
-
* P.createPipe(op1, op2, op3)(data);
|
|
5
|
-
* @example
|
|
6
|
-
* P.createPipe(
|
|
7
|
-
* (x: number) => x * 2,
|
|
8
|
-
* x => x * 3
|
|
9
|
-
* )(1) // => 6
|
|
10
|
-
* @category Function
|
|
11
|
-
*/
|
|
12
|
-
export declare function createPipe<A, B>(op1: (input: A) => B): (value: A) => B;
|
|
13
|
-
export declare function createPipe<A, B, C>(op1: (input: A) => B, op2: (input: B) => C): (value: A) => C;
|
|
14
|
-
export declare function createPipe<A, B, C, D>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D): (value: A) => D;
|
|
15
|
-
export declare function createPipe<A, B, C, D, E>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E): (value: A) => E;
|
|
16
|
-
export declare function createPipe<A, B, C, D, E, F>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F): (value: A) => F;
|
|
17
|
-
export declare function createPipe<A, B, C, D, E, F, G>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G): (value: A) => G;
|
|
18
|
-
export declare function createPipe<A, B, C, D, E, F, G, H>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H): (value: A) => H;
|
|
19
|
-
//# sourceMappingURL=create-pipe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-pipe.d.ts","sourceRoot":"","sources":["../../../src/function/create-pipe.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAExE,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAChC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACpB,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACnB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAEnB,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACnC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACpB,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACpB,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACnB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAEnB,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACtC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACpB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