@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,14 +0,0 @@
|
|
|
1
|
-
import type { NarrowedTo } from '../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* A function that checks if the passed parameter is a symbol and narrows its type accordingly
|
|
4
|
-
* @param data the variable to check
|
|
5
|
-
* @signature
|
|
6
|
-
* P.isSymbol(data)
|
|
7
|
-
* @returns true if the passed input is a symbol, false otherwise
|
|
8
|
-
* @example
|
|
9
|
-
* P.isSymbol(Symbol('foo')) //=> true
|
|
10
|
-
* P.isSymbol(1) //=> false
|
|
11
|
-
* @category Guard
|
|
12
|
-
*/
|
|
13
|
-
export declare function isSymbol<T>(data: T | symbol): data is NarrowedTo<T, symbol>;
|
|
14
|
-
//# sourceMappingURL=is-symbol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-symbol.d.ts","sourceRoot":"","sources":["../../../src/guard/is-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAE3E"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A function that checks if the passed parameter is truthy and narrows its type accordingly
|
|
3
|
-
* @param data the variable to check
|
|
4
|
-
* @signature
|
|
5
|
-
* P.isTruthy(data)
|
|
6
|
-
* @returns true if the passed input is truthy, false otherwise
|
|
7
|
-
* @example
|
|
8
|
-
* P.isTruthy('somethingElse') //=> true
|
|
9
|
-
* P.isTruthy(null) //=> false
|
|
10
|
-
* P.isTruthy(undefined) //=> false
|
|
11
|
-
* P.isTruthy(false) //=> false
|
|
12
|
-
* P.isTruthy(0) //=> false
|
|
13
|
-
* P.isTruthy('') //=> false
|
|
14
|
-
* @category Guard
|
|
15
|
-
*/
|
|
16
|
-
export declare function isTruthy<T>(data: T): data is Exclude<T, '' | 0 | false | null | undefined>;
|
|
17
|
-
//# sourceMappingURL=is-truthy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-truthy.d.ts","sourceRoot":"","sources":["../../../src/guard/is-truthy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,CAEvD"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './aria';
|
|
2
|
-
export * from './array';
|
|
3
|
-
export * from './function';
|
|
4
|
-
export * from './guard';
|
|
5
|
-
export * from './number';
|
|
6
|
-
export * from './object';
|
|
7
|
-
export * from './string';
|
|
8
|
-
export * from './type';
|
|
9
|
-
export declare const isBrowser: boolean;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,eAAO,MAAM,SAAS,SAAgC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adds two numbers.
|
|
3
|
-
* @param value The number.
|
|
4
|
-
* @param addend The number to add to the value.
|
|
5
|
-
* @signature
|
|
6
|
-
* P.add(value, addend);
|
|
7
|
-
* @example
|
|
8
|
-
* P.add(10, 5) // => 15
|
|
9
|
-
* P.add(10, -5) // => 5
|
|
10
|
-
* P.reduce([1, 2, 3, 4], P.add, 0) // => 10
|
|
11
|
-
* @dataFirst
|
|
12
|
-
* @category Number
|
|
13
|
-
*/
|
|
14
|
-
export declare function add(value: number, addend: number): number;
|
|
15
|
-
/**
|
|
16
|
-
* Adds two numbers.
|
|
17
|
-
* @param addend The number to add to the value.
|
|
18
|
-
* @signature
|
|
19
|
-
* P.add(addend)(value);
|
|
20
|
-
* @example
|
|
21
|
-
* P.add(5)(10) // => 15
|
|
22
|
-
* P.add(-5)(10) // => 5
|
|
23
|
-
* P.map([1, 2, 3, 4], P.add(1)) // => [2, 3, 4, 5]
|
|
24
|
-
* @dataLast
|
|
25
|
-
* @category Number
|
|
26
|
-
*/
|
|
27
|
-
export declare function add(addend: number): (value: number) => number;
|
|
28
|
-
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/number/add.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rounds up a given number to a specific precision.
|
|
3
|
-
* If you'd like to round up to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
|
-
* use `Math.ceil` instead, as it won't incur the additional library overhead.
|
|
5
|
-
*
|
|
6
|
-
* @param value The number to round up.
|
|
7
|
-
* @param precision The precision to round up to. Must be an integer between -15 and 15.
|
|
8
|
-
* @signature
|
|
9
|
-
* P.ceil(value, precision);
|
|
10
|
-
* @example
|
|
11
|
-
* P.ceil(123.9876, 3) // => 123.988
|
|
12
|
-
* P.ceil(483.22243, 1) // => 483.3
|
|
13
|
-
* P.ceil(8541, -1) // => 8550
|
|
14
|
-
* P.ceil(456789, -3) // => 457000
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Number
|
|
17
|
-
*/
|
|
18
|
-
export declare function ceil(value: number, precision: number): number;
|
|
19
|
-
/**
|
|
20
|
-
* Rounds up a given number to a specific precision.
|
|
21
|
-
* If you'd like to round up to an integer (i.e. use this function with constant `precision === 0`),
|
|
22
|
-
* use `Math.ceil` instead, as it won't incur the additional library overhead.
|
|
23
|
-
*
|
|
24
|
-
* @param precision The precision to round up to. Must be an integer between -15 and 15.
|
|
25
|
-
* @signature
|
|
26
|
-
* P.ceil(precision)(value);
|
|
27
|
-
* @example
|
|
28
|
-
* P.ceil(3)(123.9876) // => 123.988
|
|
29
|
-
* P.ceil(1)(483.22243) // => 483.3
|
|
30
|
-
* P.ceil(-1)(8541) // => 8550
|
|
31
|
-
* P.ceil(-3)(456789) // => 457000
|
|
32
|
-
* @dataLast
|
|
33
|
-
* @category Number
|
|
34
|
-
*/
|
|
35
|
-
export declare function ceil(precision: number): (value: number) => number;
|
|
36
|
-
//# sourceMappingURL=ceil.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ceil.d.ts","sourceRoot":"","sources":["../../../src/number/ceil.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
interface Limits {
|
|
2
|
-
readonly max?: number;
|
|
3
|
-
readonly min?: number;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Clamp the given value within the inclusive min and max bounds.
|
|
7
|
-
* @param value the number
|
|
8
|
-
* @param limits the bounds limits
|
|
9
|
-
* @param limits.min the minimal bounds limits
|
|
10
|
-
* @param limits.max the maximal bounds limits
|
|
11
|
-
* @signature
|
|
12
|
-
* P.clamp(value, { min, max });
|
|
13
|
-
* @example
|
|
14
|
-
* P.clamp(10, { min: 20 }) // => 20
|
|
15
|
-
* P.clamp(10, { max: 5 }) // => 5
|
|
16
|
-
* P.clamp(10, { max: 20, min: 5 }) // => 10
|
|
17
|
-
* @dataFirst
|
|
18
|
-
* @category Number
|
|
19
|
-
*/
|
|
20
|
-
export declare function clamp(value: number, limits: Limits): number;
|
|
21
|
-
/**
|
|
22
|
-
* Clamp the given value within the inclusive min and max bounds.
|
|
23
|
-
* @param limits the bounds limits
|
|
24
|
-
* @param limits.min the minimal bounds limits
|
|
25
|
-
* @param limits.max the maximal bounds limits
|
|
26
|
-
* @signature
|
|
27
|
-
* P.clamp({ min, max })(value);
|
|
28
|
-
* @example
|
|
29
|
-
* P.clamp({ min: 20 })(10) // => 20
|
|
30
|
-
* P.clamp({ max: 5 })(10) // => 5
|
|
31
|
-
* P.clamp({ max: 20, min: 5 })(10) // => 10
|
|
32
|
-
* @dataLast
|
|
33
|
-
* @category Number
|
|
34
|
-
*/
|
|
35
|
-
export declare function clamp(limits: Limits): (value: number) => number;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=clamp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../../src/number/clamp.ts"],"names":[],"mappings":"AAEA,UAAU,MAAM;IACd,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Divides two numbers.
|
|
3
|
-
* @param value The number.
|
|
4
|
-
* @param divisor The number to divide the value by.
|
|
5
|
-
* @signature
|
|
6
|
-
* P.divide(value, divisor);
|
|
7
|
-
* @example
|
|
8
|
-
* P.divide(12, 3) // => 4
|
|
9
|
-
* P.reduce([1, 2, 3, 4], P.divide, 24) // => 1
|
|
10
|
-
* @dataFirst
|
|
11
|
-
* @category Number
|
|
12
|
-
*/
|
|
13
|
-
export declare function divide(value: number, divisor: number): number;
|
|
14
|
-
/**
|
|
15
|
-
* Divides two numbers.
|
|
16
|
-
* @param divisor The number to divide the value by.
|
|
17
|
-
* @signature
|
|
18
|
-
* P.divide(divisor)(value);
|
|
19
|
-
* @example
|
|
20
|
-
* P.divide(3)(12) // => 4
|
|
21
|
-
* P.map([2, 4, 6, 8], P.divide(2)) // => [1, 2, 3, 4]
|
|
22
|
-
* @dataLast
|
|
23
|
-
* @category Number
|
|
24
|
-
*/
|
|
25
|
-
export declare function divide(divisor: number): (value: number) => number;
|
|
26
|
-
//# sourceMappingURL=divide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divide.d.ts","sourceRoot":"","sources":["../../../src/number/divide.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rounds down a given number to a specific precision.
|
|
3
|
-
* If you'd like to round down to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
|
-
* use `Math.floor` instead, as it won't incur the additional library overhead.
|
|
5
|
-
*
|
|
6
|
-
* @param value The number to round down.
|
|
7
|
-
* @param precision The precision to round down to. Must be an integer between -15 and 15.
|
|
8
|
-
* @signature
|
|
9
|
-
* P.floor(value, precision);
|
|
10
|
-
* @example
|
|
11
|
-
* P.floor(123.9876, 3) // => 123.987
|
|
12
|
-
* P.floor(483.22243, 1) // => 483.2
|
|
13
|
-
* P.floor(8541, -1) // => 8540
|
|
14
|
-
* P.floor(456789, -3) // => 456000
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Number
|
|
17
|
-
*/
|
|
18
|
-
export declare function floor(value: number, precision: number): number;
|
|
19
|
-
/**
|
|
20
|
-
* Rounds down a given number to a specific precision.
|
|
21
|
-
* If you'd like to round down to an integer (i.e. use this function with constant `precision === 0`),
|
|
22
|
-
* use `Math.floor` instead, as it won't incur the additional library overhead.
|
|
23
|
-
*
|
|
24
|
-
* @param precision The precision to round down to. Must be an integer between -15 and 15.
|
|
25
|
-
* @signature
|
|
26
|
-
* P.floor(precision)(value);
|
|
27
|
-
* @example
|
|
28
|
-
* P.floor(3)(123.9876) // => 123.987
|
|
29
|
-
* P.floor(1)(483.22243) // => 483.2
|
|
30
|
-
* P.floor(-1)(8541) // => 8540
|
|
31
|
-
* P.floor(-3)(456789) // => 456000
|
|
32
|
-
* @dataLast
|
|
33
|
-
* @category Number
|
|
34
|
-
*/
|
|
35
|
-
export declare function floor(precision: number): (value: number) => number;
|
|
36
|
-
//# sourceMappingURL=floor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"floor.d.ts","sourceRoot":"","sources":["../../../src/number/floor.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/number/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multiplies two numbers.
|
|
3
|
-
*
|
|
4
|
-
* @param value The number.
|
|
5
|
-
* @param multiplicand The number to multiply the value by.
|
|
6
|
-
* @signature
|
|
7
|
-
* P.multiply(value, multiplicand);
|
|
8
|
-
* @example
|
|
9
|
-
* P.multiply(3, 4) // => 12
|
|
10
|
-
* P.reduce([1, 2, 3, 4], P.multiply, 1) // => 24
|
|
11
|
-
* @dataFirst
|
|
12
|
-
* @category Number
|
|
13
|
-
*/
|
|
14
|
-
export declare function multiply(value: number, multiplicand: number): number;
|
|
15
|
-
/**
|
|
16
|
-
* Multiplies two numbers.
|
|
17
|
-
*
|
|
18
|
-
* @param multiplicand The number to multiply the value by.
|
|
19
|
-
* @signature
|
|
20
|
-
* P.multiply(multiplicand)(value);
|
|
21
|
-
* @example
|
|
22
|
-
* P.multiply(4)(3) // => 12
|
|
23
|
-
* P.map([1, 2, 3, 4], P.multiply(2)) // => [2, 4, 6, 8]
|
|
24
|
-
* @dataLast
|
|
25
|
-
* @category Number
|
|
26
|
-
*/
|
|
27
|
-
export declare function multiply(multiplicand: number): (value: number) => number;
|
|
28
|
-
//# sourceMappingURL=multiply.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/number/multiply.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rounds a given number to a specific precision.
|
|
3
|
-
* If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),
|
|
4
|
-
* use `Math.round` instead, as it won't incur the additional library overhead.
|
|
5
|
-
*
|
|
6
|
-
* @param value The number to round.
|
|
7
|
-
* @param precision The precision to round to. Must be an integer between -15 and 15.
|
|
8
|
-
* @signature
|
|
9
|
-
* P.round(value, precision);
|
|
10
|
-
* @example
|
|
11
|
-
* P.round(123.9876, 3) // => 123.988
|
|
12
|
-
* P.round(483.22243, 1) // => 483.2
|
|
13
|
-
* P.round(8541, -1) // => 8540
|
|
14
|
-
* P.round(456789, -3) // => 457000
|
|
15
|
-
* @dataFirst
|
|
16
|
-
* @category Number
|
|
17
|
-
*/
|
|
18
|
-
export declare function round(value: number, precision: number): number;
|
|
19
|
-
/**
|
|
20
|
-
* Rounds a given number to a specific precision.
|
|
21
|
-
* If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),
|
|
22
|
-
* use `Math.round` instead, as it won't incur the additional library overhead.
|
|
23
|
-
*
|
|
24
|
-
* @param precision The precision to round to. Must be an integer between -15 and 15.
|
|
25
|
-
* @signature
|
|
26
|
-
* P.round(precision)(value);
|
|
27
|
-
* @example
|
|
28
|
-
* P.round(3)(123.9876) // => 123.988
|
|
29
|
-
* P.round(1)(483.22243) // => 483.2
|
|
30
|
-
* P.round(-1)(8541) // => 8540
|
|
31
|
-
* P.round(-3)(456789) // => 457000
|
|
32
|
-
* @dataLast
|
|
33
|
-
* @category Number
|
|
34
|
-
*/
|
|
35
|
-
export declare function round(precision: number): (value: number) => number;
|
|
36
|
-
//# sourceMappingURL=round.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/number/round.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subtracts two numbers.
|
|
3
|
-
*
|
|
4
|
-
* @param value The number.
|
|
5
|
-
* @param subtrahend The number to subtract from the value.
|
|
6
|
-
* @signature
|
|
7
|
-
* P.subtract(value, subtrahend);
|
|
8
|
-
* @example
|
|
9
|
-
* P.subtract(10, 5) // => 5
|
|
10
|
-
* P.subtract(10, -5) // => 15
|
|
11
|
-
* R.reduce([1, 2, 3, 4], P.subtract, 20) // => 10
|
|
12
|
-
* @dataFirst
|
|
13
|
-
* @category Number
|
|
14
|
-
*/
|
|
15
|
-
export declare function subtract(value: number, subtrahend: number): number;
|
|
16
|
-
/**
|
|
17
|
-
* Subtracts two numbers.
|
|
18
|
-
*
|
|
19
|
-
* @param subtrahend The number to subtract from the value.
|
|
20
|
-
* @signature
|
|
21
|
-
* P.subtract(subtrahend)(value);
|
|
22
|
-
* @example
|
|
23
|
-
* P.subtract(5)(10) // => 5
|
|
24
|
-
* P.subtract(-5)(10) // => 15
|
|
25
|
-
* P.map([1, 2, 3, 4], P.subtract(1)) // => [0, 1, 2, 3]
|
|
26
|
-
* @dataLast
|
|
27
|
-
* @category Number
|
|
28
|
-
*/
|
|
29
|
-
export declare function subtract(subtrahend: number): (value: number) => number;
|
|
30
|
-
//# sourceMappingURL=subtract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subtract.d.ts","sourceRoot":"","sources":["../../../src/number/subtract.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add a new property to an object.
|
|
3
|
-
* @param obj the target object
|
|
4
|
-
* @param prop the property name
|
|
5
|
-
* @param value the property value
|
|
6
|
-
* @signature
|
|
7
|
-
* P.addProp(obj, prop, value)
|
|
8
|
-
* @example
|
|
9
|
-
* P.addProp({firstName: 'john'}, 'lastName', 'doe') // => {firstName: 'john', lastName: 'doe'}
|
|
10
|
-
* @dataFirst
|
|
11
|
-
* @category Object
|
|
12
|
-
*/
|
|
13
|
-
export declare function addProp<T extends Record<PropertyKey, unknown>, K extends string, V>(obj: T, prop: K, value: V): T & {
|
|
14
|
-
[x in K]: V;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Add a new property to an object.
|
|
18
|
-
* @param prop the property name
|
|
19
|
-
* @param value the property value
|
|
20
|
-
* @signature
|
|
21
|
-
* P.addProp(prop, value)(obj)
|
|
22
|
-
* @example
|
|
23
|
-
* P.addProp('lastName', 'doe')({firstName: 'john'}) // => {firstName: 'john', lastName: 'doe'}
|
|
24
|
-
* @dataLast
|
|
25
|
-
* @category Object
|
|
26
|
-
*/
|
|
27
|
-
export declare function addProp<T extends Record<PropertyKey, unknown>, K extends string, V>(prop: K, value: V): (obj: T) => T & {
|
|
28
|
-
[x in K]: V;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=add-prop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-prop.d.ts","sourceRoot":"","sources":["../../../src/object/add-prop.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,CAAC,SAAS,MAAM,EAChB,CAAC,EACD,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,CAAC;AAElD;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,CAAC,SAAS,MAAM,EAChB,CAAC,EACD,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a deep copy of the value. Supported types: `Array`, `Object`, `Number`, `String`, `Boolean`, `Date`, `RegExp`. Functions are assigned by reference rather than copied.
|
|
3
|
-
* @param value the object to clone
|
|
4
|
-
* @category Object
|
|
5
|
-
* @signature P.clone(value)
|
|
6
|
-
* @example
|
|
7
|
-
* P.clone({foo: 'bar'}) // {foo: 'bar'}
|
|
8
|
-
*/
|
|
9
|
-
export declare function clone<T>(value: T): T;
|
|
10
|
-
//# sourceMappingURL=clone.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../src/object/clone.ts"],"names":[],"mappings":"AAsDA;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAIpC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
type IndexedIteratee<T extends Record<PropertyKey, unknown>, K extends keyof T> = (value: T[K], key: K, obj: T) => void;
|
|
2
|
-
type UnindexedIteratee<T extends Record<PropertyKey, unknown>> = (value: T[keyof T]) => void;
|
|
3
|
-
/**
|
|
4
|
-
* Iterate an object using a defined callback function. The original object is returned.
|
|
5
|
-
* @param object The object.
|
|
6
|
-
* @param fn The callback function.
|
|
7
|
-
* @returns The original object
|
|
8
|
-
* @signature
|
|
9
|
-
* P.forEachObj(object, fn)
|
|
10
|
-
* @example
|
|
11
|
-
* P.forEachObj({a: 1}, (val) => {
|
|
12
|
-
* console.log(`${val}`)
|
|
13
|
-
* }) // "1"
|
|
14
|
-
* P.forEachObj.indexed({a: 1}, (val, key, obj) => {
|
|
15
|
-
* console.log(`${key}: ${val}`)
|
|
16
|
-
* }) // "a: 1"
|
|
17
|
-
* @dataFirst
|
|
18
|
-
* @category Object
|
|
19
|
-
*/
|
|
20
|
-
export declare function forEachObj<T extends Record<PropertyKey, unknown>>(object: T, fn: UnindexedIteratee<T>): T;
|
|
21
|
-
/**
|
|
22
|
-
* Iterate an object using a defined callback function. The original object is returned.
|
|
23
|
-
* @param fn The callback function.
|
|
24
|
-
* @signature
|
|
25
|
-
* P.forEachObj(fn)(object)
|
|
26
|
-
* @example
|
|
27
|
-
* P.pipe(
|
|
28
|
-
* {a: 1},
|
|
29
|
-
* P.forEachObj((val) => console.log(`${val}`))
|
|
30
|
-
* ) // "1"
|
|
31
|
-
* P.pipe(
|
|
32
|
-
* {a: 1},
|
|
33
|
-
* P.forEachObj.indexed((val, key) => console.log(`${key}: ${val}`))
|
|
34
|
-
* ) // "a: 1"
|
|
35
|
-
* @dataLast
|
|
36
|
-
* @category Object
|
|
37
|
-
*/
|
|
38
|
-
export declare function forEachObj<T extends Record<PropertyKey, unknown>>(fn: UnindexedIteratee<T>): (object: T) => T;
|
|
39
|
-
export declare namespace forEachObj {
|
|
40
|
-
function indexed<T extends Record<PropertyKey, unknown>>(object: T, fn: IndexedIteratee<T, keyof T>): T;
|
|
41
|
-
function indexed<T extends Record<PropertyKey, unknown>>(fn: IndexedIteratee<T, keyof T>): (object: T) => T;
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=for-each-obj.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"for-each-obj.d.ts","sourceRoot":"","sources":["../../../src/object/for-each-obj.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,CAClB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,CAAC,SAAS,MAAM,CAAC,IACf,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;AAC1C,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAC/D,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KACd,IAAI,CAAC;AACV;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC/D,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,GACvB,CAAC,CAAC;AAEL;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC/D,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,GACvB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;AA8BpB,yBAAiB,UAAU,CAAC;IAC1B,SAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC5D,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAC9B,CAAC,CAAC;IACL,SAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC5D,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAC9B,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;CAIrB"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Simplify } from 'type-fest';
|
|
2
|
-
import type { IterableContainer } from '../utils/types';
|
|
3
|
-
type ExactlyOneKey<T, V> = T extends PropertyKey ? {
|
|
4
|
-
[P in T]: V;
|
|
5
|
-
} : never;
|
|
6
|
-
type FromKeys<T extends IterableContainer, V> = T extends readonly [] ? {} : T extends readonly [infer Head, ...infer Rest] ? ExactlyOneKey<Head, V> & FromKeys<Rest, V> : T[number] extends PropertyKey ? Partial<Record<T[number], V>> : never;
|
|
7
|
-
/**
|
|
8
|
-
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
9
|
-
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
|
10
|
-
* for each item in `data`.
|
|
11
|
-
*
|
|
12
|
-
* @param data - An array of keys of the output object. All items in the array
|
|
13
|
-
* would be keys in the output array.
|
|
14
|
-
* @param mapper - Takes a key and returns the value that would be associated
|
|
15
|
-
* with that key.
|
|
16
|
-
* @signature
|
|
17
|
-
* P.fromKeys(data, mapper);
|
|
18
|
-
* @example
|
|
19
|
-
* P.fromKeys(["cat", "dog"], P.length()); // { cat: 3, dog: 3 } (typed as Partial<Record<"cat" | "dog", number>>)
|
|
20
|
-
* P.fromKeys([1, 2], P.add(1)); // { 1: 2, 2: 3 } (typed as Partial<Record<1 | 2, number>>)
|
|
21
|
-
* @dataFirst
|
|
22
|
-
* @category Object
|
|
23
|
-
*/
|
|
24
|
-
export declare function fromKeys<T extends IterableContainer<PropertyKey>, V>(data: T, mapper: (item: T[number]) => V): Simplify<FromKeys<T, V>>;
|
|
25
|
-
/**
|
|
26
|
-
* Creates an object that maps each key in `data` to the result of `mapper` for
|
|
27
|
-
* that key. Duplicate keys are overwritten, guaranteeing that `mapper` is run
|
|
28
|
-
* for each item in `data`.
|
|
29
|
-
*
|
|
30
|
-
* @param mapper - Takes a key and returns the value that would be associated
|
|
31
|
-
* with that key.
|
|
32
|
-
* @signature
|
|
33
|
-
* P.fromKeys(mapper)(data);
|
|
34
|
-
* @example
|
|
35
|
-
* P.pipe(["cat", "dog"], P.fromKeys(P.length())); // { cat: 3, dog: 3 } (typed as Partial<Record<"cat" | "dog", number>>)
|
|
36
|
-
* P.pipe([1, 2], P.fromKeys(P.add(1))); // { 1: 2, 2: 3 } (typed as Partial<Record<1 | 2, number>>)
|
|
37
|
-
* @dataLast
|
|
38
|
-
* @category Object
|
|
39
|
-
*/
|
|
40
|
-
export declare function fromKeys<T extends IterableContainer<PropertyKey>, V>(mapper: (item: T[number]) => V): (data: T) => Simplify<FromKeys<T, V>>;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=from-keys.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"from-keys.d.ts","sourceRoot":"","sources":["../../../src/object/from-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,WAAW,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,GAAG,KAAK,CAAC;AAE3E,KAAK,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAAE,CAAC,IAAI,CAAC,SAAS,SAAS,EAAE,GAEjE,EAAE,GACF,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GAC5C,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,GAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,WAAW,GAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAC7B,KAAK,CAAC;AAEd;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,EAClE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC7B,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,EAClE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC7B,CAAC,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { IterableContainer } from '../utils/types';
|
|
2
|
-
type Entry<Key extends PropertyKey = PropertyKey, Value = unknown> = readonly [
|
|
3
|
-
key: Key,
|
|
4
|
-
value: Value
|
|
5
|
-
];
|
|
6
|
-
/**
|
|
7
|
-
* Creates a new object from an array of tuples by pairing up first and second elements as `{[key]: value}`.
|
|
8
|
-
* If a tuple is not supplied for any element in the array, the element will be ignored
|
|
9
|
-
* If duplicate keys exist, the tuple with the greatest index in the input array will be preferred.
|
|
10
|
-
*
|
|
11
|
-
* The strict option supports more sophisticated use-cases like those that would
|
|
12
|
-
* result when calling the strict `toPairs` function.
|
|
13
|
-
* @param pairs the list of input tuples
|
|
14
|
-
* @signature
|
|
15
|
-
* P.fromPairs(tuples)
|
|
16
|
-
* P.fromPairs.strict(tuples)
|
|
17
|
-
* @example
|
|
18
|
-
* P.fromPairs([['a', 'b'], ['c', 'd']]) // => {a: 'b', c: 'd'} (type: Record<string, string>)
|
|
19
|
-
* P.fromPairs.strict(['a', 1] as const) // => {a: 1} (type: {a: 1})
|
|
20
|
-
* P.pipe(
|
|
21
|
-
* [['a', 'b'], ['c', 'd']],
|
|
22
|
-
* P.fromPairs,
|
|
23
|
-
* ); // => {a: 'b', c: 'd'} (type: Record<string, string>)
|
|
24
|
-
* P.pipe(
|
|
25
|
-
* ['a', 1] as const,
|
|
26
|
-
* P.fromPairs.strict,
|
|
27
|
-
* ); // => {a: 1} (type: {a: 1})
|
|
28
|
-
* @category Object
|
|
29
|
-
* @strict
|
|
30
|
-
* @dataFirst
|
|
31
|
-
*/
|
|
32
|
-
export declare function fromPairs<V>(pairs: ReadonlyArray<Entry<number, V>>): Record<number, V>;
|
|
33
|
-
export declare function fromPairs<V>(pairs: ReadonlyArray<Entry<string, V>>): Record<string, V>;
|
|
34
|
-
type Strict = <Entries extends IterableContainer<Entry>>(entries: Entries) => StrictOut<Entries>;
|
|
35
|
-
type StrictOut<Entries> = Entries extends readonly [infer First, ...infer Tail] ? FromPairsTuple<First, Tail> : Entries extends readonly [...infer Head, infer Last] ? FromPairsTuple<Last, Head> : Entries extends IterableContainer<Entry> ? FromPairsArray<Entries> : 'ERROR: Entries array-like could not be infered';
|
|
36
|
-
type FromPairsTuple<E, Rest> = E extends Entry ? Record<E[0], E[1]> & StrictOut<Rest> : 'ERROR: Array-like contains a non-entry element';
|
|
37
|
-
type FromPairsArray<Entries extends IterableContainer<Entry>> = string extends AllKeys<Entries> ? Record<string, Entries[number][1]> : number extends AllKeys<Entries> ? Record<number, Entries[number][1]> : symbol extends AllKeys<Entries> ? Record<symbol, Entries[number][1]> : FromPairsArrayWithLiteralKeys<Entries>;
|
|
38
|
-
type FromPairsArrayWithLiteralKeys<Entries extends IterableContainer<Entry>> = {
|
|
39
|
-
[K in AllKeys<Entries>]?: ValueForKey<Entries, K>;
|
|
40
|
-
};
|
|
41
|
-
type AllKeys<Entries extends IterableContainer<Entry>> = Extract<Entries[number], Entry>[0];
|
|
42
|
-
type ValueForKey<Entries extends IterableContainer<Entry>, K extends PropertyKey> = (Extract<Entries[number], Entry<K>> extends never ? Entries[number] : Extract<Entries[number], Entry<K>>)[1];
|
|
43
|
-
export declare namespace fromPairs {
|
|
44
|
-
const strict: Strict;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
47
|
-
//# sourceMappingURL=from-pairs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"from-pairs.d.ts","sourceRoot":"","sources":["../../../src/object/from-pairs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,KAAK,KAAK,CAAC,GAAG,SAAS,WAAW,GAAG,WAAW,EAAE,KAAK,GAAG,OAAO,IAAI,SAAS;IAC5E,GAAG,EAAE,GAAG;IACR,KAAK,EAAE,KAAK;CACb,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACrB,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAgDrB,KAAK,MAAM,GAIT,CAAC,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,EACvC,OAAO,EAAE,OAAO,KACb,SAAS,CAAC,OAAO,CAAC,CAAC;AAS1B,KAAK,SAAS,CAAC,OAAO,IAAI,OAAO,SAAS,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAC3E,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,GAC3B,OAAO,SAAS,SAAS,CAAC,GAAG,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,GAClD,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,GAC1B,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,GACtC,cAAc,CAAC,OAAO,CAAC,GACvB,gDAAgD,CAAC;AAKzD,KAAK,cAAc,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,SAAS,KAAK,GAC1C,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,GACpC,gDAAgD,CAAC;AAYrD,KAAK,cAAc,CAAC,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,IAC1D,MAAM,SAAS,OAAO,CAAC,OAAO,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,MAAM,SAAS,OAAO,CAAC,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,MAAM,SAAS,OAAO,CAAC,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAOjD,KAAK,6BAA6B,CAAC,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,IAAI;KAC5E,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;CAClD,CAAC;AAEF,KAAK,OAAO,CAAC,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,IAAI,OAAO,CAC9D,OAAO,CAAC,MAAM,CAAC,EACf,KAAK,CACN,CAAC,CAAC,CAAC,CAAC;AAEL,KAAK,WAAW,CACd,OAAO,SAAS,iBAAiB,CAAC,KAAK,CAAC,EACxC,CAAC,SAAS,WAAW,IAQrB,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAC7C,OAAO,CAAC,MAAM,CAAC,GACf,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7C,yBAAiB,SAAS,CAAC;IAElB,MAAM,MAAM,QAAsB,CAAC;CAC3C"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from './add-prop';
|
|
2
|
-
export * from './clone';
|
|
3
|
-
export * from './for-each-obj';
|
|
4
|
-
export * from './from-keys';
|
|
5
|
-
export * from './from-pairs';
|
|
6
|
-
export * from './index';
|
|
7
|
-
export * from './invert';
|
|
8
|
-
export * from './keys';
|
|
9
|
-
export * from './map-keys';
|
|
10
|
-
export * from './map-values';
|
|
11
|
-
export * from './merge';
|
|
12
|
-
export * from './merge-deep';
|
|
13
|
-
export * from './omit';
|
|
14
|
-
export * from './omit-by';
|
|
15
|
-
export * from './path-or';
|
|
16
|
-
export * from './pick';
|
|
17
|
-
export * from './pick-by';
|
|
18
|
-
export * from './prop';
|
|
19
|
-
export * from './set';
|
|
20
|
-
export * from './set-path';
|
|
21
|
-
export * from './swap-props';
|
|
22
|
-
export * from './to-pairs';
|
|
23
|
-
export * from './values';
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/object/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type Inverted<T extends object> = T[keyof T] extends PropertyKey ? Record<T[keyof T], keyof T> : never;
|
|
2
|
-
/**
|
|
3
|
-
* Returns an object whose keys are values are swapped. If the object contains duplicate values,
|
|
4
|
-
* subsequent values will overwrite previous values.
|
|
5
|
-
*
|
|
6
|
-
* @param object the object
|
|
7
|
-
* @signature
|
|
8
|
-
* P.invert(object)
|
|
9
|
-
* @example
|
|
10
|
-
* P.invert({ a: "d", b: "e", c: "f" }) // => { d: "a", e: "b", f: "c" }
|
|
11
|
-
* @dataFirst
|
|
12
|
-
* @category Object
|
|
13
|
-
* @pipeable
|
|
14
|
-
*/
|
|
15
|
-
export declare function invert<T extends object>(object: T): Inverted<T>;
|
|
16
|
-
/**
|
|
17
|
-
* Returns an object whose keys are values are swapped. If the object contains duplicate values,
|
|
18
|
-
* subsequent values will overwrite previous values.
|
|
19
|
-
*
|
|
20
|
-
* @signature
|
|
21
|
-
* P.invert()(object)
|
|
22
|
-
* @example
|
|
23
|
-
* P.pipe({ a: "d", b: "e", c: "f" }, P.invert()); // => { d: "a", e: "b", f: "c" }
|
|
24
|
-
* @dataLast
|
|
25
|
-
* @category Object
|
|
26
|
-
* @pipeable
|
|
27
|
-
*/
|
|
28
|
-
export declare function invert<T extends object>(): (object: T) => Inverted<T>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=invert.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/object/invert.ts"],"names":[],"mappings":"AAEA,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,WAAW,GAC5D,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAC3B,KAAK,CAAC;AAEV;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC"}
|