@asd14/m 8.1.0 → 9.0.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/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 +66 -0
- package/dist/src/group/group-by.js +79 -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.d.ts +79 -0
- package/dist/src/index.js +117 -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/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/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 +55 -0
- package/dist/src/read/read.js +79 -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/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/when/when.d.ts +54 -0
- package/dist/src/when/when.js +70 -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 +70 -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 +195 -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
package/dist/top/top.test.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { top } from "./top.js";
|
|
3
|
-
test("top", function(t) {
|
|
4
|
-
t.deepEquals(top([
|
|
5
|
-
1,
|
|
6
|
-
2,
|
|
7
|
-
3
|
|
8
|
-
]), [
|
|
9
|
-
1,
|
|
10
|
-
2
|
|
11
|
-
], "3 length [] should return [] with first 2 elm");
|
|
12
|
-
t.deepEquals(top([
|
|
13
|
-
1,
|
|
14
|
-
2
|
|
15
|
-
]), [
|
|
16
|
-
1
|
|
17
|
-
], "2 length [] should return [] with 1 elm");
|
|
18
|
-
t.deepEquals(top([
|
|
19
|
-
1
|
|
20
|
-
]), [], "1 length [] should return empty []");
|
|
21
|
-
t.deepEquals(top([]), [], "Empty [] should return empty []");
|
|
22
|
-
t.deepEquals(top(2, 2), [], "Non-array should return empty []");
|
|
23
|
-
t.deepEquals(top("asd", []), [], "Non-numeric Limit should return []");
|
|
24
|
-
t.deepEquals(top(2)([
|
|
25
|
-
1,
|
|
26
|
-
2,
|
|
27
|
-
3
|
|
28
|
-
]), [
|
|
29
|
-
1,
|
|
30
|
-
2
|
|
31
|
-
], "Limit and [], curried");
|
|
32
|
-
t.deepEquals(top(2, [
|
|
33
|
-
1,
|
|
34
|
-
2
|
|
35
|
-
]), [
|
|
36
|
-
1,
|
|
37
|
-
2
|
|
38
|
-
], "Limit and [], un-curried");
|
|
39
|
-
t.deepEquals(top(2)("asd"), "as", "Limit and string, curried");
|
|
40
|
-
t.deepEquals(top(2, "asd"), "as", "Limit and string, un-curried");
|
|
41
|
-
t.deepEquals(top(3, [
|
|
42
|
-
1,
|
|
43
|
-
2
|
|
44
|
-
]), [
|
|
45
|
-
1,
|
|
46
|
-
2
|
|
47
|
-
], "Limit grater than max elements should return all elements");
|
|
48
|
-
t.end();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=top.test.js.map
|
package/dist/top/top.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/top/top.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { top } from \"./top.js\"\n\ntest(\"top\", t => {\n t.deepEquals(\n top([1, 2, 3]),\n [1, 2],\n \"3 length [] should return [] with first 2 elm\"\n )\n t.deepEquals(top([1, 2]), [1], \"2 length [] should return [] with 1 elm\")\n t.deepEquals(top([1]), [], \"1 length [] should return empty []\")\n\n t.deepEquals(top([]), [], \"Empty [] should return empty []\")\n t.deepEquals(top(2, 2), [], \"Non-array should return empty []\")\n t.deepEquals(top(\"asd\", []), [], \"Non-numeric Limit should return []\")\n\n t.deepEquals(top(2)([1, 2, 3]), [1, 2], \"Limit and [], curried\")\n t.deepEquals(top(2, [1, 2]), [1, 2], \"Limit and [], un-curried\")\n t.deepEquals(top(2)(\"asd\"), \"as\", \"Limit and string, curried\")\n t.deepEquals(top(2, \"asd\"), \"as\", \"Limit and string, un-curried\")\n\n t.deepEquals(\n top(3, [1, 2]),\n [1, 2],\n \"Limit grater than max elements should return all elements\"\n )\n\n t.end()\n})\n"],"names":["test","top","t","deepEquals","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,GAAG,QAAQ,WAAU;AAE9BD,KAAK,OAAOE,SAAAA,GAAK;IACfA,EAAEC,UAAU,CACVF,IAAI;QAAC;QAAG;QAAG;KAAE,GACb;QAAC;QAAG;KAAE,EACN;IAEFC,EAAEC,UAAU,CAACF,IAAI;QAAC;QAAG;KAAE,GAAG;QAAC;KAAE,EAAE;IAC/BC,EAAEC,UAAU,CAACF,IAAI;QAAC;KAAE,GAAG,EAAE,EAAE;IAE3BC,EAAEC,UAAU,CAACF,IAAI,EAAE,GAAG,EAAE,EAAE;IAC1BC,EAAEC,UAAU,CAACF,IAAI,GAAG,IAAI,EAAE,EAAE;IAC5BC,EAAEC,UAAU,CAACF,IAAI,OAAO,EAAE,GAAG,EAAE,EAAE;IAEjCC,EAAEC,UAAU,CAACF,IAAI,GAAG;QAAC;QAAG;QAAG;KAAE,GAAG;QAAC;QAAG;KAAE,EAAE;IACxCC,EAAEC,UAAU,CAACF,IAAI,GAAG;QAAC;QAAG;KAAE,GAAG;QAAC;QAAG;KAAE,EAAE;IACrCC,EAAEC,UAAU,CAACF,IAAI,GAAG,QAAQ,MAAM;IAClCC,EAAEC,UAAU,CAACF,IAAI,GAAG,QAAQ,MAAM;IAElCC,EAAEC,UAAU,CACVF,IAAI,GAAG;QAAC;QAAG;KAAE,GACb;QAAC;QAAG;KAAE,EACN;IAGFC,EAAEE,GAAG;AACP"}
|
package/dist/trim/trim.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/* eslint-disable jsdoc/check-param-names,jsdoc/require-param */ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
|
-
import { escapeRegExp } from "../escape-reg-exp/escape-reg-exp.js";
|
|
3
|
-
var _trim = function() {
|
|
4
|
-
var char = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : " ", input = arguments.length > 1 ? arguments[1] : void 0;
|
|
5
|
-
var safeChar = escapeRegExp(char);
|
|
6
|
-
return input.replace(new RegExp("^[".concat(safeChar, "]+|[").concat(safeChar, "]+$"), "g"), "");
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Remove char from beginning and end of string
|
|
10
|
-
*
|
|
11
|
-
* @param {string} char Character to be removed
|
|
12
|
-
* @param {string} source Source string
|
|
13
|
-
*
|
|
14
|
-
* @returns {string}
|
|
15
|
-
*
|
|
16
|
-
* @tag String
|
|
17
|
-
* @signature (char: string) => (source: string): string
|
|
18
|
-
* @signature (char: string, source: string): string
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* trim()(" lorem ")
|
|
22
|
-
* // => "lorem"
|
|
23
|
-
*
|
|
24
|
-
* trim("-", "-- lorem -")
|
|
25
|
-
* // => " lorem "
|
|
26
|
-
*/ var trim = function() {
|
|
27
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
28
|
-
params[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
// @signature (char) => (source)
|
|
31
|
-
if (params.length <= 1) {
|
|
32
|
-
return function(input) {
|
|
33
|
-
return _trim(params[0], input);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// @signature (char, source)
|
|
37
|
-
return _trim.apply(void 0, _to_consumable_array(params));
|
|
38
|
-
};
|
|
39
|
-
export { trim };
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=trim.js.map
|
package/dist/trim/trim.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/trim/trim.js"],"sourcesContent":["/* eslint-disable jsdoc/check-param-names,jsdoc/require-param */\n\nimport { escapeRegExp } from \"../escape-reg-exp/escape-reg-exp.js\"\n\nconst _trim = (char = \" \", input) => {\n const safeChar = escapeRegExp(char)\n\n return input.replace(new RegExp(`^[${safeChar}]+|[${safeChar}]+$`, \"g\"), \"\")\n}\n\n/**\n * Remove char from beginning and end of string\n *\n * @param {string} char Character to be removed\n * @param {string} source Source string\n *\n * @returns {string}\n *\n * @tag String\n * @signature (char: string) => (source: string): string\n * @signature (char: string, source: string): string\n *\n * @example\n * trim()(\" lorem \")\n * // => \"lorem\"\n *\n * trim(\"-\", \"-- lorem -\")\n * // => \" lorem \"\n */\nconst trim = (...params) => {\n // @signature (char) => (source)\n if (params.length <= 1) {\n return input => _trim(params[0], input)\n }\n\n // @signature (char, source)\n return _trim(...params)\n}\n\nexport { trim }\n"],"names":["escapeRegExp","_trim","char","input","safeChar","replace","RegExp","trim","params","length"],"mappings":"AAAA,8DAA8D,GAE9D;AAAA,SAASA,YAAY,QAAQ,sCAAqC;AAElE,IAAMC,QAAQ,WAAuB;QAAtBC,wEAAO,KAAKC;IACzB,IAAMC,WAAWJ,aAAaE;IAE9B,OAAOC,MAAME,OAAO,CAAC,IAAIC,OAAO,AAAC,KAAmBF,OAAfA,UAAS,QAAe,OAATA,UAAS,QAAM,MAAM;AAC3E;AAEA;;;;;;;;;;;;;;;;;;CAkBC,GACD,IAAMG,OAAO,WAAe;qCAAXC;QAAAA;;IACf,gCAAgC;IAChC,IAAIA,OAAOC,MAAM,IAAI,GAAG;QACtB,OAAON,SAAAA;mBAASF,MAAMO,MAAM,CAAC,EAAE,EAAEL;;IACnC,CAAC;IAED,4BAA4B;IAC5B,OAAOF,MAAAA,MAAAA,KAAAA,GAAM,qBAAGO;AAClB;AAEA,SAASD,IAAI,GAAE"}
|
package/dist/trim/trim.test.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { trim } from "./trim.js";
|
|
3
|
-
test("trim", function(t) {
|
|
4
|
-
t.equals(trim()(" lorem "), "lorem", "Remove white space - curried");
|
|
5
|
-
t.equals(trim(" ", " lorem "), "lorem", "Remove white space - uncurried");
|
|
6
|
-
t.equals(trim("-")("-- lorem -"), " lorem ", "Remove custom char");
|
|
7
|
-
t.end();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=trim.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/trim/trim.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { trim } from \"./trim.js\"\n\ntest(\"trim\", t => {\n t.equals(trim()(\" lorem \"), \"lorem\", \"Remove white space - curried\")\n\n t.equals(trim(\" \", \" lorem \"), \"lorem\", \"Remove white space - uncurried\")\n\n t.equals(trim(\"-\")(\"-- lorem -\"), \" lorem \", \"Remove custom char\")\n\n t.end()\n})\n"],"names":["test","trim","t","equals","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChBA,EAAEC,MAAM,CAACF,OAAO,aAAa,SAAS;IAEtCC,EAAEC,MAAM,CAACF,KAAK,KAAK,aAAa,SAAS;IAEzCC,EAAEC,MAAM,CAACF,KAAK,KAAK,gBAAgB,YAAY;IAE/CC,EAAEE,GAAG;AACP"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Replicate try/catch using a tryer and catcher function
|
|
3
|
-
*
|
|
4
|
-
* @param {Function} tryer Try to do something with source input
|
|
5
|
-
* @param {Function} catcher Run if tryer throws exception
|
|
6
|
-
*
|
|
7
|
-
* @returns {any}
|
|
8
|
-
*
|
|
9
|
-
* @tag Core
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* tryCatch(inc)(10)
|
|
13
|
-
* // => 11
|
|
14
|
-
*
|
|
15
|
-
* tryCatch(
|
|
16
|
-
* () => { throw new Error("Tryer error") },
|
|
17
|
-
* (error, source) => inc(source)
|
|
18
|
-
* )(10)
|
|
19
|
-
* // => 11
|
|
20
|
-
*/ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
21
|
-
var tryCatch = function(tryer, catcher) {
|
|
22
|
-
return function() {
|
|
23
|
-
for(var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++){
|
|
24
|
-
input[_key] = arguments[_key];
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
return tryer.apply(void 0, _to_consumable_array(input));
|
|
28
|
-
} catch (error) {
|
|
29
|
-
return catcher.apply(void 0, [
|
|
30
|
-
error
|
|
31
|
-
].concat(_to_consumable_array(input)));
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export { tryCatch };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=try-catch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/try-catch/try-catch.js"],"sourcesContent":["/**\n * Replicate try/catch using a tryer and catcher function\n *\n * @param {Function} tryer Try to do something with source input\n * @param {Function} catcher Run if tryer throws exception\n *\n * @returns {any}\n *\n * @tag Core\n *\n * @example\n * tryCatch(inc)(10)\n * // => 11\n *\n * tryCatch(\n * () => { throw new Error(\"Tryer error\") },\n * (error, source) => inc(source)\n * )(10)\n * // => 11\n */\nconst tryCatch =\n (tryer, catcher) =>\n (...input) => {\n try {\n return tryer(...input)\n } catch (error) {\n return catcher(error, ...input)\n }\n }\n\nexport { tryCatch }\n"],"names":["tryCatch","tryer","catcher","input","error"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GACD;AAAA,IAAMA,WACJ,SAACC,OAAOC;WACR,WAAc;yCAAVC;YAAAA;;QACF,IAAI;YACF,OAAOF,MAAAA,MAAAA,KAAAA,GAAM,qBAAGE;QAClB,EAAE,OAAOC,OAAO;YACd,OAAOF,QAAAA,MAAAA,KAAAA,GAAAA;gBAAQE;aAAgB,CAAxBF,OAAe,qBAAGC;QAC3B;IACF;;AAEF,SAASH,QAAQ,GAAE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { inc } from "../inc/inc.js";
|
|
3
|
-
import { tryCatch } from "./try-catch.js";
|
|
4
|
-
test("tryCatch", function(t) {
|
|
5
|
-
t.equals(tryCatch(inc)(10), 11, "Given tryer function not throwing, apply tryer function on input");
|
|
6
|
-
t.equals(tryCatch(function() {
|
|
7
|
-
throw new Error("Tryer error");
|
|
8
|
-
}, function(error, input) {
|
|
9
|
-
return inc(input);
|
|
10
|
-
})(10), 11, "Given tryer function throwing, apply catcher function on input");
|
|
11
|
-
t.end();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=try-catch.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/try-catch/try-catch.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { inc } from \"../inc/inc.js\"\nimport { tryCatch } from \"./try-catch.js\"\n\ntest(\"tryCatch\", t => {\n t.equals(\n tryCatch(inc)(10),\n 11,\n \"Given tryer function not throwing, apply tryer function on input\"\n )\n\n t.equals(\n tryCatch(\n () => {\n throw new Error(\"Tryer error\")\n },\n (error, input) => inc(input)\n )(10),\n 11,\n \"Given tryer function throwing, apply catcher function on input\"\n )\n\n t.end()\n})\n"],"names":["test","inc","tryCatch","t","equals","Error","error","input","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,GAAG,QAAQ,gBAAe;AACnC,SAASC,QAAQ,QAAQ,iBAAgB;AAEzCF,KAAK,YAAYG,SAAAA,GAAK;IACpBA,EAAEC,MAAM,CACNF,SAASD,KAAK,KACd,IACA;IAGFE,EAAEC,MAAM,CACNF,SACE,WAAM;QACJ,MAAM,IAAIG,MAAM,eAAc;IAChC,GACA,SAACC,OAAOC;eAAUN,IAAIM;OACtB,KACF,IACA;IAGFJ,EAAEK,GAAG;AACP"}
|
package/dist/type/type.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* From ramda: Gives a single-word string description of the (native) type of
|
|
3
|
-
* a value, returning such answers as "Object", "Number", "Array", or "Null".
|
|
4
|
-
*
|
|
5
|
-
* Does not attempt to distinguish user Object types any further, reporting
|
|
6
|
-
* them all as "Object".
|
|
7
|
-
*
|
|
8
|
-
* @param {any} input Something to check type on
|
|
9
|
-
*
|
|
10
|
-
* @returns {string}
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* type({}) // "Object"
|
|
14
|
-
* type(1) // "Number"
|
|
15
|
-
* type(false) // "Boolean"
|
|
16
|
-
* type("s") // "String"
|
|
17
|
-
* type(null) // "Null"
|
|
18
|
-
* type(undefined) // "Undefined"
|
|
19
|
-
* type([]) // "Array"
|
|
20
|
-
* type(/[A-z]/) // "RegExp"
|
|
21
|
-
* type(new Date()) // "Date"
|
|
22
|
-
* type(() => {}) // "Function"
|
|
23
|
-
* type(Promise.resolve()) // "Promise"
|
|
24
|
-
*/ var type = function(input) {
|
|
25
|
-
return input === null ? "Null" : input === undefined ? "Undefined" : Object.prototype.toString.call(input).slice(8, -1);
|
|
26
|
-
};
|
|
27
|
-
export { type };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=type.js.map
|
package/dist/type/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/type/type.js"],"sourcesContent":["/**\n * From ramda: Gives a single-word string description of the (native) type of\n * a value, returning such answers as \"Object\", \"Number\", \"Array\", or \"Null\".\n *\n * Does not attempt to distinguish user Object types any further, reporting\n * them all as \"Object\".\n *\n * @param {any} input Something to check type on\n *\n * @returns {string}\n *\n * @example\n * type({}) // \"Object\"\n * type(1) // \"Number\"\n * type(false) // \"Boolean\"\n * type(\"s\") // \"String\"\n * type(null) // \"Null\"\n * type(undefined) // \"Undefined\"\n * type([]) // \"Array\"\n * type(/[A-z]/) // \"RegExp\"\n * type(new Date()) // \"Date\"\n * type(() => {}) // \"Function\"\n * type(Promise.resolve()) // \"Promise\"\n */\nconst type = input =>\n input === null\n ? \"Null\"\n : input === undefined\n ? \"Undefined\"\n : Object.prototype.toString.call(input).slice(8, -1)\n\nexport { type }\n"],"names":["type","input","undefined","Object","prototype","toString","call","slice"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,IAAMA,OAAOC,SAAAA;WACXA,UAAU,IAAI,GACV,SACAA,UAAUC,YACV,cACAC,OAAOC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACL,OAAOM,KAAK,CAAC,GAAG,CAAC,EAAE;;AAExD,SAASP,IAAI,GAAE"}
|
package/dist/type/type.test.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/no-null */ import test from "tape";
|
|
2
|
-
import { type } from "./type.js";
|
|
3
|
-
test("type", function(t) {
|
|
4
|
-
t.equal(type(null), "Null", "null should equal Null");
|
|
5
|
-
t.equal(type(), "Undefined", "undefined should equal Undefined");
|
|
6
|
-
t.equal(type(Number.NaN), "Number", "NaN should equal Number");
|
|
7
|
-
t.equal(type(false), "Boolean", "false should equal Boolean");
|
|
8
|
-
t.equal(type(2), "Number", "2 should equal Number");
|
|
9
|
-
t.equal(type(""), "String", '"" should equal String');
|
|
10
|
-
t.equal(type([]), "Array", "[] should equal Array");
|
|
11
|
-
t.equal(type({}), "Object", "{} should equal Object");
|
|
12
|
-
t.equal(type(new Date()), "Date", "new Date() should equal Date");
|
|
13
|
-
t.equal(type(function() {}), "Function", "() => {} should equal Function");
|
|
14
|
-
t.equal(type(/[A-z]/), "RegExp", "/[A-z]/ should equal RegExp");
|
|
15
|
-
t.equal(type(Promise.resolve(2)), "Promise", "Promise.resolve(2) should equal Promise");
|
|
16
|
-
t.end();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=type.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/type/type.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { type } from \"./type.js\"\n\ntest(\"type\", t => {\n t.equal(type(null), \"Null\", \"null should equal Null\")\n t.equal(type(), \"Undefined\", \"undefined should equal Undefined\")\n t.equal(type(Number.NaN), \"Number\", \"NaN should equal Number\")\n t.equal(type(false), \"Boolean\", \"false should equal Boolean\")\n t.equal(type(2), \"Number\", \"2 should equal Number\")\n t.equal(type(\"\"), \"String\", '\"\" should equal String')\n t.equal(type([]), \"Array\", \"[] should equal Array\")\n t.equal(type({}), \"Object\", \"{} should equal Object\")\n t.equal(type(new Date()), \"Date\", \"new Date() should equal Date\")\n t.equal(\n type(() => {}),\n \"Function\",\n \"() => {} should equal Function\"\n )\n t.equal(type(/[A-z]/), \"RegExp\", \"/[A-z]/ should equal RegExp\")\n t.equal(\n type(Promise.resolve(2)),\n \"Promise\",\n \"Promise.resolve(2) should equal Promise\"\n )\n t.end()\n})\n"],"names":["test","type","t","equal","Number","NaN","Date","Promise","resolve","end"],"mappings":"AAAA,kCAAkC,GAElC,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChBA,EAAEC,KAAK,CAACF,KAAK,IAAI,GAAG,QAAQ;IAC5BC,EAAEC,KAAK,CAACF,QAAQ,aAAa;IAC7BC,EAAEC,KAAK,CAACF,KAAKG,OAAOC,GAAG,GAAG,UAAU;IACpCH,EAAEC,KAAK,CAACF,KAAK,KAAK,GAAG,WAAW;IAChCC,EAAEC,KAAK,CAACF,KAAK,IAAI,UAAU;IAC3BC,EAAEC,KAAK,CAACF,KAAK,KAAK,UAAU;IAC5BC,EAAEC,KAAK,CAACF,KAAK,EAAE,GAAG,SAAS;IAC3BC,EAAEC,KAAK,CAACF,KAAK,CAAC,IAAI,UAAU;IAC5BC,EAAEC,KAAK,CAACF,KAAK,IAAIK,SAAS,QAAQ;IAClCJ,EAAEC,KAAK,CACLF,KAAK,WAAM,CAAC,IACZ,YACA;IAEFC,EAAEC,KAAK,CAACF,KAAK,UAAU,UAAU;IACjCC,EAAEC,KAAK,CACLF,KAAKM,QAAQC,OAAO,CAAC,KACrB,WACA;IAEFN,EAAEO,GAAG;AACP"}
|
package/dist/unite/unite.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { curry } from "../curry/curry.js";
|
|
2
|
-
var _unite = function(separator, input) {
|
|
3
|
-
return Array.prototype.join.call(input, separator);
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Unite all elements of an array into a string
|
|
7
|
-
*
|
|
8
|
-
* @param {string} separator Separator between each adjacent elements
|
|
9
|
-
* @param {Array} source Source array
|
|
10
|
-
*
|
|
11
|
-
* @returns {string}
|
|
12
|
-
*
|
|
13
|
-
* @name unite
|
|
14
|
-
* @tag Array
|
|
15
|
-
* @signature (separator: String, source: Array) => String
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* unite(",", ["lorem", "ipsum"])
|
|
19
|
-
* // => "lorem,ipsum"
|
|
20
|
-
*/ export var unite = curry(_unite);
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=unite.js.map
|
package/dist/unite/unite.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unite/unite.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\nconst _unite = (separator, input) => Array.prototype.join.call(input, separator)\n\n/**\n * Unite all elements of an array into a string\n *\n * @param {string} separator Separator between each adjacent elements\n * @param {Array} source Source array\n *\n * @returns {string}\n *\n * @name unite\n * @tag Array\n * @signature (separator: String, source: Array) => String\n *\n * @example\n * unite(\",\", [\"lorem\", \"ipsum\"])\n * // => \"lorem,ipsum\"\n */\nexport const unite = curry(_unite)\n"],"names":["curry","_unite","separator","input","Array","prototype","join","call","unite"],"mappings":"AAAA,SAASA,KAAK,QAAQ,oBAAmB;AAEzC,IAAMC,SAAS,SAACC,WAAWC;WAAUC,MAAMC,SAAS,CAACC,IAAI,CAACC,IAAI,CAACJ,OAAOD;;AAEtE;;;;;;;;;;;;;;;CAeC,GACD,OAAO,IAAMM,QAAQR,MAAMC,QAAO"}
|
package/dist/unite/unite.test.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { unite } from "./unite.js";
|
|
3
|
-
test("unite", function(t) {
|
|
4
|
-
t.deepEqual(unite(",", [
|
|
5
|
-
1,
|
|
6
|
-
2,
|
|
7
|
-
3
|
|
8
|
-
]), "1,2,3", "given [a comma and and array] should [return a string with items separated by comma]");
|
|
9
|
-
t.end();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=unite.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unite/unite.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { unite } from \"./unite.js\"\n\ntest(\"unite\", t => {\n t.deepEqual(\n unite(\",\", [1, 2, 3]),\n \"1,2,3\",\n \"given [a comma and and array] should [return a string with items separated by comma]\"\n )\n\n t.end()\n})\n"],"names":["test","unite","t","deepEqual","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,KAAK,QAAQ,aAAY;AAElCD,KAAK,SAASE,SAAAA,GAAK;IACjBA,EAAEC,SAAS,CACTF,MAAM,KAAK;QAAC;QAAG;QAAG;KAAE,GACpB,SACA;IAGFC,EAAEE,GAAG;AACP"}
|
package/dist/update/update.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
-
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
3
|
-
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
4
|
-
import { map } from "../map/map.js";
|
|
5
|
-
import { isMatch } from "../is-match/is-match.js";
|
|
6
|
-
var _update = function(transformations, input) {
|
|
7
|
-
var entries = Object.entries(transformations);
|
|
8
|
-
var result = _object_spread({}, input);
|
|
9
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
10
|
-
try {
|
|
11
|
-
for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
12
|
-
var _value = _sliced_to_array(_step.value, 2), key = _value[0], value = _value[1];
|
|
13
|
-
result[key] = typeof value === "function" ? value(input[key], input) : value;
|
|
14
|
-
}
|
|
15
|
-
} catch (err) {
|
|
16
|
-
_didIteratorError = true;
|
|
17
|
-
_iteratorError = err;
|
|
18
|
-
} finally{
|
|
19
|
-
try {
|
|
20
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
21
|
-
_iterator.return();
|
|
22
|
-
}
|
|
23
|
-
} finally{
|
|
24
|
-
if (_didIteratorError) {
|
|
25
|
-
throw _iteratorError;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var _updateWith = function(filter, transformations, input) {
|
|
32
|
-
var result = [];
|
|
33
|
-
for(var i = 0, length = input.length; i < length; ++i){
|
|
34
|
-
var item = input[i];
|
|
35
|
-
var shouldMutate = isMatch(filter, item);
|
|
36
|
-
result.push(shouldMutate ? _update(transformations, item) : item);
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var _updateMany = function(transformations, input) {
|
|
41
|
-
return map(function(item) {
|
|
42
|
-
return _update(transformations, item);
|
|
43
|
-
}, input);
|
|
44
|
-
};
|
|
45
|
-
export var update = function() {
|
|
46
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
47
|
-
params[_key] = arguments[_key];
|
|
48
|
-
}
|
|
49
|
-
// @signature (transformations) => (source)
|
|
50
|
-
if (params.length <= 1) {
|
|
51
|
-
return function(input) {
|
|
52
|
-
return _update(params[0], input);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
// @signature (transformations, source)
|
|
56
|
-
return _update.apply(void 0, _to_consumable_array(params));
|
|
57
|
-
};
|
|
58
|
-
export var updateMany = function() {
|
|
59
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
60
|
-
params[_key] = arguments[_key];
|
|
61
|
-
}
|
|
62
|
-
// @signature (transformations) => (source)
|
|
63
|
-
if (params.length <= 1) {
|
|
64
|
-
return function(input) {
|
|
65
|
-
return _updateMany(params[0], input);
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
// @signature (transformations, source)
|
|
69
|
-
return _updateMany.apply(void 0, _to_consumable_array(params));
|
|
70
|
-
};
|
|
71
|
-
export var updateWith = function() {
|
|
72
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
73
|
-
params[_key] = arguments[_key];
|
|
74
|
-
}
|
|
75
|
-
// @signature (filter, transformations) => (source)
|
|
76
|
-
if (params.length <= 2) {
|
|
77
|
-
return function(input) {
|
|
78
|
-
return _updateWith(params[0], params[1], input);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
// @signature (filter, transformations, source)
|
|
82
|
-
return _updateWith.apply(void 0, _to_consumable_array(params));
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/update/update.js"],"sourcesContent":["import { map } from \"../map/map.js\"\nimport { isMatch } from \"../is-match/is-match.js\"\n\nconst _update = (transformations, input) => {\n const entries = Object.entries(transformations)\n const result = { ...input }\n\n for (const [key, value] of entries) {\n result[key] = typeof value === \"function\" ? value(input[key], input) : value\n }\n\n return result\n}\n\nconst _updateWith = (filter, transformations, input) => {\n const result = []\n\n for (let i = 0, length = input.length; i < length; ++i) {\n const item = input[i]\n const shouldMutate = isMatch(filter, item)\n\n result.push(shouldMutate ? _update(transformations, item) : item)\n }\n\n return result\n}\n\nconst _updateMany = (transformations, input) =>\n map(item => _update(transformations, item), input)\n\nexport const update = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _update(params[0], input)\n }\n\n // @signature (transformations, source)\n return _update(...params)\n}\n\nexport const updateMany = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _updateMany(params[0], input)\n }\n\n // @signature (transformations, source)\n return _updateMany(...params)\n}\n\nexport const updateWith = (...params) => {\n // @signature (filter, transformations) => (source)\n if (params.length <= 2) {\n return input => _updateWith(params[0], params[1], input)\n }\n\n // @signature (filter, transformations, source)\n return _updateWith(...params)\n}\n"],"names":["map","isMatch","_update","transformations","input","entries","Object","result","key","value","_updateWith","filter","i","length","item","shouldMutate","push","_updateMany","update","params","updateMany","updateWith"],"mappings":"AAAA;;;AAAA,SAASA,GAAG,QAAQ,gBAAe;AACnC,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,IAAMC,UAAU,SAACC,iBAAiBC,OAAU;IAC1C,IAAMC,UAAUC,OAAOD,OAAO,CAACF;IAC/B,IAAMI,SAAS,mBAAKH;QAEf,kCAAA,2BAAA;;QAAL,QAAK,YAAsBC,4BAAtB,SAAA,6BAAA,QAAA,yBAAA,iCAA+B;YAA/B,8BAAA,iBAAOG,iBAAKC;YACfF,MAAM,CAACC,IAAI,GAAG,OAAOC,UAAU,aAAaA,MAAML,KAAK,CAACI,IAAI,EAAEJ,SAASK,KAAK;QAC9E;;QAFK;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAIL,OAAOF;AACT;AAEA,IAAMG,cAAc,SAACC,QAAQR,iBAAiBC,OAAU;IACtD,IAAMG,SAAS,EAAE;IAEjB,IAAK,IAAIK,IAAI,GAAGC,SAAST,MAAMS,MAAM,EAAED,IAAIC,QAAQ,EAAED,EAAG;QACtD,IAAME,OAAOV,KAAK,CAACQ,EAAE;QACrB,IAAMG,eAAed,QAAQU,QAAQG;QAErCP,OAAOS,IAAI,CAACD,eAAeb,QAAQC,iBAAiBW,QAAQA,IAAI;IAClE;IAEA,OAAOP;AACT;AAEA,IAAMU,cAAc,SAACd,iBAAiBC;WACpCJ,IAAIc,SAAAA;eAAQZ,QAAQC,iBAAiBW;OAAOV;;AAE9C,OAAO,IAAMc,SAAS,WAAe;qCAAXC;QAAAA;;IACxB,2CAA2C;IAC3C,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOT,SAAAA;mBAASF,QAAQiB,MAAM,CAAC,EAAE,EAAEf;;IACrC,CAAC;IAED,uCAAuC;IACvC,OAAOF,QAAAA,MAAAA,KAAAA,GAAQ,qBAAGiB;AACpB,EAAC;AAED,OAAO,IAAMC,aAAa,WAAe;qCAAXD;QAAAA;;IAC5B,2CAA2C;IAC3C,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOT,SAAAA;mBAASa,YAAYE,MAAM,CAAC,EAAE,EAAEf;;IACzC,CAAC;IAED,uCAAuC;IACvC,OAAOa,YAAAA,MAAAA,KAAAA,GAAY,qBAAGE;AACxB,EAAC;AAED,OAAO,IAAME,aAAa,WAAe;qCAAXF;QAAAA;;IAC5B,mDAAmD;IACnD,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOT,SAAAA;mBAASM,YAAYS,MAAM,CAAC,EAAE,EAAEA,MAAM,CAAC,EAAE,EAAEf;;IACpD,CAAC;IAED,+CAA+C;IAC/C,OAAOM,YAAAA,MAAAA,KAAAA,GAAY,qBAAGS;AACxB,EAAC"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { update, updateMany, updateWith } from "./update.js";
|
|
3
|
-
var inc = function(x) {
|
|
4
|
-
return x + 1;
|
|
5
|
-
};
|
|
6
|
-
test("update", function(t) {
|
|
7
|
-
t.deepEqual(update({
|
|
8
|
-
test: "changed"
|
|
9
|
-
}, {
|
|
10
|
-
test: "Lorem Ipsum"
|
|
11
|
-
}), {
|
|
12
|
-
test: "changed"
|
|
13
|
-
}, "Updating existing property should return changed object");
|
|
14
|
-
t.deepEqual(update({
|
|
15
|
-
test: inc
|
|
16
|
-
})({
|
|
17
|
-
test: 2
|
|
18
|
-
}), {
|
|
19
|
-
test: 3
|
|
20
|
-
}, "Updating existing property with function should return changed object");
|
|
21
|
-
t.deepEqual(update({
|
|
22
|
-
notExist: 2
|
|
23
|
-
}, {
|
|
24
|
-
test: "Lorem Ipsum"
|
|
25
|
-
}), {
|
|
26
|
-
test: "Lorem Ipsum",
|
|
27
|
-
notExist: 2
|
|
28
|
-
}, "Updating non-existing property should return changed object");
|
|
29
|
-
t.deepEqual(update({
|
|
30
|
-
test: function(input, item) {
|
|
31
|
-
return "".concat(input, " ").concat(item.foo);
|
|
32
|
-
}
|
|
33
|
-
}, {
|
|
34
|
-
foo: "bar",
|
|
35
|
-
test: "Lorem Ipsum"
|
|
36
|
-
}), {
|
|
37
|
-
foo: "bar",
|
|
38
|
-
test: "Lorem Ipsum bar"
|
|
39
|
-
}, "Updating existing property based on other field should return changed object");
|
|
40
|
-
t.end();
|
|
41
|
-
});
|
|
42
|
-
test("updateMany", function(t) {
|
|
43
|
-
t.deepEqual(updateMany({
|
|
44
|
-
id: function() {
|
|
45
|
-
var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
46
|
-
return input + 1;
|
|
47
|
-
}
|
|
48
|
-
}, [
|
|
49
|
-
{
|
|
50
|
-
id: 1
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 2
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
test: "dolor"
|
|
57
|
-
}
|
|
58
|
-
]), [
|
|
59
|
-
{
|
|
60
|
-
id: 2
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 3
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 1,
|
|
67
|
-
test: "dolor"
|
|
68
|
-
}
|
|
69
|
-
], "Updating existing and unexisting properties should return changed object");
|
|
70
|
-
t.end();
|
|
71
|
-
});
|
|
72
|
-
test("updateWith", function(t) {
|
|
73
|
-
t.deepEqual(updateWith({
|
|
74
|
-
id: 2
|
|
75
|
-
}, {
|
|
76
|
-
count: inc,
|
|
77
|
-
other: 2
|
|
78
|
-
}, [
|
|
79
|
-
{
|
|
80
|
-
id: 1
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: 2,
|
|
84
|
-
count: 1
|
|
85
|
-
}
|
|
86
|
-
]), [
|
|
87
|
-
{
|
|
88
|
-
id: 1
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 2,
|
|
92
|
-
count: 2,
|
|
93
|
-
other: 2
|
|
94
|
-
}
|
|
95
|
-
], "Mutating item inside array should return new array with changed object");
|
|
96
|
-
t.end();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=update.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/update/update.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { update, updateMany, updateWith } from \"./update.js\"\n\nconst inc = x => x + 1\n\ntest(\"update\", t => {\n t.deepEqual(\n update({ test: \"changed\" }, { test: \"Lorem Ipsum\" }),\n { test: \"changed\" },\n \"Updating existing property should return changed object\"\n )\n\n t.deepEqual(\n update({ test: inc })({ test: 2 }),\n { test: 3 },\n \"Updating existing property with function should return changed object\"\n )\n\n t.deepEqual(\n update({ notExist: 2 }, { test: \"Lorem Ipsum\" }),\n { test: \"Lorem Ipsum\", notExist: 2 },\n \"Updating non-existing property should return changed object\"\n )\n\n t.deepEqual(\n update(\n {\n test: (input, item) => `${input} ${item.foo}`,\n },\n {\n foo: \"bar\",\n test: \"Lorem Ipsum\",\n }\n ),\n {\n foo: \"bar\",\n test: \"Lorem Ipsum bar\",\n },\n \"Updating existing property based on other field should return changed object\"\n )\n\n t.end()\n})\n\ntest(\"updateMany\", t => {\n t.deepEqual(\n updateMany(\n {\n id: (input = 0) => input + 1,\n },\n [{ id: 1 }, { id: 2 }, { test: \"dolor\" }]\n ),\n [{ id: 2 }, { id: 3 }, { id: 1, test: \"dolor\" }],\n \"Updating existing and unexisting properties should return changed object\"\n )\n\n t.end()\n})\n\ntest(\"updateWith\", t => {\n t.deepEqual(\n updateWith(\n {\n id: 2,\n },\n {\n count: inc,\n other: 2,\n },\n [{ id: 1 }, { id: 2, count: 1 }]\n ),\n [{ id: 1 }, { id: 2, count: 2, other: 2 }],\n \"Mutating item inside array should return new array with changed object\"\n )\n\n t.end()\n})\n"],"names":["test","update","updateMany","updateWith","inc","x","t","deepEqual","notExist","input","item","foo","end","id","count","other"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,MAAM,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAa;AAE5D,IAAMC,MAAMC,SAAAA;WAAKA,IAAI;;AAErBL,KAAK,UAAUM,SAAAA,GAAK;IAClBA,EAAEC,SAAS,CACTN,OAAO;QAAED,MAAM;IAAU,GAAG;QAAEA,MAAM;IAAc,IAClD;QAAEA,MAAM;IAAU,GAClB;IAGFM,EAAEC,SAAS,CACTN,OAAO;QAAED,MAAMI;IAAI,GAAG;QAAEJ,MAAM;IAAE,IAChC;QAAEA,MAAM;IAAE,GACV;IAGFM,EAAEC,SAAS,CACTN,OAAO;QAAEO,UAAU;IAAE,GAAG;QAAER,MAAM;IAAc,IAC9C;QAAEA,MAAM;QAAeQ,UAAU;IAAE,GACnC;IAGFF,EAAEC,SAAS,CACTN,OACE;QACED,MAAM,SAACS,OAAOC;mBAAS,AAAC,GAAWA,OAATD,OAAM,KAAY,OAATC,KAAKC,GAAG;;IAC7C,GACA;QACEA,KAAK;QACLX,MAAM;IACR,IAEF;QACEW,KAAK;QACLX,MAAM;IACR,GACA;IAGFM,EAAEM,GAAG;AACP;AAEAZ,KAAK,cAAcM,SAAAA,GAAK;IACtBA,EAAEC,SAAS,CACTL,WACE;QACEW,IAAI;gBAACJ,yEAAQ;mBAAMA,QAAQ;;IAC7B,GACA;QAAC;YAAEI,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;QAAG;YAAEb,MAAM;QAAQ;KAAE,GAE3C;QAAC;YAAEa,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;QAAG;YAAEA,IAAI;YAAGb,MAAM;QAAQ;KAAE,EAChD;IAGFM,EAAEM,GAAG;AACP;AAEAZ,KAAK,cAAcM,SAAAA,GAAK;IACtBA,EAAEC,SAAS,CACTJ,WACE;QACEU,IAAI;IACN,GACA;QACEC,OAAOV;QACPW,OAAO;IACT,GACA;QAAC;YAAEF,IAAI;QAAE;QAAG;YAAEA,IAAI;YAAGC,OAAO;QAAE;KAAE,GAElC;QAAC;YAAED,IAAI;QAAE;QAAG;YAAEA,IAAI;YAAGC,OAAO;YAAGC,OAAO;QAAE;KAAE,EAC1C;IAGFT,EAAEM,GAAG;AACP"}
|
package/dist/upsert/upsert.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
|
-
import { findIndexWith } from "../find-index/find-index.js";
|
|
3
|
-
import { update } from "../update/update.js";
|
|
4
|
-
var upsertWith = function(filter, value) {
|
|
5
|
-
return function(input) {
|
|
6
|
-
var result = _to_consumable_array(input);
|
|
7
|
-
var index = findIndexWith(filter, input);
|
|
8
|
-
if (index === -1) {
|
|
9
|
-
result.push(update(value, {}));
|
|
10
|
-
} else {
|
|
11
|
-
var previous = result[index];
|
|
12
|
-
result.splice(index, 1, update(value, previous));
|
|
13
|
-
}
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export { upsertWith };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=upsert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/upsert/upsert.js"],"sourcesContent":["import { findIndexWith } from \"../find-index/find-index.js\"\nimport { update } from \"../update/update.js\"\n\nconst upsertWith = (filter, value) => input => {\n const result = [...input]\n const index = findIndexWith(filter, input)\n\n if (index === -1) {\n result.push(update(value, {}))\n } else {\n const previous = result[index]\n\n result.splice(index, 1, update(value, previous))\n }\n\n return result\n}\n\nexport { upsertWith }\n"],"names":["findIndexWith","update","upsertWith","filter","value","input","result","index","push","previous","splice"],"mappings":"AAAA;AAAA,SAASA,aAAa,QAAQ,8BAA6B;AAC3D,SAASC,MAAM,QAAQ,sBAAqB;AAE5C,IAAMC,aAAa,SAACC,QAAQC;WAAUC,SAAAA,OAAS;QAC7C,IAAMC,SAAU,qBAAGD;QACnB,IAAME,QAAQP,cAAcG,QAAQE;QAEpC,IAAIE,UAAU,CAAC,GAAG;YAChBD,OAAOE,IAAI,CAACP,OAAOG,OAAO,CAAC;QAC7B,OAAO;YACL,IAAMK,WAAWH,MAAM,CAACC,MAAM;YAE9BD,OAAOI,MAAM,CAACH,OAAO,GAAGN,OAAOG,OAAOK;QACxC,CAAC;QAED,OAAOH;IACT;;AAEA,SAASJ,UAAU,GAAE"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { upsertWith } from "./upsert.js";
|
|
3
|
-
test("upsertWith", function(t) {
|
|
4
|
-
t.deepEquals(upsertWith({
|
|
5
|
-
id: 2
|
|
6
|
-
}, {
|
|
7
|
-
id: 2,
|
|
8
|
-
foo: "bar"
|
|
9
|
-
})([
|
|
10
|
-
{}
|
|
11
|
-
]), [
|
|
12
|
-
{},
|
|
13
|
-
{
|
|
14
|
-
id: 2,
|
|
15
|
-
foo: "bar"
|
|
16
|
-
}
|
|
17
|
-
], "Add if doesnt exist");
|
|
18
|
-
t.deepEquals(upsertWith({
|
|
19
|
-
id: 2
|
|
20
|
-
}, {
|
|
21
|
-
id: 2,
|
|
22
|
-
title: function(input) {
|
|
23
|
-
return "".concat(input, " ipsum");
|
|
24
|
-
},
|
|
25
|
-
foo: "bar"
|
|
26
|
-
})([
|
|
27
|
-
{
|
|
28
|
-
id: 2,
|
|
29
|
-
title: "lorem"
|
|
30
|
-
}
|
|
31
|
-
]), [
|
|
32
|
-
{
|
|
33
|
-
id: 2,
|
|
34
|
-
title: "lorem ipsum",
|
|
35
|
-
foo: "bar"
|
|
36
|
-
}
|
|
37
|
-
], "Update value if exists");
|
|
38
|
-
t.deepEquals(upsertWith({
|
|
39
|
-
id: 1
|
|
40
|
-
}, {
|
|
41
|
-
id: 1,
|
|
42
|
-
title: function(input) {
|
|
43
|
-
return "".concat(input, " ipsum");
|
|
44
|
-
}
|
|
45
|
-
})([
|
|
46
|
-
{
|
|
47
|
-
id: 2
|
|
48
|
-
}
|
|
49
|
-
]), [
|
|
50
|
-
{
|
|
51
|
-
id: 2
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 1,
|
|
55
|
-
title: "undefined ipsum"
|
|
56
|
-
}
|
|
57
|
-
], "Update value if exists");
|
|
58
|
-
t.end();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=upsert.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/upsert/upsert.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { upsertWith } from \"./upsert.js\"\n\ntest(\"upsertWith\", t => {\n t.deepEquals(\n upsertWith({ id: 2 }, { id: 2, foo: \"bar\" })([{}]),\n [{}, { id: 2, foo: \"bar\" }],\n \"Add if doesnt exist\"\n )\n\n t.deepEquals(\n upsertWith(\n { id: 2 },\n { id: 2, title: input => `${input} ipsum`, foo: \"bar\" }\n )([{ id: 2, title: \"lorem\" }]),\n [{ id: 2, title: \"lorem ipsum\", foo: \"bar\" }],\n \"Update value if exists\"\n )\n\n t.deepEquals(\n upsertWith(\n { id: 1 },\n { id: 1, title: input => `${input} ipsum` }\n )([{ id: 2 }]),\n [{ id: 2 }, { id: 1, title: \"undefined ipsum\" }],\n \"Update value if exists\"\n )\n\n t.end()\n})\n"],"names":["test","upsertWith","t","deepEquals","id","foo","title","input","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,UAAU,QAAQ,cAAa;AAExCD,KAAK,cAAcE,SAAAA,GAAK;IACtBA,EAAEC,UAAU,CACVF,WAAW;QAAEG,IAAI;IAAE,GAAG;QAAEA,IAAI;QAAGC,KAAK;IAAM,GAAG;QAAC,CAAC;KAAE,GACjD;QAAC,CAAC;QAAG;YAAED,IAAI;YAAGC,KAAK;QAAM;KAAE,EAC3B;IAGFH,EAAEC,UAAU,CACVF,WACE;QAAEG,IAAI;IAAE,GACR;QAAEA,IAAI;QAAGE,OAAOC,SAAAA;mBAAS,AAAC,GAAQ,OAANA,OAAM;;QAASF,KAAK;IAAM,GACtD;QAAC;YAAED,IAAI;YAAGE,OAAO;QAAQ;KAAE,GAC7B;QAAC;YAAEF,IAAI;YAAGE,OAAO;YAAeD,KAAK;QAAM;KAAE,EAC7C;IAGFH,EAAEC,UAAU,CACVF,WACE;QAAEG,IAAI;IAAE,GACR;QAAEA,IAAI;QAAGE,OAAOC,SAAAA;mBAAS,AAAC,GAAQ,OAANA,OAAM;;IAAQ,GAC1C;QAAC;YAAEH,IAAI;QAAE;KAAE,GACb;QAAC;YAAEA,IAAI;QAAE;QAAG;YAAEA,IAAI;YAAGE,OAAO;QAAkB;KAAE,EAChD;IAGFJ,EAAEM,GAAG;AACP"}
|
package/dist/values/values.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get list with names of all own properties
|
|
3
|
-
*
|
|
4
|
-
* @param {Array|Object} input Array or Object to extract values from
|
|
5
|
-
*
|
|
6
|
-
* @returns {string[]} List of property names
|
|
7
|
-
*
|
|
8
|
-
* @name values
|
|
9
|
-
* @tag Array,Object
|
|
10
|
-
* @signature (source: Array|Object): string[]
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* values(["lorem", "ipsum"])
|
|
14
|
-
* // => ["lorem", "ipsum"]
|
|
15
|
-
*
|
|
16
|
-
* values({ foo: "bar", lorem: "ipsum"})
|
|
17
|
-
* // => ["bar", "ipsum"]
|
|
18
|
-
*
|
|
19
|
-
* values("foo"), values(12), values(null), etc
|
|
20
|
-
* // => []
|
|
21
|
-
*/ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
22
|
-
export var values = function(input) {
|
|
23
|
-
var type = Array.isArray(input) ? "array" : input !== null && typeof input === "object" ? "object" : "other";
|
|
24
|
-
switch(type){
|
|
25
|
-
case "array":
|
|
26
|
-
{
|
|
27
|
-
return _to_consumable_array(input);
|
|
28
|
-
}
|
|
29
|
-
case "object":
|
|
30
|
-
{
|
|
31
|
-
var entries = Object.entries(input);
|
|
32
|
-
var result = [];
|
|
33
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
34
|
-
try {
|
|
35
|
-
for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
36
|
-
var entry = _step.value;
|
|
37
|
-
result.push(entry[1]);
|
|
38
|
-
}
|
|
39
|
-
} catch (err) {
|
|
40
|
-
_didIteratorError = true;
|
|
41
|
-
_iteratorError = err;
|
|
42
|
-
} finally{
|
|
43
|
-
try {
|
|
44
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
45
|
-
_iterator.return();
|
|
46
|
-
}
|
|
47
|
-
} finally{
|
|
48
|
-
if (_didIteratorError) {
|
|
49
|
-
throw _iteratorError;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
default:
|
|
56
|
-
return [];
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=values.js.map
|