@vinicunca/perkakas 0.0.4 → 0.0.8
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 +2276 -0
- package/dist/index.d.cts +3230 -0
- package/dist/index.d.ts +3230 -0
- package/dist/index.js +2135 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +7 -0
- package/package.json +38 -30
- package/dist/commonjs/aria/index.d.ts +0 -2
- package/dist/commonjs/aria/index.d.ts.map +0 -1
- package/dist/commonjs/aria/index.js +0 -17
- package/dist/commonjs/aria/key-codes.d.ts +0 -23
- package/dist/commonjs/aria/key-codes.d.ts.map +0 -1
- package/dist/commonjs/aria/key-codes.js +0 -25
- package/dist/commonjs/array/all-pass.d.ts +0 -3
- package/dist/commonjs/array/all-pass.d.ts.map +0 -1
- package/dist/commonjs/array/all-pass.js +0 -11
- package/dist/commonjs/array/any-pass.d.ts +0 -3
- package/dist/commonjs/array/any-pass.d.ts.map +0 -1
- package/dist/commonjs/array/any-pass.js +0 -11
- package/dist/commonjs/array/chunk.d.ts +0 -6
- package/dist/commonjs/array/chunk.d.ts.map +0 -1
- package/dist/commonjs/array/chunk.js +0 -17
- package/dist/commonjs/array/compact.d.ts +0 -2
- package/dist/commonjs/array/compact.d.ts.map +0 -1
- package/dist/commonjs/array/compact.js +0 -8
- package/dist/commonjs/array/concat.d.ts +0 -3
- package/dist/commonjs/array/concat.d.ts.map +0 -1
- package/dist/commonjs/array/concat.js +0 -11
- package/dist/commonjs/array/count-by.d.ts +0 -8
- package/dist/commonjs/array/count-by.d.ts.map +0 -1
- package/dist/commonjs/array/count-by.js +0 -22
- package/dist/commonjs/array/difference-with.d.ts +0 -9
- package/dist/commonjs/array/difference-with.d.ts.map +0 -1
- package/dist/commonjs/array/difference-with.js +0 -31
- package/dist/commonjs/array/difference.d.ts +0 -7
- package/dist/commonjs/array/difference.d.ts.map +0 -1
- package/dist/commonjs/array/difference.js +0 -32
- package/dist/commonjs/array/drop-last.d.ts +0 -3
- package/dist/commonjs/array/drop-last.d.ts.map +0 -1
- package/dist/commonjs/array/drop-last.js +0 -15
- package/dist/commonjs/array/drop.d.ts +0 -7
- package/dist/commonjs/array/drop.d.ts.map +0 -1
- package/dist/commonjs/array/drop.js +0 -32
- package/dist/commonjs/array/filter.d.ts +0 -17
- package/dist/commonjs/array/filter.d.ts.map +0 -1
- package/dist/commonjs/array/filter.js +0 -41
- package/dist/commonjs/array/find-index.d.ts +0 -32
- package/dist/commonjs/array/find-index.d.ts.map +0 -1
- package/dist/commonjs/array/find-index.js +0 -46
- package/dist/commonjs/array/find-last-index.d.ts +0 -8
- package/dist/commonjs/array/find-last-index.d.ts.map +0 -1
- package/dist/commonjs/array/find-last-index.js +0 -24
- package/dist/commonjs/array/find-last.d.ts +0 -8
- package/dist/commonjs/array/find-last.d.ts.map +0 -1
- package/dist/commonjs/array/find-last.js +0 -23
- package/dist/commonjs/array/find.d.ts +0 -24
- package/dist/commonjs/array/find.d.ts.map +0 -1
- package/dist/commonjs/array/find.js +0 -38
- package/dist/commonjs/array/first.d.ts +0 -16
- package/dist/commonjs/array/first.d.ts.map +0 -1
- package/dist/commonjs/array/first.js +0 -26
- package/dist/commonjs/array/flat-map-to-obj.d.ts +0 -7
- package/dist/commonjs/array/flat-map-to-obj.d.ts.map +0 -1
- package/dist/commonjs/array/flat-map-to-obj.js +0 -25
- package/dist/commonjs/array/flat-map.d.ts +0 -16
- package/dist/commonjs/array/flat-map.d.ts.map +0 -1
- package/dist/commonjs/array/flat-map.js +0 -33
- package/dist/commonjs/array/flatten-deep.d.ts +0 -12
- package/dist/commonjs/array/flatten-deep.d.ts.map +0 -1
- package/dist/commonjs/array/flatten-deep.js +0 -48
- package/dist/commonjs/array/flatten.d.ts +0 -9
- package/dist/commonjs/array/flatten.d.ts.map +0 -1
- package/dist/commonjs/array/flatten.js +0 -32
- package/dist/commonjs/array/for-each.d.ts +0 -13
- package/dist/commonjs/array/for-each.d.ts.map +0 -1
- package/dist/commonjs/array/for-each.js +0 -40
- package/dist/commonjs/array/group-by.d.ts +0 -19
- package/dist/commonjs/array/group-by.d.ts.map +0 -1
- package/dist/commonjs/array/group-by.js +0 -31
- package/dist/commonjs/array/index-by.d.ts +0 -8
- package/dist/commonjs/array/index-by.d.ts.map +0 -1
- package/dist/commonjs/array/index-by.js +0 -24
- package/dist/commonjs/array/index.d.ts +0 -56
- package/dist/commonjs/array/index.d.ts.map +0 -1
- package/dist/commonjs/array/index.js +0 -71
- package/dist/commonjs/array/intersection-with.d.ts +0 -9
- package/dist/commonjs/array/intersection-with.d.ts.map +0 -1
- package/dist/commonjs/array/intersection-with.js +0 -31
- package/dist/commonjs/array/intersection.d.ts +0 -7
- package/dist/commonjs/array/intersection.d.ts.map +0 -1
- package/dist/commonjs/array/intersection.js +0 -32
- package/dist/commonjs/array/join.d.ts +0 -8
- package/dist/commonjs/array/join.d.ts.map +0 -1
- package/dist/commonjs/array/join.js +0 -11
- package/dist/commonjs/array/last.d.ts +0 -5
- package/dist/commonjs/array/last.d.ts.map +0 -1
- package/dist/commonjs/array/last.js +0 -11
- package/dist/commonjs/array/length.d.ts +0 -5
- package/dist/commonjs/array/length.d.ts.map +0 -1
- package/dist/commonjs/array/length.js +0 -11
- package/dist/commonjs/array/map-to-obj.d.ts +0 -7
- package/dist/commonjs/array/map-to-obj.d.ts.map +0 -1
- package/dist/commonjs/array/map-to-obj.js +0 -23
- package/dist/commonjs/array/map.d.ts +0 -26
- package/dist/commonjs/array/map.d.ts.map +0 -1
- package/dist/commonjs/array/map.js +0 -35
- package/dist/commonjs/array/max-by.d.ts +0 -8
- package/dist/commonjs/array/max-by.d.ts.map +0 -1
- package/dist/commonjs/array/max-by.js +0 -28
- package/dist/commonjs/array/mean-by.d.ts +0 -8
- package/dist/commonjs/array/mean-by.d.ts.map +0 -1
- package/dist/commonjs/array/mean-by.js +0 -26
- package/dist/commonjs/array/merge-all.d.ts +0 -7
- package/dist/commonjs/array/merge-all.d.ts.map +0 -1
- package/dist/commonjs/array/merge-all.js +0 -7
- package/dist/commonjs/array/min-by.d.ts +0 -8
- package/dist/commonjs/array/min-by.d.ts.map +0 -1
- package/dist/commonjs/array/min-by.js +0 -28
- package/dist/commonjs/array/partition.d.ts +0 -10
- package/dist/commonjs/array/partition.d.ts.map +0 -1
- package/dist/commonjs/array/partition.js +0 -24
- package/dist/commonjs/array/range.d.ts +0 -3
- package/dist/commonjs/array/range.d.ts.map +0 -1
- package/dist/commonjs/array/range.js +0 -15
- package/dist/commonjs/array/reduce.d.ts +0 -7
- package/dist/commonjs/array/reduce.d.ts.map +0 -1
- package/dist/commonjs/array/reduce.js +0 -19
- package/dist/commonjs/array/reject.d.ts +0 -13
- package/dist/commonjs/array/reject.d.ts.map +0 -1
- package/dist/commonjs/array/reject.js +0 -41
- package/dist/commonjs/array/reverse.d.ts +0 -6
- package/dist/commonjs/array/reverse.d.ts.map +0 -1
- package/dist/commonjs/array/reverse.js +0 -11
- package/dist/commonjs/array/sample.d.ts +0 -11
- package/dist/commonjs/array/sample.d.ts.map +0 -1
- package/dist/commonjs/array/sample.js +0 -34
- package/dist/commonjs/array/shuffle.d.ts +0 -3
- package/dist/commonjs/array/shuffle.d.ts.map +0 -1
- package/dist/commonjs/array/shuffle.js +0 -18
- package/dist/commonjs/array/sort-by.d.ts +0 -27
- package/dist/commonjs/array/sort-by.d.ts.map +0 -1
- package/dist/commonjs/array/sort-by.js +0 -55
- package/dist/commonjs/array/sort.d.ts +0 -15
- package/dist/commonjs/array/sort.d.ts.map +0 -1
- package/dist/commonjs/array/sort.js +0 -16
- package/dist/commonjs/array/split-at.d.ts +0 -3
- package/dist/commonjs/array/split-at.d.ts.map +0 -1
- package/dist/commonjs/array/split-at.js +0 -13
- package/dist/commonjs/array/split-when.d.ts +0 -3
- package/dist/commonjs/array/split-when.d.ts.map +0 -1
- package/dist/commonjs/array/split-when.js +0 -17
- package/dist/commonjs/array/sum-by.d.ts +0 -8
- package/dist/commonjs/array/sum-by.d.ts.map +0 -1
- package/dist/commonjs/array/sum-by.js +0 -24
- package/dist/commonjs/array/swap-indices.d.ts +0 -25
- package/dist/commonjs/array/swap-indices.d.ts.map +0 -1
- package/dist/commonjs/array/swap-indices.js +0 -34
- package/dist/commonjs/array/take-while.d.ts +0 -3
- package/dist/commonjs/array/take-while.d.ts.map +0 -1
- package/dist/commonjs/array/take-while.js +0 -18
- package/dist/commonjs/array/take.d.ts +0 -7
- package/dist/commonjs/array/take.d.ts.map +0 -1
- package/dist/commonjs/array/take.js +0 -38
- package/dist/commonjs/array/uniq-by.d.ts +0 -3
- package/dist/commonjs/array/uniq-by.d.ts.map +0 -1
- package/dist/commonjs/array/uniq-by.js +0 -30
- package/dist/commonjs/array/uniq-with.d.ts +0 -12
- package/dist/commonjs/array/uniq-with.d.ts.map +0 -1
- package/dist/commonjs/array/uniq-with.js +0 -33
- package/dist/commonjs/array/uniq.d.ts +0 -7
- package/dist/commonjs/array/uniq.d.ts.map +0 -1
- package/dist/commonjs/array/uniq.js +0 -32
- package/dist/commonjs/array/zip-obj.d.ts +0 -3
- package/dist/commonjs/array/zip-obj.d.ts.map +0 -1
- package/dist/commonjs/array/zip-obj.js +0 -16
- package/dist/commonjs/array/zip-with.d.ts +0 -4
- package/dist/commonjs/array/zip-with.d.ts.map +0 -1
- package/dist/commonjs/array/zip-with.js +0 -28
- package/dist/commonjs/array/zip.d.ts +0 -3
- package/dist/commonjs/array/zip.d.ts.map +0 -1
- package/dist/commonjs/array/zip.js +0 -16
- package/dist/commonjs/base.d.ts +0 -2
- package/dist/commonjs/base.d.ts.map +0 -1
- package/dist/commonjs/base.js +0 -7
- package/dist/commonjs/function/create-pipe.d.ts +0 -8
- package/dist/commonjs/function/create-pipe.d.ts.map +0 -1
- package/dist/commonjs/function/create-pipe.js +0 -8
- package/dist/commonjs/function/identity.d.ts +0 -2
- package/dist/commonjs/function/identity.d.ts.map +0 -1
- package/dist/commonjs/function/identity.js +0 -7
- package/dist/commonjs/function/index.d.ts +0 -7
- package/dist/commonjs/function/index.d.ts.map +0 -1
- package/dist/commonjs/function/index.js +0 -22
- package/dist/commonjs/function/noop.d.ts +0 -2
- package/dist/commonjs/function/noop.d.ts.map +0 -1
- package/dist/commonjs/function/noop.js +0 -7
- package/dist/commonjs/function/once.d.ts +0 -2
- package/dist/commonjs/function/once.d.ts.map +0 -1
- package/dist/commonjs/function/once.js +0 -15
- package/dist/commonjs/function/pipe.d.ts +0 -16
- package/dist/commonjs/function/pipe.d.ts.map +0 -1
- package/dist/commonjs/function/pipe.js +0 -105
- package/dist/commonjs/function/purry.d.ts +0 -2
- package/dist/commonjs/function/purry.d.ts.map +0 -1
- package/dist/commonjs/function/purry.js +0 -20
- package/dist/commonjs/guard/index.d.ts +0 -16
- package/dist/commonjs/guard/index.d.ts.map +0 -1
- package/dist/commonjs/guard/index.js +0 -31
- package/dist/commonjs/guard/is-array.d.ts +0 -4
- package/dist/commonjs/guard/is-array.d.ts.map +0 -1
- package/dist/commonjs/guard/is-array.js +0 -7
- package/dist/commonjs/guard/is-boolean.d.ts +0 -4
- package/dist/commonjs/guard/is-boolean.d.ts.map +0 -1
- package/dist/commonjs/guard/is-boolean.js +0 -7
- package/dist/commonjs/guard/is-date.d.ts +0 -2
- package/dist/commonjs/guard/is-date.d.ts.map +0 -1
- package/dist/commonjs/guard/is-date.js +0 -7
- package/dist/commonjs/guard/is-defined.d.ts +0 -5
- package/dist/commonjs/guard/is-defined.d.ts.map +0 -1
- package/dist/commonjs/guard/is-defined.js +0 -13
- package/dist/commonjs/guard/is-empty.d.ts +0 -4
- package/dist/commonjs/guard/is-empty.d.ts.map +0 -1
- package/dist/commonjs/guard/is-empty.js +0 -19
- package/dist/commonjs/guard/is-error.d.ts +0 -4
- package/dist/commonjs/guard/is-error.d.ts.map +0 -1
- package/dist/commonjs/guard/is-error.js +0 -7
- package/dist/commonjs/guard/is-function.d.ts +0 -4
- package/dist/commonjs/guard/is-function.d.ts.map +0 -1
- package/dist/commonjs/guard/is-function.js +0 -7
- package/dist/commonjs/guard/is-nil.d.ts +0 -2
- package/dist/commonjs/guard/is-nil.d.ts.map +0 -1
- package/dist/commonjs/guard/is-nil.js +0 -7
- package/dist/commonjs/guard/is-non-null.d.ts +0 -2
- package/dist/commonjs/guard/is-non-null.d.ts.map +0 -1
- package/dist/commonjs/guard/is-non-null.js +0 -7
- package/dist/commonjs/guard/is-not.d.ts +0 -3
- package/dist/commonjs/guard/is-not.d.ts.map +0 -1
- package/dist/commonjs/guard/is-not.js +0 -9
- package/dist/commonjs/guard/is-number.d.ts +0 -4
- package/dist/commonjs/guard/is-number.d.ts.map +0 -1
- package/dist/commonjs/guard/is-number.js +0 -7
- package/dist/commonjs/guard/is-object.d.ts +0 -4
- package/dist/commonjs/guard/is-object.d.ts.map +0 -1
- package/dist/commonjs/guard/is-object.js +0 -8
- package/dist/commonjs/guard/is-promise.d.ts +0 -2
- package/dist/commonjs/guard/is-promise.d.ts.map +0 -1
- package/dist/commonjs/guard/is-promise.js +0 -7
- package/dist/commonjs/guard/is-string.d.ts +0 -4
- package/dist/commonjs/guard/is-string.d.ts.map +0 -1
- package/dist/commonjs/guard/is-string.js +0 -7
- package/dist/commonjs/guard/is-truthy.d.ts +0 -2
- package/dist/commonjs/guard/is-truthy.d.ts.map +0 -1
- package/dist/commonjs/guard/is-truthy.js +0 -7
- package/dist/commonjs/helpers/index.d.ts +0 -8
- package/dist/commonjs/helpers/index.d.ts.map +0 -1
- package/dist/commonjs/helpers/index.js +0 -52
- package/dist/commonjs/index.d.ts +0 -11
- package/dist/commonjs/index.d.ts.map +0 -1
- package/dist/commonjs/index.js +0 -27
- package/dist/commonjs/number/clamp.d.ts +0 -9
- package/dist/commonjs/number/clamp.d.ts.map +0 -1
- package/dist/commonjs/number/clamp.js +0 -17
- package/dist/commonjs/number/index.d.ts +0 -2
- package/dist/commonjs/number/index.d.ts.map +0 -1
- package/dist/commonjs/number/index.js +0 -17
- package/dist/commonjs/object/add-prop.d.ts +0 -7
- package/dist/commonjs/object/add-prop.d.ts.map +0 -1
- package/dist/commonjs/object/add-prop.js +0 -11
- package/dist/commonjs/object/clone.d.ts +0 -2
- package/dist/commonjs/object/clone.d.ts.map +0 -1
- package/dist/commonjs/object/clone.js +0 -49
- package/dist/commonjs/object/equals.d.ts +0 -3
- package/dist/commonjs/object/equals.d.ts.map +0 -1
- package/dist/commonjs/object/equals.js +0 -71
- package/dist/commonjs/object/for-each-obj.d.ts +0 -10
- package/dist/commonjs/object/for-each-obj.d.ts.map +0 -1
- package/dist/commonjs/object/for-each-obj.js +0 -30
- package/dist/commonjs/object/from-pairs.d.ts +0 -21
- package/dist/commonjs/object/from-pairs.d.ts.map +0 -1
- package/dist/commonjs/object/from-pairs.js +0 -14
- package/dist/commonjs/object/index.d.ts +0 -23
- package/dist/commonjs/object/index.d.ts.map +0 -1
- package/dist/commonjs/object/index.js +0 -38
- package/dist/commonjs/object/invert.d.ts +0 -5
- package/dist/commonjs/object/invert.d.ts.map +0 -1
- package/dist/commonjs/object/invert.js +0 -15
- package/dist/commonjs/object/keys.d.ts +0 -15
- package/dist/commonjs/object/keys.d.ts.map +0 -1
- package/dist/commonjs/object/keys.js +0 -10
- package/dist/commonjs/object/map-keys.d.ts +0 -3
- package/dist/commonjs/object/map-keys.d.ts.map +0 -1
- package/dist/commonjs/object/map-keys.js +0 -16
- package/dist/commonjs/object/map-values.d.ts +0 -3
- package/dist/commonjs/object/map-values.d.ts.map +0 -1
- package/dist/commonjs/object/map-values.js +0 -16
- package/dist/commonjs/object/merge.d.ts +0 -3
- package/dist/commonjs/object/merge.d.ts.map +0 -1
- package/dist/commonjs/object/merge.js +0 -11
- package/dist/commonjs/object/omit-by.d.ts +0 -3
- package/dist/commonjs/object/omit-by.d.ts.map +0 -1
- package/dist/commonjs/object/omit-by.js +0 -16
- package/dist/commonjs/object/omit.d.ts +0 -3
- package/dist/commonjs/object/omit.d.ts.map +0 -1
- package/dist/commonjs/object/omit.js +0 -35
- package/dist/commonjs/object/path-or.d.ts +0 -21
- package/dist/commonjs/object/path-or.d.ts.map +0 -1
- package/dist/commonjs/object/path-or.js +0 -18
- package/dist/commonjs/object/pick-by.d.ts +0 -3
- package/dist/commonjs/object/pick-by.d.ts.map +0 -1
- package/dist/commonjs/object/pick-by.js +0 -19
- package/dist/commonjs/object/pick.d.ts +0 -3
- package/dist/commonjs/object/pick.d.ts.map +0 -1
- package/dist/commonjs/object/pick.js +0 -19
- package/dist/commonjs/object/prop.d.ts +0 -2
- package/dist/commonjs/object/prop.d.ts.map +0 -1
- package/dist/commonjs/object/prop.js +0 -5
- package/dist/commonjs/object/set-path.d.ts +0 -6
- package/dist/commonjs/object/set-path.d.ts.map +0 -1
- package/dist/commonjs/object/set-path.js +0 -23
- package/dist/commonjs/object/set.d.ts +0 -3
- package/dist/commonjs/object/set.d.ts.map +0 -1
- package/dist/commonjs/object/set.js +0 -11
- package/dist/commonjs/object/swap-props.d.ts +0 -7
- package/dist/commonjs/object/swap-props.d.ts.map +0 -1
- package/dist/commonjs/object/swap-props.js +0 -12
- package/dist/commonjs/object/to-pairs.d.ts +0 -13
- package/dist/commonjs/object/to-pairs.d.ts.map +0 -1
- package/dist/commonjs/object/to-pairs.js +0 -13
- package/dist/commonjs/object/values.d.ts +0 -2
- package/dist/commonjs/object/values.d.ts.map +0 -1
- package/dist/commonjs/object/values.js +0 -7
- package/dist/commonjs/string/cases-types.d.ts +0 -29
- package/dist/commonjs/string/cases-types.d.ts.map +0 -1
- package/dist/commonjs/string/cases-types.js +0 -2
- package/dist/commonjs/string/cases.d.ts +0 -16
- package/dist/commonjs/string/cases.d.ts.map +0 -1
- package/dist/commonjs/string/cases.js +0 -86
- package/dist/commonjs/string/index.d.ts +0 -4
- package/dist/commonjs/string/index.d.ts.map +0 -1
- package/dist/commonjs/string/index.js +0 -19
- package/dist/commonjs/string/random-string.d.ts +0 -2
- package/dist/commonjs/string/random-string.d.ts.map +0 -1
- package/dist/commonjs/string/random-string.js +0 -10
- package/dist/commonjs/string/string-to-path.d.ts +0 -3
- package/dist/commonjs/string/string-to-path.d.ts.map +0 -1
- package/dist/commonjs/string/string-to-path.js +0 -19
- package/dist/commonjs/type/index.d.ts +0 -2
- package/dist/commonjs/type/index.d.ts.map +0 -1
- package/dist/commonjs/type/index.js +0 -17
- package/dist/commonjs/type/type.d.ts +0 -2
- package/dist/commonjs/type/type.d.ts.map +0 -1
- package/dist/commonjs/type/type.js +0 -11
- package/dist/commonjs/utils/narrow.d.ts +0 -8
- package/dist/commonjs/utils/narrow.d.ts.map +0 -1
- package/dist/commonjs/utils/narrow.js +0 -2
- package/dist/commonjs/utils/paths.d.ts +0 -9
- package/dist/commonjs/utils/paths.d.ts.map +0 -1
- package/dist/commonjs/utils/paths.js +0 -2
- package/dist/commonjs/utils/reduce-lazy.d.ts +0 -22
- package/dist/commonjs/utils/reduce-lazy.d.ts.map +0 -1
- package/dist/commonjs/utils/reduce-lazy.js +0 -18
- package/dist/commonjs/utils/to-lazy-indexed.d.ts +0 -4
- package/dist/commonjs/utils/to-lazy-indexed.d.ts.map +0 -1
- package/dist/commonjs/utils/to-lazy-indexed.js +0 -8
- package/dist/commonjs/utils/to-single.d.ts +0 -4
- package/dist/commonjs/utils/to-single.d.ts.map +0 -1
- package/dist/commonjs/utils/to-single.js +0 -8
- package/dist/commonjs/utils/types.d.ts +0 -6
- package/dist/commonjs/utils/types.d.ts.map +0 -1
- package/dist/commonjs/utils/types.js +0 -2
- package/dist/es/aria/index.d.ts +0 -2
- package/dist/es/aria/index.d.ts.map +0 -1
- package/dist/es/aria/index.js +0 -1
- package/dist/es/aria/key-codes.d.ts +0 -23
- package/dist/es/aria/key-codes.d.ts.map +0 -1
- package/dist/es/aria/key-codes.js +0 -22
- package/dist/es/array/all-pass.d.ts +0 -3
- package/dist/es/array/all-pass.d.ts.map +0 -1
- package/dist/es/array/all-pass.js +0 -7
- package/dist/es/array/any-pass.d.ts +0 -3
- package/dist/es/array/any-pass.d.ts.map +0 -1
- package/dist/es/array/any-pass.js +0 -7
- package/dist/es/array/chunk.d.ts +0 -6
- package/dist/es/array/chunk.d.ts.map +0 -1
- package/dist/es/array/chunk.js +0 -13
- package/dist/es/array/compact.d.ts +0 -2
- package/dist/es/array/compact.d.ts.map +0 -1
- package/dist/es/array/compact.js +0 -4
- package/dist/es/array/concat.d.ts +0 -3
- package/dist/es/array/concat.d.ts.map +0 -1
- package/dist/es/array/concat.js +0 -7
- package/dist/es/array/count-by.d.ts +0 -8
- package/dist/es/array/count-by.d.ts.map +0 -1
- package/dist/es/array/count-by.js +0 -18
- package/dist/es/array/difference-with.d.ts +0 -9
- package/dist/es/array/difference-with.d.ts.map +0 -1
- package/dist/es/array/difference-with.js +0 -27
- package/dist/es/array/difference.d.ts +0 -7
- package/dist/es/array/difference.d.ts.map +0 -1
- package/dist/es/array/difference.js +0 -28
- package/dist/es/array/drop-last.d.ts +0 -3
- package/dist/es/array/drop-last.d.ts.map +0 -1
- package/dist/es/array/drop-last.js +0 -11
- package/dist/es/array/drop.d.ts +0 -7
- package/dist/es/array/drop.d.ts.map +0 -1
- package/dist/es/array/drop.js +0 -28
- package/dist/es/array/filter.d.ts +0 -17
- package/dist/es/array/filter.d.ts.map +0 -1
- package/dist/es/array/filter.js +0 -37
- package/dist/es/array/find-index.d.ts +0 -32
- package/dist/es/array/find-index.d.ts.map +0 -1
- package/dist/es/array/find-index.js +0 -42
- package/dist/es/array/find-last-index.d.ts +0 -8
- package/dist/es/array/find-last-index.d.ts.map +0 -1
- package/dist/es/array/find-last-index.js +0 -20
- package/dist/es/array/find-last.d.ts +0 -8
- package/dist/es/array/find-last.d.ts.map +0 -1
- package/dist/es/array/find-last.js +0 -19
- package/dist/es/array/find.d.ts +0 -24
- package/dist/es/array/find.d.ts.map +0 -1
- package/dist/es/array/find.js +0 -34
- package/dist/es/array/first.d.ts +0 -16
- package/dist/es/array/first.d.ts.map +0 -1
- package/dist/es/array/first.js +0 -22
- package/dist/es/array/flat-map-to-obj.d.ts +0 -7
- package/dist/es/array/flat-map-to-obj.d.ts.map +0 -1
- package/dist/es/array/flat-map-to-obj.js +0 -21
- package/dist/es/array/flat-map.d.ts +0 -16
- package/dist/es/array/flat-map.d.ts.map +0 -1
- package/dist/es/array/flat-map.js +0 -29
- package/dist/es/array/flatten-deep.d.ts +0 -12
- package/dist/es/array/flatten-deep.d.ts.map +0 -1
- package/dist/es/array/flatten-deep.js +0 -44
- package/dist/es/array/flatten.d.ts +0 -9
- package/dist/es/array/flatten.d.ts.map +0 -1
- package/dist/es/array/flatten.js +0 -28
- package/dist/es/array/for-each.d.ts +0 -13
- package/dist/es/array/for-each.d.ts.map +0 -1
- package/dist/es/array/for-each.js +0 -36
- package/dist/es/array/group-by.d.ts +0 -19
- package/dist/es/array/group-by.d.ts.map +0 -1
- package/dist/es/array/group-by.js +0 -27
- package/dist/es/array/index-by.d.ts +0 -8
- package/dist/es/array/index-by.d.ts.map +0 -1
- package/dist/es/array/index-by.js +0 -20
- package/dist/es/array/index.d.ts +0 -56
- package/dist/es/array/index.d.ts.map +0 -1
- package/dist/es/array/index.js +0 -55
- package/dist/es/array/intersection-with.d.ts +0 -9
- package/dist/es/array/intersection-with.d.ts.map +0 -1
- package/dist/es/array/intersection-with.js +0 -27
- package/dist/es/array/intersection.d.ts +0 -7
- package/dist/es/array/intersection.d.ts.map +0 -1
- package/dist/es/array/intersection.js +0 -28
- package/dist/es/array/join.d.ts +0 -8
- package/dist/es/array/join.d.ts.map +0 -1
- package/dist/es/array/join.js +0 -7
- package/dist/es/array/last.d.ts +0 -5
- package/dist/es/array/last.d.ts.map +0 -1
- package/dist/es/array/last.js +0 -7
- package/dist/es/array/length.d.ts +0 -5
- package/dist/es/array/length.d.ts.map +0 -1
- package/dist/es/array/length.js +0 -7
- package/dist/es/array/map-to-obj.d.ts +0 -7
- package/dist/es/array/map-to-obj.d.ts.map +0 -1
- package/dist/es/array/map-to-obj.js +0 -19
- package/dist/es/array/map.d.ts +0 -26
- package/dist/es/array/map.d.ts.map +0 -1
- package/dist/es/array/map.js +0 -31
- package/dist/es/array/max-by.d.ts +0 -8
- package/dist/es/array/max-by.d.ts.map +0 -1
- package/dist/es/array/max-by.js +0 -24
- package/dist/es/array/mean-by.d.ts +0 -8
- package/dist/es/array/mean-by.d.ts.map +0 -1
- package/dist/es/array/mean-by.js +0 -22
- package/dist/es/array/merge-all.d.ts +0 -7
- package/dist/es/array/merge-all.d.ts.map +0 -1
- package/dist/es/array/merge-all.js +0 -3
- package/dist/es/array/min-by.d.ts +0 -8
- package/dist/es/array/min-by.d.ts.map +0 -1
- package/dist/es/array/min-by.js +0 -24
- package/dist/es/array/partition.d.ts +0 -10
- package/dist/es/array/partition.d.ts.map +0 -1
- package/dist/es/array/partition.js +0 -20
- package/dist/es/array/range.d.ts +0 -3
- package/dist/es/array/range.d.ts.map +0 -1
- package/dist/es/array/range.js +0 -11
- package/dist/es/array/reduce.d.ts +0 -7
- package/dist/es/array/reduce.d.ts.map +0 -1
- package/dist/es/array/reduce.js +0 -15
- package/dist/es/array/reject.d.ts +0 -13
- package/dist/es/array/reject.d.ts.map +0 -1
- package/dist/es/array/reject.js +0 -37
- package/dist/es/array/reverse.d.ts +0 -6
- package/dist/es/array/reverse.d.ts.map +0 -1
- package/dist/es/array/reverse.js +0 -7
- package/dist/es/array/sample.d.ts +0 -11
- package/dist/es/array/sample.d.ts.map +0 -1
- package/dist/es/array/sample.js +0 -30
- package/dist/es/array/shuffle.d.ts +0 -3
- package/dist/es/array/shuffle.d.ts.map +0 -1
- package/dist/es/array/shuffle.js +0 -14
- package/dist/es/array/sort-by.d.ts +0 -27
- package/dist/es/array/sort-by.d.ts.map +0 -1
- package/dist/es/array/sort-by.js +0 -51
- package/dist/es/array/sort.d.ts +0 -15
- package/dist/es/array/sort.d.ts.map +0 -1
- package/dist/es/array/sort.js +0 -12
- package/dist/es/array/split-at.d.ts +0 -3
- package/dist/es/array/split-at.d.ts.map +0 -1
- package/dist/es/array/split-at.js +0 -9
- package/dist/es/array/split-when.d.ts +0 -3
- package/dist/es/array/split-when.d.ts.map +0 -1
- package/dist/es/array/split-when.js +0 -13
- package/dist/es/array/sum-by.d.ts +0 -8
- package/dist/es/array/sum-by.d.ts.map +0 -1
- package/dist/es/array/sum-by.js +0 -20
- package/dist/es/array/swap-indices.d.ts +0 -25
- package/dist/es/array/swap-indices.d.ts.map +0 -1
- package/dist/es/array/swap-indices.js +0 -30
- package/dist/es/array/take-while.d.ts +0 -3
- package/dist/es/array/take-while.d.ts.map +0 -1
- package/dist/es/array/take-while.js +0 -14
- package/dist/es/array/take.d.ts +0 -7
- package/dist/es/array/take.d.ts.map +0 -1
- package/dist/es/array/take.js +0 -34
- package/dist/es/array/uniq-by.d.ts +0 -3
- package/dist/es/array/uniq-by.d.ts.map +0 -1
- package/dist/es/array/uniq-by.js +0 -26
- package/dist/es/array/uniq-with.d.ts +0 -12
- package/dist/es/array/uniq-with.d.ts.map +0 -1
- package/dist/es/array/uniq-with.js +0 -29
- package/dist/es/array/uniq.d.ts +0 -7
- package/dist/es/array/uniq.d.ts.map +0 -1
- package/dist/es/array/uniq.js +0 -28
- package/dist/es/array/zip-obj.d.ts +0 -3
- package/dist/es/array/zip-obj.d.ts.map +0 -1
- package/dist/es/array/zip-obj.js +0 -12
- package/dist/es/array/zip-with.d.ts +0 -4
- package/dist/es/array/zip-with.d.ts.map +0 -1
- package/dist/es/array/zip-with.js +0 -24
- package/dist/es/array/zip.d.ts +0 -3
- package/dist/es/array/zip.d.ts.map +0 -1
- package/dist/es/array/zip.js +0 -12
- package/dist/es/base.d.ts +0 -2
- package/dist/es/base.d.ts.map +0 -1
- package/dist/es/base.js +0 -3
- package/dist/es/function/create-pipe.d.ts +0 -8
- package/dist/es/function/create-pipe.d.ts.map +0 -1
- package/dist/es/function/create-pipe.js +0 -4
- package/dist/es/function/identity.d.ts +0 -2
- package/dist/es/function/identity.d.ts.map +0 -1
- package/dist/es/function/identity.js +0 -3
- package/dist/es/function/index.d.ts +0 -7
- package/dist/es/function/index.d.ts.map +0 -1
- package/dist/es/function/index.js +0 -6
- package/dist/es/function/noop.d.ts +0 -2
- package/dist/es/function/noop.d.ts.map +0 -1
- package/dist/es/function/noop.js +0 -3
- package/dist/es/function/once.d.ts +0 -2
- package/dist/es/function/once.d.ts.map +0 -1
- package/dist/es/function/once.js +0 -11
- package/dist/es/function/pipe.d.ts +0 -16
- package/dist/es/function/pipe.d.ts.map +0 -1
- package/dist/es/function/pipe.js +0 -101
- package/dist/es/function/purry.d.ts +0 -2
- package/dist/es/function/purry.d.ts.map +0 -1
- package/dist/es/function/purry.js +0 -16
- package/dist/es/guard/index.d.ts +0 -16
- package/dist/es/guard/index.d.ts.map +0 -1
- package/dist/es/guard/index.js +0 -15
- package/dist/es/guard/is-array.d.ts +0 -4
- package/dist/es/guard/is-array.d.ts.map +0 -1
- package/dist/es/guard/is-array.js +0 -3
- package/dist/es/guard/is-boolean.d.ts +0 -4
- package/dist/es/guard/is-boolean.d.ts.map +0 -1
- package/dist/es/guard/is-boolean.js +0 -3
- package/dist/es/guard/is-date.d.ts +0 -2
- package/dist/es/guard/is-date.d.ts.map +0 -1
- package/dist/es/guard/is-date.js +0 -3
- package/dist/es/guard/is-defined.d.ts +0 -5
- package/dist/es/guard/is-defined.d.ts.map +0 -1
- package/dist/es/guard/is-defined.js +0 -9
- package/dist/es/guard/is-empty.d.ts +0 -4
- package/dist/es/guard/is-empty.d.ts.map +0 -1
- package/dist/es/guard/is-empty.js +0 -15
- package/dist/es/guard/is-error.d.ts +0 -4
- package/dist/es/guard/is-error.d.ts.map +0 -1
- package/dist/es/guard/is-error.js +0 -3
- package/dist/es/guard/is-function.d.ts +0 -4
- package/dist/es/guard/is-function.d.ts.map +0 -1
- package/dist/es/guard/is-function.js +0 -3
- package/dist/es/guard/is-nil.d.ts +0 -2
- package/dist/es/guard/is-nil.d.ts.map +0 -1
- package/dist/es/guard/is-nil.js +0 -3
- package/dist/es/guard/is-non-null.d.ts +0 -2
- package/dist/es/guard/is-non-null.d.ts.map +0 -1
- package/dist/es/guard/is-non-null.js +0 -3
- package/dist/es/guard/is-not.d.ts +0 -3
- package/dist/es/guard/is-not.d.ts.map +0 -1
- package/dist/es/guard/is-not.js +0 -5
- package/dist/es/guard/is-number.d.ts +0 -4
- package/dist/es/guard/is-number.d.ts.map +0 -1
- package/dist/es/guard/is-number.js +0 -3
- package/dist/es/guard/is-object.d.ts +0 -4
- package/dist/es/guard/is-object.d.ts.map +0 -1
- package/dist/es/guard/is-object.js +0 -4
- package/dist/es/guard/is-promise.d.ts +0 -2
- package/dist/es/guard/is-promise.d.ts.map +0 -1
- package/dist/es/guard/is-promise.js +0 -3
- package/dist/es/guard/is-string.d.ts +0 -4
- package/dist/es/guard/is-string.d.ts.map +0 -1
- package/dist/es/guard/is-string.js +0 -3
- package/dist/es/guard/is-truthy.d.ts +0 -2
- package/dist/es/guard/is-truthy.d.ts.map +0 -1
- package/dist/es/guard/is-truthy.js +0 -3
- package/dist/es/helpers/index.d.ts +0 -8
- package/dist/es/helpers/index.d.ts.map +0 -1
- package/dist/es/helpers/index.js +0 -45
- package/dist/es/index.d.ts +0 -11
- package/dist/es/index.d.ts.map +0 -1
- package/dist/es/index.js +0 -10
- package/dist/es/number/clamp.d.ts +0 -9
- package/dist/es/number/clamp.d.ts.map +0 -1
- package/dist/es/number/clamp.js +0 -13
- package/dist/es/number/index.d.ts +0 -2
- package/dist/es/number/index.d.ts.map +0 -1
- package/dist/es/number/index.js +0 -1
- package/dist/es/object/add-prop.d.ts +0 -7
- package/dist/es/object/add-prop.d.ts.map +0 -1
- package/dist/es/object/add-prop.js +0 -7
- package/dist/es/object/clone.d.ts +0 -2
- package/dist/es/object/clone.d.ts.map +0 -1
- package/dist/es/object/clone.js +0 -45
- package/dist/es/object/equals.d.ts +0 -3
- package/dist/es/object/equals.d.ts.map +0 -1
- package/dist/es/object/equals.js +0 -67
- package/dist/es/object/for-each-obj.d.ts +0 -10
- package/dist/es/object/for-each-obj.d.ts.map +0 -1
- package/dist/es/object/for-each-obj.js +0 -26
- package/dist/es/object/from-pairs.d.ts +0 -21
- package/dist/es/object/from-pairs.d.ts.map +0 -1
- package/dist/es/object/from-pairs.js +0 -10
- package/dist/es/object/index.d.ts +0 -23
- package/dist/es/object/index.d.ts.map +0 -1
- package/dist/es/object/index.js +0 -22
- package/dist/es/object/invert.d.ts +0 -5
- package/dist/es/object/invert.d.ts.map +0 -1
- package/dist/es/object/invert.js +0 -11
- package/dist/es/object/keys.d.ts +0 -15
- package/dist/es/object/keys.d.ts.map +0 -1
- package/dist/es/object/keys.js +0 -6
- package/dist/es/object/map-keys.d.ts +0 -3
- package/dist/es/object/map-keys.d.ts.map +0 -1
- package/dist/es/object/map-keys.js +0 -12
- package/dist/es/object/map-values.d.ts +0 -3
- package/dist/es/object/map-values.d.ts.map +0 -1
- package/dist/es/object/map-values.js +0 -12
- package/dist/es/object/merge.d.ts +0 -3
- package/dist/es/object/merge.d.ts.map +0 -1
- package/dist/es/object/merge.js +0 -7
- package/dist/es/object/omit-by.d.ts +0 -3
- package/dist/es/object/omit-by.d.ts.map +0 -1
- package/dist/es/object/omit-by.js +0 -12
- package/dist/es/object/omit.d.ts +0 -3
- package/dist/es/object/omit.d.ts.map +0 -1
- package/dist/es/object/omit.js +0 -31
- package/dist/es/object/path-or.d.ts +0 -21
- package/dist/es/object/path-or.d.ts.map +0 -1
- package/dist/es/object/path-or.js +0 -14
- package/dist/es/object/pick-by.d.ts +0 -3
- package/dist/es/object/pick-by.d.ts.map +0 -1
- package/dist/es/object/pick-by.js +0 -15
- package/dist/es/object/pick.d.ts +0 -3
- package/dist/es/object/pick.d.ts.map +0 -1
- package/dist/es/object/pick.js +0 -15
- package/dist/es/object/prop.d.ts +0 -2
- package/dist/es/object/prop.d.ts.map +0 -1
- package/dist/es/object/prop.js +0 -1
- package/dist/es/object/set-path.d.ts +0 -6
- package/dist/es/object/set-path.d.ts.map +0 -1
- package/dist/es/object/set-path.js +0 -18
- package/dist/es/object/set.d.ts +0 -3
- package/dist/es/object/set.d.ts.map +0 -1
- package/dist/es/object/set.js +0 -7
- package/dist/es/object/swap-props.d.ts +0 -7
- package/dist/es/object/swap-props.d.ts.map +0 -1
- package/dist/es/object/swap-props.js +0 -8
- package/dist/es/object/to-pairs.d.ts +0 -13
- package/dist/es/object/to-pairs.d.ts.map +0 -1
- package/dist/es/object/to-pairs.js +0 -9
- package/dist/es/object/values.d.ts +0 -2
- package/dist/es/object/values.d.ts.map +0 -1
- package/dist/es/object/values.js +0 -3
- package/dist/es/string/cases-types.d.ts +0 -29
- package/dist/es/string/cases-types.d.ts.map +0 -1
- package/dist/es/string/cases-types.js +0 -1
- package/dist/es/string/cases.d.ts +0 -16
- package/dist/es/string/cases.d.ts.map +0 -1
- package/dist/es/string/cases.js +0 -75
- package/dist/es/string/index.d.ts +0 -4
- package/dist/es/string/index.d.ts.map +0 -1
- package/dist/es/string/index.js +0 -3
- package/dist/es/string/random-string.d.ts +0 -2
- package/dist/es/string/random-string.d.ts.map +0 -1
- package/dist/es/string/random-string.js +0 -6
- package/dist/es/string/string-to-path.d.ts +0 -3
- package/dist/es/string/string-to-path.d.ts.map +0 -1
- package/dist/es/string/string-to-path.js +0 -15
- package/dist/es/type/index.d.ts +0 -2
- package/dist/es/type/index.d.ts.map +0 -1
- package/dist/es/type/index.js +0 -1
- package/dist/es/type/type.d.ts +0 -2
- package/dist/es/type/type.d.ts.map +0 -1
- package/dist/es/type/type.js +0 -7
- package/dist/es/utils/narrow.d.ts +0 -8
- package/dist/es/utils/narrow.d.ts.map +0 -1
- package/dist/es/utils/narrow.js +0 -1
- package/dist/es/utils/paths.d.ts +0 -9
- package/dist/es/utils/paths.d.ts.map +0 -1
- package/dist/es/utils/paths.js +0 -1
- package/dist/es/utils/reduce-lazy.d.ts +0 -22
- package/dist/es/utils/reduce-lazy.d.ts.map +0 -1
- package/dist/es/utils/reduce-lazy.js +0 -14
- package/dist/es/utils/to-lazy-indexed.d.ts +0 -4
- package/dist/es/utils/to-lazy-indexed.d.ts.map +0 -1
- package/dist/es/utils/to-lazy-indexed.js +0 -4
- package/dist/es/utils/to-single.d.ts +0 -4
- package/dist/es/utils/to-single.d.ts.map +0 -1
- package/dist/es/utils/to-single.js +0 -4
- package/dist/es/utils/types.d.ts +0 -6
- package/dist/es/utils/types.d.ts.map +0 -1
- package/dist/es/utils/types.js +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
KEY_CODES: () => KEY_CODES,
|
|
24
|
+
_setPath: () => _setPath,
|
|
25
|
+
addProp: () => addProp,
|
|
26
|
+
allPass: () => allPass,
|
|
27
|
+
anyPass: () => anyPass,
|
|
28
|
+
chunk: () => chunk,
|
|
29
|
+
clamp: () => clamp,
|
|
30
|
+
clone: () => clone,
|
|
31
|
+
compact: () => compact,
|
|
32
|
+
concat: () => concat,
|
|
33
|
+
countBy: () => countBy,
|
|
34
|
+
createPipe: () => createPipe,
|
|
35
|
+
difference: () => difference,
|
|
36
|
+
differenceWith: () => differenceWith,
|
|
37
|
+
drop: () => drop,
|
|
38
|
+
dropLast: () => dropLast,
|
|
39
|
+
equals: () => equals,
|
|
40
|
+
filter: () => filter,
|
|
41
|
+
find: () => find,
|
|
42
|
+
findIndex: () => findIndex,
|
|
43
|
+
findLast: () => findLast,
|
|
44
|
+
findLastIndex: () => findLastIndex,
|
|
45
|
+
first: () => first,
|
|
46
|
+
flatMap: () => flatMap,
|
|
47
|
+
flatMapToObj: () => flatMapToObj,
|
|
48
|
+
flatten: () => flatten,
|
|
49
|
+
flattenDeep: () => flattenDeep,
|
|
50
|
+
forEach: () => forEach,
|
|
51
|
+
forEachObj: () => forEachObj,
|
|
52
|
+
fromPairs: () => fromPairs,
|
|
53
|
+
groupBy: () => groupBy,
|
|
54
|
+
humanReadableFileSize: () => humanReadableFileSize,
|
|
55
|
+
identity: () => identity,
|
|
56
|
+
indexBy: () => indexBy,
|
|
57
|
+
intersection: () => intersection,
|
|
58
|
+
intersectionWith: () => intersectionWith,
|
|
59
|
+
invert: () => invert,
|
|
60
|
+
isArray: () => isArray,
|
|
61
|
+
isBoolean: () => isBoolean,
|
|
62
|
+
isBrowser: () => isBrowser,
|
|
63
|
+
isDate: () => isDate,
|
|
64
|
+
isDefined: () => isDefined,
|
|
65
|
+
isEmpty: () => isEmpty,
|
|
66
|
+
isError: () => isError,
|
|
67
|
+
isFunction: () => isFunction,
|
|
68
|
+
isNil: () => isNil,
|
|
69
|
+
isNonNull: () => isNonNull,
|
|
70
|
+
isNot: () => isNot,
|
|
71
|
+
isNumber: () => isNumber,
|
|
72
|
+
isObject: () => isObject,
|
|
73
|
+
isPromise: () => isPromise,
|
|
74
|
+
isString: () => isString,
|
|
75
|
+
isTruthy: () => isTruthy,
|
|
76
|
+
isUppercase: () => isUppercase,
|
|
77
|
+
join: () => join,
|
|
78
|
+
keys: () => keys,
|
|
79
|
+
last: () => last,
|
|
80
|
+
length: () => length,
|
|
81
|
+
map: () => map,
|
|
82
|
+
mapKeys: () => mapKeys,
|
|
83
|
+
mapToObj: () => mapToObj,
|
|
84
|
+
mapValues: () => mapValues,
|
|
85
|
+
maxBy: () => maxBy,
|
|
86
|
+
meanBy: () => meanBy,
|
|
87
|
+
merge: () => merge,
|
|
88
|
+
mergeAll: () => mergeAll,
|
|
89
|
+
minBy: () => minBy,
|
|
90
|
+
noop: () => noop,
|
|
91
|
+
omit: () => omit,
|
|
92
|
+
omitBy: () => omitBy,
|
|
93
|
+
once: () => once,
|
|
94
|
+
partition: () => partition,
|
|
95
|
+
pathOr: () => pathOr,
|
|
96
|
+
pick: () => pick,
|
|
97
|
+
pickBy: () => pickBy,
|
|
98
|
+
pipe: () => pipe,
|
|
99
|
+
prop: () => prop,
|
|
100
|
+
purry: () => purry,
|
|
101
|
+
randomString: () => randomString,
|
|
102
|
+
range: () => range,
|
|
103
|
+
reduce: () => reduce,
|
|
104
|
+
reject: () => reject,
|
|
105
|
+
reverse: () => reverse,
|
|
106
|
+
sample: () => sample,
|
|
107
|
+
set: () => set,
|
|
108
|
+
setPath: () => setPath,
|
|
109
|
+
shuffle: () => shuffle,
|
|
110
|
+
sleep: () => sleep,
|
|
111
|
+
slugify: () => slugify,
|
|
112
|
+
sort: () => sort,
|
|
113
|
+
sortBy: () => sortBy,
|
|
114
|
+
splitAt: () => splitAt,
|
|
115
|
+
splitByCase: () => splitByCase,
|
|
116
|
+
splitWhen: () => splitWhen,
|
|
117
|
+
stringToPath: () => stringToPath,
|
|
118
|
+
sumBy: () => sumBy,
|
|
119
|
+
swapIndices: () => swapIndices,
|
|
120
|
+
swapProps: () => swapProps,
|
|
121
|
+
take: () => take,
|
|
122
|
+
takeWhile: () => takeWhile,
|
|
123
|
+
toCamelCase: () => toCamelCase,
|
|
124
|
+
toKebabCase: () => toKebabCase,
|
|
125
|
+
toLowerFirst: () => toLowerFirst,
|
|
126
|
+
toPairs: () => toPairs,
|
|
127
|
+
toPascalCase: () => toPascalCase,
|
|
128
|
+
toSnakeCase: () => toSnakeCase,
|
|
129
|
+
toUpperFirst: () => toUpperFirst,
|
|
130
|
+
type: () => type,
|
|
131
|
+
uniq: () => uniq,
|
|
132
|
+
uniqBy: () => uniqBy,
|
|
133
|
+
uniqWith: () => uniqWith,
|
|
134
|
+
values: () => values,
|
|
135
|
+
zip: () => zip,
|
|
136
|
+
zipObj: () => zipObj,
|
|
137
|
+
zipWith: () => zipWith
|
|
138
|
+
});
|
|
139
|
+
module.exports = __toCommonJS(src_exports);
|
|
140
|
+
|
|
141
|
+
// src/aria/key-codes.ts
|
|
142
|
+
var KEY_CODES = {
|
|
143
|
+
TAB: "Tab",
|
|
144
|
+
ARROW_DOWN: "ArrowDown",
|
|
145
|
+
ARROW_UP: "ArrowUp",
|
|
146
|
+
ARROW_LEFT: "ArrowLeft",
|
|
147
|
+
ARROW_RIGHT: "ArrowRight",
|
|
148
|
+
ENTER: "Enter",
|
|
149
|
+
ESC: "Escape",
|
|
150
|
+
SPACE: "Space",
|
|
151
|
+
SHIFT: "Shift",
|
|
152
|
+
KEY_F: "KEY_F",
|
|
153
|
+
CTRL: "Control",
|
|
154
|
+
ALT: "Alt",
|
|
155
|
+
META: "Meta",
|
|
156
|
+
AT: "@",
|
|
157
|
+
DELETE: "Delete",
|
|
158
|
+
BACKSPACE: "Backspace",
|
|
159
|
+
HOME: "Home",
|
|
160
|
+
END: "End",
|
|
161
|
+
PAGE_UP: "PageUp",
|
|
162
|
+
PAGE_DOWN: "PageDown"
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/function/pipe.ts
|
|
166
|
+
function pipe(value, ...operations) {
|
|
167
|
+
let ret = value;
|
|
168
|
+
const lazyOps = operations.map((op) => {
|
|
169
|
+
const { lazy, lazyArgs } = op;
|
|
170
|
+
if (lazy) {
|
|
171
|
+
const fn = lazy(...lazyArgs || []);
|
|
172
|
+
fn.indexed = lazy.indexed;
|
|
173
|
+
fn.single = lazy.single;
|
|
174
|
+
fn.index = 0;
|
|
175
|
+
fn.items = [];
|
|
176
|
+
return fn;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
});
|
|
180
|
+
let opIdx = 0;
|
|
181
|
+
while (opIdx < operations.length) {
|
|
182
|
+
const op = operations[opIdx];
|
|
183
|
+
const lazyOp = lazyOps[opIdx];
|
|
184
|
+
if (!lazyOp) {
|
|
185
|
+
ret = op(ret);
|
|
186
|
+
opIdx++;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const lazySeq = [];
|
|
190
|
+
for (let j = opIdx; j < operations.length; j++) {
|
|
191
|
+
if (lazyOps[j]) {
|
|
192
|
+
lazySeq.push(lazyOps[j]);
|
|
193
|
+
if (lazyOps[j].single) {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const acc = [];
|
|
201
|
+
for (const item of ret) {
|
|
202
|
+
if (_processItem({ item, acc, lazySeq })) {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const lastLazySeq = lazySeq[lazySeq.length - 1];
|
|
207
|
+
if (lastLazySeq.single) {
|
|
208
|
+
ret = acc[0];
|
|
209
|
+
} else {
|
|
210
|
+
ret = acc;
|
|
211
|
+
}
|
|
212
|
+
opIdx += lazySeq.length;
|
|
213
|
+
}
|
|
214
|
+
return ret;
|
|
215
|
+
}
|
|
216
|
+
function _processItem({
|
|
217
|
+
item,
|
|
218
|
+
lazySeq,
|
|
219
|
+
acc
|
|
220
|
+
}) {
|
|
221
|
+
if (lazySeq.length === 0) {
|
|
222
|
+
acc.push(item);
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
let lazyResult = { done: false, hasNext: false };
|
|
226
|
+
let isDone = false;
|
|
227
|
+
for (let i = 0; i < lazySeq.length; i++) {
|
|
228
|
+
const lazyFn = lazySeq[i];
|
|
229
|
+
const indexed = lazyFn.indexed;
|
|
230
|
+
const index = lazyFn.index;
|
|
231
|
+
const items = lazyFn.items;
|
|
232
|
+
items.push(item);
|
|
233
|
+
lazyResult = indexed ? lazyFn(item, index, items) : lazyFn(item);
|
|
234
|
+
lazyFn.index++;
|
|
235
|
+
if (lazyResult.hasNext) {
|
|
236
|
+
if (lazyResult.hasMany) {
|
|
237
|
+
const nextValues = lazyResult.next;
|
|
238
|
+
for (const subItem of nextValues) {
|
|
239
|
+
const subResult = _processItem({
|
|
240
|
+
item: subItem,
|
|
241
|
+
acc,
|
|
242
|
+
lazySeq: lazySeq.slice(i + 1)
|
|
243
|
+
});
|
|
244
|
+
if (subResult) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
} else {
|
|
250
|
+
item = lazyResult.next;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (!lazyResult.hasNext) {
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
if (lazyResult.done) {
|
|
257
|
+
isDone = true;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (lazyResult.hasNext) {
|
|
261
|
+
acc.push(item);
|
|
262
|
+
}
|
|
263
|
+
if (isDone) {
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/function/create-pipe.ts
|
|
270
|
+
function createPipe(...operations) {
|
|
271
|
+
return (value) => pipe(value, ...operations);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/function/identity.ts
|
|
275
|
+
function identity(value) {
|
|
276
|
+
return value;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// src/function/noop.ts
|
|
280
|
+
function noop() {
|
|
281
|
+
return void 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// src/function/once.ts
|
|
285
|
+
function once(fn) {
|
|
286
|
+
let called = false;
|
|
287
|
+
let ret;
|
|
288
|
+
return () => {
|
|
289
|
+
if (!called) {
|
|
290
|
+
ret = fn();
|
|
291
|
+
called = true;
|
|
292
|
+
}
|
|
293
|
+
return ret;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/function/purry.ts
|
|
298
|
+
function purry(fn, args, lazy) {
|
|
299
|
+
const diff = fn.length - args.length;
|
|
300
|
+
const arrayArgs = Array.from(args);
|
|
301
|
+
if (diff === 0) {
|
|
302
|
+
return fn(...arrayArgs);
|
|
303
|
+
}
|
|
304
|
+
if (diff === 1) {
|
|
305
|
+
const ret = (data) => fn(data, ...arrayArgs);
|
|
306
|
+
if (lazy || fn.lazy) {
|
|
307
|
+
ret.lazy = lazy || fn.lazy;
|
|
308
|
+
ret.lazyArgs = args;
|
|
309
|
+
}
|
|
310
|
+
return ret;
|
|
311
|
+
}
|
|
312
|
+
throw new Error("Wrong number of arguments");
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/function/sleep.ts
|
|
316
|
+
function sleep(timeout) {
|
|
317
|
+
return new Promise((resolve) => {
|
|
318
|
+
setTimeout(resolve, timeout);
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// src/array/all-pass.ts
|
|
323
|
+
function allPass(...args) {
|
|
324
|
+
return purry(_allPass, args);
|
|
325
|
+
}
|
|
326
|
+
function _allPass(data, fns) {
|
|
327
|
+
return fns.every((fn) => fn(data));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// src/array/any-pass.ts
|
|
331
|
+
function anyPass(...args) {
|
|
332
|
+
return purry(_anyPass, args);
|
|
333
|
+
}
|
|
334
|
+
function _anyPass(data, fns) {
|
|
335
|
+
return fns.some((fn) => fn(data));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/array/chunk.ts
|
|
339
|
+
function chunk(...args) {
|
|
340
|
+
return purry(_chunk, args);
|
|
341
|
+
}
|
|
342
|
+
function _chunk(array, size) {
|
|
343
|
+
const ret = Array.from({
|
|
344
|
+
length: Math.ceil(array.length / size)
|
|
345
|
+
});
|
|
346
|
+
for (let index = 0; index < ret.length; index += 1) {
|
|
347
|
+
ret[index] = array.slice(index * size, (index + 1) * size);
|
|
348
|
+
}
|
|
349
|
+
return ret;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// src/guard/is-array.ts
|
|
353
|
+
function isArray(data) {
|
|
354
|
+
return Array.isArray(data);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// src/guard/is-boolean.ts
|
|
358
|
+
function isBoolean(data) {
|
|
359
|
+
return typeof data === "boolean";
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/guard/is-date.ts
|
|
363
|
+
function isDate(data) {
|
|
364
|
+
return data instanceof Date;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// src/guard/is-defined.ts
|
|
368
|
+
function isDefined(data) {
|
|
369
|
+
return typeof data !== "undefined" && data !== null;
|
|
370
|
+
}
|
|
371
|
+
((isDefined2) => {
|
|
372
|
+
function strict(data) {
|
|
373
|
+
return data !== void 0;
|
|
374
|
+
}
|
|
375
|
+
isDefined2.strict = strict;
|
|
376
|
+
})(isDefined || (isDefined = {}));
|
|
377
|
+
|
|
378
|
+
// src/base.ts
|
|
379
|
+
function toString(value) {
|
|
380
|
+
return Object.prototype.toString.call(value);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// src/guard/is-object.ts
|
|
384
|
+
function isObject(data) {
|
|
385
|
+
return toString(data) === "[object Object]";
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// src/guard/is-string.ts
|
|
389
|
+
function isString(data) {
|
|
390
|
+
return typeof data === "string";
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// src/guard/is-empty.ts
|
|
394
|
+
function isEmpty(data) {
|
|
395
|
+
if (isArray(data) || isString(data)) {
|
|
396
|
+
return data.length === 0;
|
|
397
|
+
}
|
|
398
|
+
if (isObject(data)) {
|
|
399
|
+
for (const _ in data) {
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
return !(data instanceof RegExp);
|
|
403
|
+
}
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/guard/is-error.ts
|
|
408
|
+
function isError(data) {
|
|
409
|
+
return data instanceof Error;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/guard/is-function.ts
|
|
413
|
+
function isFunction(data) {
|
|
414
|
+
return typeof data === "function";
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// src/guard/is-nil.ts
|
|
418
|
+
function isNil(data) {
|
|
419
|
+
return data == null;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// src/guard/is-non-null.ts
|
|
423
|
+
function isNonNull(data) {
|
|
424
|
+
return data !== null;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// src/guard/is-not.ts
|
|
428
|
+
function isNot(predicate) {
|
|
429
|
+
return (data) => {
|
|
430
|
+
return !predicate(data);
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// src/guard/is-number.ts
|
|
435
|
+
function isNumber(data) {
|
|
436
|
+
return typeof data === "number" && !Number.isNaN(data);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// src/guard/is-promise.ts
|
|
440
|
+
function isPromise(data) {
|
|
441
|
+
return data instanceof Promise;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/guard/is-truthy.ts
|
|
445
|
+
function isTruthy(data) {
|
|
446
|
+
return !!data;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// src/array/compact.ts
|
|
450
|
+
function compact(items) {
|
|
451
|
+
return items.filter(isTruthy);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// src/array/concat.ts
|
|
455
|
+
function concat(...args) {
|
|
456
|
+
return purry(_concat, args);
|
|
457
|
+
}
|
|
458
|
+
function _concat(arr1, arr2) {
|
|
459
|
+
return arr1.concat(arr2);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// src/array/count-by.ts
|
|
463
|
+
function _countBy(indexed) {
|
|
464
|
+
return (array, fn) => {
|
|
465
|
+
return array.reduce((ret, item, index) => {
|
|
466
|
+
const value = indexed ? fn(item, index, array) : fn(item);
|
|
467
|
+
return ret + (value ? 1 : 0);
|
|
468
|
+
}, 0);
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function countBy(...args) {
|
|
472
|
+
return purry(_countBy(false), args);
|
|
473
|
+
}
|
|
474
|
+
((countBy2) => {
|
|
475
|
+
function indexed(...args) {
|
|
476
|
+
return purry(_countBy(true), args);
|
|
477
|
+
}
|
|
478
|
+
countBy2.indexed = indexed;
|
|
479
|
+
})(countBy || (countBy = {}));
|
|
480
|
+
|
|
481
|
+
// src/utils/reduce-lazy.ts
|
|
482
|
+
function _reduceLazy(array, lazy, indexed) {
|
|
483
|
+
const newArray = [];
|
|
484
|
+
for (let index = 0; index < array.length; index++) {
|
|
485
|
+
const item = array[index];
|
|
486
|
+
const result = indexed ? lazy(item, index, array) : lazy(item);
|
|
487
|
+
if (result.hasMany === true) {
|
|
488
|
+
newArray.push(...result.next);
|
|
489
|
+
} else if (result.hasNext) {
|
|
490
|
+
newArray.push(result.next);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return newArray;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// src/array/difference-with.ts
|
|
497
|
+
function differenceWith(...args) {
|
|
498
|
+
return purry(_differenceWith, args, differenceWith.lazy);
|
|
499
|
+
}
|
|
500
|
+
function _differenceWith(array, other, isEquals) {
|
|
501
|
+
const lazy = differenceWith.lazy(other, isEquals);
|
|
502
|
+
return _reduceLazy(array, lazy);
|
|
503
|
+
}
|
|
504
|
+
((differenceWith2) => {
|
|
505
|
+
function lazy(other, isEquals) {
|
|
506
|
+
return (value) => {
|
|
507
|
+
if (other.every((otherValue) => !isEquals(value, otherValue))) {
|
|
508
|
+
return {
|
|
509
|
+
done: false,
|
|
510
|
+
hasNext: true,
|
|
511
|
+
next: value
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
return {
|
|
515
|
+
done: false,
|
|
516
|
+
hasNext: false
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
differenceWith2.lazy = lazy;
|
|
521
|
+
})(differenceWith || (differenceWith = {}));
|
|
522
|
+
|
|
523
|
+
// src/array/difference.ts
|
|
524
|
+
function difference(...args) {
|
|
525
|
+
return purry(_difference, args, difference.lazy);
|
|
526
|
+
}
|
|
527
|
+
function _difference(array, other) {
|
|
528
|
+
const lazy = difference.lazy(other);
|
|
529
|
+
return _reduceLazy(array, lazy);
|
|
530
|
+
}
|
|
531
|
+
((difference2) => {
|
|
532
|
+
function lazy(other) {
|
|
533
|
+
const set2 = new Set(other);
|
|
534
|
+
return (value) => {
|
|
535
|
+
if (!set2.has(value)) {
|
|
536
|
+
return {
|
|
537
|
+
done: false,
|
|
538
|
+
hasNext: true,
|
|
539
|
+
next: value
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
done: false,
|
|
544
|
+
hasNext: false
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
difference2.lazy = lazy;
|
|
549
|
+
})(difference || (difference = {}));
|
|
550
|
+
|
|
551
|
+
// src/array/drop-last.ts
|
|
552
|
+
function dropLast(...args) {
|
|
553
|
+
return purry(_dropLast, args);
|
|
554
|
+
}
|
|
555
|
+
function _dropLast(array, n) {
|
|
556
|
+
const copy = [...array];
|
|
557
|
+
if (n > 0) {
|
|
558
|
+
copy.splice(-n);
|
|
559
|
+
}
|
|
560
|
+
return copy;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// src/array/drop.ts
|
|
564
|
+
function drop(...args) {
|
|
565
|
+
return purry(_drop, args, drop.lazy);
|
|
566
|
+
}
|
|
567
|
+
function _drop(array, n) {
|
|
568
|
+
return _reduceLazy(array, drop.lazy(n));
|
|
569
|
+
}
|
|
570
|
+
((drop2) => {
|
|
571
|
+
function lazy(n) {
|
|
572
|
+
let left = n;
|
|
573
|
+
return (value) => {
|
|
574
|
+
if (left > 0) {
|
|
575
|
+
left--;
|
|
576
|
+
return {
|
|
577
|
+
done: false,
|
|
578
|
+
hasNext: false
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
return {
|
|
582
|
+
done: false,
|
|
583
|
+
hasNext: true,
|
|
584
|
+
next: value
|
|
585
|
+
};
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
drop2.lazy = lazy;
|
|
589
|
+
})(drop || (drop = {}));
|
|
590
|
+
|
|
591
|
+
// src/utils/to-lazy-indexed.ts
|
|
592
|
+
function toLazyIndexed(fn) {
|
|
593
|
+
fn.indexed = true;
|
|
594
|
+
return fn;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// src/array/filter.ts
|
|
598
|
+
function filter(...args) {
|
|
599
|
+
return purry(_filter(false), args, filter.lazy);
|
|
600
|
+
}
|
|
601
|
+
function _filter(indexed) {
|
|
602
|
+
return (array, fn) => {
|
|
603
|
+
return _reduceLazy(
|
|
604
|
+
array,
|
|
605
|
+
indexed ? filter.lazyIndexed(fn) : filter.lazy(fn),
|
|
606
|
+
indexed
|
|
607
|
+
);
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
function _lazy(indexed) {
|
|
611
|
+
return (fn) => {
|
|
612
|
+
return (value, index, array) => {
|
|
613
|
+
const valid = indexed ? fn(value, index, array) : fn(value);
|
|
614
|
+
if (valid) {
|
|
615
|
+
return {
|
|
616
|
+
done: false,
|
|
617
|
+
hasNext: true,
|
|
618
|
+
next: value
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return {
|
|
622
|
+
done: false,
|
|
623
|
+
hasNext: false
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
((filter2) => {
|
|
629
|
+
function indexed(...args) {
|
|
630
|
+
return purry(_filter(true), args, filter2.lazyIndexed);
|
|
631
|
+
}
|
|
632
|
+
filter2.indexed = indexed;
|
|
633
|
+
filter2.lazy = _lazy(false);
|
|
634
|
+
filter2.lazyIndexed = toLazyIndexed(_lazy(true));
|
|
635
|
+
})(filter || (filter = {}));
|
|
636
|
+
|
|
637
|
+
// src/utils/to-single.ts
|
|
638
|
+
function toSingle(fn) {
|
|
639
|
+
fn.single = true;
|
|
640
|
+
return fn;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// src/array/find-index.ts
|
|
644
|
+
function findIndex(...args) {
|
|
645
|
+
return purry(_findIndex(false), args, findIndex.lazy);
|
|
646
|
+
}
|
|
647
|
+
function _findIndex(indexed) {
|
|
648
|
+
return (array, fn) => {
|
|
649
|
+
if (indexed) {
|
|
650
|
+
return array.findIndex(fn);
|
|
651
|
+
}
|
|
652
|
+
return array.findIndex((x) => fn(x));
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function _lazy2(indexed) {
|
|
656
|
+
return (fn) => {
|
|
657
|
+
let i = 0;
|
|
658
|
+
return (value, index, array) => {
|
|
659
|
+
const valid = indexed ? fn(value, index, array) : fn(value);
|
|
660
|
+
if (valid) {
|
|
661
|
+
return {
|
|
662
|
+
done: true,
|
|
663
|
+
hasNext: true,
|
|
664
|
+
next: i
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
i++;
|
|
668
|
+
return {
|
|
669
|
+
done: false,
|
|
670
|
+
hasNext: false
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
((findIndex2) => {
|
|
676
|
+
function indexed(...args) {
|
|
677
|
+
return purry(_findIndex(true), args, findIndex2.lazyIndexed);
|
|
678
|
+
}
|
|
679
|
+
findIndex2.indexed = indexed;
|
|
680
|
+
findIndex2.lazy = toSingle(_lazy2(false));
|
|
681
|
+
findIndex2.lazyIndexed = toSingle(toLazyIndexed(_lazy2(true)));
|
|
682
|
+
})(findIndex || (findIndex = {}));
|
|
683
|
+
|
|
684
|
+
// src/array/find-last-index.ts
|
|
685
|
+
function findLastIndex(...args) {
|
|
686
|
+
return purry(_findLastIndex(false), args);
|
|
687
|
+
}
|
|
688
|
+
function _findLastIndex(indexed) {
|
|
689
|
+
return (array, fn) => {
|
|
690
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
691
|
+
if (indexed ? fn(array[i], i, array) : fn(array[i])) {
|
|
692
|
+
return i;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return -1;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
((findLastIndex2) => {
|
|
699
|
+
function indexed(...args) {
|
|
700
|
+
return purry(_findLastIndex(true), args);
|
|
701
|
+
}
|
|
702
|
+
findLastIndex2.indexed = indexed;
|
|
703
|
+
})(findLastIndex || (findLastIndex = {}));
|
|
704
|
+
|
|
705
|
+
// src/array/find-last.ts
|
|
706
|
+
function findLast(...args) {
|
|
707
|
+
return purry(_findLast(false), args);
|
|
708
|
+
}
|
|
709
|
+
function _findLast(indexed) {
|
|
710
|
+
return (array, fn) => {
|
|
711
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
712
|
+
if (indexed ? fn(array[i], i, array) : fn(array[i])) {
|
|
713
|
+
return array[i];
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
((findLast2) => {
|
|
719
|
+
function indexed(...args) {
|
|
720
|
+
return purry(_findLast(true), args);
|
|
721
|
+
}
|
|
722
|
+
findLast2.indexed = indexed;
|
|
723
|
+
})(findLast || (findLast = {}));
|
|
724
|
+
|
|
725
|
+
// src/array/find.ts
|
|
726
|
+
function find(...args) {
|
|
727
|
+
return purry(_find(false), args, find.lazy);
|
|
728
|
+
}
|
|
729
|
+
function _find(indexed) {
|
|
730
|
+
return (array, fn) => {
|
|
731
|
+
if (indexed) {
|
|
732
|
+
return array.find(fn);
|
|
733
|
+
}
|
|
734
|
+
return array.find((x) => fn(x));
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function _lazy3(indexed) {
|
|
738
|
+
return (fn) => {
|
|
739
|
+
return (value, index, array) => {
|
|
740
|
+
const valid = indexed ? fn(value, index, array) : fn(value);
|
|
741
|
+
return {
|
|
742
|
+
done: valid,
|
|
743
|
+
hasNext: valid,
|
|
744
|
+
next: value
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
((find2) => {
|
|
750
|
+
function indexed(...args) {
|
|
751
|
+
return purry(_find(true), args, find2.lazyIndexed);
|
|
752
|
+
}
|
|
753
|
+
find2.indexed = indexed;
|
|
754
|
+
find2.lazy = toSingle(_lazy3(false));
|
|
755
|
+
find2.lazyIndexed = toSingle(toLazyIndexed(_lazy3(true)));
|
|
756
|
+
})(find || (find = {}));
|
|
757
|
+
|
|
758
|
+
// src/array/first.ts
|
|
759
|
+
function first(...args) {
|
|
760
|
+
return purry(_first, args, first.lazy);
|
|
761
|
+
}
|
|
762
|
+
function _first([first2]) {
|
|
763
|
+
return first2;
|
|
764
|
+
}
|
|
765
|
+
((first2) => {
|
|
766
|
+
function lazy() {
|
|
767
|
+
return (value) => {
|
|
768
|
+
return {
|
|
769
|
+
done: true,
|
|
770
|
+
hasNext: true,
|
|
771
|
+
next: value
|
|
772
|
+
};
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
first2.lazy = lazy;
|
|
776
|
+
((lazy2) => {
|
|
777
|
+
lazy2.single = true;
|
|
778
|
+
})(lazy = first2.lazy || (first2.lazy = {}));
|
|
779
|
+
})(first || (first = {}));
|
|
780
|
+
|
|
781
|
+
// src/array/flat-map-to-obj.ts
|
|
782
|
+
function flatMapToObj(...args) {
|
|
783
|
+
return purry(_flatMapToObj(false), args);
|
|
784
|
+
}
|
|
785
|
+
function _flatMapToObj(indexed) {
|
|
786
|
+
return (array, fn) => {
|
|
787
|
+
return array.reduce((result, element, index) => {
|
|
788
|
+
const items = indexed ? fn(element, index, array) : fn(element);
|
|
789
|
+
items.forEach(([key, value]) => {
|
|
790
|
+
result[key] = value;
|
|
791
|
+
});
|
|
792
|
+
return result;
|
|
793
|
+
}, {});
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
((flatMapToObj2) => {
|
|
797
|
+
function indexed(...args) {
|
|
798
|
+
return purry(_flatMapToObj(true), args);
|
|
799
|
+
}
|
|
800
|
+
flatMapToObj2.indexed = indexed;
|
|
801
|
+
})(flatMapToObj || (flatMapToObj = {}));
|
|
802
|
+
|
|
803
|
+
// src/array/flatten.ts
|
|
804
|
+
function flatten(...args) {
|
|
805
|
+
return purry(_flatten, args, flatten.lazy);
|
|
806
|
+
}
|
|
807
|
+
function _flatten(items) {
|
|
808
|
+
return _reduceLazy(items, flatten.lazy());
|
|
809
|
+
}
|
|
810
|
+
((flatten2) => {
|
|
811
|
+
function lazy() {
|
|
812
|
+
return (next) => {
|
|
813
|
+
if (Array.isArray(next)) {
|
|
814
|
+
return {
|
|
815
|
+
done: false,
|
|
816
|
+
hasNext: true,
|
|
817
|
+
hasMany: true,
|
|
818
|
+
next
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
return {
|
|
822
|
+
done: false,
|
|
823
|
+
hasNext: true,
|
|
824
|
+
next
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
flatten2.lazy = lazy;
|
|
829
|
+
})(flatten || (flatten = {}));
|
|
830
|
+
|
|
831
|
+
// src/array/flat-map.ts
|
|
832
|
+
function flatMap(...args) {
|
|
833
|
+
return purry(_flatMap, args, flatMap.lazy);
|
|
834
|
+
}
|
|
835
|
+
function _flatMap(array, fn) {
|
|
836
|
+
return flatten(array.map((item) => fn(item)));
|
|
837
|
+
}
|
|
838
|
+
((flatMap2) => {
|
|
839
|
+
function lazy(fn) {
|
|
840
|
+
return (value) => {
|
|
841
|
+
const next = fn(value);
|
|
842
|
+
if (Array.isArray(next)) {
|
|
843
|
+
return {
|
|
844
|
+
done: false,
|
|
845
|
+
hasNext: true,
|
|
846
|
+
hasMany: true,
|
|
847
|
+
next
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
return {
|
|
851
|
+
done: false,
|
|
852
|
+
hasNext: true,
|
|
853
|
+
next
|
|
854
|
+
};
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
flatMap2.lazy = lazy;
|
|
858
|
+
})(flatMap || (flatMap = {}));
|
|
859
|
+
|
|
860
|
+
// src/array/flatten-deep.ts
|
|
861
|
+
function flattenDeep(...args) {
|
|
862
|
+
return purry(_flattenDeep, args, flattenDeep.lazy);
|
|
863
|
+
}
|
|
864
|
+
function _flattenDeep(items) {
|
|
865
|
+
return _reduceLazy(items, flattenDeep.lazy());
|
|
866
|
+
}
|
|
867
|
+
function _flattenDeepValue(value) {
|
|
868
|
+
if (!Array.isArray(value)) {
|
|
869
|
+
return value;
|
|
870
|
+
}
|
|
871
|
+
const ret = [];
|
|
872
|
+
value.forEach((item) => {
|
|
873
|
+
if (Array.isArray(item)) {
|
|
874
|
+
ret.push(...flattenDeep(item));
|
|
875
|
+
} else {
|
|
876
|
+
ret.push(item);
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
return ret;
|
|
880
|
+
}
|
|
881
|
+
((flattenDeep2) => {
|
|
882
|
+
function lazy() {
|
|
883
|
+
return (value) => {
|
|
884
|
+
const next = _flattenDeepValue(value);
|
|
885
|
+
if (Array.isArray(next)) {
|
|
886
|
+
return {
|
|
887
|
+
done: false,
|
|
888
|
+
hasNext: true,
|
|
889
|
+
hasMany: true,
|
|
890
|
+
next
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
return {
|
|
894
|
+
done: false,
|
|
895
|
+
hasNext: true,
|
|
896
|
+
next
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
flattenDeep2.lazy = lazy;
|
|
901
|
+
})(flattenDeep || (flattenDeep = {}));
|
|
902
|
+
|
|
903
|
+
// src/array/for-each.ts
|
|
904
|
+
function forEach(...args) {
|
|
905
|
+
return purry(_forEach(false), args, forEach.lazy);
|
|
906
|
+
}
|
|
907
|
+
function _forEach(indexed) {
|
|
908
|
+
return (array, fn) => {
|
|
909
|
+
return _reduceLazy(
|
|
910
|
+
array,
|
|
911
|
+
indexed ? forEach.lazyIndexed(fn) : forEach.lazy(fn),
|
|
912
|
+
indexed
|
|
913
|
+
);
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function _lazy4(indexed) {
|
|
917
|
+
return (fn) => {
|
|
918
|
+
return (value, index, array) => {
|
|
919
|
+
if (indexed) {
|
|
920
|
+
fn(value, index, array);
|
|
921
|
+
} else {
|
|
922
|
+
fn(value);
|
|
923
|
+
}
|
|
924
|
+
return {
|
|
925
|
+
done: false,
|
|
926
|
+
hasNext: true,
|
|
927
|
+
next: value
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
((forEach2) => {
|
|
933
|
+
function indexed(...args) {
|
|
934
|
+
return purry(_forEach(true), args, forEach2.lazyIndexed);
|
|
935
|
+
}
|
|
936
|
+
forEach2.indexed = indexed;
|
|
937
|
+
forEach2.lazy = _lazy4(false);
|
|
938
|
+
forEach2.lazyIndexed = toLazyIndexed(_lazy4(true));
|
|
939
|
+
})(forEach || (forEach = {}));
|
|
940
|
+
|
|
941
|
+
// src/array/group-by.ts
|
|
942
|
+
function groupBy(...args) {
|
|
943
|
+
return purry(_groupBy(false), args);
|
|
944
|
+
}
|
|
945
|
+
function _groupBy(indexed) {
|
|
946
|
+
return (array, fn) => {
|
|
947
|
+
const ret = {};
|
|
948
|
+
array.forEach((item, index) => {
|
|
949
|
+
const key = indexed ? fn(item, index, array) : fn(item);
|
|
950
|
+
if (key !== void 0) {
|
|
951
|
+
const actualKey = String(key);
|
|
952
|
+
if (!ret[actualKey]) {
|
|
953
|
+
ret[actualKey] = [];
|
|
954
|
+
}
|
|
955
|
+
ret[actualKey].push(item);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
return ret;
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
((groupBy2) => {
|
|
962
|
+
function indexed(...args) {
|
|
963
|
+
return purry(_groupBy(true), args);
|
|
964
|
+
}
|
|
965
|
+
groupBy2.indexed = indexed;
|
|
966
|
+
groupBy2.strict = groupBy2;
|
|
967
|
+
})(groupBy || (groupBy = {}));
|
|
968
|
+
|
|
969
|
+
// src/array/index-by.ts
|
|
970
|
+
function indexBy(...args) {
|
|
971
|
+
return purry(_indexBy(false), args);
|
|
972
|
+
}
|
|
973
|
+
function _indexBy(indexed) {
|
|
974
|
+
return (array, fn) => {
|
|
975
|
+
return array.reduce((ret, item, index) => {
|
|
976
|
+
const value = indexed ? fn(item, index, array) : fn(item);
|
|
977
|
+
const key = String(value);
|
|
978
|
+
ret[key] = item;
|
|
979
|
+
return ret;
|
|
980
|
+
}, {});
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
((indexBy2) => {
|
|
984
|
+
function indexed(...args) {
|
|
985
|
+
return purry(_indexBy(true), args);
|
|
986
|
+
}
|
|
987
|
+
indexBy2.indexed = indexed;
|
|
988
|
+
})(indexBy || (indexBy = {}));
|
|
989
|
+
|
|
990
|
+
// src/array/intersection.ts
|
|
991
|
+
function intersection(...args) {
|
|
992
|
+
return purry(_intersection, args, intersection.lazy);
|
|
993
|
+
}
|
|
994
|
+
function _intersection(array, other) {
|
|
995
|
+
const lazy = intersection.lazy(other);
|
|
996
|
+
return _reduceLazy(array, lazy);
|
|
997
|
+
}
|
|
998
|
+
((intersection2) => {
|
|
999
|
+
function lazy(other) {
|
|
1000
|
+
return (value) => {
|
|
1001
|
+
const set2 = new Set(other);
|
|
1002
|
+
if (set2.has(value)) {
|
|
1003
|
+
return {
|
|
1004
|
+
done: false,
|
|
1005
|
+
hasNext: true,
|
|
1006
|
+
next: value
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
return {
|
|
1010
|
+
done: false,
|
|
1011
|
+
hasNext: false
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
intersection2.lazy = lazy;
|
|
1016
|
+
})(intersection || (intersection = {}));
|
|
1017
|
+
|
|
1018
|
+
// src/array/intersection-with.ts
|
|
1019
|
+
function intersectionWith(...args) {
|
|
1020
|
+
return purry(_intersectionWith, args, intersectionWith.lazy);
|
|
1021
|
+
}
|
|
1022
|
+
function _intersectionWith(array, other, comparator) {
|
|
1023
|
+
const lazy = intersectionWith.lazy(other, comparator);
|
|
1024
|
+
return _reduceLazy(array, lazy);
|
|
1025
|
+
}
|
|
1026
|
+
((intersectionWith2) => {
|
|
1027
|
+
function lazy(other, comparator) {
|
|
1028
|
+
return (value) => {
|
|
1029
|
+
if (other.some((otherValue) => comparator(value, otherValue))) {
|
|
1030
|
+
return {
|
|
1031
|
+
done: false,
|
|
1032
|
+
hasNext: true,
|
|
1033
|
+
next: value
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
return {
|
|
1037
|
+
done: false,
|
|
1038
|
+
hasNext: false
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
intersectionWith2.lazy = lazy;
|
|
1043
|
+
})(intersectionWith || (intersectionWith = {}));
|
|
1044
|
+
|
|
1045
|
+
// src/array/join.ts
|
|
1046
|
+
function join(...args) {
|
|
1047
|
+
return purry(joinImplementation, args);
|
|
1048
|
+
}
|
|
1049
|
+
function joinImplementation(data, glue) {
|
|
1050
|
+
return data.join(glue);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
// src/array/last.ts
|
|
1054
|
+
function last(...args) {
|
|
1055
|
+
return purry(_last, args);
|
|
1056
|
+
}
|
|
1057
|
+
function _last(array) {
|
|
1058
|
+
return array[array.length - 1];
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// src/array/length.ts
|
|
1062
|
+
function length(...args) {
|
|
1063
|
+
return purry(_length, args);
|
|
1064
|
+
}
|
|
1065
|
+
function _length(items) {
|
|
1066
|
+
return "length" in items ? items.length : Array.from(items).length;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
// src/array/map.ts
|
|
1070
|
+
function map(...args) {
|
|
1071
|
+
return purry(_map(false), args, map.lazy);
|
|
1072
|
+
}
|
|
1073
|
+
function _map(indexed) {
|
|
1074
|
+
return (array, fn) => {
|
|
1075
|
+
return _reduceLazy(
|
|
1076
|
+
array,
|
|
1077
|
+
indexed ? map.lazyIndexed(fn) : map.lazy(fn),
|
|
1078
|
+
indexed
|
|
1079
|
+
);
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
function _lazy5(indexed) {
|
|
1083
|
+
return (fn) => {
|
|
1084
|
+
return (value, index, array) => {
|
|
1085
|
+
return {
|
|
1086
|
+
done: false,
|
|
1087
|
+
hasNext: true,
|
|
1088
|
+
next: indexed ? fn(value, index, array) : fn(value)
|
|
1089
|
+
};
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
((map2) => {
|
|
1094
|
+
function indexed(...args) {
|
|
1095
|
+
return purry(_map(true), args, map2.lazyIndexed);
|
|
1096
|
+
}
|
|
1097
|
+
map2.indexed = indexed;
|
|
1098
|
+
map2.lazy = _lazy5(false);
|
|
1099
|
+
map2.lazyIndexed = toLazyIndexed(_lazy5(true));
|
|
1100
|
+
map2.strict = map2;
|
|
1101
|
+
})(map || (map = {}));
|
|
1102
|
+
|
|
1103
|
+
// src/array/map-to-obj.ts
|
|
1104
|
+
function mapToObj(...args) {
|
|
1105
|
+
return purry(_mapToObj(false), args);
|
|
1106
|
+
}
|
|
1107
|
+
function _mapToObj(indexed) {
|
|
1108
|
+
return (array, fn) => {
|
|
1109
|
+
return array.reduce((result, element, index) => {
|
|
1110
|
+
const [key, value] = indexed ? fn(element, index, array) : fn(element);
|
|
1111
|
+
result[key] = value;
|
|
1112
|
+
return result;
|
|
1113
|
+
}, {});
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
((mapToObj2) => {
|
|
1117
|
+
function indexed(...args) {
|
|
1118
|
+
return purry(_mapToObj(true), args);
|
|
1119
|
+
}
|
|
1120
|
+
mapToObj2.indexed = indexed;
|
|
1121
|
+
})(mapToObj || (mapToObj = {}));
|
|
1122
|
+
|
|
1123
|
+
// src/array/max-by.ts
|
|
1124
|
+
function _maxBy(indexed) {
|
|
1125
|
+
return (array, fn) => {
|
|
1126
|
+
let ret;
|
|
1127
|
+
let retMax;
|
|
1128
|
+
array.forEach((item, i) => {
|
|
1129
|
+
const max = indexed ? fn(item, i, array) : fn(item);
|
|
1130
|
+
if (retMax === void 0 || max > retMax) {
|
|
1131
|
+
ret = item;
|
|
1132
|
+
retMax = max;
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
return ret;
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
function maxBy(...args) {
|
|
1139
|
+
return purry(_maxBy(false), args);
|
|
1140
|
+
}
|
|
1141
|
+
((maxBy2) => {
|
|
1142
|
+
function indexed(...args) {
|
|
1143
|
+
return purry(_maxBy(true), args);
|
|
1144
|
+
}
|
|
1145
|
+
maxBy2.indexed = indexed;
|
|
1146
|
+
})(maxBy || (maxBy = {}));
|
|
1147
|
+
|
|
1148
|
+
// src/array/mean-by.ts
|
|
1149
|
+
function _meanBy(indexed) {
|
|
1150
|
+
return (array, fn) => {
|
|
1151
|
+
if (array.length === 0) {
|
|
1152
|
+
return Number.NaN;
|
|
1153
|
+
}
|
|
1154
|
+
let sum = 0;
|
|
1155
|
+
array.forEach((item, i) => {
|
|
1156
|
+
sum += indexed ? fn(item, i, array) : fn(item);
|
|
1157
|
+
});
|
|
1158
|
+
return sum / array.length;
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
function meanBy(...args) {
|
|
1162
|
+
return purry(_meanBy(false), args);
|
|
1163
|
+
}
|
|
1164
|
+
((meanBy2) => {
|
|
1165
|
+
function indexed(...args) {
|
|
1166
|
+
return purry(_meanBy(true), args);
|
|
1167
|
+
}
|
|
1168
|
+
meanBy2.indexed = indexed;
|
|
1169
|
+
})(meanBy || (meanBy = {}));
|
|
1170
|
+
|
|
1171
|
+
// src/array/merge-all.ts
|
|
1172
|
+
function mergeAll(items) {
|
|
1173
|
+
return items.reduce((acc, x) => ({ ...acc, ...x }), {});
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// src/array/min-by.ts
|
|
1177
|
+
function _minBy(indexed) {
|
|
1178
|
+
return (array, fn) => {
|
|
1179
|
+
let ret;
|
|
1180
|
+
let retMin;
|
|
1181
|
+
array.forEach((item, i) => {
|
|
1182
|
+
const min = indexed ? fn(item, i, array) : fn(item);
|
|
1183
|
+
if (retMin === void 0 || min < retMin) {
|
|
1184
|
+
ret = item;
|
|
1185
|
+
retMin = min;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
return ret;
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
function minBy(...args) {
|
|
1192
|
+
return purry(_minBy(false), args);
|
|
1193
|
+
}
|
|
1194
|
+
((minBy2) => {
|
|
1195
|
+
function indexed(...args) {
|
|
1196
|
+
return purry(_minBy(true), args);
|
|
1197
|
+
}
|
|
1198
|
+
minBy2.indexed = indexed;
|
|
1199
|
+
})(minBy || (minBy = {}));
|
|
1200
|
+
|
|
1201
|
+
// src/array/partition.ts
|
|
1202
|
+
function partition(...args) {
|
|
1203
|
+
return purry(_partition(false), args);
|
|
1204
|
+
}
|
|
1205
|
+
function _partition(indexed) {
|
|
1206
|
+
return (array, fn) => {
|
|
1207
|
+
const ret = [[], []];
|
|
1208
|
+
array.forEach((item, index) => {
|
|
1209
|
+
const matches = indexed ? fn(item, index, array) : fn(item);
|
|
1210
|
+
ret[matches ? 0 : 1].push(item);
|
|
1211
|
+
});
|
|
1212
|
+
return ret;
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
((partition2) => {
|
|
1216
|
+
function indexed(...args) {
|
|
1217
|
+
return purry(_partition(true), args);
|
|
1218
|
+
}
|
|
1219
|
+
partition2.indexed = indexed;
|
|
1220
|
+
})(partition || (partition = {}));
|
|
1221
|
+
|
|
1222
|
+
// src/array/range.ts
|
|
1223
|
+
function range(...args) {
|
|
1224
|
+
return purry(_range, args);
|
|
1225
|
+
}
|
|
1226
|
+
function _range(start, end) {
|
|
1227
|
+
const ret = [];
|
|
1228
|
+
for (let i = start; i < end; i++) {
|
|
1229
|
+
ret.push(i);
|
|
1230
|
+
}
|
|
1231
|
+
return ret;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
// src/array/reduce.ts
|
|
1235
|
+
function reduce(...args) {
|
|
1236
|
+
return purry(_reduce(false), args);
|
|
1237
|
+
}
|
|
1238
|
+
function _reduce(indexed) {
|
|
1239
|
+
return (items, fn, initialValue) => {
|
|
1240
|
+
return items.reduce(
|
|
1241
|
+
(acc, item, index) => indexed ? fn(acc, item, index, items) : fn(acc, item),
|
|
1242
|
+
initialValue
|
|
1243
|
+
);
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
((reduce2) => {
|
|
1247
|
+
function indexed(...args) {
|
|
1248
|
+
return purry(_reduce(true), args);
|
|
1249
|
+
}
|
|
1250
|
+
reduce2.indexed = indexed;
|
|
1251
|
+
})(reduce || (reduce = {}));
|
|
1252
|
+
|
|
1253
|
+
// src/array/reject.ts
|
|
1254
|
+
function reject(...args) {
|
|
1255
|
+
return purry(_reject(false), args, reject.lazy);
|
|
1256
|
+
}
|
|
1257
|
+
function _reject(indexed) {
|
|
1258
|
+
return (array, fn) => {
|
|
1259
|
+
return _reduceLazy(
|
|
1260
|
+
array,
|
|
1261
|
+
indexed ? reject.lazyIndexed(fn) : reject.lazy(fn),
|
|
1262
|
+
indexed
|
|
1263
|
+
);
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
function _lazy6(indexed) {
|
|
1267
|
+
return (fn) => {
|
|
1268
|
+
return (value, index, array) => {
|
|
1269
|
+
const valid = indexed ? fn(value, index, array) : fn(value);
|
|
1270
|
+
if (!valid) {
|
|
1271
|
+
return {
|
|
1272
|
+
done: false,
|
|
1273
|
+
hasNext: true,
|
|
1274
|
+
next: value
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
return {
|
|
1278
|
+
done: false,
|
|
1279
|
+
hasNext: false
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
((reject2) => {
|
|
1285
|
+
function indexed(...args) {
|
|
1286
|
+
return purry(_reject(true), args, reject2.lazyIndexed);
|
|
1287
|
+
}
|
|
1288
|
+
reject2.indexed = indexed;
|
|
1289
|
+
reject2.lazy = _lazy6(false);
|
|
1290
|
+
reject2.lazyIndexed = toLazyIndexed(_lazy6(true));
|
|
1291
|
+
})(reject || (reject = {}));
|
|
1292
|
+
|
|
1293
|
+
// src/array/reverse.ts
|
|
1294
|
+
function reverse(...args) {
|
|
1295
|
+
return purry(_reverse, args);
|
|
1296
|
+
}
|
|
1297
|
+
function _reverse(array) {
|
|
1298
|
+
return array.slice().reverse();
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
// src/array/sample.ts
|
|
1302
|
+
function sample(...args) {
|
|
1303
|
+
return purry(sampleImplementation, args);
|
|
1304
|
+
}
|
|
1305
|
+
function sampleImplementation(data, sampleSize) {
|
|
1306
|
+
if (sampleSize < 0) {
|
|
1307
|
+
throw new RangeError(`sampleSize must cannot be negative: ${sampleSize}`);
|
|
1308
|
+
}
|
|
1309
|
+
if (!Number.isInteger(sampleSize)) {
|
|
1310
|
+
throw new TypeError(`sampleSize must be an integer: ${sampleSize}`);
|
|
1311
|
+
}
|
|
1312
|
+
if (sampleSize >= data.length) {
|
|
1313
|
+
return data;
|
|
1314
|
+
}
|
|
1315
|
+
if (sampleSize === 0) {
|
|
1316
|
+
return [];
|
|
1317
|
+
}
|
|
1318
|
+
const actualSampleSize = Math.min(sampleSize, data.length - sampleSize);
|
|
1319
|
+
const sampleIndices = /* @__PURE__ */ new Set();
|
|
1320
|
+
while (sampleIndices.size < actualSampleSize) {
|
|
1321
|
+
const randomIndex = Math.floor(Math.random() * data.length);
|
|
1322
|
+
sampleIndices.add(randomIndex);
|
|
1323
|
+
}
|
|
1324
|
+
if (sampleSize === actualSampleSize) {
|
|
1325
|
+
return Array.from(sampleIndices).sort((a, b) => a - b).map((index) => data[index]);
|
|
1326
|
+
}
|
|
1327
|
+
return data.filter((_, index) => !sampleIndices.has(index));
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// src/array/shuffle.ts
|
|
1331
|
+
function shuffle(...args) {
|
|
1332
|
+
return purry(_shuffle, args);
|
|
1333
|
+
}
|
|
1334
|
+
function _shuffle(items) {
|
|
1335
|
+
const result = items.slice();
|
|
1336
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
1337
|
+
const rand = index + Math.floor(Math.random() * (items.length - index));
|
|
1338
|
+
const value = result[rand];
|
|
1339
|
+
result[rand] = result[index];
|
|
1340
|
+
result[index] = value;
|
|
1341
|
+
}
|
|
1342
|
+
return result;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// src/array/sort.ts
|
|
1346
|
+
function sort(...args) {
|
|
1347
|
+
return purry(_sort, args);
|
|
1348
|
+
}
|
|
1349
|
+
function _sort(items, cmp) {
|
|
1350
|
+
const ret = [...items];
|
|
1351
|
+
ret.sort(cmp);
|
|
1352
|
+
return ret;
|
|
1353
|
+
}
|
|
1354
|
+
((sort2) => {
|
|
1355
|
+
sort2.strict = sort2;
|
|
1356
|
+
})(sort || (sort = {}));
|
|
1357
|
+
|
|
1358
|
+
// src/array/sort-by.ts
|
|
1359
|
+
var ALL_DIRECTIONS = ["asc", "desc"];
|
|
1360
|
+
var COMPARATOR = {
|
|
1361
|
+
asc: (x, y) => x > y,
|
|
1362
|
+
desc: (x, y) => x < y
|
|
1363
|
+
};
|
|
1364
|
+
function sortBy(arrayOrSortRule, ...sortRules) {
|
|
1365
|
+
const args = isSortRule(arrayOrSortRule) ? [[arrayOrSortRule, ...sortRules]] : [arrayOrSortRule, sortRules];
|
|
1366
|
+
return purry(_sortBy, args);
|
|
1367
|
+
}
|
|
1368
|
+
function isSortRule(x) {
|
|
1369
|
+
if (typeof x === "function") {
|
|
1370
|
+
return true;
|
|
1371
|
+
}
|
|
1372
|
+
const [maybeProjection, maybeDirection, ...rest] = x;
|
|
1373
|
+
if (rest.length > 0) {
|
|
1374
|
+
return false;
|
|
1375
|
+
}
|
|
1376
|
+
return typeof maybeProjection === "function" && ALL_DIRECTIONS.includes(maybeDirection);
|
|
1377
|
+
}
|
|
1378
|
+
function _sortBy(array, sorts) {
|
|
1379
|
+
return [...array].sort(comparer(...sorts));
|
|
1380
|
+
}
|
|
1381
|
+
function comparer(primaryRule, secondaryRule, ...otherRules) {
|
|
1382
|
+
const projector = typeof primaryRule === "function" ? primaryRule : primaryRule[0];
|
|
1383
|
+
const direction = typeof primaryRule === "function" ? "asc" : primaryRule[1];
|
|
1384
|
+
const comparator = COMPARATOR[direction];
|
|
1385
|
+
const nextComparer = secondaryRule === void 0 ? void 0 : comparer(secondaryRule, ...otherRules);
|
|
1386
|
+
return (a, b) => {
|
|
1387
|
+
const projectedA = projector(a);
|
|
1388
|
+
const projectedB = projector(b);
|
|
1389
|
+
if (comparator(projectedA, projectedB)) {
|
|
1390
|
+
return 1;
|
|
1391
|
+
}
|
|
1392
|
+
if (comparator(projectedB, projectedA)) {
|
|
1393
|
+
return -1;
|
|
1394
|
+
}
|
|
1395
|
+
return nextComparer?.(a, b) ?? 0;
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
((sortBy2) => {
|
|
1399
|
+
sortBy2.strict = sortBy2;
|
|
1400
|
+
})(sortBy || (sortBy = {}));
|
|
1401
|
+
|
|
1402
|
+
// src/array/split-at.ts
|
|
1403
|
+
function splitAt(...args) {
|
|
1404
|
+
return purry(_splitAt, args);
|
|
1405
|
+
}
|
|
1406
|
+
function _splitAt(array, index) {
|
|
1407
|
+
const copy = [...array];
|
|
1408
|
+
const tail = copy.splice(index);
|
|
1409
|
+
return [copy, tail];
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
// src/array/split-when.ts
|
|
1413
|
+
function splitWhen(...args) {
|
|
1414
|
+
return purry(_splitWhen, args);
|
|
1415
|
+
}
|
|
1416
|
+
function _splitWhen(array, fn) {
|
|
1417
|
+
for (let i = 0; i < array.length; i++) {
|
|
1418
|
+
if (fn(array[i])) {
|
|
1419
|
+
return splitAt(array, i);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
return [array, []];
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// src/array/sum-by.ts
|
|
1426
|
+
function _sumBy(indexed) {
|
|
1427
|
+
return (array, fn) => {
|
|
1428
|
+
let sum = 0;
|
|
1429
|
+
array.forEach((item, i) => {
|
|
1430
|
+
const summand = indexed ? fn(item, i, array) : fn(item);
|
|
1431
|
+
sum += summand;
|
|
1432
|
+
});
|
|
1433
|
+
return sum;
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
function sumBy(...args) {
|
|
1437
|
+
return purry(_sumBy(false), args);
|
|
1438
|
+
}
|
|
1439
|
+
((sumBy2) => {
|
|
1440
|
+
function indexed(...args) {
|
|
1441
|
+
return purry(_sumBy(true), args);
|
|
1442
|
+
}
|
|
1443
|
+
sumBy2.indexed = indexed;
|
|
1444
|
+
})(sumBy || (sumBy = {}));
|
|
1445
|
+
|
|
1446
|
+
// src/array/swap-indices.ts
|
|
1447
|
+
function swapIndices(...args) {
|
|
1448
|
+
return purry(_swapIndices, args);
|
|
1449
|
+
}
|
|
1450
|
+
function _swapIndices(item, index1, index2) {
|
|
1451
|
+
return typeof item === "string" ? _swapString(item, index1, index2) : _swapArray(item, index1, index2);
|
|
1452
|
+
}
|
|
1453
|
+
function _swapArray(item, index1, index2) {
|
|
1454
|
+
const result = item.slice();
|
|
1455
|
+
if (Number.isNaN(index1) || Number.isNaN(index2)) {
|
|
1456
|
+
return result;
|
|
1457
|
+
}
|
|
1458
|
+
const positiveIndexA = index1 < 0 ? item.length + index1 : index1;
|
|
1459
|
+
const positiveIndexB = index2 < 0 ? item.length + index2 : index2;
|
|
1460
|
+
if (positiveIndexA < 0 || positiveIndexA > item.length) {
|
|
1461
|
+
return result;
|
|
1462
|
+
}
|
|
1463
|
+
if (positiveIndexB < 0 || positiveIndexB > item.length) {
|
|
1464
|
+
return result;
|
|
1465
|
+
}
|
|
1466
|
+
result[positiveIndexA] = item[positiveIndexB];
|
|
1467
|
+
result[positiveIndexB] = item[positiveIndexA];
|
|
1468
|
+
return result;
|
|
1469
|
+
}
|
|
1470
|
+
function _swapString(item, index1, index2) {
|
|
1471
|
+
const result = _swapArray(item.split(""), index1, index2);
|
|
1472
|
+
return result.join("");
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
// src/array/take.ts
|
|
1476
|
+
function take(...args) {
|
|
1477
|
+
return purry(_take, args, take.lazy);
|
|
1478
|
+
}
|
|
1479
|
+
function _take(array, n) {
|
|
1480
|
+
return _reduceLazy(array, take.lazy(n));
|
|
1481
|
+
}
|
|
1482
|
+
((take2) => {
|
|
1483
|
+
function lazy(n) {
|
|
1484
|
+
return (value) => {
|
|
1485
|
+
if (n === 0) {
|
|
1486
|
+
return {
|
|
1487
|
+
done: true,
|
|
1488
|
+
hasNext: false
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
n--;
|
|
1492
|
+
if (n === 0) {
|
|
1493
|
+
return {
|
|
1494
|
+
done: true,
|
|
1495
|
+
hasNext: true,
|
|
1496
|
+
next: value
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
return {
|
|
1500
|
+
done: false,
|
|
1501
|
+
hasNext: true,
|
|
1502
|
+
next: value
|
|
1503
|
+
};
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
take2.lazy = lazy;
|
|
1507
|
+
})(take || (take = {}));
|
|
1508
|
+
|
|
1509
|
+
// src/array/take-while.ts
|
|
1510
|
+
function takeWhile(...args) {
|
|
1511
|
+
return purry(_takeWhile, args);
|
|
1512
|
+
}
|
|
1513
|
+
function _takeWhile(array, fn) {
|
|
1514
|
+
const ret = [];
|
|
1515
|
+
for (const item of array) {
|
|
1516
|
+
if (!fn(item)) {
|
|
1517
|
+
break;
|
|
1518
|
+
}
|
|
1519
|
+
ret.push(item);
|
|
1520
|
+
}
|
|
1521
|
+
return ret;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
// src/array/uniq.ts
|
|
1525
|
+
function uniq(...args) {
|
|
1526
|
+
return purry(_uniq, args, uniq.lazy);
|
|
1527
|
+
}
|
|
1528
|
+
function _uniq(array) {
|
|
1529
|
+
return _reduceLazy(array, uniq.lazy());
|
|
1530
|
+
}
|
|
1531
|
+
((uniq2) => {
|
|
1532
|
+
function lazy() {
|
|
1533
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
1534
|
+
return (value) => {
|
|
1535
|
+
if (set2.has(value)) {
|
|
1536
|
+
return {
|
|
1537
|
+
done: false,
|
|
1538
|
+
hasNext: false
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
set2.add(value);
|
|
1542
|
+
return {
|
|
1543
|
+
done: false,
|
|
1544
|
+
hasNext: true,
|
|
1545
|
+
next: value
|
|
1546
|
+
};
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
uniq2.lazy = lazy;
|
|
1550
|
+
})(uniq || (uniq = {}));
|
|
1551
|
+
|
|
1552
|
+
// src/array/uniq-by.ts
|
|
1553
|
+
function uniqBy(...args) {
|
|
1554
|
+
return purry(_uniqBy, args, lazyUniqBy);
|
|
1555
|
+
}
|
|
1556
|
+
function _uniqBy(array, transformer) {
|
|
1557
|
+
return _reduceLazy(array, lazyUniqBy(transformer));
|
|
1558
|
+
}
|
|
1559
|
+
function lazyUniqBy(transformer) {
|
|
1560
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
1561
|
+
return (value) => {
|
|
1562
|
+
const appliedItem = transformer(value);
|
|
1563
|
+
if (set2.has(appliedItem)) {
|
|
1564
|
+
return {
|
|
1565
|
+
done: false,
|
|
1566
|
+
hasNext: false
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
set2.add(appliedItem);
|
|
1570
|
+
return {
|
|
1571
|
+
done: false,
|
|
1572
|
+
hasNext: true,
|
|
1573
|
+
next: value
|
|
1574
|
+
};
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
// src/array/uniq-with.ts
|
|
1579
|
+
function uniqWith(...args) {
|
|
1580
|
+
return purry(_uniqWith, args, uniqWith.lazy);
|
|
1581
|
+
}
|
|
1582
|
+
function _uniqWith(array, isEquals) {
|
|
1583
|
+
const lazy = uniqWith.lazy(isEquals);
|
|
1584
|
+
return _reduceLazy(array, lazy, true);
|
|
1585
|
+
}
|
|
1586
|
+
function _lazy7(isEquals) {
|
|
1587
|
+
return (value, index, array) => {
|
|
1588
|
+
if (array && array.findIndex((otherValue) => isEquals(value, otherValue)) === index) {
|
|
1589
|
+
return {
|
|
1590
|
+
done: false,
|
|
1591
|
+
hasNext: true,
|
|
1592
|
+
next: value
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
return {
|
|
1596
|
+
done: false,
|
|
1597
|
+
hasNext: false
|
|
1598
|
+
};
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
((uniqWith2) => {
|
|
1602
|
+
uniqWith2.lazy = toLazyIndexed(_lazy7);
|
|
1603
|
+
})(uniqWith || (uniqWith = {}));
|
|
1604
|
+
|
|
1605
|
+
// src/array/zip.ts
|
|
1606
|
+
function zip(...args) {
|
|
1607
|
+
return purry(_zip, args);
|
|
1608
|
+
}
|
|
1609
|
+
function _zip(first2, second) {
|
|
1610
|
+
const resultLength = first2.length > second.length ? second.length : first2.length;
|
|
1611
|
+
const result = [];
|
|
1612
|
+
for (let i = 0; i < resultLength; i++) {
|
|
1613
|
+
result.push([first2[i], second[i]]);
|
|
1614
|
+
}
|
|
1615
|
+
return result;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
// src/array/zip-obj.ts
|
|
1619
|
+
function zipObj(...args) {
|
|
1620
|
+
return purry(_zipObj, args);
|
|
1621
|
+
}
|
|
1622
|
+
function _zipObj(first2, second) {
|
|
1623
|
+
const resultLength = first2.length > second.length ? second.length : first2.length;
|
|
1624
|
+
const result = {};
|
|
1625
|
+
for (let i = 0; i < resultLength; i++) {
|
|
1626
|
+
result[first2[i]] = second[i];
|
|
1627
|
+
}
|
|
1628
|
+
return result;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
// src/array/zip-with.ts
|
|
1632
|
+
function zipWith(...args) {
|
|
1633
|
+
if (typeof args[0] === "function" && args.length === 1) {
|
|
1634
|
+
return function(f, s) {
|
|
1635
|
+
return _zipWith(f, s, args[0]);
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
if (typeof args[0] === "function" && args.length === 2) {
|
|
1639
|
+
return function(f) {
|
|
1640
|
+
return _zipWith(f, args[1], args[0]);
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
if (args.length === 3) {
|
|
1644
|
+
return _zipWith(args[0], args[1], args[2]);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
function _zipWith(first2, second, fn) {
|
|
1648
|
+
const resultLength = first2.length > second.length ? second.length : first2.length;
|
|
1649
|
+
const result = [];
|
|
1650
|
+
for (let i = 0; i < resultLength; i++) {
|
|
1651
|
+
result.push(fn(first2[i], second[i]));
|
|
1652
|
+
}
|
|
1653
|
+
return result;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
// src/number/clamp.ts
|
|
1657
|
+
function clamp(...args) {
|
|
1658
|
+
return purry(_clamp, args);
|
|
1659
|
+
}
|
|
1660
|
+
function _clamp(value, limits) {
|
|
1661
|
+
if (limits.min != null && limits.min > value) {
|
|
1662
|
+
return limits.min;
|
|
1663
|
+
}
|
|
1664
|
+
if (limits.max != null && limits.max < value) {
|
|
1665
|
+
return limits.max;
|
|
1666
|
+
}
|
|
1667
|
+
return value;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
// src/object/add-prop.ts
|
|
1671
|
+
function addProp(...args) {
|
|
1672
|
+
return purry(_addProp, args);
|
|
1673
|
+
}
|
|
1674
|
+
function _addProp(obj, prop2, value) {
|
|
1675
|
+
return {
|
|
1676
|
+
...obj,
|
|
1677
|
+
[prop2]: value
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
// src/type/type.ts
|
|
1682
|
+
function type(val) {
|
|
1683
|
+
if (val === null) {
|
|
1684
|
+
return "Null";
|
|
1685
|
+
}
|
|
1686
|
+
if (val === void 0) {
|
|
1687
|
+
return "Undefined";
|
|
1688
|
+
}
|
|
1689
|
+
return Object.prototype.toString.call(val).slice(8, -1);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
// src/object/clone.ts
|
|
1693
|
+
function _cloneRegExp(pattern) {
|
|
1694
|
+
return new RegExp(
|
|
1695
|
+
pattern.source,
|
|
1696
|
+
(pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "")
|
|
1697
|
+
);
|
|
1698
|
+
}
|
|
1699
|
+
function _clone(value, refFrom, refTo, deep) {
|
|
1700
|
+
function copy(copiedValue) {
|
|
1701
|
+
const len = refFrom.length;
|
|
1702
|
+
let idx = 0;
|
|
1703
|
+
while (idx < len) {
|
|
1704
|
+
if (value === refFrom[idx]) {
|
|
1705
|
+
return refTo[idx];
|
|
1706
|
+
}
|
|
1707
|
+
idx += 1;
|
|
1708
|
+
}
|
|
1709
|
+
refFrom[idx + 1] = value;
|
|
1710
|
+
refTo[idx + 1] = copiedValue;
|
|
1711
|
+
for (const key in value) {
|
|
1712
|
+
copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];
|
|
1713
|
+
}
|
|
1714
|
+
return copiedValue;
|
|
1715
|
+
}
|
|
1716
|
+
switch (type(value)) {
|
|
1717
|
+
case "Object":
|
|
1718
|
+
return copy({});
|
|
1719
|
+
case "Array":
|
|
1720
|
+
return copy([]);
|
|
1721
|
+
case "Date":
|
|
1722
|
+
return new Date(value.valueOf());
|
|
1723
|
+
case "RegExp":
|
|
1724
|
+
return _cloneRegExp(value);
|
|
1725
|
+
default:
|
|
1726
|
+
return value;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
function clone(value) {
|
|
1730
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, [], [], true);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// src/object/equals.ts
|
|
1734
|
+
var isArray2 = Array.isArray;
|
|
1735
|
+
var keyList = Object.keys;
|
|
1736
|
+
function equals(...args) {
|
|
1737
|
+
return purry(_equals, args);
|
|
1738
|
+
}
|
|
1739
|
+
function _equals(a, b) {
|
|
1740
|
+
if (a === b) {
|
|
1741
|
+
return true;
|
|
1742
|
+
}
|
|
1743
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
1744
|
+
const arrA = isArray2(a);
|
|
1745
|
+
const arrB = isArray2(b);
|
|
1746
|
+
let i;
|
|
1747
|
+
let length2;
|
|
1748
|
+
let key;
|
|
1749
|
+
if (arrA && arrB) {
|
|
1750
|
+
length2 = a.length;
|
|
1751
|
+
if (length2 !== b.length) {
|
|
1752
|
+
return false;
|
|
1753
|
+
}
|
|
1754
|
+
for (i = length2; i-- !== 0; ) {
|
|
1755
|
+
if (!equals(a[i], b[i])) {
|
|
1756
|
+
return false;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
return true;
|
|
1760
|
+
}
|
|
1761
|
+
if (arrA !== arrB) {
|
|
1762
|
+
return false;
|
|
1763
|
+
}
|
|
1764
|
+
const dateA = a instanceof Date;
|
|
1765
|
+
const dateB = b instanceof Date;
|
|
1766
|
+
if (dateA !== dateB) {
|
|
1767
|
+
return false;
|
|
1768
|
+
}
|
|
1769
|
+
if (dateA && dateB) {
|
|
1770
|
+
return a.getTime() === b.getTime();
|
|
1771
|
+
}
|
|
1772
|
+
const regexpA = a instanceof RegExp;
|
|
1773
|
+
const regexpB = b instanceof RegExp;
|
|
1774
|
+
if (regexpA !== regexpB) {
|
|
1775
|
+
return false;
|
|
1776
|
+
}
|
|
1777
|
+
if (regexpA && regexpB) {
|
|
1778
|
+
return a.toString() === b.toString();
|
|
1779
|
+
}
|
|
1780
|
+
const keys2 = keyList(a);
|
|
1781
|
+
length2 = keys2.length;
|
|
1782
|
+
if (length2 !== keyList(b).length) {
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1785
|
+
for (i = length2; i-- !== 0; ) {
|
|
1786
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys2[i])) {
|
|
1787
|
+
return false;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
for (i = length2; i-- !== 0; ) {
|
|
1791
|
+
key = keys2[i];
|
|
1792
|
+
if (!equals(a[key], b[key])) {
|
|
1793
|
+
return false;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return true;
|
|
1797
|
+
}
|
|
1798
|
+
return a !== a && b !== b;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
// src/object/for-each-obj.ts
|
|
1802
|
+
function forEachObj(...args) {
|
|
1803
|
+
return purry(_forEachObj(false), args);
|
|
1804
|
+
}
|
|
1805
|
+
function _forEachObj(indexed) {
|
|
1806
|
+
return (object, fn) => {
|
|
1807
|
+
for (const key in object) {
|
|
1808
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
1809
|
+
const val = object[key];
|
|
1810
|
+
if (indexed) {
|
|
1811
|
+
fn(val, key, object);
|
|
1812
|
+
} else {
|
|
1813
|
+
fn(val);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
return object;
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
((forEachObj2) => {
|
|
1821
|
+
function indexed(...args) {
|
|
1822
|
+
return purry(_forEachObj(true), args);
|
|
1823
|
+
}
|
|
1824
|
+
forEachObj2.indexed = indexed;
|
|
1825
|
+
})(forEachObj || (forEachObj = {}));
|
|
1826
|
+
|
|
1827
|
+
// src/object/from-pairs.ts
|
|
1828
|
+
function fromPairs(entries) {
|
|
1829
|
+
const out = {};
|
|
1830
|
+
for (const [key, value] of entries) {
|
|
1831
|
+
out[key] = value;
|
|
1832
|
+
}
|
|
1833
|
+
return out;
|
|
1834
|
+
}
|
|
1835
|
+
((fromPairs2) => {
|
|
1836
|
+
fromPairs2.strict = fromPairs2;
|
|
1837
|
+
})(fromPairs || (fromPairs = {}));
|
|
1838
|
+
|
|
1839
|
+
// src/object/invert.ts
|
|
1840
|
+
function invert(...args) {
|
|
1841
|
+
return purry(_invert, args);
|
|
1842
|
+
}
|
|
1843
|
+
function _invert(object) {
|
|
1844
|
+
const result = {};
|
|
1845
|
+
for (const key in object) {
|
|
1846
|
+
result[object[key]] = key;
|
|
1847
|
+
}
|
|
1848
|
+
return result;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
// src/object/keys.ts
|
|
1852
|
+
function keys(source) {
|
|
1853
|
+
return Object.keys(source);
|
|
1854
|
+
}
|
|
1855
|
+
((keys2) => {
|
|
1856
|
+
keys2.strict = keys2;
|
|
1857
|
+
})(keys || (keys = {}));
|
|
1858
|
+
|
|
1859
|
+
// src/object/map-keys.ts
|
|
1860
|
+
function mapKeys(arg1, arg2) {
|
|
1861
|
+
if (arguments.length === 1) {
|
|
1862
|
+
return (data) => _mapKeys(data, arg1);
|
|
1863
|
+
}
|
|
1864
|
+
return _mapKeys(arg1, arg2);
|
|
1865
|
+
}
|
|
1866
|
+
function _mapKeys(obj, fn) {
|
|
1867
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
1868
|
+
acc[fn(key, obj[key])] = obj[key];
|
|
1869
|
+
return acc;
|
|
1870
|
+
}, {});
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
// src/object/map-values.ts
|
|
1874
|
+
function mapValues(arg1, arg2) {
|
|
1875
|
+
if (arguments.length === 1) {
|
|
1876
|
+
return (data) => _mapValues(data, arg1);
|
|
1877
|
+
}
|
|
1878
|
+
return _mapValues(arg1, arg2);
|
|
1879
|
+
}
|
|
1880
|
+
function _mapValues(obj, fn) {
|
|
1881
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
1882
|
+
acc[key] = fn(obj[key], key);
|
|
1883
|
+
return acc;
|
|
1884
|
+
}, {});
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
// src/object/merge.ts
|
|
1888
|
+
function merge(...args) {
|
|
1889
|
+
return purry(_merge, args);
|
|
1890
|
+
}
|
|
1891
|
+
function _merge(a, b) {
|
|
1892
|
+
return Object.assign({}, a, b);
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
// src/object/omit.ts
|
|
1896
|
+
function omit(...args) {
|
|
1897
|
+
return purry(_omit, args);
|
|
1898
|
+
}
|
|
1899
|
+
function _omit(data, propNames) {
|
|
1900
|
+
if (propNames.length === 0) {
|
|
1901
|
+
return { ...data };
|
|
1902
|
+
}
|
|
1903
|
+
if (propNames.length === 1) {
|
|
1904
|
+
const [propName] = propNames;
|
|
1905
|
+
const {
|
|
1906
|
+
[propName]: omitted,
|
|
1907
|
+
...remaining
|
|
1908
|
+
} = data;
|
|
1909
|
+
return remaining;
|
|
1910
|
+
}
|
|
1911
|
+
if (!propNames.some((propName) => propName in data)) {
|
|
1912
|
+
return { ...data };
|
|
1913
|
+
}
|
|
1914
|
+
const asSet = new Set(propNames);
|
|
1915
|
+
return fromPairs(
|
|
1916
|
+
Object.entries(data).filter(([key]) => !asSet.has(key))
|
|
1917
|
+
);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
// src/object/omit-by.ts
|
|
1921
|
+
function omitBy(...args) {
|
|
1922
|
+
return purry(_omitBy, args);
|
|
1923
|
+
}
|
|
1924
|
+
function _omitBy(object, fn) {
|
|
1925
|
+
return Object.keys(object).reduce((acc, key) => {
|
|
1926
|
+
if (!fn(object[key], key)) {
|
|
1927
|
+
acc[key] = object[key];
|
|
1928
|
+
}
|
|
1929
|
+
return acc;
|
|
1930
|
+
}, {});
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
// src/object/path-or.ts
|
|
1934
|
+
function pathOr(...args) {
|
|
1935
|
+
return purry(_pathOr, args);
|
|
1936
|
+
}
|
|
1937
|
+
function _pathOr(object, path, defaultValue) {
|
|
1938
|
+
let current = object;
|
|
1939
|
+
for (const prop2 of path) {
|
|
1940
|
+
if (current == null || current[prop2] == null) {
|
|
1941
|
+
return defaultValue;
|
|
1942
|
+
}
|
|
1943
|
+
current = current[prop2];
|
|
1944
|
+
}
|
|
1945
|
+
return current;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
// src/object/pick.ts
|
|
1949
|
+
function pick(...args) {
|
|
1950
|
+
return purry(_pick, args);
|
|
1951
|
+
}
|
|
1952
|
+
function _pick(object, names) {
|
|
1953
|
+
if (object == null) {
|
|
1954
|
+
return {};
|
|
1955
|
+
}
|
|
1956
|
+
return names.reduce((acc, name) => {
|
|
1957
|
+
if (name in object) {
|
|
1958
|
+
acc[name] = object[name];
|
|
1959
|
+
}
|
|
1960
|
+
return acc;
|
|
1961
|
+
}, {});
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
// src/object/pick-by.ts
|
|
1965
|
+
function pickBy(...args) {
|
|
1966
|
+
return purry(_pickBy, args);
|
|
1967
|
+
}
|
|
1968
|
+
function _pickBy(object, fn) {
|
|
1969
|
+
if (object == null) {
|
|
1970
|
+
return {};
|
|
1971
|
+
}
|
|
1972
|
+
return Object.keys(object).reduce((acc, key) => {
|
|
1973
|
+
if (fn(object[key], key)) {
|
|
1974
|
+
acc[key] = object[key];
|
|
1975
|
+
}
|
|
1976
|
+
return acc;
|
|
1977
|
+
}, {});
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
// src/object/prop.ts
|
|
1981
|
+
function prop(propName) {
|
|
1982
|
+
return ({ [propName]: value }) => value;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
// src/object/set.ts
|
|
1986
|
+
function set(...args) {
|
|
1987
|
+
return purry(_set, args);
|
|
1988
|
+
}
|
|
1989
|
+
function _set(obj, prop2, value) {
|
|
1990
|
+
return {
|
|
1991
|
+
...obj,
|
|
1992
|
+
[prop2]: value
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
// src/object/set-path.ts
|
|
1997
|
+
function setPath(...args) {
|
|
1998
|
+
return purry(_setPath, args);
|
|
1999
|
+
}
|
|
2000
|
+
function _setPath(object, path, defaultValue) {
|
|
2001
|
+
if (path.length === 0) {
|
|
2002
|
+
return defaultValue;
|
|
2003
|
+
}
|
|
2004
|
+
if (Array.isArray(object)) {
|
|
2005
|
+
return object.map((item, index) => {
|
|
2006
|
+
if (index === path[0]) {
|
|
2007
|
+
return _setPath(item, path.slice(1), defaultValue);
|
|
2008
|
+
}
|
|
2009
|
+
return item;
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
return {
|
|
2013
|
+
...object,
|
|
2014
|
+
[path[0]]: _setPath(object[path[0]], path.slice(1), defaultValue)
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
// src/object/swap-props.ts
|
|
2019
|
+
function swapProps(...args) {
|
|
2020
|
+
return purry(_swapProps, args);
|
|
2021
|
+
}
|
|
2022
|
+
function _swapProps(obj, key1, key2) {
|
|
2023
|
+
const { [key1]: value1, [key2]: value2 } = obj;
|
|
2024
|
+
return {
|
|
2025
|
+
...obj,
|
|
2026
|
+
[key1]: value2,
|
|
2027
|
+
[key2]: value1
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
// src/object/to-pairs.ts
|
|
2032
|
+
function toPairs(object) {
|
|
2033
|
+
return Object.entries(object);
|
|
2034
|
+
}
|
|
2035
|
+
((toPairs2) => {
|
|
2036
|
+
function strict(object) {
|
|
2037
|
+
return Object.entries(object);
|
|
2038
|
+
}
|
|
2039
|
+
toPairs2.strict = strict;
|
|
2040
|
+
})(toPairs || (toPairs = {}));
|
|
2041
|
+
|
|
2042
|
+
// src/object/values.ts
|
|
2043
|
+
function values(source) {
|
|
2044
|
+
return Object.values(source);
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
// src/string/cases.ts
|
|
2048
|
+
var RE_NUMBER_CHAR = /\d/;
|
|
2049
|
+
var STR_SPLITTERS = ["-", "_", "/", "."];
|
|
2050
|
+
function isUppercase(char = "") {
|
|
2051
|
+
if (RE_NUMBER_CHAR.test(char)) {
|
|
2052
|
+
return void 0;
|
|
2053
|
+
}
|
|
2054
|
+
return char.toUpperCase() === char;
|
|
2055
|
+
}
|
|
2056
|
+
function splitByCase(string_, separators) {
|
|
2057
|
+
const splitters = separators ?? STR_SPLITTERS;
|
|
2058
|
+
const parts = [];
|
|
2059
|
+
if (!string_ || !isString(string_)) {
|
|
2060
|
+
return parts;
|
|
2061
|
+
}
|
|
2062
|
+
let buff = "";
|
|
2063
|
+
let previousUpper;
|
|
2064
|
+
let previousSplitter;
|
|
2065
|
+
for (const char of string_) {
|
|
2066
|
+
const isSplitter = splitters.includes(char);
|
|
2067
|
+
if (isSplitter === true) {
|
|
2068
|
+
parts.push(buff);
|
|
2069
|
+
buff = "";
|
|
2070
|
+
previousUpper = void 0;
|
|
2071
|
+
continue;
|
|
2072
|
+
}
|
|
2073
|
+
const isUpper = isUppercase(char);
|
|
2074
|
+
if (previousSplitter === false) {
|
|
2075
|
+
if (previousUpper === false && isUpper === true) {
|
|
2076
|
+
parts.push(buff);
|
|
2077
|
+
buff = char;
|
|
2078
|
+
previousUpper = isUpper;
|
|
2079
|
+
continue;
|
|
2080
|
+
}
|
|
2081
|
+
if (previousUpper === true && isUpper === false && buff.length > 1) {
|
|
2082
|
+
const lastChar = buff[buff.length - 1];
|
|
2083
|
+
parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
|
|
2084
|
+
buff = lastChar + char;
|
|
2085
|
+
previousUpper = isUpper;
|
|
2086
|
+
continue;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
buff += char;
|
|
2090
|
+
previousUpper = isUpper;
|
|
2091
|
+
previousSplitter = isSplitter;
|
|
2092
|
+
}
|
|
2093
|
+
parts.push(buff);
|
|
2094
|
+
return parts;
|
|
2095
|
+
}
|
|
2096
|
+
function toUpperFirst(string_) {
|
|
2097
|
+
return !string_ ? "" : string_[0].toUpperCase() + string_.slice(1);
|
|
2098
|
+
}
|
|
2099
|
+
function toLowerFirst(string_) {
|
|
2100
|
+
return !string_ ? "" : string_[0].toLowerCase() + string_.slice(1);
|
|
2101
|
+
}
|
|
2102
|
+
function toPascalCase(string_) {
|
|
2103
|
+
return !string_ ? "" : (Array.isArray(string_) ? string_ : splitByCase(string_)).map((p) => toUpperFirst(p)).join("");
|
|
2104
|
+
}
|
|
2105
|
+
function toCamelCase(string_) {
|
|
2106
|
+
return toLowerFirst(toPascalCase(string_ || ""));
|
|
2107
|
+
}
|
|
2108
|
+
function toKebabCase(string_, joiner) {
|
|
2109
|
+
return !string_ ? "" : (Array.isArray(string_) ? string_ : splitByCase(string_)).map((p) => p.toLowerCase()).join(joiner ?? "-");
|
|
2110
|
+
}
|
|
2111
|
+
function toSnakeCase(string_) {
|
|
2112
|
+
return toKebabCase(string_ || "", "_");
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
// src/string/human-readable-file-size.ts
|
|
2116
|
+
function humanReadableFileSize(bytes, base = 1e3) {
|
|
2117
|
+
if (bytes < base) {
|
|
2118
|
+
return `${bytes} B`;
|
|
2119
|
+
}
|
|
2120
|
+
const prefix = base === 1024 ? ["Ki", "Mi", "Gi"] : ["k", "M", "G"];
|
|
2121
|
+
let unit = -1;
|
|
2122
|
+
while (Math.abs(bytes) >= base && unit < prefix.length - 1) {
|
|
2123
|
+
bytes /= base;
|
|
2124
|
+
++unit;
|
|
2125
|
+
}
|
|
2126
|
+
return `${bytes.toFixed(1)} ${prefix[unit]}B`;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
// src/string/random-string.ts
|
|
2130
|
+
function randomString(length2) {
|
|
2131
|
+
const characterSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2132
|
+
const randomChar = () => characterSet[Math.floor(Math.random() * characterSet.length)];
|
|
2133
|
+
return range(0, length2).reduce((text) => text + randomChar(), "");
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
// src/string/slugify.ts
|
|
2137
|
+
function slugify(str) {
|
|
2138
|
+
return str.normalize("NFD").replace(/[\u0300-\u036F]/g, "").toLowerCase().replace(/[^a-z0-9]/g, " ").trim().replace(/\s+/g, "-");
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
// src/string/string-to-path.ts
|
|
2142
|
+
function stringToPath(path) {
|
|
2143
|
+
return _stringToPath(path);
|
|
2144
|
+
}
|
|
2145
|
+
function _stringToPath(path) {
|
|
2146
|
+
if (path.length === 0) {
|
|
2147
|
+
return [];
|
|
2148
|
+
}
|
|
2149
|
+
const match = path.match(/^\[(.+?)\](.*)$/) ?? path.match(/^\.?([^.[\]]+)(.*)$/);
|
|
2150
|
+
if (match) {
|
|
2151
|
+
const [, key, rest] = match;
|
|
2152
|
+
return [key, ..._stringToPath(rest)];
|
|
2153
|
+
}
|
|
2154
|
+
return [path];
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
// src/index.ts
|
|
2158
|
+
var isBrowser = typeof window !== "undefined";
|
|
2159
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2160
|
+
0 && (module.exports = {
|
|
2161
|
+
KEY_CODES,
|
|
2162
|
+
_setPath,
|
|
2163
|
+
addProp,
|
|
2164
|
+
allPass,
|
|
2165
|
+
anyPass,
|
|
2166
|
+
chunk,
|
|
2167
|
+
clamp,
|
|
2168
|
+
clone,
|
|
2169
|
+
compact,
|
|
2170
|
+
concat,
|
|
2171
|
+
countBy,
|
|
2172
|
+
createPipe,
|
|
2173
|
+
difference,
|
|
2174
|
+
differenceWith,
|
|
2175
|
+
drop,
|
|
2176
|
+
dropLast,
|
|
2177
|
+
equals,
|
|
2178
|
+
filter,
|
|
2179
|
+
find,
|
|
2180
|
+
findIndex,
|
|
2181
|
+
findLast,
|
|
2182
|
+
findLastIndex,
|
|
2183
|
+
first,
|
|
2184
|
+
flatMap,
|
|
2185
|
+
flatMapToObj,
|
|
2186
|
+
flatten,
|
|
2187
|
+
flattenDeep,
|
|
2188
|
+
forEach,
|
|
2189
|
+
forEachObj,
|
|
2190
|
+
fromPairs,
|
|
2191
|
+
groupBy,
|
|
2192
|
+
humanReadableFileSize,
|
|
2193
|
+
identity,
|
|
2194
|
+
indexBy,
|
|
2195
|
+
intersection,
|
|
2196
|
+
intersectionWith,
|
|
2197
|
+
invert,
|
|
2198
|
+
isArray,
|
|
2199
|
+
isBoolean,
|
|
2200
|
+
isBrowser,
|
|
2201
|
+
isDate,
|
|
2202
|
+
isDefined,
|
|
2203
|
+
isEmpty,
|
|
2204
|
+
isError,
|
|
2205
|
+
isFunction,
|
|
2206
|
+
isNil,
|
|
2207
|
+
isNonNull,
|
|
2208
|
+
isNot,
|
|
2209
|
+
isNumber,
|
|
2210
|
+
isObject,
|
|
2211
|
+
isPromise,
|
|
2212
|
+
isString,
|
|
2213
|
+
isTruthy,
|
|
2214
|
+
isUppercase,
|
|
2215
|
+
join,
|
|
2216
|
+
keys,
|
|
2217
|
+
last,
|
|
2218
|
+
length,
|
|
2219
|
+
map,
|
|
2220
|
+
mapKeys,
|
|
2221
|
+
mapToObj,
|
|
2222
|
+
mapValues,
|
|
2223
|
+
maxBy,
|
|
2224
|
+
meanBy,
|
|
2225
|
+
merge,
|
|
2226
|
+
mergeAll,
|
|
2227
|
+
minBy,
|
|
2228
|
+
noop,
|
|
2229
|
+
omit,
|
|
2230
|
+
omitBy,
|
|
2231
|
+
once,
|
|
2232
|
+
partition,
|
|
2233
|
+
pathOr,
|
|
2234
|
+
pick,
|
|
2235
|
+
pickBy,
|
|
2236
|
+
pipe,
|
|
2237
|
+
prop,
|
|
2238
|
+
purry,
|
|
2239
|
+
randomString,
|
|
2240
|
+
range,
|
|
2241
|
+
reduce,
|
|
2242
|
+
reject,
|
|
2243
|
+
reverse,
|
|
2244
|
+
sample,
|
|
2245
|
+
set,
|
|
2246
|
+
setPath,
|
|
2247
|
+
shuffle,
|
|
2248
|
+
sleep,
|
|
2249
|
+
slugify,
|
|
2250
|
+
sort,
|
|
2251
|
+
sortBy,
|
|
2252
|
+
splitAt,
|
|
2253
|
+
splitByCase,
|
|
2254
|
+
splitWhen,
|
|
2255
|
+
stringToPath,
|
|
2256
|
+
sumBy,
|
|
2257
|
+
swapIndices,
|
|
2258
|
+
swapProps,
|
|
2259
|
+
take,
|
|
2260
|
+
takeWhile,
|
|
2261
|
+
toCamelCase,
|
|
2262
|
+
toKebabCase,
|
|
2263
|
+
toLowerFirst,
|
|
2264
|
+
toPairs,
|
|
2265
|
+
toPascalCase,
|
|
2266
|
+
toSnakeCase,
|
|
2267
|
+
toUpperFirst,
|
|
2268
|
+
type,
|
|
2269
|
+
uniq,
|
|
2270
|
+
uniqBy,
|
|
2271
|
+
uniqWith,
|
|
2272
|
+
values,
|
|
2273
|
+
zip,
|
|
2274
|
+
zipObj,
|
|
2275
|
+
zipWith
|
|
2276
|
+
});
|