@vinicunca/perkakas 0.4.1 → 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/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 -20
- 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 -16
- 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,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
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AC,QAAQ,EAAE,SAAS,CAAC;IAAE,GAAG,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC;CAAC,GAGpD;IAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAE,GAAG,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;CAAC,GACtD,KAAK,SAAS,SAAS,CAAC,MAAM,SAAS,EAAE,GAAG,MAAM,SAAS,CAAC,GAC1D,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,GAGtD,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAE/C,yBAAiB,GAAG,CAAC;IAGZ,MAAM,MAAM,EAAE,MAAY,CAAC;CACnC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
type Case<In, Out, Thru extends In = In> = readonly [
|
|
2
|
-
when: ((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
|
-
{"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ated. 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,CAA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AAE,CAAC,KAAK,CAAC,CAAC;AAEnB,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAC5C,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,EACpB,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,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAC/C,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,EACpB,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,EACpB,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACnB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
interface Debouncer<F extends (...args: any) => unknown, IsNullable extends boolean = true> {
|
|
2
|
-
/**
|
|
3
|
-
* The last computed value of the debounced function.
|
|
4
|
-
*/
|
|
5
|
-
readonly cachedValue: ReturnType<F> | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Invoke the debounced function.
|
|
8
|
-
* @param args - same as the args for the debounced function.
|
|
9
|
-
* @returns - the last computed value of the debounced function with the
|
|
10
|
-
* latest args provided to it. If `timing` does not include `leading` then the
|
|
11
|
-
* the function would return `undefined` until the first cool-down period is
|
|
12
|
-
* over, otherwise the function would always return the return type of the
|
|
13
|
-
* debounced function.
|
|
14
|
-
*/
|
|
15
|
-
readonly call: (...args: Parameters<F>) => ReturnType<F> | (true extends IsNullable ? undefined : never);
|
|
16
|
-
/**
|
|
17
|
-
* Cancels any debounced functions without calling them, effectively resetting
|
|
18
|
-
* the debouncer to the same state it is when initially created.
|
|
19
|
-
*/
|
|
20
|
-
readonly cancel: () => void;
|
|
21
|
-
/**
|
|
22
|
-
* Similar to `cancel`, but would also trigger the `trailing` invocation if
|
|
23
|
-
* the debouncer would run one at the end of the cool-down period.
|
|
24
|
-
*/
|
|
25
|
-
readonly flush: () => ReturnType<F> | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Is `true` when there is an active cool-down period currently debouncing
|
|
28
|
-
* invocations.
|
|
29
|
-
*/
|
|
30
|
-
readonly isPending: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface DebounceOptions {
|
|
33
|
-
readonly maxWaitMs?: number;
|
|
34
|
-
readonly waitMs?: number;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Wraps `func` with a debouncer object that "debounces" (delays) invocations of the function during a defined cool-down period (`waitMs`). It can be configured to invoke the function either at the start of the cool-down period, the end of it, or at both ends (`timing`).
|
|
38
|
-
* It can also be configured to allow invocations during the cool-down period (`maxWaitMs`).
|
|
39
|
-
* It stores the latest call's arguments so they could be used at the end of the cool-down period when invoking `func` (if configured to invoke the function at the end of the cool-down period).
|
|
40
|
-
* It stores the value returned by `func` whenever its invoked. This value is returned on every call, and is accessible via the `cachedValue` property of the debouncer. Its important to note that the value might be different from the value that would be returned from running `func` with the current arguments as it is a cached value from a previous invocation.
|
|
41
|
-
* **Important**: The cool-down period defines the minimum between two invocations, and not the maximum. The period will be **extended** each time a call is made until a full cool-down period has elapsed without any additional calls.
|
|
42
|
-
* @param func The function to debounce, the returned `call` function will have
|
|
43
|
-
* the exact same signature.
|
|
44
|
-
* @param options An object allowing further customization of the debouncer:
|
|
45
|
-
* - `timing?: 'leading' | 'trailing' |'both'`. The default is `'trailing'`.
|
|
46
|
-
* `leading` would result in the function being invoked at the start of the
|
|
47
|
-
* cool-down period; `trailing` would result in the function being invoked at
|
|
48
|
-
* the end of the cool-down period (using the args from the last call to the
|
|
49
|
-
* debouncer). When `both` is selected the `trailing` invocation would only
|
|
50
|
-
* take place if there were more than one call to the debouncer during the
|
|
51
|
-
* cool-down period. **DEFAULT: 'trailing'**
|
|
52
|
-
* - `waitMs?: number`. The length of the cool-down period in milliseconds. The
|
|
53
|
-
* debouncer would wait until this amount of time has passed without **any**
|
|
54
|
-
* additional calls to the debouncer before triggering the end-of-cool-down-
|
|
55
|
-
* period event. When this happens, the function would be invoked (if `timing`
|
|
56
|
-
* isn't `'leading'`) and the debouncer state would be reset. **DEFAULT: 0**
|
|
57
|
-
* - `maxWaitMs?: number`. The length of time since a debounced call (a call
|
|
58
|
-
* that the debouncer prevented from being invoked) was made until it would be
|
|
59
|
-
* invoked. Because the debouncer can be continually triggered and thus never
|
|
60
|
-
* reach the end of the cool-down period, this allows the function to still
|
|
61
|
-
* be invoked occasionally. IMPORTANT: This param is ignored when `timing` is
|
|
62
|
-
* `'leading'`.
|
|
63
|
-
* @returns a debouncer object. The main function is `call`. In addition to it
|
|
64
|
-
* the debouncer comes with the following additional functions and properties:
|
|
65
|
-
* - `cancel` method to cancel delayed `func` invocations
|
|
66
|
-
* - `flush` method to end the cool-down period immediately.
|
|
67
|
-
* - `cachedValue` the latest return value of an invocation (if one occurred).
|
|
68
|
-
* - `isPending` flag to check if there is an inflight cool-down window.
|
|
69
|
-
* @signature
|
|
70
|
-
* P.debounce(func, options);
|
|
71
|
-
* @example
|
|
72
|
-
* const debouncer = debounce(identity, { timing: 'trailing', waitMs: 1000 });
|
|
73
|
-
* const result1 = debouncer.call(1); // => undefined
|
|
74
|
-
* const result2 = debouncer.call(2); // => undefined
|
|
75
|
-
* // after 1 second
|
|
76
|
-
* const result3 = debouncer.call(3); // => 2
|
|
77
|
-
* // after 1 second
|
|
78
|
-
* debouncer.cachedValue; // => 3
|
|
79
|
-
* @dataFirst
|
|
80
|
-
* @category Function
|
|
81
|
-
* @see https://css-tricks.com/debouncing-throttling-explained-examples/
|
|
82
|
-
*/
|
|
83
|
-
export declare function debounce<F extends (...args: any) => any>(func: F, options: {
|
|
84
|
-
readonly timing?: 'trailing';
|
|
85
|
-
} & DebounceOptions): Debouncer<F>;
|
|
86
|
-
export declare function debounce<F extends (...args: any) => any>(func: F, options: ({
|
|
87
|
-
readonly timing: 'both';
|
|
88
|
-
} & DebounceOptions) | ({
|
|
89
|
-
readonly timing: 'leading';
|
|
90
|
-
} & Omit<DebounceOptions, 'maxWaitMs'>)): Debouncer<F, false>;
|
|
91
|
-
export {};
|
|
92
|
-
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/function/debounce.ts"],"names":[],"mappings":"AAAA,UAAU,SAAS,CACjB,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,EACnC,UAAU,SAAS,OAAO,GAAG,IAAI;IAEjC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAEhD;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,CACb,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KACnB,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,SAAS,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IAEnE;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACtD,IAAI,EAAE,CAAC,EACP,OAAO,EAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,eAAe,GAC1D,SAAS,CAAC,CAAC,CAAC,CAAC;AAEhB,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACtD,IAAI,EAAE,CAAC,EACP,OAAO,EACL,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAAC,GAC/C,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,GACtE,SAAS,CAAC,CAAC,EAAE,KAAK,CAA8B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A function that always returns the param passed to it
|
|
3
|
-
* @signature
|
|
4
|
-
* P.identity(data)
|
|
5
|
-
* @example
|
|
6
|
-
* P.identity('foo') // => 'foo'
|
|
7
|
-
* @category Function
|
|
8
|
-
*/
|
|
9
|
-
export declare function identity<T>(value: T): T;
|
|
10
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/function/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAEnC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './conditional';
|
|
2
|
-
export * from './create-pipe';
|
|
3
|
-
export * from './identity';
|
|
4
|
-
export * from './noop';
|
|
5
|
-
export * from './once';
|
|
6
|
-
export * from './debounce';
|
|
7
|
-
export * from './pipe';
|
|
8
|
-
export * from './purry';
|
|
9
|
-
export * from './sleep';
|
|
10
|
-
export * from './times';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/function/noop.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,SAAS,CAEhC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation.
|
|
3
|
-
* @param fn the function to wrap
|
|
4
|
-
* @signature P.once(fn)
|
|
5
|
-
* @example
|
|
6
|
-
* const initialize = P.once(createApplication);
|
|
7
|
-
* initialize();
|
|
8
|
-
* initialize();
|
|
9
|
-
* // => `createApplication` is invoked once
|
|
10
|
-
* @category Function
|
|
11
|
-
*/
|
|
12
|
-
export declare function once<T>(fn: () => T): () => T;
|
|
13
|
-
//# sourceMappingURL=once.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../../src/function/once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAU5C"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export type LazyEvaluator<T = unknown, R = T> = (item: T, index?: number, data?: ReadonlyArray<T>) => LazyResult<R>;
|
|
2
|
-
type LazyResult<T> = LazyEmpty | LazyMany<T> | LazyNext<T>;
|
|
3
|
-
interface LazyEmpty {
|
|
4
|
-
done: boolean;
|
|
5
|
-
hasMany?: false | undefined;
|
|
6
|
-
hasNext: false;
|
|
7
|
-
next?: undefined;
|
|
8
|
-
}
|
|
9
|
-
interface LazyNext<T> {
|
|
10
|
-
done: boolean;
|
|
11
|
-
hasMany?: false | undefined;
|
|
12
|
-
hasNext: true;
|
|
13
|
-
next: T;
|
|
14
|
-
}
|
|
15
|
-
interface LazyMany<T> {
|
|
16
|
-
done: boolean;
|
|
17
|
-
hasMany: true;
|
|
18
|
-
hasNext: true;
|
|
19
|
-
next: Array<T>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Perform left-to-right function composition.
|
|
23
|
-
* @param value The initial value.
|
|
24
|
-
* @param arguments the list of operations to apply.
|
|
25
|
-
* @signature P.pipe(data, op1, op2, op3)
|
|
26
|
-
* @example
|
|
27
|
-
* P.pipe(
|
|
28
|
-
* [1, 2, 3, 4],
|
|
29
|
-
* P.map(x => x * 2),
|
|
30
|
-
* arr => [arr[0] + arr[1], arr[2] + arr[3]],
|
|
31
|
-
* ) // => [6, 14]
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @dataFirst
|
|
35
|
-
* @category Function
|
|
36
|
-
*/
|
|
37
|
-
export declare function pipe<A, B>(value: A, op1: (input: A) => B): B;
|
|
38
|
-
export declare function pipe<A, B, C>(value: A, op1: (input: A) => B, op2: (input: B) => C): C;
|
|
39
|
-
export declare function pipe<A, B, C, D>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D): D;
|
|
40
|
-
export declare function pipe<A, B, C, D, E>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E): E;
|
|
41
|
-
export declare function pipe<A, B, C, D, E, F>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F): F;
|
|
42
|
-
export declare function pipe<A, B, C, D, E, F, G>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G): G;
|
|
43
|
-
export declare function pipe<A, B, C, D, E, F, G, H>(value: A, 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): H;
|
|
44
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, 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, op8: (input: H) => I): I;
|
|
45
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, 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, op8: (input: H) => I, op9: (input: I) => J): J;
|
|
46
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K): K;
|
|
47
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L): L;
|
|
48
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M): M;
|
|
49
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N): N;
|
|
50
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N, op14: (input: N) => O): O;
|
|
51
|
-
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N, op14: (input: N) => O, op15: (input: O) => P): P;
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=pipe.d.ts.map
|