@vinicunca/perkakas 0.4.1 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2375 -0
- package/dist/index.d.cts +4609 -0
- package/dist/index.d.mts +4609 -0
- package/dist/index.d.ts +4609 -0
- package/dist/index.mjs +2231 -0
- package/dist/metadata.json +8 -8
- 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,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,E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)
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../../src/function/pipe.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAC9C,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,KACpB,UAAU,CAAC,CAAC,CAAC,CAAC;AAEnB,KAAK,UAAU,CAAC,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAE3D,UAAU,SAAS;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,QAAQ,CAAC,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,QAAQ,CAAC,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CAChB;AAWD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAA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CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACpB,CAAC,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { LazyEvaluator } from '../function/pipe';
|
|
2
|
-
type LazyEvaluatorFactory = (...args: any) => LazyEvaluator;
|
|
3
|
-
interface MaybeLazyFunction {
|
|
4
|
-
(...args: any): unknown;
|
|
5
|
-
readonly lazy?: LazyEvaluatorFactory;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Creates a function with `dataFirst` and `dataLast` signatures.
|
|
9
|
-
*
|
|
10
|
-
* `purry` is a dynamic function and it's not type safe. It should be wrapped by
|
|
11
|
-
* a function that have proper typings. Refer to the example below for correct
|
|
12
|
-
* usage.
|
|
13
|
-
*
|
|
14
|
-
* !IMPORTANT: functions that simply call `purry` and return the result (like
|
|
15
|
-
* almost all functions in this library) should return `unknown` themselves if
|
|
16
|
-
* an explicit return type is required. This is because we currently don't
|
|
17
|
-
* provide a generic return type that is built from the input function, and
|
|
18
|
-
* crafting one manually isn't worthwhile as we rely on function declaration
|
|
19
|
-
* overloading to combine the types for dataFirst and dataLast invocations!
|
|
20
|
-
*
|
|
21
|
-
* @param fn the function to purry.
|
|
22
|
-
* @param args the arguments
|
|
23
|
-
* @param lazyFactory - A lazy version of the function to purry.
|
|
24
|
-
* @signature P.purry(fn, arguments);
|
|
25
|
-
* @exampleRaw
|
|
26
|
-
* function findIndex_(array, fn) {
|
|
27
|
-
* for (let i = 0; i < array.length; i++) {
|
|
28
|
-
* if (fn(array[i])) {
|
|
29
|
-
* return i;
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
* return -1;
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* // data-first
|
|
36
|
-
* function findIndex<T>(array: T[], fn: (item: T) => boolean): number;
|
|
37
|
-
*
|
|
38
|
-
* // data-last
|
|
39
|
-
* function findIndex<T>(fn: (item: T) => boolean): (array: T[]) => number;
|
|
40
|
-
*
|
|
41
|
-
* function findIndex() {
|
|
42
|
-
* return P.purry(findIndex_, arguments);
|
|
43
|
-
* }
|
|
44
|
-
* @category Function
|
|
45
|
-
*/
|
|
46
|
-
export declare function purry(fn: MaybeLazyFunction, args: IArguments | ReadonlyArray<unknown>, lazyFactory?: LazyEvaluatorFactory): unknown;
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=purry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"purry.d.ts","sourceRoot":"","sources":["../../../src/function/purry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,oBAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,aAAa,CAAC;AAE5D,UAAU,iBAAiB;IACzB,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,KAAK,CACnB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,EACzC,WAAW,CAAC,EAAE,oBAAoB,WAmBnC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delay execution for a given number of milliseconds.
|
|
3
|
-
*
|
|
4
|
-
* @param timeout the number of milliseconds to wait
|
|
5
|
-
* @signature
|
|
6
|
-
* P.sleep(timeout)
|
|
7
|
-
* @example
|
|
8
|
-
* P.sleep(1000) // => Promise<void>
|
|
9
|
-
* @category Function
|
|
10
|
-
*/
|
|
11
|
-
export declare function sleep(timeout: number): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../src/function/sleep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpD"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calls an input function `n` times, returning an array containing the results
|
|
3
|
-
* of those function calls.
|
|
4
|
-
*
|
|
5
|
-
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
6
|
-
* and is gradually incremented to `n - 1`.
|
|
7
|
-
*
|
|
8
|
-
* @param count A value between `0` and `n - 1`. Increments after each function call.
|
|
9
|
-
* @param fn The function to invoke. Passed one argument, the current value of `n`.
|
|
10
|
-
* @return An array containing the return values of all calls to `fn`.
|
|
11
|
-
* @example times(5, identity); //=> [0, 1, 2, 3, 4]
|
|
12
|
-
* @dataFirst
|
|
13
|
-
*/
|
|
14
|
-
export declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Calls an input function `n` times, returning an array containing the results
|
|
17
|
-
* of those function calls.
|
|
18
|
-
*
|
|
19
|
-
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
20
|
-
* and is gradually incremented to `n - 1`.
|
|
21
|
-
*
|
|
22
|
-
* @param fn The function to invoke. Passed one argument, the current value of `n`.
|
|
23
|
-
* @return An array containing the return values of all calls to `fn`.
|
|
24
|
-
* @example P.times(identity)(5); //=> [0, 1, 2, 3, 4]
|
|
25
|
-
* @dataLast
|
|
26
|
-
*/
|
|
27
|
-
export declare function times<T>(fn: (n: number) => T): (count: number) => Array<T>;
|
|
28
|
-
//# sourceMappingURL=times.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../../src/function/times.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Simplify } from 'type-fest';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
4
|
-
* property and value in `subObject`, there's the same property in `object`
|
|
5
|
-
* with an equal value. Equality is checked with `isDeepEqual`.
|
|
6
|
-
*
|
|
7
|
-
* @param data - The object to test.
|
|
8
|
-
* @param subObject - The sub-object to test against.
|
|
9
|
-
* @signature
|
|
10
|
-
* P.hasSubObject(data, subObject)
|
|
11
|
-
* @example
|
|
12
|
-
* P.hasSubObject({ a: 1, b: 2, c: 3 }, { a: 1, c: 3 }) //=> true
|
|
13
|
-
* P.hasSubObject({ a: 1, b: 2, c: 3 }, { b: 4 }) //=> false
|
|
14
|
-
* P.hasSubObject({ a: 1, b: 2, c: 3 }, {}) //=> true
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Guard
|
|
17
|
-
*/
|
|
18
|
-
export declare function hasSubObject<T, S extends Partial<T>>(data: T, subObject: S): data is Simplify<S & T>;
|
|
19
|
-
/**
|
|
20
|
-
* Checks if `subObject` is a sub-object of `object`, which means for every
|
|
21
|
-
* property and value in `subObject`, there's the same property in `object`
|
|
22
|
-
* with an equal value. Equality is checked with `isDeepEqual`.
|
|
23
|
-
*
|
|
24
|
-
* @param subObject - The sub-object to test against.
|
|
25
|
-
* @signature
|
|
26
|
-
* P.hasSubObject(subObject)(data)
|
|
27
|
-
* @example
|
|
28
|
-
* P.hasSubObject({ a: 1, c: 3 })({ a: 1, b: 2, c: 3 }) //=> true
|
|
29
|
-
* P.hasSubObject({ b: 4 })({ a: 1, b: 2, c: 3 }) //=> false
|
|
30
|
-
* P.hasSubObject({})({ a: 1, b: 2, c: 3 }) //=> true
|
|
31
|
-
* @dataLast
|
|
32
|
-
* @category Guard
|
|
33
|
-
*/
|
|
34
|
-
export declare function hasSubObject<T, S extends Partial<T>>(subObject: S): (data: T) => data is Simplify<S & T>;
|
|
35
|
-
//# sourceMappingURL=has-sub-object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has-sub-object.d.ts","sourceRoot":"","sources":["../../../src/guard/has-sub-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAK1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAClD,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,GAEd,IAAI,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAClD,SAAS,EAAE,CAAC,GACX,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export * from './has-sub-object';
|
|
2
|
-
export * from './is-array';
|
|
3
|
-
export * from './is-boolean';
|
|
4
|
-
export * from './is-date';
|
|
5
|
-
export * from './is-deep-equal';
|
|
6
|
-
export * from './is-defined';
|
|
7
|
-
export * from './is-empty';
|
|
8
|
-
export * from './is-error';
|
|
9
|
-
export * from './is-function';
|
|
10
|
-
export * from './is-included-in';
|
|
11
|
-
export * from './is-nil';
|
|
12
|
-
export * from './is-non-null';
|
|
13
|
-
export * from './is-not';
|
|
14
|
-
export * from './is-number';
|
|
15
|
-
export * from './is-object';
|
|
16
|
-
export * from './is-promise';
|
|
17
|
-
export * from './is-string';
|
|
18
|
-
export * from './is-symbol';
|
|
19
|
-
export * from './is-truthy';
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/guard/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NarrowedTo } from '../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is an Array and narrows its type accordingly
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isArray(data)
|
|
7
|
-
* @returns true if the passed input is an Array, false otherwise
|
|
8
|
-
* @example
|
|
9
|
-
* P.isArray([5]) //=> true
|
|
10
|
-
* P.isArray([]) //=> true
|
|
11
|
-
* P.isArray('somethingElse') //=> false
|
|
12
|
-
* @category Guard
|
|
13
|
-
*/
|
|
14
|
-
export declare function isArray<T>(data: ArrayLike<unknown> | T): data is NarrowedTo<T, ReadonlyArray<unknown>>;
|
|
15
|
-
//# sourceMappingURL=is-array.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../../src/guard/is-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAC3B,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAE/C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NarrowedTo } from '../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is a boolean and narrows its type accordingly
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isBoolean(data)
|
|
7
|
-
* @returns true if the passed input is a boolean, false otherwise
|
|
8
|
-
* @example
|
|
9
|
-
* P.isBoolean(true) //=> true
|
|
10
|
-
* P.isBoolean(false) //=> true
|
|
11
|
-
* P.isBoolean('somethingElse') //=> false
|
|
12
|
-
* @category Guard
|
|
13
|
-
*/
|
|
14
|
-
export declare function isBoolean<T>(data: T | boolean): data is NarrowedTo<T, boolean>;
|
|
15
|
-
//# sourceMappingURL=is-boolean.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-boolean.d.ts","sourceRoot":"","sources":["../../../src/guard/is-boolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,IAAI,EAAE,CAAC,GAAG,OAAO,GAChB,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,CAEhC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A function that checks if the passed parameter is a Date and narrows its type accordingly
|
|
3
|
-
* @param data the variable to check
|
|
4
|
-
* @signature
|
|
5
|
-
* P.isDate(data)
|
|
6
|
-
* @returns true if the passed input is a Date, false otherwise
|
|
7
|
-
* @example
|
|
8
|
-
* P.isDate(new Date()) //=> true
|
|
9
|
-
* P.isDate('somethingElse') //=> false
|
|
10
|
-
* @category Guard
|
|
11
|
-
*/
|
|
12
|
-
export declare function isDate(data: unknown): data is Date;
|
|
13
|
-
//# sourceMappingURL=is-date.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-date.d.ts","sourceRoot":"","sources":["../../../src/guard/is-date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,CAElD"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Performs a deep *semantic* comparison between two values to determine if they
|
|
3
|
-
* are equivalent. For primitive values this is equivalent to `===`, for arrays
|
|
4
|
-
* the check would be performed on every item recursively, in order, and for
|
|
5
|
-
* objects all props will be compared recursively. The built-in Date and RegExp
|
|
6
|
-
* are special-cased and will be compared by their values.
|
|
7
|
-
*
|
|
8
|
-
* !IMPORTANT: Maps, Sets and TypedArrays, and symbol properties of objects are
|
|
9
|
-
* not supported right now and might result in unexpected behavior.
|
|
10
|
-
*
|
|
11
|
-
* The result would be narrowed to the second value so that the function can be
|
|
12
|
-
* used as a type guard.
|
|
13
|
-
*
|
|
14
|
-
* @param data - The first value to compare.
|
|
15
|
-
* @param other - The second value to compare.
|
|
16
|
-
* @signature
|
|
17
|
-
* P.isDeepEqual(data, other)
|
|
18
|
-
* @example
|
|
19
|
-
* P.isDeepEqual(1, 1) //=> true
|
|
20
|
-
* P.isDeepEqual(1, '1') //=> false
|
|
21
|
-
* P.isDeepEqual([1, 2, 3], [1, 2, 3]) //=> true
|
|
22
|
-
* @dataFirst
|
|
23
|
-
* @category Guard
|
|
24
|
-
*/
|
|
25
|
-
export declare function isDeepEqual<T, S extends T = T>(data: T, other: S): data is S;
|
|
26
|
-
/**
|
|
27
|
-
* Performs a deep *semantic* comparison between two values to determine if they
|
|
28
|
-
* are equivalent. For primitive values this is equivalent to `===`, for arrays
|
|
29
|
-
* the check would be performed on every item recursively, in order, and for
|
|
30
|
-
* objects all props will be compared recursively. The built-in Date and RegExp
|
|
31
|
-
* are special-cased and will be compared by their values.
|
|
32
|
-
*
|
|
33
|
-
* !IMPORTANT: Maps, Sets and TypedArrays, and symbol properties of objects are
|
|
34
|
-
* not supported right now and might result in unexpected behavior.
|
|
35
|
-
*
|
|
36
|
-
* The result would be narrowed to the second value so that the function can be
|
|
37
|
-
* used as a type guard.
|
|
38
|
-
*
|
|
39
|
-
* @param other - The second value to compare.
|
|
40
|
-
* @signature
|
|
41
|
-
* P.isDeepEqual(other)(data)
|
|
42
|
-
* @example
|
|
43
|
-
* P.pipe(1, P.isDeepEqual(1)); //=> true
|
|
44
|
-
* P.pipe(1, P.isDeepEqual('1')); //=> false
|
|
45
|
-
* P.pipe([1, 2, 3], P.isDeepEqual([1, 2, 3])); //=> true
|
|
46
|
-
* @dataLast
|
|
47
|
-
* @category Guard
|
|
48
|
-
*/
|
|
49
|
-
export declare function isDeepEqual<T, S extends T = T>(other: S): (data: T) => data is S;
|
|
50
|
-
//# sourceMappingURL=is-deep-equal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-equal.d.ts","sourceRoot":"","sources":["../../../src/guard/is-deep-equal.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC5C,KAAK,EAAE,CAAC,GACP,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A function that checks if the passed parameter is defined and narrows its type accordingly.
|
|
3
|
-
* To test specifically for `undefined` (and not `null`) use the strict variant of this function.
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isDefined(data)
|
|
7
|
-
* P.isDefined.strict(data)
|
|
8
|
-
* @returns true if the passed input is defined, false otherwise
|
|
9
|
-
* @example
|
|
10
|
-
* P.isDefined('string') //=> true
|
|
11
|
-
* P.isDefined(null) //=> false
|
|
12
|
-
* P.isDefined(undefined) //=> false
|
|
13
|
-
* P.isDefined.strict(null) //=> true
|
|
14
|
-
* P.isDefined.strict(undefined) //=> false
|
|
15
|
-
* @category Guard
|
|
16
|
-
* @strict
|
|
17
|
-
*/
|
|
18
|
-
export declare function isDefined<T>(data: T): data is NonNullable<T>;
|
|
19
|
-
export declare namespace isDefined {
|
|
20
|
-
function strict<T>(data: T | undefined): data is T;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=is-defined.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-defined.d.ts","sourceRoot":"","sources":["../../../src/guard/is-defined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAE5D;AAED,yBAAiB,SAAS,CAAC;IACzB,SAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,IAAI,CAAC,CAExD;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { IterableContainer } from '../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is empty.
|
|
4
|
-
*
|
|
5
|
-
* `undefined` is also considered empty, but only when it's in a union with a
|
|
6
|
-
* `string` or string-like type.
|
|
7
|
-
*
|
|
8
|
-
* This guard doesn't work negated because of typescript limitations! If you
|
|
9
|
-
* need to check that an array is *not* empty, use `P.hasAtLeast(data, 1)`
|
|
10
|
-
* and not `!P.isEmpty(data)`. For strings and objects there's no way in
|
|
11
|
-
* typescript to narrow the result to a non-empty type.
|
|
12
|
-
*
|
|
13
|
-
* @param data the variable to check
|
|
14
|
-
* @signature
|
|
15
|
-
* P.isEmpty(data)
|
|
16
|
-
* @returns true if the passed input is empty, false otherwise
|
|
17
|
-
* @example
|
|
18
|
-
* P.isEmpty(undefined) //=>true
|
|
19
|
-
* P.isEmpty('') //=> true
|
|
20
|
-
* P.isEmpty([]) //=> true
|
|
21
|
-
* P.isEmpty({}) //=> true
|
|
22
|
-
* P.isEmpty('test') //=> false
|
|
23
|
-
* P.isEmpty([1, 2, 3]) //=> false
|
|
24
|
-
* P.isEmpty({ length: 0 }) //=> false
|
|
25
|
-
* @category Guard
|
|
26
|
-
*/
|
|
27
|
-
export declare function isEmpty<T extends string | undefined>(data: T): data is ('' extends T ? '' : never) | (undefined extends T ? undefined : never);
|
|
28
|
-
export declare function isEmpty(data: IterableContainer): data is [];
|
|
29
|
-
export declare function isEmpty<T extends Readonly<Record<PropertyKey, unknown>>>(data: T): data is Record<keyof T, never>;
|
|
30
|
-
//# sourceMappingURL=is-empty.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.d.ts","sourceRoot":"","sources":["../../../src/guard/is-empty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,EAClD,IAAI,EAAE,CAAC,GACN,IAAI,IACH,CAAC,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAC3B,CAAC,SAAS,SAAS,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;AAC9C,wBAAgB,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,EAAE,CAAC;AAC7D,wBAAgB,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,EACtE,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type DefinitelyError<T> = Extract<T, Error> extends never ? Error : Extract<T, Error>;
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is an Error and narrows its type accordingly
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isError(data)
|
|
7
|
-
* @returns true if the passed input is an Error, false otherwise
|
|
8
|
-
* @example
|
|
9
|
-
* P.isError(new Error('message')) //=> true
|
|
10
|
-
* P.isError('somethingElse') //=> false
|
|
11
|
-
* @category Guard
|
|
12
|
-
*/
|
|
13
|
-
export declare function isError<T>(data: Error | T): data is DefinitelyError<T>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=is-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-error.d.ts","sourceRoot":"","sources":["../../../src/guard/is-error.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,CAAC,CAAC,IACpB,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CAEtE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type DefinitelyFunction<T> = Extract<T, Function> extends never ? Function : Extract<T, Function>;
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is a Function and narrows its type accordingly
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isFunction(data)
|
|
7
|
-
* @returns true if the passed input is a Function, false otherwise
|
|
8
|
-
* @example
|
|
9
|
-
* P.isFunction(() => {}) //=> true
|
|
10
|
-
* P.isFunction('somethingElse') //=> false
|
|
11
|
-
* @category Guard
|
|
12
|
-
*/
|
|
13
|
-
export declare function isFunction<T>(data: Function | T): data is DefinitelyFunction<T>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=is-function.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-function.d.ts","sourceRoot":"","sources":["../../../src/guard/is-function.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,CAAC,CAAC,IACvB,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,IAAI,EAAE,QAAQ,GAAG,CAAC,GACjB,IAAI,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAE/B"}
|