@asd14/m 8.1.0 → 9.1.0
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/LICENSE +1 -1
- package/README.md +73 -28
- package/dist/src/all/all.d.ts +53 -0
- package/dist/src/all/all.js +59 -0
- package/dist/src/all/with/all-with.d.ts +47 -0
- package/dist/src/all/with/all-with.js +59 -0
- package/dist/src/any/any.d.ts +62 -0
- package/dist/src/any/any.js +68 -0
- package/dist/src/any/with/any-with.d.ts +47 -0
- package/dist/src/any/with/any-with.js +59 -0
- package/dist/src/converge/converge.d.ts +89 -0
- package/dist/src/converge/converge.js +68 -0
- package/dist/src/count/by/count-by.d.ts +55 -0
- package/dist/src/count/by/count-by.js +62 -0
- package/dist/src/count/count.d.ts +39 -0
- package/dist/src/count/count.js +39 -0
- package/dist/src/count/with/count-with.d.ts +46 -0
- package/dist/src/count/with/count-with.js +59 -0
- package/dist/src/curry/curry.d.ts +43 -0
- package/dist/src/curry/curry.js +52 -0
- package/dist/src/debounce/debounce.d.ts +39 -0
- package/dist/src/debounce/debounce.js +63 -0
- package/dist/src/dec/dec.d.ts +22 -0
- package/dist/src/dec/dec.js +27 -0
- package/dist/src/default-to/default-to.d.ts +44 -0
- package/dist/src/default-to/default-to.js +46 -0
- package/dist/src/distinct/by/distinct-by.d.ts +49 -0
- package/dist/src/distinct/by/distinct-by.js +74 -0
- package/dist/src/distinct/distinct.d.ts +32 -0
- package/dist/src/distinct/distinct.js +39 -0
- package/dist/src/drop/drop.d.ts +38 -0
- package/dist/src/drop/drop.js +56 -0
- package/dist/src/drop/last/drop-last.d.ts +37 -0
- package/dist/src/drop/last/drop-last.js +55 -0
- package/dist/src/escape/escape.d.ts +35 -0
- package/dist/src/escape/escape.js +47 -0
- package/dist/src/escape/html/escape-html.d.ts +26 -0
- package/dist/src/escape/html/escape-html.js +38 -0
- package/dist/src/escape/reg-exp/escape-reg-exp.d.ts +30 -0
- package/dist/src/escape/reg-exp/escape-reg-exp.js +34 -0
- package/dist/src/evolve/deep-by/evolve-deep-by.d.ts +65 -0
- package/dist/src/evolve/deep-by/evolve-deep-by.js +90 -0
- package/dist/src/evolve/evolve.d.ts +61 -0
- package/dist/src/evolve/evolve.js +66 -0
- package/dist/src/evolve/many/evolve-many.d.ts +46 -0
- package/dist/src/evolve/many/evolve-many.js +62 -0
- package/dist/src/evolve/with/evolve-with.d.ts +63 -0
- package/dist/src/evolve/with/evolve-with.js +84 -0
- package/dist/src/filter/filter.d.ts +56 -0
- package/dist/src/filter/filter.js +63 -0
- package/dist/src/filter/with/filter-with.d.ts +46 -0
- package/dist/src/filter/with/filter-with.js +59 -0
- package/dist/src/find/find.d.ts +57 -0
- package/dist/src/find/find.js +64 -0
- package/dist/src/find/index/find-index.d.ts +57 -0
- package/dist/src/find/index/find-index.js +64 -0
- package/dist/src/find/index/with/find-index-with.d.ts +47 -0
- package/dist/src/find/index/with/find-index-with.js +60 -0
- package/dist/src/find/with/find-with.d.ts +47 -0
- package/dist/src/find/with/find-with.js +60 -0
- package/dist/src/first/first.d.ts +37 -0
- package/dist/src/first/first.js +38 -0
- package/dist/src/flatten/flatten.d.ts +65 -0
- package/dist/src/flatten/flatten.js +107 -0
- package/dist/src/for-each/for-each.d.ts +49 -0
- package/dist/src/for-each/for-each.js +56 -0
- package/dist/src/fuzzy-match/fuzzy-match.d.ts +49 -0
- package/dist/src/fuzzy-match/fuzzy-match.js +164 -0
- package/dist/src/group/group-by.d.ts +75 -0
- package/dist/src/group/group-by.js +88 -0
- package/dist/src/i/i.d.ts +23 -0
- package/dist/src/i/i.js +22 -0
- package/dist/src/inc/inc.d.ts +22 -0
- package/dist/src/inc/inc.js +27 -0
- package/dist/src/index-by/index-by.d.ts +67 -0
- package/dist/src/index-by/index-by.js +73 -0
- package/dist/src/index.d.ts +91 -0
- package/dist/src/index.js +121 -0
- package/dist/src/intersect/by/intersect-by.d.ts +45 -0
- package/dist/src/intersect/by/intersect-by.js +72 -0
- package/dist/src/intersect/intersect.d.ts +42 -0
- package/dist/src/intersect/intersect.js +63 -0
- package/dist/src/is/is.d.ts +177 -0
- package/dist/src/is/is.js +173 -0
- package/dist/src/is-deep-equal/is-deep-equal.d.ts +39 -0
- package/dist/src/is-deep-equal/is-deep-equal.js +141 -0
- package/dist/src/is-equal/is-equal.d.ts +33 -0
- package/dist/src/is-equal/is-equal.js +35 -0
- package/dist/src/is-match/is-match.d.ts +64 -0
- package/dist/src/is-match/is-match.js +69 -0
- package/dist/src/is-uri/is-uri.d.ts +29 -0
- package/dist/src/is-uri/is-uri.js +84 -0
- package/dist/src/join/join.d.ts +33 -0
- package/dist/src/join/join.js +45 -0
- package/dist/src/keys/keys.d.ts +29 -0
- package/dist/src/keys/keys.js +35 -0
- package/dist/src/last/last.d.ts +37 -0
- package/dist/src/last/last.js +38 -0
- package/dist/src/map/indexed/map-indexed.d.ts +54 -0
- package/dist/src/map/indexed/map-indexed.js +61 -0
- package/dist/src/map/map.d.ts +51 -0
- package/dist/src/map/map.js +57 -0
- package/dist/src/map/matrix/map-matrix.d.ts +55 -0
- package/dist/src/map/matrix/map-matrix.js +67 -0
- package/dist/src/max/by/max-by.d.ts +52 -0
- package/dist/src/max/by/max-by.js +69 -0
- package/dist/src/max/max.d.ts +34 -0
- package/dist/src/max/max.js +49 -0
- package/dist/src/merge/by/merge-by.d.ts +48 -0
- package/dist/src/merge/by/merge-by.js +73 -0
- package/dist/src/merge/merge.d.ts +48 -0
- package/dist/src/merge/merge.js +81 -0
- package/dist/src/min/by/min-by.d.ts +52 -0
- package/dist/src/min/by/min-by.js +69 -0
- package/dist/src/min/min.d.ts +34 -0
- package/dist/src/min/min.js +49 -0
- package/dist/src/partition/partition.d.ts +59 -0
- package/dist/src/partition/partition.js +72 -0
- package/dist/src/partition/with/partition-with.d.ts +45 -0
- package/dist/src/partition/with/partition-with.js +58 -0
- package/dist/src/pick/pick.d.ts +39 -0
- package/dist/src/pick/pick.js +59 -0
- package/dist/src/pipe/pipe.d.ts +89 -0
- package/dist/src/pipe/pipe.js +50 -0
- package/dist/src/pipe/promise/pipe-p.d.ts +33 -0
- package/dist/src/pipe/promise/pipe-p.js +44 -0
- package/dist/src/push/push.d.ts +28 -0
- package/dist/src/push/push.js +38 -0
- package/dist/src/read/read.d.ts +56 -0
- package/dist/src/read/read.js +80 -0
- package/dist/src/reduce/reduce.d.ts +40 -0
- package/dist/src/reduce/reduce.js +58 -0
- package/dist/src/remove/remove.d.ts +32 -0
- package/dist/src/remove/remove.js +48 -0
- package/dist/src/remove/with/remove-with.d.ts +44 -0
- package/dist/src/remove/with/remove-with.js +62 -0
- package/dist/src/sort/by/sort-by.d.ts +34 -0
- package/dist/src/sort/by/sort-by.js +46 -0
- package/dist/src/sort/sort.d.ts +43 -0
- package/dist/src/sort/sort.js +72 -0
- package/dist/src/sort/with/sort-with.d.ts +58 -0
- package/dist/src/sort/with/sort-with.js +126 -0
- package/dist/src/split/split.d.ts +33 -0
- package/dist/src/split/split.js +45 -0
- package/dist/src/split-in-groups-of/split-in-groups-of.d.ts +34 -0
- package/dist/src/split-in-groups-of/split-in-groups-of.js +53 -0
- package/dist/src/sum/sum.d.ts +28 -0
- package/dist/src/sum/sum.js +34 -0
- package/dist/src/take/last/take-last.d.ts +38 -0
- package/dist/src/take/last/take-last.js +56 -0
- package/dist/src/take/take.d.ts +38 -0
- package/dist/src/take/take.js +56 -0
- package/dist/src/throttle/throttle.d.ts +46 -0
- package/dist/src/throttle/throttle.js +90 -0
- package/dist/src/to-string/to-string.d.ts +28 -0
- package/dist/src/to-string/to-string.js +27 -0
- package/dist/src/trim/trim.d.ts +48 -0
- package/dist/src/trim/trim.js +79 -0
- package/dist/src/type/type.d.ts +28 -0
- package/dist/src/type/type.js +35 -0
- package/dist/src/unflatten/unflatten.d.ts +44 -0
- package/dist/src/unflatten/unflatten.js +88 -0
- package/dist/src/unite/by/unite-by.d.ts +43 -0
- package/dist/src/unite/by/unite-by.js +63 -0
- package/dist/src/unite/unite.d.ts +42 -0
- package/dist/src/unite/unite.js +58 -0
- package/dist/src/update/update.d.ts +57 -0
- package/dist/src/update/update.js +62 -0
- package/dist/src/update/with/update-with.d.ts +63 -0
- package/dist/src/update/with/update-with.js +84 -0
- package/dist/src/upsert/with/upsert-with.d.ts +57 -0
- package/dist/src/upsert/with/upsert-with.js +87 -0
- package/dist/src/utils/build-match.d.ts +25 -0
- package/dist/src/utils/build-match.js +56 -0
- package/dist/src/utils/build-patch.d.ts +32 -0
- package/dist/src/utils/build-patch.js +59 -0
- package/dist/src/utils/pipe.d.ts +11 -0
- package/dist/src/utils/pipe.js +15 -0
- package/dist/src/utils/set-own.d.ts +20 -0
- package/dist/src/utils/set-own.js +29 -0
- package/dist/src/utils/to-function.d.ts +22 -0
- package/dist/src/utils/to-function.js +32 -0
- package/dist/src/values/values.d.ts +42 -0
- package/dist/src/values/values.js +46 -0
- package/dist/src/when/when.d.ts +54 -0
- package/dist/src/when/when.js +70 -0
- package/dist/src/write/write.d.ts +53 -0
- package/dist/src/write/write.js +104 -0
- package/dist/src/zip-to-object/zip-to-object.d.ts +39 -0
- package/dist/src/zip-to-object/zip-to-object.js +58 -0
- package/dist/types/array.d.ts +25 -0
- package/dist/types/basic.d.ts +3 -0
- package/dist/types/function.d.ts +42 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/object.d.ts +115 -0
- package/dist/types/object.matcher.d.ts +22 -0
- package/dist/types/object.patcher.d.ts +34 -0
- package/docs/DECISIONS.md +7 -0
- package/docs/SPEC.md +196 -0
- package/docs/decisions/01.use-manual-currying.md +34 -0
- package/docs/decisions/02.add-runtime-type-checks.md +27 -0
- package/docs/decisions/03.use-c8-over-node-test-runner.md +30 -0
- package/docs/decisions/04.use-relative-types-imports.md +26 -0
- package/docs/decisions/05.read-an-array-as-a-pipe.md +37 -0
- package/docs/explanation/curried-type-inference.md +136 -0
- package/docs/how-to/jsdoc.md +94 -0
- package/docs/how-to/pipe-arrays.md +104 -0
- package/docs/how-to/tape-runtime-tests.md +206 -0
- package/docs/how-to/tstyche-type-tests.md +146 -0
- package/docs/how-to/writing-functions.md +249 -0
- package/docs/spec/pending.md +18 -0
- package/package.json +76 -52
- package/dist/all/all.js +0 -68
- package/dist/all/all.js.map +0 -1
- package/dist/all/all.test.js +0 -66
- package/dist/all/all.test.js.map +0 -1
- package/dist/any/any.js +0 -71
- package/dist/any/any.js.map +0 -1
- package/dist/any/any.test.js +0 -60
- package/dist/any/any.test.js.map +0 -1
- package/dist/append/append.js +0 -31
- package/dist/append/append.js.map +0 -1
- package/dist/append/append.test.js +0 -41
- package/dist/append/append.test.js.map +0 -1
- package/dist/bottom/bottom.js +0 -52
- package/dist/bottom/bottom.js.map +0 -1
- package/dist/bottom/bottom.test.js +0 -57
- package/dist/bottom/bottom.test.js.map +0 -1
- package/dist/cases/cases.js +0 -32
- package/dist/cases/cases.js.map +0 -1
- package/dist/cases/cases.test.js +0 -71
- package/dist/cases/cases.test.js.map +0 -1
- package/dist/clone/clone.js +0 -48
- package/dist/clone/clone.js.map +0 -1
- package/dist/clone/clone.test.js +0 -45
- package/dist/clone/clone.test.js.map +0 -1
- package/dist/compact/compact.js +0 -80
- package/dist/compact/compact.js.map +0 -1
- package/dist/compact/compact.test.js +0 -88
- package/dist/compact/compact.test.js.map +0 -1
- package/dist/contains/contains.js +0 -24
- package/dist/contains/contains.js.map +0 -1
- package/dist/contains/contains.test.js +0 -11
- package/dist/contains/contains.test.js.map +0 -1
- package/dist/converge/converge.js +0 -62
- package/dist/converge/converge.js.map +0 -1
- package/dist/converge/converge.test.js +0 -69
- package/dist/converge/converge.test.js.map +0 -1
- package/dist/count/count.js +0 -113
- package/dist/count/count.js.map +0 -1
- package/dist/count/count.test.js +0 -105
- package/dist/count/count.test.js.map +0 -1
- package/dist/curry/curry.js +0 -39
- package/dist/curry/curry.js.map +0 -1
- package/dist/curry/curry.test.js +0 -13
- package/dist/curry/curry.test.js.map +0 -1
- package/dist/debounce/debounce.js +0 -36
- package/dist/debounce/debounce.js.map +0 -1
- package/dist/debounce/debounce.test.js +0 -49
- package/dist/debounce/debounce.test.js.map +0 -1
- package/dist/dec/dec.js +0 -18
- package/dist/dec/dec.js.map +0 -1
- package/dist/dec/dec.test.js +0 -8
- package/dist/dec/dec.test.js.map +0 -1
- package/dist/deep-equal/deep-equal.bench.js +0 -123
- package/dist/deep-equal/deep-equal.bench.js.map +0 -1
- package/dist/deep-equal/deep-equal.js +0 -47
- package/dist/deep-equal/deep-equal.js.map +0 -1
- package/dist/deep-equal/deep-equal.own.js +0 -97
- package/dist/deep-equal/deep-equal.own.js.map +0 -1
- package/dist/deep-equal/deep-equal.test.js +0 -131
- package/dist/deep-equal/deep-equal.test.js.map +0 -1
- package/dist/distinct/distinct.bench.js +0 -56
- package/dist/distinct/distinct.bench.js.map +0 -1
- package/dist/distinct/distinct.js +0 -36
- package/dist/distinct/distinct.js.map +0 -1
- package/dist/distinct/distinct.test.js +0 -43
- package/dist/distinct/distinct.test.js.map +0 -1
- package/dist/drop-last/drop-last.js +0 -23
- package/dist/drop-last/drop-last.js.map +0 -1
- package/dist/drop-last/drop-last.test.js +0 -38
- package/dist/drop-last/drop-last.test.js.map +0 -1
- package/dist/elapsed-time/elapsed-time.js +0 -42
- package/dist/elapsed-time/elapsed-time.js.map +0 -1
- package/dist/elapsed-time/elapsed-time.test.js +0 -13
- package/dist/elapsed-time/elapsed-time.test.js.map +0 -1
- package/dist/ends-with/ends-with.js +0 -36
- package/dist/ends-with/ends-with.js.map +0 -1
- package/dist/ends-with/ends-with.test.js +0 -33
- package/dist/ends-with/ends-with.test.js.map +0 -1
- package/dist/escape/escape.js +0 -7
- package/dist/escape/escape.js.map +0 -1
- package/dist/escape-html/escape-html.js +0 -14
- package/dist/escape-html/escape-html.js.map +0 -1
- package/dist/escape-html/escape-html.test.js +0 -10
- package/dist/escape-html/escape-html.test.js.map +0 -1
- package/dist/escape-reg-exp/escape-reg-exp.js +0 -17
- package/dist/escape-reg-exp/escape-reg-exp.js.map +0 -1
- package/dist/escape-reg-exp/escape-reg-exp.test.js +0 -13
- package/dist/escape-reg-exp/escape-reg-exp.test.js.map +0 -1
- package/dist/filter/filter.js +0 -45
- package/dist/filter/filter.js.map +0 -1
- package/dist/filter/filter.test.js +0 -101
- package/dist/filter/filter.test.js.map +0 -1
- package/dist/find/find.js +0 -93
- package/dist/find/find.js.map +0 -1
- package/dist/find/find.test.js +0 -77
- package/dist/find/find.test.js.map +0 -1
- package/dist/find-index/find-index.js +0 -43
- package/dist/find-index/find-index.js.map +0 -1
- package/dist/find-index/find-index.test.js +0 -53
- package/dist/find-index/find-index.test.js.map +0 -1
- package/dist/first/first.js +0 -21
- package/dist/first/first.js.map +0 -1
- package/dist/first/first.test.js +0 -17
- package/dist/first/first.test.js.map +0 -1
- package/dist/flatten/flatten.js +0 -46
- package/dist/flatten/flatten.js.map +0 -1
- package/dist/flatten/flatten.test.js +0 -63
- package/dist/flatten/flatten.test.js.map +0 -1
- package/dist/for-each/for-each.js +0 -25
- package/dist/for-each/for-each.js.map +0 -1
- package/dist/for-each/for-each.test.js +0 -41
- package/dist/for-each/for-each.test.js.map +0 -1
- package/dist/group-by/group-by.js +0 -38
- package/dist/group-by/group-by.js.map +0 -1
- package/dist/group-by/group-by.test.js +0 -86
- package/dist/group-by/group-by.test.js.map +0 -1
- package/dist/gt/gt.js +0 -25
- package/dist/gt/gt.js.map +0 -1
- package/dist/gt/gt.test.js +0 -11
- package/dist/gt/gt.test.js.map +0 -1
- package/dist/has-key/has-key.js +0 -8
- package/dist/has-key/has-key.js.map +0 -1
- package/dist/has-key/has-key.test.js +0 -14
- package/dist/has-key/has-key.test.js.map +0 -1
- package/dist/hist/hist.js +0 -73
- package/dist/hist/hist.js.map +0 -1
- package/dist/hist/hist.test.js +0 -47
- package/dist/hist/hist.test.js.map +0 -1
- package/dist/i/i.js +0 -11
- package/dist/i/i.js.map +0 -1
- package/dist/i/i.test.js +0 -21
- package/dist/i/i.test.js.map +0 -1
- package/dist/inc/inc.js +0 -18
- package/dist/inc/inc.js.map +0 -1
- package/dist/inc/inc.test.js +0 -8
- package/dist/inc/inc.test.js.map +0 -1
- package/dist/index-by/index-by.js +0 -36
- package/dist/index-by/index-by.js.map +0 -1
- package/dist/index-by/index-by.test.js +0 -48
- package/dist/index-by/index-by.test.js.map +0 -1
- package/dist/index.js +0 -99
- package/dist/index.js.map +0 -1
- package/dist/index.test.js +0 -10
- package/dist/index.test.js.map +0 -1
- package/dist/intersect/intersect.js +0 -113
- package/dist/intersect/intersect.js.map +0 -1
- package/dist/intersect/intersect.test.js +0 -79
- package/dist/intersect/intersect.test.js.map +0 -1
- package/dist/is/is.js +0 -40
- package/dist/is/is.js.map +0 -1
- package/dist/is/is.test.js +0 -28
- package/dist/is/is.test.js.map +0 -1
- package/dist/is-between/is-between.js +0 -30
- package/dist/is-between/is-between.js.map +0 -1
- package/dist/is-between/is-between.test.js +0 -18
- package/dist/is-between/is-between.test.js.map +0 -1
- package/dist/is-empty/is-empty.js +0 -53
- package/dist/is-empty/is-empty.js.map +0 -1
- package/dist/is-empty/is-empty.test.js +0 -35
- package/dist/is-empty/is-empty.test.js.map +0 -1
- package/dist/is-equal/is-equal.js +0 -31
- package/dist/is-equal/is-equal.js.map +0 -1
- package/dist/is-equal/is-equal.test.js +0 -22
- package/dist/is-equal/is-equal.test.js.map +0 -1
- package/dist/is-match/is-match.js +0 -58
- package/dist/is-match/is-match.js.map +0 -1
- package/dist/is-match/is-match.test.js +0 -72
- package/dist/is-match/is-match.test.js.map +0 -1
- package/dist/is-uri/is-uri.js +0 -24
- package/dist/is-uri/is-uri.js.map +0 -1
- package/dist/is-uri/is-uri.test.js +0 -16
- package/dist/is-uri/is-uri.test.js.map +0 -1
- package/dist/join/join.js +0 -74
- package/dist/join/join.js.map +0 -1
- package/dist/join/join.test.js +0 -99
- package/dist/join/join.test.js.map +0 -1
- package/dist/keys/keys.js +0 -56
- package/dist/keys/keys.js.map +0 -1
- package/dist/keys/keys.test.js +0 -25
- package/dist/keys/keys.test.js.map +0 -1
- package/dist/last/last.js +0 -22
- package/dist/last/last.js.map +0 -1
- package/dist/last/last.test.js +0 -18
- package/dist/last/last.test.js.map +0 -1
- package/dist/lt/lt.js +0 -27
- package/dist/lt/lt.js.map +0 -1
- package/dist/lt/lt.test.js +0 -10
- package/dist/lt/lt.test.js.map +0 -1
- package/dist/map/map.js +0 -40
- package/dist/map/map.js.map +0 -1
- package/dist/map/map.test.js +0 -66
- package/dist/map/map.test.js.map +0 -1
- package/dist/map-matrix/map-matrix.js +0 -43
- package/dist/map-matrix/map-matrix.js.map +0 -1
- package/dist/map-matrix/map-matrix.test.js +0 -82
- package/dist/map-matrix/map-matrix.test.js.map +0 -1
- package/dist/max/max.js +0 -60
- package/dist/max/max.js.map +0 -1
- package/dist/max/max.test.js +0 -50
- package/dist/max/max.test.js.map +0 -1
- package/dist/merge/merge.js +0 -79
- package/dist/merge/merge.js.map +0 -1
- package/dist/merge/merge.test.js +0 -61
- package/dist/merge/merge.test.js.map +0 -1
- package/dist/min/min.js +0 -60
- package/dist/min/min.js.map +0 -1
- package/dist/min/min.test.js +0 -45
- package/dist/min/min.test.js.map +0 -1
- package/dist/move/move.js +0 -48
- package/dist/move/move.js.map +0 -1
- package/dist/move/move.test.js +0 -62
- package/dist/move/move.test.js.map +0 -1
- package/dist/mutate/mutate.js +0 -89
- package/dist/mutate/mutate.js.map +0 -1
- package/dist/mutate/mutate.test.js +0 -114
- package/dist/mutate/mutate.test.js.map +0 -1
- package/dist/page/page.js +0 -26
- package/dist/page/page.js.map +0 -1
- package/dist/page/page.test.js +0 -70
- package/dist/page/page.test.js.map +0 -1
- package/dist/partition/partition.js +0 -60
- package/dist/partition/partition.js.map +0 -1
- package/dist/partition/partition.test.js +0 -104
- package/dist/partition/partition.test.js.map +0 -1
- package/dist/pick/pick.js +0 -42
- package/dist/pick/pick.js.map +0 -1
- package/dist/pick/pick.test.js +0 -26
- package/dist/pick/pick.test.js.map +0 -1
- package/dist/pipe/pipe.js +0 -37
- package/dist/pipe/pipe.js.map +0 -1
- package/dist/pipe/pipe.test.js +0 -15
- package/dist/pipe/pipe.test.js.map +0 -1
- package/dist/pipe-p/pipe-p.js +0 -47
- package/dist/pipe-p/pipe-p.js.map +0 -1
- package/dist/pipe-p/pipe-p.test.js +0 -27
- package/dist/pipe-p/pipe-p.test.js.map +0 -1
- package/dist/pluck/pluck.js +0 -65
- package/dist/pluck/pluck.js.map +0 -1
- package/dist/pluck/pluck.test.js +0 -61
- package/dist/pluck/pluck.test.js.map +0 -1
- package/dist/prepend/prepend.js +0 -28
- package/dist/prepend/prepend.js.map +0 -1
- package/dist/prepend/prepend.test.js +0 -41
- package/dist/prepend/prepend.test.js.map +0 -1
- package/dist/proto-chain/proto-chain.js +0 -21
- package/dist/proto-chain/proto-chain.js.map +0 -1
- package/dist/proto-chain/proto-chain.test.js +0 -25
- package/dist/proto-chain/proto-chain.test.js.map +0 -1
- package/dist/push/push.js +0 -27
- package/dist/push/push.js.map +0 -1
- package/dist/push/push.test.js +0 -22
- package/dist/push/push.test.js.map +0 -1
- package/dist/raise/raise.js +0 -6
- package/dist/raise/raise.js.map +0 -1
- package/dist/raise/raise.test.js +0 -10
- package/dist/raise/raise.test.js.map +0 -1
- package/dist/random/random.js +0 -13
- package/dist/random/random.js.map +0 -1
- package/dist/random/random.test.js +0 -21
- package/dist/random/random.test.js.map +0 -1
- package/dist/read/read.js +0 -80
- package/dist/read/read.js.map +0 -1
- package/dist/read/read.test.js +0 -110
- package/dist/read/read.test.js.map +0 -1
- package/dist/reduce/reduce.js +0 -49
- package/dist/reduce/reduce.js.map +0 -1
- package/dist/reduce/reduce.test.js +0 -49
- package/dist/reduce/reduce.test.js.map +0 -1
- package/dist/remove/remove.js +0 -90
- package/dist/remove/remove.js.map +0 -1
- package/dist/remove/remove.test.js +0 -98
- package/dist/remove/remove.test.js.map +0 -1
- package/dist/rename/rename.js +0 -77
- package/dist/rename/rename.js.map +0 -1
- package/dist/rename/rename.test.js +0 -49
- package/dist/rename/rename.test.js.map +0 -1
- package/dist/rename-file/rename-file.js +0 -23
- package/dist/rename-file/rename-file.js.map +0 -1
- package/dist/rename-file/rename-file.test.js +0 -13
- package/dist/rename-file/rename-file.test.js.map +0 -1
- package/dist/repeat/repeat.js +0 -46
- package/dist/repeat/repeat.js.map +0 -1
- package/dist/repeat/repeat.test.js +0 -33
- package/dist/repeat/repeat.test.js.map +0 -1
- package/dist/replace/replace.js +0 -102
- package/dist/replace/replace.js.map +0 -1
- package/dist/replace/replace.test.js +0 -132
- package/dist/replace/replace.test.js.map +0 -1
- package/dist/same/same.js +0 -13
- package/dist/same/same.js.map +0 -1
- package/dist/same/same.test.js +0 -9
- package/dist/same/same.test.js.map +0 -1
- package/dist/sequence/sequence.js +0 -36
- package/dist/sequence/sequence.js.map +0 -1
- package/dist/sequence/sequence.test.js +0 -139
- package/dist/sequence/sequence.test.js.map +0 -1
- package/dist/sort/sort-with.js +0 -130
- package/dist/sort/sort-with.js.map +0 -1
- package/dist/sort/sort.js +0 -70
- package/dist/sort/sort.js.map +0 -1
- package/dist/sort/sort.test.js +0 -413
- package/dist/sort/sort.test.js.map +0 -1
- package/dist/split/split.js +0 -44
- package/dist/split/split.js.map +0 -1
- package/dist/split/split.test.js +0 -32
- package/dist/split/split.test.js.map +0 -1
- package/dist/split-in-groups-of/split-in-groups-of.js +0 -49
- package/dist/split-in-groups-of/split-in-groups-of.js.map +0 -1
- package/dist/split-in-groups-of/split-in-groups-of.test.js +0 -87
- package/dist/split-in-groups-of/split-in-groups-of.test.js.map +0 -1
- package/dist/spy/spy.js +0 -35
- package/dist/spy/spy.js.map +0 -1
- package/dist/spy/spy.test.js +0 -37
- package/dist/spy/spy.test.js.map +0 -1
- package/dist/starts-with/starts-with.js +0 -35
- package/dist/starts-with/starts-with.js.map +0 -1
- package/dist/starts-with/starts-with.test.js +0 -37
- package/dist/starts-with/starts-with.test.js.map +0 -1
- package/dist/throttle/throttle.js +0 -47
- package/dist/throttle/throttle.js.map +0 -1
- package/dist/throttle/throttle.test.js +0 -41
- package/dist/throttle/throttle.test.js.map +0 -1
- package/dist/to-lower/to-lower.js +0 -21
- package/dist/to-lower/to-lower.js.map +0 -1
- package/dist/to-lower/to-lower.test.js +0 -9
- package/dist/to-lower/to-lower.test.js.map +0 -1
- package/dist/to-upper/to-upper.js +0 -21
- package/dist/to-upper/to-upper.js.map +0 -1
- package/dist/to-upper/to-upper.test.js +0 -9
- package/dist/to-upper/to-upper.test.js.map +0 -1
- package/dist/toggle/toggle.js +0 -35
- package/dist/toggle/toggle.js.map +0 -1
- package/dist/toggle/toggle.test.js +0 -28
- package/dist/toggle/toggle.test.js.map +0 -1
- package/dist/top/top.js +0 -62
- package/dist/top/top.js.map +0 -1
- package/dist/top/top.test.js +0 -51
- package/dist/top/top.test.js.map +0 -1
- package/dist/trim/trim.js +0 -41
- package/dist/trim/trim.js.map +0 -1
- package/dist/trim/trim.test.js +0 -10
- package/dist/trim/trim.test.js.map +0 -1
- package/dist/try-catch/try-catch.js +0 -37
- package/dist/try-catch/try-catch.js.map +0 -1
- package/dist/try-catch/try-catch.test.js +0 -14
- package/dist/try-catch/try-catch.test.js.map +0 -1
- package/dist/type/type.js +0 -29
- package/dist/type/type.js.map +0 -1
- package/dist/type/type.test.js +0 -19
- package/dist/type/type.test.js.map +0 -1
- package/dist/unite/unite.js +0 -22
- package/dist/unite/unite.js.map +0 -1
- package/dist/unite/unite.test.js +0 -12
- package/dist/unite/unite.test.js.map +0 -1
- package/dist/update/update.js +0 -85
- package/dist/update/update.js.map +0 -1
- package/dist/update/update.test.js +0 -99
- package/dist/update/update.test.js.map +0 -1
- package/dist/upsert/upsert.js +0 -19
- package/dist/upsert/upsert.js.map +0 -1
- package/dist/upsert/upsert.test.js +0 -61
- package/dist/upsert/upsert.test.js.map +0 -1
- package/dist/values/values.js +0 -60
- package/dist/values/values.js.map +0 -1
- package/dist/values/values.test.js +0 -25
- package/dist/values/values.test.js.map +0 -1
- package/dist/when/when.js +0 -51
- package/dist/when/when.js.map +0 -1
- package/dist/when/when.test.js +0 -30
- package/dist/when/when.test.js.map +0 -1
- package/dist/write/write.js +0 -28
- package/dist/write/write.js.map +0 -1
- package/dist/write/write.test.js +0 -18
- package/dist/write/write.test.js.map +0 -1
- package/dist/zip-to-object/zip-to-object.js +0 -28
- package/dist/zip-to-object/zip-to-object.js.map +0 -1
- package/dist/zip-to-object/zip-to-object.test.js +0 -33
- package/dist/zip-to-object/zip-to-object.test.js.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { hasKey } from "./has-key.js";
|
|
3
|
-
test("hasKey", function(t) {
|
|
4
|
-
t.equals(hasKey("test")({}), false, "Key does not exist");
|
|
5
|
-
t.equals(hasKey("test", {
|
|
6
|
-
test: "1"
|
|
7
|
-
}), true, "Key exists");
|
|
8
|
-
t.equals(hasKey("test", {
|
|
9
|
-
test: undefined
|
|
10
|
-
}), true, "Key exists even if undefined");
|
|
11
|
-
t.end();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=has-key.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/has-key/has-key.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { hasKey } from \"./has-key.js\"\n\ntest(\"hasKey\", t => {\n t.equals(hasKey(\"test\")({}), false, \"Key does not exist\")\n\n t.equals(hasKey(\"test\", { test: \"1\" }), true, \"Key exists\")\n\n t.equals(\n hasKey(\"test\", { test: undefined }),\n true,\n \"Key exists even if undefined\"\n )\n\n t.end()\n})\n"],"names":["test","hasKey","t","equals","undefined","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,MAAM,QAAQ,eAAc;AAErCD,KAAK,UAAUE,SAAAA,GAAK;IAClBA,EAAEC,MAAM,CAACF,OAAO,QAAQ,CAAC,IAAI,KAAK,EAAE;IAEpCC,EAAEC,MAAM,CAACF,OAAO,QAAQ;QAAED,MAAM;IAAI,IAAI,IAAI,EAAE;IAE9CE,EAAEC,MAAM,CACNF,OAAO,QAAQ;QAAED,MAAMI;IAAU,IACjC,IAAI,EACJ;IAGFF,EAAEG,GAAG;AACP"}
|
package/dist/hist/hist.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { type } from "../type/type.js";
|
|
2
|
-
import { is } from "../is/is.js";
|
|
3
|
-
/**
|
|
4
|
-
* Count the number of occurances of each element
|
|
5
|
-
*
|
|
6
|
-
* @param {Array} input Source input
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object}
|
|
9
|
-
*/ var byArray = function(input) {
|
|
10
|
-
var result = {};
|
|
11
|
-
for(var i = 0, length = input.length - 1; i <= length; i++){
|
|
12
|
-
result[input[i]] = is(result[input[i]]) ? result[input[i]] + 1 : 1;
|
|
13
|
-
}
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Count the number of occurances of each object by a field
|
|
18
|
-
*
|
|
19
|
-
* @param {string} field The field
|
|
20
|
-
*
|
|
21
|
-
* @returns {Object}
|
|
22
|
-
*/ var byKey = function(field) {
|
|
23
|
-
return function(input) {
|
|
24
|
-
var result = {};
|
|
25
|
-
for(var i = 0, length = input.length; i < length; i++){
|
|
26
|
-
if (!!input[i][field]) {
|
|
27
|
-
var groupKey = String(input[i][field]);
|
|
28
|
-
result[groupKey] = result[groupKey] ? result[groupKey] + 1 : 1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
var byType = {
|
|
35
|
-
Array: byArray,
|
|
36
|
-
String: byKey
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Determine the count of all field's distinct values in a list of objects
|
|
40
|
-
* (aka histogram)
|
|
41
|
-
*
|
|
42
|
-
* @tag Array
|
|
43
|
-
* @signature (field: string)(source: Object[]): Object
|
|
44
|
-
*
|
|
45
|
-
* @param {string} field Field name to count
|
|
46
|
-
* @param {Object[]} source Array of objects
|
|
47
|
-
*
|
|
48
|
-
* @returns {Object}
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
*
|
|
52
|
-
* const scores = [{
|
|
53
|
-
* name : "Bob",
|
|
54
|
-
* score : 1,
|
|
55
|
-
* subject: "Math"
|
|
56
|
-
* }, {
|
|
57
|
-
* name : "Alice",
|
|
58
|
-
* score : 10,
|
|
59
|
-
* subject: "Math"
|
|
60
|
-
* }, {
|
|
61
|
-
* name : "Hatter",
|
|
62
|
-
* score : 10,
|
|
63
|
-
* subject: "Math"
|
|
64
|
-
* }]
|
|
65
|
-
*
|
|
66
|
-
* hist( "score" )( scores )
|
|
67
|
-
* // => { "1": 1, "10": 2 }
|
|
68
|
-
*/ var hist = function(field) {
|
|
69
|
-
return byType[type(field)](field);
|
|
70
|
-
};
|
|
71
|
-
export { hist };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=hist.js.map
|
package/dist/hist/hist.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hist/hist.js"],"sourcesContent":["import { type } from \"../type/type.js\"\nimport { is } from \"../is/is.js\"\n\n/**\n * Count the number of occurances of each element\n *\n * @param {Array} input Source input\n *\n * @returns {Object}\n */\nconst byArray = input => {\n const result = {}\n\n for (let i = 0, length = input.length - 1; i <= length; i++) {\n result[input[i]] = is(result[input[i]]) ? result[input[i]] + 1 : 1\n }\n\n return result\n}\n\n/**\n * Count the number of occurances of each object by a field\n *\n * @param {string} field The field\n *\n * @returns {Object}\n */\nconst byKey = field => input => {\n const result = {}\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (!!input[i][field]) {\n const groupKey = String(input[i][field])\n\n result[groupKey] = result[groupKey] ? result[groupKey] + 1 : 1\n }\n }\n\n return result\n}\n\nconst byType = {\n Array: byArray,\n String: byKey,\n}\n\n/**\n * Determine the count of all field's distinct values in a list of objects\n * (aka histogram)\n *\n * @tag Array\n * @signature (field: string)(source: Object[]): Object\n *\n * @param {string} field Field name to count\n * @param {Object[]} source Array of objects\n *\n * @returns {Object}\n *\n * @example\n *\n * const scores = [{\n * name : \"Bob\",\n * score : 1,\n * subject: \"Math\"\n * }, {\n * name : \"Alice\",\n * score : 10,\n * subject: \"Math\"\n * }, {\n * name : \"Hatter\",\n * score : 10,\n * subject: \"Math\"\n * }]\n *\n * hist( \"score\" )( scores )\n * // => { \"1\": 1, \"10\": 2 }\n */\nconst hist = field => byType[type(field)](field)\n\nexport { hist }\n"],"names":["type","is","byArray","input","result","i","length","byKey","field","groupKey","String","byType","Array","hist"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,EAAE,QAAQ,cAAa;AAEhC;;;;;;CAMC,GACD,IAAMC,UAAUC,SAAAA,OAAS;IACvB,IAAMC,SAAS,CAAC;IAEhB,IAAK,IAAIC,IAAI,GAAGC,SAASH,MAAMG,MAAM,GAAG,GAAGD,KAAKC,QAAQD,IAAK;QAC3DD,MAAM,CAACD,KAAK,CAACE,EAAE,CAAC,GAAGJ,GAAGG,MAAM,CAACD,KAAK,CAACE,EAAE,CAAC,IAAID,MAAM,CAACD,KAAK,CAACE,EAAE,CAAC,GAAG,IAAI,CAAC;IACpE;IAEA,OAAOD;AACT;AAEA;;;;;;CAMC,GACD,IAAMG,QAAQC,SAAAA;WAASL,SAAAA,OAAS;QAC9B,IAAMC,SAAS,CAAC;QAEhB,IAAK,IAAIC,IAAI,GAAGC,SAASH,MAAMG,MAAM,EAAED,IAAIC,QAAQD,IAAK;YACtD,IAAI,CAAC,CAACF,KAAK,CAACE,EAAE,CAACG,MAAM,EAAE;gBACrB,IAAMC,WAAWC,OAAOP,KAAK,CAACE,EAAE,CAACG,MAAM;gBAEvCJ,MAAM,CAACK,SAAS,GAAGL,MAAM,CAACK,SAAS,GAAGL,MAAM,CAACK,SAAS,GAAG,IAAI,CAAC;YAChE,CAAC;QACH;QAEA,OAAOL;IACT;;AAEA,IAAMO,SAAS;IACbC,OAAOV;IACPQ,QAAQH;AACV;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,IAAMM,OAAOL,SAAAA;WAASG,MAAM,CAACX,KAAKQ,OAAO,CAACA;;AAE1C,SAASK,IAAI,GAAE"}
|
package/dist/hist/hist.test.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { hist } from "./hist.js";
|
|
3
|
-
test("hist", function(t) {
|
|
4
|
-
var scores = [
|
|
5
|
-
{
|
|
6
|
-
name: "Bob",
|
|
7
|
-
score: 1
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
name: "Alice",
|
|
11
|
-
score: 10,
|
|
12
|
-
subject: "Math"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "Hatter",
|
|
16
|
-
score: 10,
|
|
17
|
-
subject: "Math"
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
t.deepEqual(hist([
|
|
21
|
-
1,
|
|
22
|
-
1,
|
|
23
|
-
2,
|
|
24
|
-
3,
|
|
25
|
-
4,
|
|
26
|
-
5,
|
|
27
|
-
1,
|
|
28
|
-
2,
|
|
29
|
-
3
|
|
30
|
-
]), {
|
|
31
|
-
1: 3,
|
|
32
|
-
2: 2,
|
|
33
|
-
3: 2,
|
|
34
|
-
4: 1,
|
|
35
|
-
5: 1
|
|
36
|
-
}, "object with distinct values and their occurrence");
|
|
37
|
-
t.deepEqual(hist("score")(scores), {
|
|
38
|
-
1: 1,
|
|
39
|
-
10: 2
|
|
40
|
-
}, "object with distinct values and their occurrence");
|
|
41
|
-
t.deepEqual(hist("subject")(scores), {
|
|
42
|
-
Math: 2
|
|
43
|
-
}, "object with occurrences even if field is not defined on some elements");
|
|
44
|
-
t.end();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=hist.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hist/hist.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { hist } from \"./hist.js\"\n\ntest(\"hist\", t => {\n const scores = [\n {\n name: \"Bob\",\n score: 1,\n },\n {\n name: \"Alice\",\n score: 10,\n subject: \"Math\",\n },\n {\n name: \"Hatter\",\n score: 10,\n subject: \"Math\",\n },\n ]\n\n t.deepEqual(\n hist([1, 1, 2, 3, 4, 5, 1, 2, 3]),\n {\n 1: 3,\n 2: 2,\n 3: 2,\n 4: 1,\n 5: 1,\n },\n \"object with distinct values and their occurrence\"\n )\n\n t.deepEqual(\n hist(\"score\")(scores),\n {\n 1: 1,\n 10: 2,\n },\n \"object with distinct values and their occurrence\"\n )\n\n t.deepEqual(\n hist(\"subject\")(scores),\n {\n Math: 2,\n },\n \"object with occurrences even if field is not defined on some elements\"\n )\n\n t.end()\n})\n"],"names":["test","hist","t","scores","name","score","subject","deepEqual","Math","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChB,IAAMC,SAAS;QACb;YACEC,MAAM;YACNC,OAAO;QACT;QACA;YACED,MAAM;YACNC,OAAO;YACPC,SAAS;QACX;QACA;YACEF,MAAM;YACNC,OAAO;YACPC,SAAS;QACX;KACD;IAEDJ,EAAEK,SAAS,CACTN,KAAK;QAAC;QAAG;QAAG;QAAG;QAAG;QAAG;QAAG;QAAG;QAAG;KAAE,GAChC;QACE,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;IACL,GACA;IAGFC,EAAEK,SAAS,CACTN,KAAK,SAASE,SACd;QACE,GAAG;QACH,IAAI;IACN,GACA;IAGFD,EAAEK,SAAS,CACTN,KAAK,WAAWE,SAChB;QACEK,MAAM;IACR,GACA;IAGFN,EAAEO,GAAG;AACP"}
|
package/dist/i/i.js
DELETED
package/dist/i/i.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i/i.js"],"sourcesContent":["/**\n * Identity function\n *\n * @param {any} input Source input\n *\n * @returns {any}\n */\nexport const i = input => input\n"],"names":["i","input"],"mappings":"AAAA;;;;;;CAMC,GACD,OAAO,IAAMA,IAAIC,SAAAA;WAASA;EAAK"}
|
package/dist/i/i.test.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { i } from "./i.js";
|
|
3
|
-
test("i", function(t) {
|
|
4
|
-
t.equals(i(true), true, "Identity boolean");
|
|
5
|
-
t.equals(i(3), 3, "Identity string");
|
|
6
|
-
t.equals(i("asd"), "asd", "Identity string");
|
|
7
|
-
var array = [
|
|
8
|
-
1,
|
|
9
|
-
2,
|
|
10
|
-
3
|
|
11
|
-
];
|
|
12
|
-
t.equals(i(array), array, "Identity array");
|
|
13
|
-
var object = {
|
|
14
|
-
a: 1,
|
|
15
|
-
b: 2
|
|
16
|
-
};
|
|
17
|
-
t.equals(i(object), object, "Identity object");
|
|
18
|
-
t.end();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=i.test.js.map
|
package/dist/i/i.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i/i.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { i } from \"./i.js\"\n\ntest(\"i\", t => {\n t.equals(i(true), true, \"Identity boolean\")\n t.equals(i(3), 3, \"Identity string\")\n t.equals(i(\"asd\"), \"asd\", \"Identity string\")\n\n const array = [1, 2, 3]\n\n t.equals(i(array), array, \"Identity array\")\n\n const object = { a: 1, b: 2 }\n\n t.equals(i(object), object, \"Identity object\")\n\n t.end()\n})\n"],"names":["test","i","t","equals","array","object","a","b","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,CAAC,QAAQ,SAAQ;AAE1BD,KAAK,KAAKE,SAAAA,GAAK;IACbA,EAAEC,MAAM,CAACF,EAAE,IAAI,GAAG,IAAI,EAAE;IACxBC,EAAEC,MAAM,CAACF,EAAE,IAAI,GAAG;IAClBC,EAAEC,MAAM,CAACF,EAAE,QAAQ,OAAO;IAE1B,IAAMG,QAAQ;QAAC;QAAG;QAAG;KAAE;IAEvBF,EAAEC,MAAM,CAACF,EAAEG,QAAQA,OAAO;IAE1B,IAAMC,SAAS;QAAEC,GAAG;QAAGC,GAAG;IAAE;IAE5BL,EAAEC,MAAM,CAACF,EAAEI,SAASA,QAAQ;IAE5BH,EAAEM,GAAG;AACP"}
|
package/dist/inc/inc.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add one
|
|
3
|
-
*
|
|
4
|
-
* @param {number} input Source input
|
|
5
|
-
*
|
|
6
|
-
* @returns {number}
|
|
7
|
-
*
|
|
8
|
-
* @tag Number
|
|
9
|
-
* @signature (source: number): number
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* inc(2)
|
|
13
|
-
* // => 3
|
|
14
|
-
*/ export var inc = function(input) {
|
|
15
|
-
return input + 1;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=inc.js.map
|
package/dist/inc/inc.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/inc/inc.js"],"sourcesContent":["/**\n * Add one\n *\n * @param {number} input Source input\n *\n * @returns {number}\n *\n * @tag Number\n * @signature (source: number): number\n *\n * @example\n * inc(2)\n * // => 3\n */\nexport const inc = input => input + 1\n"],"names":["inc","input"],"mappings":"AAAA;;;;;;;;;;;;;CAaC,GACD,OAAO,IAAMA,MAAMC,SAAAA;WAASA,QAAQ;EAAC"}
|
package/dist/inc/inc.test.js
DELETED
package/dist/inc/inc.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/inc/inc.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { inc } from \"./inc.js\"\n\ntest(\"inc\", t => {\n t.equal(inc(2), 3, \"Increment number\")\n\n t.end()\n})\n"],"names":["test","inc","t","equal","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,GAAG,QAAQ,WAAU;AAE9BD,KAAK,OAAOE,SAAAA,GAAK;IACfA,EAAEC,KAAK,CAACF,IAAI,IAAI,GAAG;IAEnBC,EAAEE,GAAG;AACP"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { curry } from "../curry/curry.js";
|
|
2
|
-
var _indexBy = function(field) {
|
|
3
|
-
return function(input) {
|
|
4
|
-
var result = {};
|
|
5
|
-
for(var i = 0, length = input.length; i < length; i++){
|
|
6
|
-
if (input[i][field]) {
|
|
7
|
-
var indexKey = String(input[i][field]);
|
|
8
|
-
result[indexKey] = input[i];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Index an array of objects by field. Only truthy fields will be indexed.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} field The field to index by
|
|
18
|
-
* @param {Array} source Input
|
|
19
|
-
*
|
|
20
|
-
* @returns {object}
|
|
21
|
-
*
|
|
22
|
-
* @tag Array
|
|
23
|
-
* @signature (field: string, source: Object[]): Object
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* indexBy("id")([
|
|
27
|
-
* {id: 1, user_id: 2},
|
|
28
|
-
* {id: 2, user_id: 3},
|
|
29
|
-
* ])
|
|
30
|
-
* // => {
|
|
31
|
-
* // 1: {id: 1, user_id: 2},
|
|
32
|
-
* // 2: {id: 2, user_id: 3},
|
|
33
|
-
* // }
|
|
34
|
-
*/ export var indexBy = curry(_indexBy);
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=index-by.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-by/index-by.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\nconst _indexBy = field => input => {\n const result = {}\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (input[i][field]) {\n const indexKey = String(input[i][field])\n\n result[indexKey] = input[i]\n }\n }\n\n return result\n}\n\n/**\n * Index an array of objects by field. Only truthy fields will be indexed.\n *\n * @param {string} field The field to index by\n * @param {Array} source Input\n *\n * @returns {object}\n *\n * @tag Array\n * @signature (field: string, source: Object[]): Object\n *\n * @example\n * indexBy(\"id\")([\n * {id: 1, user_id: 2},\n * {id: 2, user_id: 3},\n * ])\n * // => {\n * // 1: {id: 1, user_id: 2},\n * // 2: {id: 2, user_id: 3},\n * // }\n */\nexport const indexBy = curry(_indexBy)\n"],"names":["curry","_indexBy","field","input","result","i","length","indexKey","String","indexBy"],"mappings":"AAAA,SAASA,KAAK,QAAQ,oBAAmB;AAEzC,IAAMC,WAAWC,SAAAA;WAASC,SAAAA,OAAS;QACjC,IAAMC,SAAS,CAAC;QAEhB,IAAK,IAAIC,IAAI,GAAGC,SAASH,MAAMG,MAAM,EAAED,IAAIC,QAAQD,IAAK;YACtD,IAAIF,KAAK,CAACE,EAAE,CAACH,MAAM,EAAE;gBACnB,IAAMK,WAAWC,OAAOL,KAAK,CAACE,EAAE,CAACH,MAAM;gBAEvCE,MAAM,CAACG,SAAS,GAAGJ,KAAK,CAACE,EAAE;YAC7B,CAAC;QACH;QAEA,OAAOD;IACT;;AAEA;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,IAAMK,UAAUT,MAAMC,UAAS"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { indexBy } from "./index-by.js";
|
|
3
|
-
test("indexBy", function(t) {
|
|
4
|
-
t.deepEqual(indexBy("id")([
|
|
5
|
-
{
|
|
6
|
-
id: 1,
|
|
7
|
-
label: "test"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
id: 2,
|
|
11
|
-
label: "foo"
|
|
12
|
-
}
|
|
13
|
-
]), {
|
|
14
|
-
1: {
|
|
15
|
-
id: 1,
|
|
16
|
-
label: "test"
|
|
17
|
-
},
|
|
18
|
-
2: {
|
|
19
|
-
id: 2,
|
|
20
|
-
label: "foo"
|
|
21
|
-
}
|
|
22
|
-
}, "index object array by existing field");
|
|
23
|
-
t.deepEqual(indexBy("id")([
|
|
24
|
-
{
|
|
25
|
-
id: 1,
|
|
26
|
-
label: "test"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 2,
|
|
30
|
-
label: "foo"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: "foo bar"
|
|
34
|
-
}
|
|
35
|
-
]), {
|
|
36
|
-
1: {
|
|
37
|
-
id: 1,
|
|
38
|
-
label: "test"
|
|
39
|
-
},
|
|
40
|
-
2: {
|
|
41
|
-
id: 2,
|
|
42
|
-
label: "foo"
|
|
43
|
-
}
|
|
44
|
-
}, "index object array by existing field");
|
|
45
|
-
t.end();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=index-by.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-by/index-by.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { indexBy } from \"./index-by.js\"\n\ntest(\"indexBy\", t => {\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n { label: \"foo bar\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.end()\n})\n"],"names":["test","indexBy","t","deepEqual","id","label","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,OAAO,QAAQ,gBAAe;AAEvCD,KAAK,WAAWE,SAAAA,GAAK;IACnBA,EAAEC,SAAS,CACTF,QAAQ,MAAM;QACZ;YAAEG,IAAI;YAAGC,OAAO;QAAO;QACvB;YAAED,IAAI;YAAGC,OAAO;QAAM;KACvB,GACD;QACE,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAO;QAC1B,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAM;IAC3B,GACA;IAGFH,EAAEC,SAAS,CACTF,QAAQ,MAAM;QACZ;YAAEG,IAAI;YAAGC,OAAO;QAAO;QACvB;YAAED,IAAI;YAAGC,OAAO;QAAM;QACtB;YAAEA,OAAO;QAAU;KACpB,GACD;QACE,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAO;QAC1B,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAM;IAC3B,GACA;IAGFH,EAAEI,GAAG;AACP"}
|
package/dist/index.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
export { isDeepEqual, isDeepEqual as deepEqual } from "./deep-equal/deep-equal.js";
|
|
2
|
-
export { elapsedTime } from "./elapsed-time/elapsed-time.js";
|
|
3
|
-
export { groupBy } from "./group-by/group-by.js";
|
|
4
|
-
export { indexBy } from "./index-by/index-by.js";
|
|
5
|
-
export { hist } from "./hist/hist.js";
|
|
6
|
-
export { protoChain } from "./proto-chain/proto-chain.js";
|
|
7
|
-
export { sequence, sequenceWhile } from "./sequence/sequence.js";
|
|
8
|
-
export { tryCatch } from "./try-catch/try-catch.js";
|
|
9
|
-
export { raise } from "./raise/raise.js";
|
|
10
|
-
export { type } from "./type/type.js";
|
|
11
|
-
export { throttle } from "./throttle/throttle.js";
|
|
12
|
-
export { debounce } from "./debounce/debounce.js";
|
|
13
|
-
export { isURI } from "./is-uri/is-uri.js";
|
|
14
|
-
export { spy } from "./spy/spy.js";
|
|
15
|
-
// Core
|
|
16
|
-
export { map } from "./map/map.js";
|
|
17
|
-
export { mapMatrix } from "./map-matrix/map-matrix.js";
|
|
18
|
-
export { reduce } from "./reduce/reduce.js";
|
|
19
|
-
export { converge } from "./converge/converge.js";
|
|
20
|
-
export { forEach } from "./for-each/for-each.js";
|
|
21
|
-
export { pipe } from "./pipe/pipe.js";
|
|
22
|
-
export { pipeP } from "./pipe-p/pipe-p.js";
|
|
23
|
-
export { read as get, read, readMany } from "./read/read.js";
|
|
24
|
-
export { write as set, write } from "./write/write.js";
|
|
25
|
-
export { same } from "./same/same.js";
|
|
26
|
-
export { i } from "./i/i.js";
|
|
27
|
-
export { clone } from "./clone/clone.js";
|
|
28
|
-
export { repeat } from "./repeat/repeat.js";
|
|
29
|
-
export { curry } from "./curry/curry.js";
|
|
30
|
-
export { compact, compactMany } from "./compact/compact.js";
|
|
31
|
-
// Boolean
|
|
32
|
-
export { is, isNothing, not, isTrue, isFalse, isObject } from "./is/is.js";
|
|
33
|
-
export { isEmpty, isNotEmpty } from "./is-empty/is-empty.js";
|
|
34
|
-
export { isEqual, isEqual as equals, isEqual as eq } from "./is-equal/is-equal.js";
|
|
35
|
-
export { isBetween, isBetween as between } from "./is-between/is-between.js";
|
|
36
|
-
export { any, any as has, anyWith, anyWith as hasWith } from "./any/any.js";
|
|
37
|
-
export { all, allWith } from "./all/all.js";
|
|
38
|
-
export { when } from "./when/when.js";
|
|
39
|
-
export { cases } from "./cases/cases.js";
|
|
40
|
-
export { isMatch } from "./is-match/is-match.js";
|
|
41
|
-
// Object
|
|
42
|
-
export { pick } from "./pick/pick.js";
|
|
43
|
-
export { pluck } from "./pluck/pluck.js";
|
|
44
|
-
export { merge, mergeAll, mergeBy } from "./merge/merge.js";
|
|
45
|
-
export { keys } from "./keys/keys.js";
|
|
46
|
-
export { values } from "./values/values.js";
|
|
47
|
-
export { rename as renameKeys, rename, renameMany } from "./rename/rename.js";
|
|
48
|
-
export { zipToObject as zipToObj, zipToObject } from "./zip-to-object/zip-to-object.js";
|
|
49
|
-
export { mutate, mutateMany, mutateWith } from "./mutate/mutate.js";
|
|
50
|
-
export { update, updateMany, updateWith } from "./update/update.js";
|
|
51
|
-
// Array
|
|
52
|
-
export { top } from "./top/top.js";
|
|
53
|
-
export { bottom } from "./bottom/bottom.js";
|
|
54
|
-
export { first, first as head } from "./first/first.js";
|
|
55
|
-
export { last, last as tail } from "./last/last.js";
|
|
56
|
-
export { page } from "./page/page.js";
|
|
57
|
-
export { push } from "./push/push.js";
|
|
58
|
-
export { max, maxBy } from "./max/max.js";
|
|
59
|
-
export { min, minBy } from "./min/min.js";
|
|
60
|
-
export { move } from "./move/move.js";
|
|
61
|
-
export { flatten } from "./flatten/flatten.js";
|
|
62
|
-
export { distinct, distinctBy } from "./distinct/distinct.js";
|
|
63
|
-
export { dropLast } from "./drop-last/drop-last.js";
|
|
64
|
-
export { upsertWith as upsert, upsertWith } from "./upsert/upsert.js";
|
|
65
|
-
export { append, append as concat } from "./append/append.js";
|
|
66
|
-
export { prepend } from "./prepend/prepend.js";
|
|
67
|
-
export { toggle } from "./toggle/toggle.js";
|
|
68
|
-
export { partition, partitionWith } from "./partition/partition.js";
|
|
69
|
-
export { count, count as length, count as size, countBy, countWith } from "./count/count.js";
|
|
70
|
-
export { replace, replaceWith } from "./replace/replace.js";
|
|
71
|
-
export { sort, sortBy } from "./sort/sort.js";
|
|
72
|
-
export { sortWith } from "./sort/sort-with.js";
|
|
73
|
-
export { remove, removeWith } from "./remove/remove.js";
|
|
74
|
-
export { hasKey } from "./has-key/has-key.js";
|
|
75
|
-
export { filter, filterWith } from "./filter/filter.js";
|
|
76
|
-
export { find, findWith } from "./find/find.js";
|
|
77
|
-
export { findIndex, findIndexWith } from "./find-index/find-index.js";
|
|
78
|
-
export { join, joinBy } from "./join/join.js";
|
|
79
|
-
export { intersect, intersectBy } from "./intersect/intersect.js";
|
|
80
|
-
// Number
|
|
81
|
-
export { dec } from "./dec/dec.js";
|
|
82
|
-
export { inc } from "./inc/inc.js";
|
|
83
|
-
export { gt } from "./gt/gt.js";
|
|
84
|
-
export { lt } from "./lt/lt.js";
|
|
85
|
-
export { random } from "./random/random.js";
|
|
86
|
-
// String
|
|
87
|
-
export { split } from "./split/split.js";
|
|
88
|
-
export { splitInGroupsOf } from "./split-in-groups-of/split-in-groups-of.js";
|
|
89
|
-
export { startsWith } from "./starts-with/starts-with.js";
|
|
90
|
-
export { endsWith } from "./ends-with/ends-with.js";
|
|
91
|
-
export { toLower } from "./to-lower/to-lower.js";
|
|
92
|
-
export { toUpper } from "./to-upper/to-upper.js";
|
|
93
|
-
export { trim } from "./trim/trim.js";
|
|
94
|
-
export { contains } from "./contains/contains.js";
|
|
95
|
-
export { unite } from "./unite/unite.js";
|
|
96
|
-
export { escapeHTML } from "./escape-html/escape-html.js";
|
|
97
|
-
export { escapeRegExp } from "./escape-reg-exp/escape-reg-exp.js";
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"sourcesContent":["export {\n isDeepEqual,\n isDeepEqual as deepEqual,\n} from \"./deep-equal/deep-equal.js\"\nexport { elapsedTime } from \"./elapsed-time/elapsed-time.js\"\nexport { groupBy } from \"./group-by/group-by.js\"\nexport { indexBy } from \"./index-by/index-by.js\"\nexport { hist } from \"./hist/hist.js\"\nexport { protoChain } from \"./proto-chain/proto-chain.js\"\nexport { sequence, sequenceWhile } from \"./sequence/sequence.js\"\nexport { tryCatch } from \"./try-catch/try-catch.js\"\nexport { raise } from \"./raise/raise.js\"\nexport { type } from \"./type/type.js\"\nexport { throttle } from \"./throttle/throttle.js\"\nexport { debounce } from \"./debounce/debounce.js\"\nexport { isURI } from \"./is-uri/is-uri.js\"\nexport { spy } from \"./spy/spy.js\"\n\n// Core\nexport { map } from \"./map/map.js\"\nexport { mapMatrix } from \"./map-matrix/map-matrix.js\"\nexport { reduce } from \"./reduce/reduce.js\"\nexport { converge } from \"./converge/converge.js\"\nexport { forEach } from \"./for-each/for-each.js\"\nexport { pipe } from \"./pipe/pipe.js\"\nexport { pipeP } from \"./pipe-p/pipe-p.js\"\nexport { read as get, read, readMany } from \"./read/read.js\"\nexport { write as set, write } from \"./write/write.js\"\nexport { same } from \"./same/same.js\"\nexport { i } from \"./i/i.js\"\nexport { clone } from \"./clone/clone.js\"\nexport { repeat } from \"./repeat/repeat.js\"\nexport { curry } from \"./curry/curry.js\"\nexport { compact, compactMany } from \"./compact/compact.js\"\n\n// Boolean\nexport { is, isNothing, not, isTrue, isFalse, isObject } from \"./is/is.js\"\nexport { isEmpty, isNotEmpty } from \"./is-empty/is-empty.js\"\nexport {\n isEqual,\n isEqual as equals,\n isEqual as eq,\n} from \"./is-equal/is-equal.js\"\nexport { isBetween, isBetween as between } from \"./is-between/is-between.js\"\nexport { any, any as has, anyWith, anyWith as hasWith } from \"./any/any.js\"\nexport { all, allWith } from \"./all/all.js\"\nexport { when } from \"./when/when.js\"\nexport { cases } from \"./cases/cases.js\"\nexport { isMatch } from \"./is-match/is-match.js\"\n\n// Object\nexport { pick } from \"./pick/pick.js\"\nexport { pluck } from \"./pluck/pluck.js\"\nexport { merge, mergeAll, mergeBy } from \"./merge/merge.js\"\nexport { keys } from \"./keys/keys.js\"\nexport { values } from \"./values/values.js\"\nexport { rename as renameKeys, rename, renameMany } from \"./rename/rename.js\"\nexport {\n zipToObject as zipToObj,\n zipToObject,\n} from \"./zip-to-object/zip-to-object.js\"\nexport { mutate, mutateMany, mutateWith } from \"./mutate/mutate.js\"\nexport { update, updateMany, updateWith } from \"./update/update.js\"\n\n// Array\nexport { top } from \"./top/top.js\"\nexport { bottom } from \"./bottom/bottom.js\"\nexport { first, first as head } from \"./first/first.js\"\nexport { last, last as tail } from \"./last/last.js\"\nexport { page } from \"./page/page.js\"\nexport { push } from \"./push/push.js\"\nexport { max, maxBy } from \"./max/max.js\"\nexport { min, minBy } from \"./min/min.js\"\nexport { move } from \"./move/move.js\"\nexport { flatten } from \"./flatten/flatten.js\"\nexport { distinct, distinctBy } from \"./distinct/distinct.js\"\nexport { dropLast } from \"./drop-last/drop-last.js\"\nexport { upsertWith as upsert, upsertWith } from \"./upsert/upsert.js\"\nexport { append, append as concat } from \"./append/append.js\"\nexport { prepend } from \"./prepend/prepend.js\"\nexport { toggle } from \"./toggle/toggle.js\"\nexport { partition, partitionWith } from \"./partition/partition.js\"\nexport {\n count,\n count as length,\n count as size,\n countBy,\n countWith,\n} from \"./count/count.js\"\nexport { replace, replaceWith } from \"./replace/replace.js\"\nexport { sort, sortBy } from \"./sort/sort.js\"\nexport { sortWith } from \"./sort/sort-with.js\"\nexport { remove, removeWith } from \"./remove/remove.js\"\nexport { hasKey } from \"./has-key/has-key.js\"\nexport { filter, filterWith } from \"./filter/filter.js\"\nexport { find, findWith } from \"./find/find.js\"\nexport { findIndex, findIndexWith } from \"./find-index/find-index.js\"\nexport { join, joinBy } from \"./join/join.js\"\nexport { intersect, intersectBy } from \"./intersect/intersect.js\"\n\n// Number\nexport { dec } from \"./dec/dec.js\"\nexport { inc } from \"./inc/inc.js\"\nexport { gt } from \"./gt/gt.js\"\nexport { lt } from \"./lt/lt.js\"\nexport { random } from \"./random/random.js\"\n\n// String\nexport { split } from \"./split/split.js\"\nexport { splitInGroupsOf } from \"./split-in-groups-of/split-in-groups-of.js\"\nexport { startsWith } from \"./starts-with/starts-with.js\"\nexport { endsWith } from \"./ends-with/ends-with.js\"\nexport { toLower } from \"./to-lower/to-lower.js\"\nexport { toUpper } from \"./to-upper/to-upper.js\"\nexport { trim } from \"./trim/trim.js\"\nexport { contains } from \"./contains/contains.js\"\nexport { unite } from \"./unite/unite.js\"\nexport { escapeHTML } from \"./escape-html/escape-html.js\"\nexport { escapeRegExp } from \"./escape-reg-exp/escape-reg-exp.js\"\n"],"names":["isDeepEqual","deepEqual","elapsedTime","groupBy","indexBy","hist","protoChain","sequence","sequenceWhile","tryCatch","raise","type","throttle","debounce","isURI","spy","map","mapMatrix","reduce","converge","forEach","pipe","pipeP","read","get","readMany","write","set","same","i","clone","repeat","curry","compact","compactMany","is","isNothing","not","isTrue","isFalse","isObject","isEmpty","isNotEmpty","isEqual","equals","eq","isBetween","between","any","has","anyWith","hasWith","all","allWith","when","cases","isMatch","pick","pluck","merge","mergeAll","mergeBy","keys","values","rename","renameKeys","renameMany","zipToObject","zipToObj","mutate","mutateMany","mutateWith","update","updateMany","updateWith","top","bottom","first","head","last","tail","page","push","max","maxBy","min","minBy","move","flatten","distinct","distinctBy","dropLast","upsertWith","upsert","append","concat","prepend","toggle","partition","partitionWith","count","length","size","countBy","countWith","replace","replaceWith","sort","sortBy","sortWith","remove","removeWith","hasKey","filter","filterWith","find","findWith","findIndex","findIndexWith","join","joinBy","intersect","intersectBy","dec","inc","gt","lt","random","split","splitInGroupsOf","startsWith","endsWith","toLower","toUpper","trim","contains","unite","escapeHTML","escapeRegExp"],"mappings":"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"}
|
package/dist/index.test.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */ import test from "tape";
|
|
2
|
-
import { createRequire } from "module";
|
|
3
|
-
test("index", function(t) {
|
|
4
|
-
t.doesNotThrow(function() {
|
|
5
|
-
createRequire(new URL("index.js", import.meta.url));
|
|
6
|
-
}, "Main file loads without errors");
|
|
7
|
-
t.end();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.test.js.map
|
package/dist/index.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.test.js"],"sourcesContent":["/* eslint-disable unicorn/prefer-module */\n\nimport test from \"tape\"\nimport { createRequire } from \"module\"\n\ntest(\"index\", t => {\n t.doesNotThrow(() => {\n createRequire(new URL(\"index.js\", import.meta.url))\n }, \"Main file loads without errors\")\n\n t.end()\n})\n"],"names":["test","createRequire","t","doesNotThrow","URL","url","end"],"mappings":"AAAA,wCAAwC,GAExC,OAAOA,UAAU,OAAM;AACvB,SAASC,aAAa,QAAQ,SAAQ;AAEtCD,KAAK,SAASE,SAAAA,GAAK;IACjBA,EAAEC,YAAY,CAAC,WAAM;QACnBF,cAAc,IAAIG,IAAI,YAAY,YAAYC,GAAG;IACnD,GAAG;IAEHH,EAAEI,GAAG;AACP"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { find } from "../find/find.js";
|
|
2
|
-
import { curry } from "../curry/curry.js";
|
|
3
|
-
import { any } from "../any/any.js";
|
|
4
|
-
import { isEqual } from "../is-equal/is-equal.js";
|
|
5
|
-
var _intersectBy = function(predicateFn, mergeFn, aList, bList) {
|
|
6
|
-
if (aList.length === 0 || bList.length === 0) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
var result = [];
|
|
10
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
11
|
-
try {
|
|
12
|
-
var _loop = function() {
|
|
13
|
-
var b = _step.value;
|
|
14
|
-
var a = find(function(item) {
|
|
15
|
-
return predicateFn(item, b);
|
|
16
|
-
}, undefined, aList);
|
|
17
|
-
if (a) {
|
|
18
|
-
var alreadyAdded = any(function(item) {
|
|
19
|
-
return predicateFn(item, a);
|
|
20
|
-
}, result);
|
|
21
|
-
if (!alreadyAdded) {
|
|
22
|
-
result.push(mergeFn(a, b));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
for(var _iterator = bList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
27
|
-
} catch (err) {
|
|
28
|
-
_didIteratorError = true;
|
|
29
|
-
_iteratorError = err;
|
|
30
|
-
} finally{
|
|
31
|
-
try {
|
|
32
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
33
|
-
_iterator.return();
|
|
34
|
-
}
|
|
35
|
-
} finally{
|
|
36
|
-
if (_didIteratorError) {
|
|
37
|
-
throw _iteratorError;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
var _intersect = function(aList, bList) {
|
|
44
|
-
return _intersectBy(isEqual, function(a) {
|
|
45
|
-
return a;
|
|
46
|
-
}, aList, bList);
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Combine two arrays into one a set (array of unique items), composed of common
|
|
50
|
-
* items from both arrays.
|
|
51
|
-
*
|
|
52
|
-
* The function starts with an empty array and each item of bList will be
|
|
53
|
-
* searched in aList using a shallow equal. If it's found, it's also checked
|
|
54
|
-
* if it has not been already added.
|
|
55
|
-
*
|
|
56
|
-
* @param {any[]} aList
|
|
57
|
-
* @param {any[]} bList
|
|
58
|
-
*
|
|
59
|
-
* @returns {any[]}
|
|
60
|
-
*
|
|
61
|
-
* @name intersect
|
|
62
|
-
* @tag Array
|
|
63
|
-
* @signature (aList: any[], bList: any[]): any[]
|
|
64
|
-
*
|
|
65
|
-
* @see {@link intersectBy}
|
|
66
|
-
* @see {@link overlap}
|
|
67
|
-
* @see {@link overlapBy}
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* intersect([1, 2, 3, 3], [3, 3, 4, 5])
|
|
71
|
-
* // => [3]
|
|
72
|
-
*/ export var intersect = curry(_intersect);
|
|
73
|
-
/**
|
|
74
|
-
* Combine two arrays into one a set (array of unique items), composed of common
|
|
75
|
-
* items from both arrays. Allow custom predicate and merge functions.
|
|
76
|
-
*
|
|
77
|
-
* The function starts with an empty array and each item of bList will be
|
|
78
|
-
* searched in aList using a shallow equal. If it's found, it's also checked
|
|
79
|
-
* if it has not been already added.
|
|
80
|
-
*
|
|
81
|
-
* @param {Function} predicateFn
|
|
82
|
-
* @param {Function} mergeFn
|
|
83
|
-
* @param {any[]} aList
|
|
84
|
-
* @param {any[]} bList
|
|
85
|
-
*
|
|
86
|
-
* @returns {any[]}
|
|
87
|
-
*
|
|
88
|
-
* @name intersectBy
|
|
89
|
-
* @tag Array
|
|
90
|
-
* @signature (predicateFn: Funciton, mergeFn: Function, aList: any[], bList: any[]): any[]
|
|
91
|
-
*
|
|
92
|
-
* @see {@link intersect}
|
|
93
|
-
* @see {@link overlap}
|
|
94
|
-
* @see {@link overlapBy}
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* intersectBy(
|
|
98
|
-
* (a, b) => a.id === b.id,
|
|
99
|
-
* (a, b) => ({ ...a, ...b }),
|
|
100
|
-
* [
|
|
101
|
-
* { id: 1, lorem: "ipsum" },
|
|
102
|
-
* { id: 2, foo: "bar1" },
|
|
103
|
-
* { id: 2, foo: "bar2" },
|
|
104
|
-
* ],
|
|
105
|
-
* [
|
|
106
|
-
* { id: 2, comments: [] },
|
|
107
|
-
* { id: 3, comments: [] },
|
|
108
|
-
* ]
|
|
109
|
-
* )
|
|
110
|
-
* // => [{ id: 2, foo: "bar1", comments: [] }]
|
|
111
|
-
*/ export var intersectBy = curry(_intersectBy);
|
|
112
|
-
|
|
113
|
-
//# sourceMappingURL=intersect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intersect/intersect.js"],"sourcesContent":["import { find } from \"../find/find.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { any } from \"../any/any.js\"\nimport { isEqual } from \"../is-equal/is-equal.js\"\n\nconst _intersectBy = (predicateFn, mergeFn, aList, bList) => {\n if (aList.length === 0 || bList.length === 0) {\n return []\n }\n\n const result = []\n\n for (const b of bList) {\n const a = find(item => predicateFn(item, b), undefined, aList)\n\n if (a) {\n const alreadyAdded = any(item => predicateFn(item, a), result)\n\n if (!alreadyAdded) {\n result.push(mergeFn(a, b))\n }\n }\n }\n\n return result\n}\n\nconst _intersect = (aList, bList) => _intersectBy(isEqual, a => a, aList, bList)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersect\n * @tag Array\n * @signature (aList: any[], bList: any[]): any[]\n *\n * @see {@link intersectBy}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersect([1, 2, 3, 3], [3, 3, 4, 5])\n * // => [3]\n */\nexport const intersect = curry(_intersect)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays. Allow custom predicate and merge functions.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {Function} predicateFn\n * @param {Function} mergeFn\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersectBy\n * @tag Array\n * @signature (predicateFn: Funciton, mergeFn: Function, aList: any[], bList: any[]): any[]\n *\n * @see {@link intersect}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersectBy(\n * (a, b) => a.id === b.id,\n * (a, b) => ({ ...a, ...b }),\n * [\n * { id: 1, lorem: \"ipsum\" },\n * { id: 2, foo: \"bar1\" },\n * { id: 2, foo: \"bar2\" },\n * ],\n * [\n * { id: 2, comments: [] },\n * { id: 3, comments: [] },\n * ]\n * )\n * // => [{ id: 2, foo: \"bar1\", comments: [] }]\n */\nexport const intersectBy = curry(_intersectBy)\n"],"names":["find","curry","any","isEqual","_intersectBy","predicateFn","mergeFn","aList","bList","length","result","b","a","item","undefined","alreadyAdded","push","_intersect","intersect","intersectBy"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,KAAK,QAAQ,oBAAmB;AACzC,SAASC,GAAG,QAAQ,gBAAe;AACnC,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,IAAMC,eAAe,SAACC,aAAaC,SAASC,OAAOC,OAAU;IAC3D,IAAID,MAAME,MAAM,KAAK,KAAKD,MAAMC,MAAM,KAAK,GAAG;QAC5C,OAAO,EAAE;IACX,CAAC;IAED,IAAMC,SAAS,EAAE;QAEZ,kCAAA,2BAAA;;+BAAkB;YAAlB,IAAMC,IAAN;YACH,IAAMC,IAAIZ,KAAKa,SAAAA;uBAAQR,YAAYQ,MAAMF;eAAIG,WAAWP;YAExD,IAAIK,GAAG;gBACL,IAAMG,eAAeb,IAAIW,SAAAA;2BAAQR,YAAYQ,MAAMD;mBAAIF;gBAEvD,IAAI,CAACK,cAAc;oBACjBL,OAAOM,IAAI,CAACV,QAAQM,GAAGD;gBACzB,CAAC;YACH,CAAC;QACH;QAVA,QAAK,YAAWH,0BAAX,SAAA,6BAAA,QAAA,yBAAA;;QAAA;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAYL,OAAOE;AACT;AAEA,IAAMO,aAAa,SAACV,OAAOC;WAAUJ,aAAaD,SAASS,SAAAA;eAAKA;OAAGL,OAAOC;;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,IAAMU,YAAYjB,MAAMgB,YAAW;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,IAAME,cAAclB,MAAMG,cAAa"}
|