@asd14/m 8.0.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
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/* eslint-disable new-cap */ import test from "tape";
|
|
2
|
-
import { splitInGroupsOf } from "./split-in-groups-of.js";
|
|
3
|
-
test("splitInGroupsOf", function(t) {
|
|
4
|
-
t.deepEqual(splitInGroupsOf(2)([
|
|
5
|
-
1,
|
|
6
|
-
2,
|
|
7
|
-
3,
|
|
8
|
-
4
|
|
9
|
-
]), [
|
|
10
|
-
[
|
|
11
|
-
1,
|
|
12
|
-
2
|
|
13
|
-
],
|
|
14
|
-
[
|
|
15
|
-
3,
|
|
16
|
-
4
|
|
17
|
-
],
|
|
18
|
-
], "given [array of size 4, split by size 2] should [return array with 2 sub-arrays, both of size 2]");
|
|
19
|
-
t.deepEqual(splitInGroupsOf(3, [
|
|
20
|
-
1,
|
|
21
|
-
2,
|
|
22
|
-
3,
|
|
23
|
-
4
|
|
24
|
-
]), [
|
|
25
|
-
[
|
|
26
|
-
1,
|
|
27
|
-
2,
|
|
28
|
-
3
|
|
29
|
-
],
|
|
30
|
-
[
|
|
31
|
-
4
|
|
32
|
-
]
|
|
33
|
-
], "given [array of size 4, split by size 3] should [return array with 2 sub-arrays, one of size 3, other of size 1]");
|
|
34
|
-
t.deepEqual(splitInGroupsOf(4, [
|
|
35
|
-
1,
|
|
36
|
-
2,
|
|
37
|
-
3,
|
|
38
|
-
4
|
|
39
|
-
]), [
|
|
40
|
-
[
|
|
41
|
-
1,
|
|
42
|
-
2,
|
|
43
|
-
3,
|
|
44
|
-
4
|
|
45
|
-
]
|
|
46
|
-
], "given [array of size 4, split by size 4] should [return array with 1 sub-array, one of size 4]");
|
|
47
|
-
t.deepEqual(splitInGroupsOf(4, [
|
|
48
|
-
1,
|
|
49
|
-
2,
|
|
50
|
-
3,
|
|
51
|
-
4
|
|
52
|
-
]), [
|
|
53
|
-
[
|
|
54
|
-
1,
|
|
55
|
-
2,
|
|
56
|
-
3,
|
|
57
|
-
4
|
|
58
|
-
]
|
|
59
|
-
], "given [array of size 4, split by size 10] should [return array with 1 sub-array, one of size 4]");
|
|
60
|
-
t.deepEqual(splitInGroupsOf(4, [
|
|
61
|
-
1,
|
|
62
|
-
2,
|
|
63
|
-
3,
|
|
64
|
-
4
|
|
65
|
-
]), [
|
|
66
|
-
[
|
|
67
|
-
1,
|
|
68
|
-
2,
|
|
69
|
-
3,
|
|
70
|
-
4
|
|
71
|
-
]
|
|
72
|
-
], "given [array of size 4, split by size 10] should [return array with 1 sub-array, one of size 4]");
|
|
73
|
-
t.throws(function() {
|
|
74
|
-
return splitInGroupsOf(0, [
|
|
75
|
-
1,
|
|
76
|
-
2,
|
|
77
|
-
3,
|
|
78
|
-
4
|
|
79
|
-
]);
|
|
80
|
-
}, "Error: splitInGroupsOf - invalid 'size' parameter value '0'. 'size' value should be a positive, non-zero, integer.", "given [array of size 4, split by size 0] shold [throw]");
|
|
81
|
-
t.throws(function() {
|
|
82
|
-
return splitInGroupsOf(2, 2);
|
|
83
|
-
}, "TypeError: splitInGroupsOf - invalid 'source' parameter type 'number'. 'source' type should be Array.", "given [non-array source] shold [throw]");
|
|
84
|
-
t.end();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
//# sourceMappingURL=split-in-groups-of.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/split-in-groups-of/split-in-groups-of.test.js"],"sourcesContent":["/* eslint-disable new-cap */\n\nimport test from \"tape\"\n\nimport { splitInGroupsOf } from \"./split-in-groups-of.js\"\n\ntest(\"splitInGroupsOf\", t => {\n t.deepEqual(\n splitInGroupsOf(2)([1, 2, 3, 4]),\n [\n [1, 2],\n [3, 4],\n ],\n \"given [array of size 4, split by size 2] should [return array with 2 sub-arrays, both of size 2]\"\n )\n\n t.deepEqual(\n splitInGroupsOf(3, [1, 2, 3, 4]),\n [[1, 2, 3], [4]],\n \"given [array of size 4, split by size 3] should [return array with 2 sub-arrays, one of size 3, other of size 1]\"\n )\n\n t.deepEqual(\n splitInGroupsOf(4, [1, 2, 3, 4]),\n [[1, 2, 3, 4]],\n \"given [array of size 4, split by size 4] should [return array with 1 sub-array, one of size 4]\"\n )\n\n t.deepEqual(\n splitInGroupsOf(4, [1, 2, 3, 4]),\n [[1, 2, 3, 4]],\n \"given [array of size 4, split by size 10] should [return array with 1 sub-array, one of size 4]\"\n )\n\n t.deepEqual(\n splitInGroupsOf(4, [1, 2, 3, 4]),\n [[1, 2, 3, 4]],\n \"given [array of size 4, split by size 10] should [return array with 1 sub-array, one of size 4]\"\n )\n\n t.throws(\n () => splitInGroupsOf(0, [1, 2, 3, 4]),\n \"Error: splitInGroupsOf - invalid 'size' parameter value '0'. 'size' value should be a positive, non-zero, integer.\",\n \"given [array of size 4, split by size 0] shold [throw]\"\n )\n\n t.throws(\n () => splitInGroupsOf(2, 2),\n \"TypeError: splitInGroupsOf - invalid 'source' parameter type 'number'. 'source' type should be Array.\",\n \"given [non-array source] shold [throw]\"\n )\n\n t.end()\n})\n"],"names":["test","splitInGroupsOf","t","deepEqual","throws","end"],"mappings":"AAAA,0BAA0B,GAE1B,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,eAAe,QAAQ,yBAAyB,CAAA;AAEzDD,IAAI,CAAC,iBAAiB,EAAEE,SAAAA,CAAC,EAAI;IAC3BA,CAAC,CAACC,SAAS,CACTF,eAAe,CAAC,CAAC,CAAC,CAAC;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EAChC;QACE;AAAC,aAAC;AAAE,aAAC;SAAC;QACN;AAAC,aAAC;AAAE,aAAC;SAAC;KACP,EACD,kGAAkG,CACnG;IAEDC,CAAC,CAACC,SAAS,CACTF,eAAe,CAAC,CAAC,EAAE;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EAChC;QAAC;AAAC,aAAC;AAAE,aAAC;AAAE,aAAC;SAAC;QAAE;AAAC,aAAC;SAAC;KAAC,EAChB,kHAAkH,CACnH;IAEDC,CAAC,CAACC,SAAS,CACTF,eAAe,CAAC,CAAC,EAAE;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EAChC;QAAC;AAAC,aAAC;AAAE,aAAC;AAAE,aAAC;AAAE,aAAC;SAAC;KAAC,EACd,gGAAgG,CACjG;IAEDC,CAAC,CAACC,SAAS,CACTF,eAAe,CAAC,CAAC,EAAE;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EAChC;QAAC;AAAC,aAAC;AAAE,aAAC;AAAE,aAAC;AAAE,aAAC;SAAC;KAAC,EACd,iGAAiG,CAClG;IAEDC,CAAC,CAACC,SAAS,CACTF,eAAe,CAAC,CAAC,EAAE;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EAChC;QAAC;AAAC,aAAC;AAAE,aAAC;AAAE,aAAC;AAAE,aAAC;SAAC;KAAC,EACd,iGAAiG,CAClG;IAEDC,CAAC,CAACE,MAAM,CACN;eAAMH,eAAe,CAAC,CAAC,EAAE;AAAC,aAAC;AAAE,aAAC;AAAE,aAAC;AAAE,aAAC;SAAC,CAAC;KAAA,EACtC,oHAAoH,EACpH,wDAAwD,CACzD;IAEDC,CAAC,CAACE,MAAM,CACN;eAAMH,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;KAAA,EAC3B,uGAAuG,EACvG,wCAAwC,CACzC;IAEDC,CAAC,CAACG,GAAG,EAAE;AACT,CAAC,CAAC"}
|
package/dist/spy/spy.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { is } from "../is/is.js";
|
|
2
|
-
/**
|
|
3
|
-
* Proxy input and print to console.log. Useful for debugging pipe chains.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} props
|
|
6
|
-
* @param {any} source
|
|
7
|
-
*
|
|
8
|
-
* @returns {any}
|
|
9
|
-
*
|
|
10
|
-
* @name spy
|
|
11
|
-
* @tag Other
|
|
12
|
-
* @signature (...props: any) => (source: any): any
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
*/ export var spy = function() {
|
|
16
|
-
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
17
|
-
return function() {
|
|
18
|
-
for(var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++){
|
|
19
|
-
input[_key] = arguments[_key];
|
|
20
|
-
}
|
|
21
|
-
if (input.length > 1) {
|
|
22
|
-
throw new Error("@asd14/m/spy - Can only be called with 1 parameter, received ".concat(input.length));
|
|
23
|
-
}
|
|
24
|
-
var _description = props.description, description = _description === void 0 ? "@asd14/m/spy" : _description, transform = props.transform;
|
|
25
|
-
var spyValue = is(transform) ? transform(input[0]) : input[0];
|
|
26
|
-
console.log();
|
|
27
|
-
console.log("// ".concat(description));
|
|
28
|
-
console.log();
|
|
29
|
-
/* eslint-disable unicorn/no-null */ console.log(JSON.stringify(spyValue, null, 2));
|
|
30
|
-
// Make sure we're just proxying input
|
|
31
|
-
return input[0];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=spy.js.map
|
package/dist/spy/spy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/spy/spy.js"],"sourcesContent":["import { is } from \"../is/is.js\"\n\n/**\n * Proxy input and print to console.log. Useful for debugging pipe chains.\n *\n * @param {Object} props\n * @param {any} source\n *\n * @returns {any}\n *\n * @name spy\n * @tag Other\n * @signature (...props: any) => (source: any): any\n *\n * @example\n */\nexport const spy =\n (props = {}) =>\n (...input) => {\n if (input.length > 1) {\n throw new Error(\n `@asd14/m/spy - Can only be called with 1 parameter, received ${input.length}`\n )\n }\n\n const { description = \"@asd14/m/spy\", transform } = props\n\n const spyValue = is(transform) ? transform(input[0]) : input[0]\n\n console.log()\n console.log(`// ${description}`)\n console.log()\n\n /* eslint-disable unicorn/no-null */\n console.log(JSON.stringify(spyValue, null, 2))\n\n // Make sure we're just proxying input\n return input[0]\n }\n"],"names":["is","spy","props","input","length","Error","description","transform","spyValue","console","log","JSON","stringify"],"mappings":"AAAA,SAASA,EAAE,QAAQ,aAAa,CAAA;AAEhC;;;;;;;;;;;;;CAaC,GACD,OAAO,IAAMC,GAAG,GACd;QAACC,KAAK,oEAAG,EAAE;WACX,WAAc;yCAAVC,KAAK;YAALA,KAAK;;QACP,IAAIA,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,IAAIC,KAAK,CACb,AAAC,+DAA6D,CAAe,MAAA,CAAbF,KAAK,CAACC,MAAM,CAAE,CAC/E,CAAA;QACH,CAAC;QAED,mBAAoDF,KAAK,CAAjDI,WAAW,EAAXA,WAAW,6BAAG,cAAc,eAAA,EAAEC,SAAS,GAAKL,KAAK,CAAnBK,SAAS,AAAU;QAEzD,IAAMC,QAAQ,GAAGR,EAAE,CAACO,SAAS,CAAC,GAAGA,SAAS,CAACJ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC;QAE/DM,OAAO,CAACC,GAAG,EAAE;QACbD,OAAO,CAACC,GAAG,CAAC,AAAC,KAAG,CAAc,MAAA,CAAZJ,WAAW,CAAE,CAAC;QAChCG,OAAO,CAACC,GAAG,EAAE;QAEb,kCAAkC,GAClCD,OAAO,CAACC,GAAG,CAACC,IAAI,CAACC,SAAS,CAACJ,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE9C,sCAAsC;QACtC,OAAOL,KAAK,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;CAAA,CAAA"}
|
package/dist/spy/spy.test.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* eslint-disable new-cap */ import test from "tape";
|
|
2
|
-
import { pipe } from "../pipe/pipe.js";
|
|
3
|
-
import { top } from "../top/top.js";
|
|
4
|
-
import { spy } from "./spy.js";
|
|
5
|
-
var example = [
|
|
6
|
-
{
|
|
7
|
-
id: 1
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
id: 2
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
id: "uuid"
|
|
14
|
-
}
|
|
15
|
-
];
|
|
16
|
-
test("spy", function(t) {
|
|
17
|
-
t.deepEqual(pipe(spy(), function(input) {
|
|
18
|
-
return input;
|
|
19
|
-
})(2), 2, "given [no arguments pipe] should [return initial source value]");
|
|
20
|
-
t.deepEqual(pipe(spy("test"), function(input) {
|
|
21
|
-
return input;
|
|
22
|
-
})(2), 2, "given [unary pipe] should [return initial source value]");
|
|
23
|
-
t.deepEqual(pipe(spy({
|
|
24
|
-
description: "First 2 items",
|
|
25
|
-
transform: top(2)
|
|
26
|
-
}), function(input) {
|
|
27
|
-
return input;
|
|
28
|
-
})(example), example, "given [slicing and transformations] should [return initial source value]");
|
|
29
|
-
t.throws(function() {
|
|
30
|
-
return pipe(spy("test"), function(input) {
|
|
31
|
-
return input;
|
|
32
|
-
})(2, 3);
|
|
33
|
-
}, "Error: @asd14/m/spy - Can only be called with 1 parameter, received 2", "given [multiple parameters when calling pipe] shold [throw since we cant proxy multiple values]");
|
|
34
|
-
t.end();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=spy.test.js.map
|
package/dist/spy/spy.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/spy/spy.test.js"],"sourcesContent":["/* eslint-disable new-cap */\n\nimport test from \"tape\"\n\nimport { pipe } from \"../pipe/pipe.js\"\nimport { top } from \"../top/top.js\"\nimport { spy } from \"./spy.js\"\n\nconst example = [{ id: 1 }, { id: 2 }, { id: \"uuid\" }]\n\ntest(\"spy\", t => {\n t.deepEqual(\n pipe(spy(), input => input)(2),\n 2,\n \"given [no arguments pipe] should [return initial source value]\"\n )\n\n t.deepEqual(\n pipe(spy(\"test\"), input => input)(2),\n 2,\n \"given [unary pipe] should [return initial source value]\"\n )\n\n t.deepEqual(\n pipe(\n spy({\n description: \"First 2 items\",\n transform: top(2),\n }),\n input => input\n )(example),\n example,\n \"given [slicing and transformations] should [return initial source value]\"\n )\n\n t.throws(\n () => pipe(spy(\"test\"), input => input)(2, 3),\n \"Error: @asd14/m/spy - Can only be called with 1 parameter, received 2\",\n \"given [multiple parameters when calling pipe] shold [throw since we cant proxy multiple values]\"\n )\n\n t.end()\n})\n"],"names":["test","pipe","top","spy","example","id","t","deepEqual","input","description","transform","throws","end"],"mappings":"AAAA,2BAA2B,GAE3B,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,IAAI,QAAQ,iBAAiB,CAAA;AACtC,SAASC,GAAG,QAAQ,eAAe,CAAA;AACnC,SAASC,GAAG,QAAQ,UAAU,CAAA;AAE9B,IAAMC,OAAO,GAAG;IAAC;QAAEC,EAAE,EAAE,CAAC;KAAE;IAAE;QAAEA,EAAE,EAAE,CAAC;KAAE;IAAE;QAAEA,EAAE,EAAE,MAAM;KAAE;CAAC;AAEtDL,IAAI,CAAC,KAAK,EAAEM,SAAAA,CAAC,EAAI;IACfA,CAAC,CAACC,SAAS,CACTN,IAAI,CAACE,GAAG,EAAE,EAAEK,SAAAA,KAAK;eAAIA,KAAK;KAAA,CAAC,CAAC,CAAC,CAAC,EAC9B,CAAC,EACD,gEAAgE,CACjE;IAEDF,CAAC,CAACC,SAAS,CACTN,IAAI,CAACE,GAAG,CAAC,MAAM,CAAC,EAAEK,SAAAA,KAAK;eAAIA,KAAK;KAAA,CAAC,CAAC,CAAC,CAAC,EACpC,CAAC,EACD,yDAAyD,CAC1D;IAEDF,CAAC,CAACC,SAAS,CACTN,IAAI,CACFE,GAAG,CAAC;QACFM,WAAW,EAAE,eAAe;QAC5BC,SAAS,EAAER,GAAG,CAAC,CAAC,CAAC;KAClB,CAAC,EACFM,SAAAA,KAAK;eAAIA,KAAK;KAAA,CACf,CAACJ,OAAO,CAAC,EACVA,OAAO,EACP,0EAA0E,CAC3E;IAEDE,CAAC,CAACK,MAAM,CACN;eAAMV,IAAI,CAACE,GAAG,CAAC,MAAM,CAAC,EAAEK,SAAAA,KAAK;mBAAIA,KAAK;SAAA,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KAAA,EAC7C,uEAAuE,EACvE,iGAAiG,CAClG;IAEDF,CAAC,CAACM,GAAG,EAAE;AACT,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { is } from "../is/is.js";
|
|
2
|
-
import { curry } from "../curry/curry.js";
|
|
3
|
-
var _startsWith = function(search, input) {
|
|
4
|
-
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
if (!is(search)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
return input.indexOf(search) === 0;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Test if string starts with substring
|
|
14
|
-
*
|
|
15
|
-
* @param {string|any} search
|
|
16
|
-
* @param {string|array} source
|
|
17
|
-
*
|
|
18
|
-
* @returns {boolean}
|
|
19
|
-
*
|
|
20
|
-
* @name startsWith
|
|
21
|
-
* @tag String
|
|
22
|
-
* @signature (search: string|any) => (source: string|Array): boolean
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* startsWith("lorem", "lorem ipsum")
|
|
26
|
-
* // => true
|
|
27
|
-
*
|
|
28
|
-
* startsWith("lorem", ["lorem", "ipsum"])
|
|
29
|
-
* // => true
|
|
30
|
-
*
|
|
31
|
-
* startsWith("dolor")("lorem ipsum")
|
|
32
|
-
* // false
|
|
33
|
-
*/ export var startsWith = curry(_startsWith);
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=starts-with.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/starts-with/starts-with.js"],"sourcesContent":["import { is } from \"../is/is.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _startsWith = (search, input) => {\n if (!(typeof input === \"string\" || Array.isArray(input))) {\n return false\n }\n\n if (!is(search)) {\n return false\n }\n\n return input.indexOf(search) === 0\n}\n\n/**\n * Test if string starts with substring\n *\n * @param {string|any} search\n * @param {string|array} source\n *\n * @returns {boolean}\n *\n * @name startsWith\n * @tag String\n * @signature (search: string|any) => (source: string|Array): boolean\n *\n * @example\n * startsWith(\"lorem\", \"lorem ipsum\")\n * // => true\n *\n * startsWith(\"lorem\", [\"lorem\", \"ipsum\"])\n * // => true\n *\n * startsWith(\"dolor\")(\"lorem ipsum\")\n * // false\n */\nexport const startsWith = curry(_startsWith)\n"],"names":["is","curry","_startsWith","search","input","Array","isArray","indexOf","startsWith"],"mappings":"AAAA,SAASA,EAAE,QAAQ,aAAa,CAAA;AAChC,SAASC,KAAK,QAAQ,mBAAmB,CAAA;AAEzC,IAAMC,WAAW,GAAG,SAACC,MAAM,EAAEC,KAAK,EAAK;IACrC,IAAI,CAAE,CAAA,OAAOA,KAAK,KAAK,QAAQ,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,CAAA,AAAC,EAAE;QACxD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,CAACJ,EAAE,CAACG,MAAM,CAAC,EAAE;QACf,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAOC,KAAK,CAACG,OAAO,CAACJ,MAAM,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,IAAMK,UAAU,GAAGP,KAAK,CAACC,WAAW,CAAC,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/no-null */ import test from "tape";
|
|
2
|
-
import { startsWith } from "./starts-with.js";
|
|
3
|
-
test("startsWith", function(t) {
|
|
4
|
-
t.equals(startsWith("lorem", "lorem ipsum"), true, "Source string starts with search string (uncurried)");
|
|
5
|
-
t.equals(startsWith("lorem")("lorem ipsum"), true, "Source string starts with search string (curried)");
|
|
6
|
-
t.equals(startsWith("ipsum")("lorem ipsum"), false, "Search string exists but not at starting");
|
|
7
|
-
t.equals(startsWith("lorem ipsum dolor")("lorem ipsum"), false, "Search string is longer than source string");
|
|
8
|
-
t.equals(startsWith("asd")("lorem ipsum"), false, "Search string does not exist in source");
|
|
9
|
-
t.equals(startsWith("lorem")([
|
|
10
|
-
"lorem",
|
|
11
|
-
"ipsum"
|
|
12
|
-
]), true, "Search item inside array");
|
|
13
|
-
t.equals(startsWith("lorem")([
|
|
14
|
-
"lorem",
|
|
15
|
-
"ipsum"
|
|
16
|
-
]), true, "Search in Array should returns true if the entry if its the exactly the first");
|
|
17
|
-
t.equals(startsWith("lorem")([
|
|
18
|
-
"loremipsum",
|
|
19
|
-
"ipsum"
|
|
20
|
-
]), false, "Search in Array should not return true if the entry if its just starting but not exactly the first");
|
|
21
|
-
t.equals(startsWith("")([
|
|
22
|
-
"lorem"
|
|
23
|
-
]), false, "Search in Array should returns false if searching for empty string");
|
|
24
|
-
t.equals(startsWith("lorem")([]), false, "Search in Array should returns false if empty");
|
|
25
|
-
t.equals(startsWith(null)([]), false, "Search in Array should returns false if empty, even if searching for null");
|
|
26
|
-
t.equals(startsWith(null)([
|
|
27
|
-
null
|
|
28
|
-
]), false, "Search null in Array should returns false, even if it matches the first entry");
|
|
29
|
-
t.equals(startsWith("lorem")(null), false, "Search null returns false");
|
|
30
|
-
t.equals(startsWith("lorem")(), false, "Search undefined returns false");
|
|
31
|
-
t.equals(startsWith("lorem")({
|
|
32
|
-
lorem: "lorem"
|
|
33
|
-
}), false, "Search in Object should returns false");
|
|
34
|
-
t.end();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=starts-with.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/starts-with/starts-with.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\nimport test from \"tape\"\n\nimport { startsWith } from \"./starts-with.js\"\n\ntest(\"startsWith\", t => {\n t.equals(\n startsWith(\"lorem\", \"lorem ipsum\"),\n true,\n \"Source string starts with search string (uncurried)\"\n )\n\n t.equals(\n startsWith(\"lorem\")(\"lorem ipsum\"),\n true,\n \"Source string starts with search string (curried)\"\n )\n\n t.equals(\n startsWith(\"ipsum\")(\"lorem ipsum\"),\n false,\n \"Search string exists but not at starting\"\n )\n\n t.equals(\n startsWith(\"lorem ipsum dolor\")(\"lorem ipsum\"),\n false,\n \"Search string is longer than source string\"\n )\n\n t.equals(\n startsWith(\"asd\")(\"lorem ipsum\"),\n false,\n \"Search string does not exist in source\"\n )\n\n t.equals(\n startsWith(\"lorem\")([\"lorem\", \"ipsum\"]),\n true,\n \"Search item inside array\"\n )\n\n t.equals(\n startsWith(\"lorem\")([\"lorem\", \"ipsum\"]),\n true,\n \"Search in Array should returns true if the entry if its the exactly the first\"\n )\n\n t.equals(\n startsWith(\"lorem\")([\"loremipsum\", \"ipsum\"]),\n false,\n \"Search in Array should not return true if the entry if its just starting but not exactly the first\"\n )\n\n t.equals(\n startsWith(\"\")([\"lorem\"]),\n false,\n \"Search in Array should returns false if searching for empty string\"\n )\n\n t.equals(\n startsWith(\"lorem\")([]),\n false,\n \"Search in Array should returns false if empty\"\n )\n\n t.equals(\n startsWith(null)([]),\n false,\n \"Search in Array should returns false if empty, even if searching for null\"\n )\n\n t.equals(\n startsWith(null)([null]),\n false,\n \"Search null in Array should returns false, even if it matches the first entry\"\n )\n\n t.equals(startsWith(\"lorem\")(null), false, \"Search null returns false\")\n\n t.equals(startsWith(\"lorem\")(), false, \"Search undefined returns false\")\n\n t.equals(\n startsWith(\"lorem\")({ lorem: \"lorem\" }),\n false,\n \"Search in Object should returns false\"\n )\n\n t.end()\n})\n"],"names":["test","startsWith","t","equals","lorem","end"],"mappings":"AAAA,kCAAkC,GAClC,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,UAAU,QAAQ,kBAAkB,CAAA;AAE7CD,IAAI,CAAC,YAAY,EAAEE,SAAAA,CAAC,EAAI;IACtBA,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,EAClC,IAAI,EACJ,qDAAqD,CACtD;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,EAClC,IAAI,EACJ,mDAAmD,CACpD;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,EAClC,KAAK,EACL,0CAA0C,CAC3C;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,mBAAmB,CAAC,CAAC,aAAa,CAAC,EAC9C,KAAK,EACL,4CAA4C,CAC7C;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,EAChC,KAAK,EACL,wCAAwC,CACzC;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,OAAO;QAAE,OAAO;KAAC,CAAC,EACvC,IAAI,EACJ,0BAA0B,CAC3B;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,OAAO;QAAE,OAAO;KAAC,CAAC,EACvC,IAAI,EACJ,+EAA+E,CAChF;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,YAAY;QAAE,OAAO;KAAC,CAAC,EAC5C,KAAK,EACL,oGAAoG,CACrG;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,EAAE,CAAC,CAAC;QAAC,OAAO;KAAC,CAAC,EACzB,KAAK,EACL,oEAAoE,CACrE;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EACvB,KAAK,EACL,+CAA+C,CAChD;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EACpB,KAAK,EACL,2EAA2E,CAC5E;IAEDC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,IAAI,CAAC,CAAC;QAAC,IAAI;KAAC,CAAC,EACxB,KAAK,EACL,+EAA+E,CAChF;IAEDC,CAAC,CAACC,MAAM,CAACF,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,2BAA2B,CAAC;IAEvEC,CAAC,CAACC,MAAM,CAACF,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,gCAAgC,CAAC;IAExEC,CAAC,CAACC,MAAM,CACNF,UAAU,CAAC,OAAO,CAAC,CAAC;QAAEG,KAAK,EAAE,OAAO;KAAE,CAAC,EACvC,KAAK,EACL,uCAAuC,CACxC;IAEDF,CAAC,CAACG,GAAG,EAAE;AACT,CAAC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a wrapper function that is invoked once every time interval, regardless
|
|
3
|
-
* of how many times is called.
|
|
4
|
-
*
|
|
5
|
-
* @param {Function} fn
|
|
6
|
-
* @param {Object} [props]
|
|
7
|
-
* @param {number} [props.wait=50] Time in milliseconds between "fn" invokations
|
|
8
|
-
* @param {boolean} [props.hasLastCall=false] If should call "fn" after wrapper is no longer called
|
|
9
|
-
*
|
|
10
|
-
* @returns {Function}
|
|
11
|
-
*
|
|
12
|
-
* @name throttle
|
|
13
|
-
* @tag Core
|
|
14
|
-
* @signature (fn: Function, { wait: number }): Function
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const thottledMouseMove = throttle(mouseMove, { wait: 100 })
|
|
18
|
-
*
|
|
19
|
-
* // render
|
|
20
|
-
* <input onMouseMove={thottledMouseMove} ... />
|
|
21
|
-
*/ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
22
|
-
var throttle = function(fn) {
|
|
23
|
-
var ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _wait = ref.wait, wait = _wait === void 0 ? 50 : _wait, _hasLastCall = ref.hasLastCall, hasLastCall = _hasLastCall === void 0 ? false : _hasLastCall;
|
|
24
|
-
var lastExecution = new Date(Date.now() - wait);
|
|
25
|
-
var finalRunTimer;
|
|
26
|
-
return function() {
|
|
27
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
28
|
-
params[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
var hasTimeWindowPassed = lastExecution.getTime() + wait <= Date.now();
|
|
31
|
-
// once every
|
|
32
|
-
if (hasTimeWindowPassed) {
|
|
33
|
-
lastExecution = new Date();
|
|
34
|
-
fn.apply(void 0, _to_consumable_array(params));
|
|
35
|
-
}
|
|
36
|
-
if (hasLastCall) {
|
|
37
|
-
clearTimeout(finalRunTimer);
|
|
38
|
-
finalRunTimer = setTimeout(function() {
|
|
39
|
-
lastExecution = new Date();
|
|
40
|
-
fn.apply(void 0, _to_consumable_array(params));
|
|
41
|
-
}, wait);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export { throttle };
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=throttle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/throttle/throttle.js"],"sourcesContent":["/**\n * Create a wrapper function that is invoked once every time interval, regardless\n * of how many times is called.\n *\n * @param {Function} fn\n * @param {Object} [props]\n * @param {number} [props.wait=50] Time in milliseconds between \"fn\" invokations\n * @param {boolean} [props.hasLastCall=false] If should call \"fn\" after wrapper is no longer called\n *\n * @returns {Function}\n *\n * @name throttle\n * @tag Core\n * @signature (fn: Function, { wait: number }): Function\n *\n * @example\n * const thottledMouseMove = throttle(mouseMove, { wait: 100 })\n *\n * // render\n * <input onMouseMove={thottledMouseMove} ... />\n */\nconst throttle = (fn, { wait = 50, hasLastCall = false } = {}) => {\n let lastExecution = new Date(Date.now() - wait)\n\n let finalRunTimer\n\n return (...params) => {\n const hasTimeWindowPassed = lastExecution.getTime() + wait <= Date.now()\n\n // once every\n if (hasTimeWindowPassed) {\n lastExecution = new Date()\n\n fn(...params)\n }\n\n if (hasLastCall) {\n clearTimeout(finalRunTimer)\n\n finalRunTimer = setTimeout(() => {\n lastExecution = new Date()\n\n fn(...params)\n }, wait)\n }\n }\n}\n\nexport { throttle }\n"],"names":["throttle","fn","wait","hasLastCall","lastExecution","Date","now","finalRunTimer","params","hasTimeWindowPassed","getTime","clearTimeout","setTimeout"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;CAoBC,GACD;AAAA,IAAMA,QAAQ,GAAG,SAACC,EAAE,EAA8C;+EAAP,EAAE,cAArCC,IAAI,EAAJA,IAAI,sBAAG,EAAE,QAAA,qBAAEC,WAAW,EAAXA,WAAW,6BAAG,KAAK,eAAA;IACpD,IAAIC,aAAa,GAAG,IAAIC,IAAI,CAACA,IAAI,CAACC,GAAG,EAAE,GAAGJ,IAAI,CAAC;IAE/C,IAAIK,aAAa;IAEjB,OAAO,WAAe;yCAAXC,MAAM;YAANA,MAAM;;QACf,IAAMC,mBAAmB,GAAGL,aAAa,CAACM,OAAO,EAAE,GAAGR,IAAI,IAAIG,IAAI,CAACC,GAAG,EAAE;QAExE,aAAa;QACb,IAAIG,mBAAmB,EAAE;YACvBL,aAAa,GAAG,IAAIC,IAAI,EAAE;YAE1BJ,EAAE,CAAFA,KAAa,CAAbA,KAAAA,CAAE,EAAC,qBAAGO,MAAM,CAANA,CAAO;QACf,CAAC;QAED,IAAIL,WAAW,EAAE;YACfQ,YAAY,CAACJ,aAAa,CAAC;YAE3BA,aAAa,GAAGK,UAAU,CAAC,WAAM;gBAC/BR,aAAa,GAAG,IAAIC,IAAI,EAAE;gBAE1BJ,EAAE,CAAFA,KAAa,CAAbA,KAAAA,CAAE,EAAC,qBAAGO,MAAM,CAANA,CAAO;YACf,CAAC,EAAEN,IAAI,CAAC;QACV,CAAC;IACH,CAAC,CAAA;AACH,CAAC;AAED,SAASF,QAAQ,GAAE"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { throttle } from "./throttle.js";
|
|
3
|
-
test("throttle", function(t) {
|
|
4
|
-
{
|
|
5
|
-
var callData = [];
|
|
6
|
-
var fn = function(input) {
|
|
7
|
-
return callData.push(input);
|
|
8
|
-
};
|
|
9
|
-
var throttledFn = throttle(fn);
|
|
10
|
-
for(var i = 0; i < 100; i++){
|
|
11
|
-
throttledFn(i);
|
|
12
|
-
}
|
|
13
|
-
setTimeout(function() {
|
|
14
|
-
t.deepEqual(callData, [
|
|
15
|
-
0
|
|
16
|
-
], "Calling throttled function 100 times should run it once - using default throttle props");
|
|
17
|
-
}, 100);
|
|
18
|
-
}
|
|
19
|
-
{
|
|
20
|
-
var callData1 = [];
|
|
21
|
-
var fn1 = function(input) {
|
|
22
|
-
return callData1.push(input);
|
|
23
|
-
};
|
|
24
|
-
var throttledFn1 = throttle(fn1, {
|
|
25
|
-
timeWindow: 50,
|
|
26
|
-
hasLastCall: true
|
|
27
|
-
});
|
|
28
|
-
for(var i1 = 0; i1 < 100; i1++){
|
|
29
|
-
throttledFn1(i1);
|
|
30
|
-
}
|
|
31
|
-
setTimeout(function() {
|
|
32
|
-
t.deepEqual(callData1, [
|
|
33
|
-
0,
|
|
34
|
-
99
|
|
35
|
-
], "Calling throttled function 100 times with lastCall enabled should run it twice - using custom throttle props");
|
|
36
|
-
t.end();
|
|
37
|
-
}, 100);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=throttle.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/throttle/throttle.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { throttle } from \"./throttle.js\"\n\ntest(\"throttle\", t => {\n {\n const callData = []\n const fn = input => callData.push(input)\n const throttledFn = throttle(fn)\n\n for (let i = 0; i < 100; i++) {\n throttledFn(i)\n }\n\n setTimeout(() => {\n t.deepEqual(\n callData,\n [0],\n \"Calling throttled function 100 times should run it once - using default throttle props\"\n )\n }, 100)\n }\n\n {\n const callData = []\n const fn = input => callData.push(input)\n const throttledFn = throttle(fn, {\n timeWindow: 50,\n hasLastCall: true,\n })\n\n for (let i = 0; i < 100; i++) {\n throttledFn(i)\n }\n\n setTimeout(() => {\n t.deepEqual(\n callData,\n [0, 99],\n \"Calling throttled function 100 times with lastCall enabled should run it twice - using custom throttle props\"\n )\n\n t.end()\n }, 100)\n }\n})\n"],"names":["test","throttle","t","callData","fn","input","push","throttledFn","i","setTimeout","deepEqual","timeWindow","hasLastCall","end"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,QAAQ,QAAQ,eAAe,CAAA;AAExCD,IAAI,CAAC,UAAU,EAAEE,SAAAA,CAAC,EAAI;IACpB;QACE,IAAMC,QAAQ,GAAG,EAAE;QACnB,IAAMC,EAAE,GAAGC,SAAAA,KAAK;mBAAIF,QAAQ,CAACG,IAAI,CAACD,KAAK,CAAC;SAAA;QACxC,IAAME,WAAW,GAAGN,QAAQ,CAACG,EAAE,CAAC;QAEhC,IAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,GAAG,EAAEA,CAAC,EAAE,CAAE;YAC5BD,WAAW,CAACC,CAAC,CAAC;QAChB,CAAC;QAEDC,UAAU,CAAC,WAAM;YACfP,CAAC,CAACQ,SAAS,CACTP,QAAQ,EACR;AAAC,iBAAC;aAAC,EACH,wFAAwF,CACzF;QACH,CAAC,EAAE,GAAG,CAAC;IACT;IAEA;QACE,IAAMA,SAAQ,GAAG,EAAE;QACnB,IAAMC,GAAE,GAAGC,SAAAA,KAAK;mBAAIF,SAAQ,CAACG,IAAI,CAACD,KAAK,CAAC;SAAA;QACxC,IAAME,YAAW,GAAGN,QAAQ,CAACG,GAAE,EAAE;YAC/BO,UAAU,EAAE,EAAE;YACdC,WAAW,EAAE,IAAI;SAClB,CAAC;QAEF,IAAK,IAAIJ,EAAC,GAAG,CAAC,EAAEA,EAAC,GAAG,GAAG,EAAEA,EAAC,EAAE,CAAE;YAC5BD,YAAW,CAACC,EAAC,CAAC;QAChB,CAAC;QAEDC,UAAU,CAAC,WAAM;YACfP,CAAC,CAACQ,SAAS,CACTP,SAAQ,EACR;AAAC,iBAAC;AAAE,kBAAE;aAAC,EACP,8GAA8G,CAC/G;YAEDD,CAAC,CAACW,GAAG,EAAE;QACT,CAAC,EAAE,GAAG,CAAC;IACT;AACF,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert string to lower case
|
|
3
|
-
*
|
|
4
|
-
* @param {string} input
|
|
5
|
-
*
|
|
6
|
-
* @returns {string}
|
|
7
|
-
*
|
|
8
|
-
* @name toLower
|
|
9
|
-
* @tag String
|
|
10
|
-
* @signature (source: string): string
|
|
11
|
-
*
|
|
12
|
-
* @see {@link toUpper}
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* toLower("Lorem Ipsum")
|
|
16
|
-
* // "lorem ipsum"
|
|
17
|
-
*/ export var toLower = function(input) {
|
|
18
|
-
return String.prototype.toLowerCase.call(input);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=to-lower.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/to-lower/to-lower.js"],"sourcesContent":["/**\n * Convert string to lower case\n *\n * @param {string} input\n *\n * @returns {string}\n *\n * @name toLower\n * @tag String\n * @signature (source: string): string\n *\n * @see {@link toUpper}\n *\n * @example\n * toLower(\"Lorem Ipsum\")\n * // \"lorem ipsum\"\n */\nexport const toLower = input => String.prototype.toLowerCase.call(input)\n"],"names":["toLower","input","String","prototype","toLowerCase","call"],"mappings":"AAAA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,IAAMA,OAAO,GAAGC,SAAAA,KAAK;WAAIC,MAAM,CAACC,SAAS,CAACC,WAAW,CAACC,IAAI,CAACJ,KAAK,CAAC;CAAA,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { toLower } from "./to-lower.js";
|
|
3
|
-
test("toLower", function(t) {
|
|
4
|
-
var input = "Lorem Opsum";
|
|
5
|
-
t.equals(toLower(input), "lorem opsum", "Convert chars into lowercase");
|
|
6
|
-
t.end();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=to-lower.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/to-lower/to-lower.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { toLower } from \"./to-lower.js\"\n\ntest(\"toLower\", t => {\n const input = \"Lorem Opsum\"\n\n t.equals(toLower(input), \"lorem opsum\", \"Convert chars into lowercase\")\n\n t.end()\n})\n"],"names":["test","toLower","t","input","equals","end"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,OAAO,QAAQ,eAAe,CAAA;AAEvCD,IAAI,CAAC,SAAS,EAAEE,SAAAA,CAAC,EAAI;IACnB,IAAMC,KAAK,GAAG,aAAa;IAE3BD,CAAC,CAACE,MAAM,CAACH,OAAO,CAACE,KAAK,CAAC,EAAE,aAAa,EAAE,8BAA8B,CAAC;IAEvED,CAAC,CAACG,GAAG,EAAE;AACT,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert string to upper case
|
|
3
|
-
*
|
|
4
|
-
* @param {string} input
|
|
5
|
-
*
|
|
6
|
-
* @returns {string}
|
|
7
|
-
*
|
|
8
|
-
* @name toUpper
|
|
9
|
-
* @tag String
|
|
10
|
-
* @signature (source: string): string
|
|
11
|
-
*
|
|
12
|
-
* @see {@link toLower}
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* toUpper("Lorem Ipsum")
|
|
16
|
-
* // "LOREM IPSUM"
|
|
17
|
-
*/ export var toUpper = function(input) {
|
|
18
|
-
return String.prototype.toUpperCase.call(input);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=to-upper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/to-upper/to-upper.js"],"sourcesContent":["/**\n * Convert string to upper case\n *\n * @param {string} input\n *\n * @returns {string}\n *\n * @name toUpper\n * @tag String\n * @signature (source: string): string\n *\n * @see {@link toLower}\n *\n * @example\n * toUpper(\"Lorem Ipsum\")\n * // \"LOREM IPSUM\"\n */\nexport const toUpper = input => String.prototype.toUpperCase.call(input)\n"],"names":["toUpper","input","String","prototype","toUpperCase","call"],"mappings":"AAAA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,IAAMA,OAAO,GAAGC,SAAAA,KAAK;WAAIC,MAAM,CAACC,SAAS,CAACC,WAAW,CAACC,IAAI,CAACJ,KAAK,CAAC;CAAA,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { toUpper } from "./to-upper.js";
|
|
3
|
-
test("toUpper", function(t) {
|
|
4
|
-
var input = "Lorem Opsum";
|
|
5
|
-
t.equals(toUpper(input), "LOREM OPSUM", "Convert chars into uppercase");
|
|
6
|
-
t.end();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=to-upper.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/to-upper/to-upper.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { toUpper } from \"./to-upper.js\"\n\ntest(\"toUpper\", t => {\n const input = \"Lorem Opsum\"\n\n t.equals(toUpper(input), \"LOREM OPSUM\", \"Convert chars into uppercase\")\n\n t.end()\n})\n"],"names":["test","toUpper","t","input","equals","end"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,OAAO,QAAQ,eAAe,CAAA;AAEvCD,IAAI,CAAC,SAAS,EAAEE,SAAAA,CAAC,EAAI;IACnB,IAAMC,KAAK,GAAG,aAAa;IAE3BD,CAAC,CAACE,MAAM,CAACH,OAAO,CAACE,KAAK,CAAC,EAAE,aAAa,EAAE,8BAA8B,CAAC;IAEvED,CAAC,CAACG,GAAG,EAAE;AACT,CAAC,CAAC"}
|
package/dist/toggle/toggle.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { curry } from "../curry/curry.js";
|
|
2
|
-
import { when } from "../when/when.js";
|
|
3
|
-
import { any } from "../any/any.js";
|
|
4
|
-
import { remove } from "../remove/remove.js";
|
|
5
|
-
import { push } from "../push/push.js";
|
|
6
|
-
var _toggle = function(element, input) {
|
|
7
|
-
if (input.length === 0) {
|
|
8
|
-
return [
|
|
9
|
-
element
|
|
10
|
-
];
|
|
11
|
-
}
|
|
12
|
-
return when(any(element), remove(element), push(element), input);
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Add element if not exists, remove otherwise
|
|
16
|
-
*
|
|
17
|
-
* @param {any} element
|
|
18
|
-
* @param {Array} source
|
|
19
|
-
*
|
|
20
|
-
* @returns {Array}
|
|
21
|
-
*
|
|
22
|
-
* @name toggle
|
|
23
|
-
* @tag Array
|
|
24
|
-
* @signature (element: any) => (source: Array): Array
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* toggle(1)([1, 2])
|
|
28
|
-
* // => [2]
|
|
29
|
-
*
|
|
30
|
-
* toggle(1, [2])
|
|
31
|
-
* // => [1, 2]
|
|
32
|
-
*/ var toggle = curry(_toggle);
|
|
33
|
-
export { toggle };
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=toggle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/toggle/toggle.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { when } from \"../when/when.js\"\nimport { any } from \"../any/any.js\"\nimport { remove } from \"../remove/remove.js\"\nimport { push } from \"../push/push.js\"\n\nconst _toggle = (element, input) => {\n if (input.length === 0) {\n return [element]\n }\n\n return when(any(element), remove(element), push(element), input)\n}\n\n/**\n * Add element if not exists, remove otherwise\n *\n * @param {any} element\n * @param {Array} source\n *\n * @returns {Array}\n *\n * @name toggle\n * @tag Array\n * @signature (element: any) => (source: Array): Array\n *\n * @example\n * toggle(1)([1, 2])\n * // => [2]\n *\n * toggle(1, [2])\n * // => [1, 2]\n */\nconst toggle = curry(_toggle)\n\nexport { toggle }\n"],"names":["curry","when","any","remove","push","_toggle","element","input","length","toggle"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAmB,CAAA;AACzC,SAASC,IAAI,QAAQ,iBAAiB,CAAA;AACtC,SAASC,GAAG,QAAQ,eAAe,CAAA;AACnC,SAASC,MAAM,QAAQ,qBAAqB,CAAA;AAC5C,SAASC,IAAI,QAAQ,iBAAiB,CAAA;AAEtC,IAAMC,OAAO,GAAG,SAACC,OAAO,EAAEC,KAAK,EAAK;IAClC,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO;YAACF,OAAO;SAAC,CAAA;IAClB,CAAC;IAED,OAAOL,IAAI,CAACC,GAAG,CAACI,OAAO,CAAC,EAAEH,MAAM,CAACG,OAAO,CAAC,EAAEF,IAAI,CAACE,OAAO,CAAC,EAAEC,KAAK,CAAC,CAAA;AAClE,CAAC;AAED;;;;;;;;;;;;;;;;;;CAkBC,GACD,IAAME,MAAM,GAAGT,KAAK,CAACK,OAAO,CAAC;AAE7B,SAASI,MAAM,GAAE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import test from "tape";
|
|
2
|
-
import { toggle } from "./toggle.js";
|
|
3
|
-
test("toggle", function(t) {
|
|
4
|
-
t.deepEqual(toggle(2, [
|
|
5
|
-
1,
|
|
6
|
-
2,
|
|
7
|
-
3
|
|
8
|
-
]), [
|
|
9
|
-
1,
|
|
10
|
-
3
|
|
11
|
-
], "Toggle/remove existing element in array");
|
|
12
|
-
t.deepEqual(toggle(2)([
|
|
13
|
-
1,
|
|
14
|
-
"2",
|
|
15
|
-
3
|
|
16
|
-
]), [
|
|
17
|
-
1,
|
|
18
|
-
"2",
|
|
19
|
-
3,
|
|
20
|
-
2
|
|
21
|
-
], "Toggle/add non-existing element in array");
|
|
22
|
-
t.deepEqual(toggle(2)([]), [
|
|
23
|
-
2
|
|
24
|
-
], "Toggle/add element in empty array");
|
|
25
|
-
t.end();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=toggle.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/toggle/toggle.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { toggle } from \"./toggle.js\"\n\ntest(\"toggle\", t => {\n t.deepEqual(\n toggle(2, [1, 2, 3]),\n [1, 3],\n \"Toggle/remove existing element in array\"\n )\n\n t.deepEqual(\n toggle(2)([1, \"2\", 3]),\n [1, \"2\", 3, 2],\n \"Toggle/add non-existing element in array\"\n )\n\n t.deepEqual(toggle(2)([]), [2], \"Toggle/add element in empty array\")\n\n t.end()\n})\n"],"names":["test","toggle","t","deepEqual","end"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM,CAAA;AAEvB,SAASC,MAAM,QAAQ,aAAa,CAAA;AAEpCD,IAAI,CAAC,QAAQ,EAAEE,SAAAA,CAAC,EAAI;IAClBA,CAAC,CAACC,SAAS,CACTF,MAAM,CAAC,CAAC,EAAE;AAAC,SAAC;AAAE,SAAC;AAAE,SAAC;KAAC,CAAC,EACpB;AAAC,SAAC;AAAE,SAAC;KAAC,EACN,yCAAyC,CAC1C;IAEDC,CAAC,CAACC,SAAS,CACTF,MAAM,CAAC,CAAC,CAAC,CAAC;AAAC,SAAC;QAAE,GAAG;AAAE,SAAC;KAAC,CAAC,EACtB;AAAC,SAAC;QAAE,GAAG;AAAE,SAAC;AAAE,SAAC;KAAC,EACd,0CAA0C,CAC3C;IAEDC,CAAC,CAACC,SAAS,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;AAAC,SAAC;KAAC,EAAE,mCAAmC,CAAC;IAEpEC,CAAC,CAACE,GAAG,EAAE;AACT,CAAC,CAAC"}
|
package/dist/top/top.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* eslint-disable jsdoc/check-param-names,jsdoc/require-param */ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
2
|
-
import { is } from "../is/is.js";
|
|
3
|
-
var topX = function(limit, input) {
|
|
4
|
-
return Array.isArray(input) || typeof input === "string" ? input.slice(0, is(limit) ? limit : -1) : [];
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Get all but last element from array
|
|
8
|
-
*
|
|
9
|
-
* @param {number} [limit=1] Item count
|
|
10
|
-
* @param {Array} source
|
|
11
|
-
*
|
|
12
|
-
* @returns {any}
|
|
13
|
-
*
|
|
14
|
-
* @name top
|
|
15
|
-
* @tag Array
|
|
16
|
-
* @signature (limit: number, source: Array): Array
|
|
17
|
-
* @signature (limit: number) => (source: Array): Array
|
|
18
|
-
* @signature (source: Array): Array
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* top([1, 2, 3])
|
|
22
|
-
* // => [1, 2]
|
|
23
|
-
*
|
|
24
|
-
* top([1]), top([])
|
|
25
|
-
* // => []
|
|
26
|
-
*
|
|
27
|
-
* top(2, [2, 3])
|
|
28
|
-
* // => [2, 3]
|
|
29
|
-
*
|
|
30
|
-
* top(2)([1, 2, 3])
|
|
31
|
-
* // => [2, 3]
|
|
32
|
-
*/ var top = function() {
|
|
33
|
-
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
34
|
-
params[_key] = arguments[_key];
|
|
35
|
-
}
|
|
36
|
-
/*
|
|
37
|
-
* @signature (limit: number) => (source: Array): Array
|
|
38
|
-
*
|
|
39
|
-
* top(2)([1, 2, 3, 4]) => [3, 4]
|
|
40
|
-
*/ if (params.length === 1 && typeof params[0] === "number") {
|
|
41
|
-
var _params = _sliced_to_array(params, 1), limit = _params[0];
|
|
42
|
-
return function(input) {
|
|
43
|
-
return topX(limit, input);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/*
|
|
47
|
-
* @signature (source: Array): Array
|
|
48
|
-
*
|
|
49
|
-
* top([1, 2, 3, 4]) => [2, 3, 4]
|
|
50
|
-
*/ if (params.length === 1) {
|
|
51
|
-
var _params1 = _sliced_to_array(params, 1), input = _params1[0];
|
|
52
|
-
return topX(undefined, input);
|
|
53
|
-
}
|
|
54
|
-
/*
|
|
55
|
-
* @signature (limit: number, source: Array): Array
|
|
56
|
-
*
|
|
57
|
-
* top(2, [1, 2, 3, 4]) => [3, 4]
|
|
58
|
-
*/ return topX(params[0], params[1]);
|
|
59
|
-
};
|
|
60
|
-
export { top };
|
|
61
|
-
|
|
62
|
-
//# sourceMappingURL=top.js.map
|
package/dist/top/top.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/top/top.js"],"sourcesContent":["/* eslint-disable jsdoc/check-param-names,jsdoc/require-param */\n\nimport { is } from \"../is/is.js\"\n\nconst topX = (limit, input) =>\n Array.isArray(input) || typeof input === \"string\"\n ? input.slice(0, is(limit) ? limit : -1)\n : []\n\n/**\n * Get all but last element from array\n *\n * @param {number} [limit=1] Item count\n * @param {Array} source\n *\n * @returns {any}\n *\n * @name top\n * @tag Array\n * @signature (limit: number, source: Array): Array\n * @signature (limit: number) => (source: Array): Array\n * @signature (source: Array): Array\n *\n * @example\n * top([1, 2, 3])\n * // => [1, 2]\n *\n * top([1]), top([])\n * // => []\n *\n * top(2, [2, 3])\n * // => [2, 3]\n *\n * top(2)([1, 2, 3])\n * // => [2, 3]\n */\nconst top = (...params) => {\n /*\n * @signature (limit: number) => (source: Array): Array\n *\n * top(2)([1, 2, 3, 4]) => [3, 4]\n */\n if (params.length === 1 && typeof params[0] === \"number\") {\n const [limit] = params\n\n return input => topX(limit, input)\n }\n\n /*\n * @signature (source: Array): Array\n *\n * top([1, 2, 3, 4]) => [2, 3, 4]\n */\n if (params.length === 1) {\n const [input] = params\n\n return topX(undefined, input)\n }\n\n /*\n * @signature (limit: number, source: Array): Array\n *\n * top(2, [1, 2, 3, 4]) => [3, 4]\n */\n return topX(params[0], params[1])\n}\n\nexport { top }\n"],"names":["is","topX","limit","input","Array","isArray","slice","top","params","length","undefined"],"mappings":"AAAA,8DAA8D,GAE9D;AAAA,SAASA,EAAE,QAAQ,aAAa,CAAA;AAEhC,IAAMC,IAAI,GAAG,SAACC,KAAK,EAAEC,KAAK;WACxBC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAC7CA,KAAK,CAACG,KAAK,CAAC,CAAC,EAAEN,EAAE,CAACE,KAAK,CAAC,GAAGA,KAAK,GAAG,CAAC,CAAC,CAAC,GACtC,EAAE;CAAA;AAER;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,IAAMK,GAAG,GAAG,WAAe;qCAAXC,MAAM;QAANA,MAAM;;IACpB;;;;GAIC,GACD,IAAIA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAI,OAAOD,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;QACxD,IAAgBA,OAAM,oBAANA,MAAM,IAAA,EAAfN,KAAK,GAAIM,OAAM,GAAV,AAAU;QAEtB,OAAOL,SAAAA,KAAK;mBAAIF,IAAI,CAACC,KAAK,EAAEC,KAAK,CAAC;SAAA,CAAA;IACpC,CAAC;IAED;;;;GAIC,GACD,IAAIK,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;QACvB,IAAgBD,QAAM,oBAANA,MAAM,IAAA,EAAfL,KAAK,GAAIK,QAAM,GAAV,AAAU;QAEtB,OAAOP,IAAI,CAACS,SAAS,EAAEP,KAAK,CAAC,CAAA;IAC/B,CAAC;IAED;;;;GAIC,GACD,OAAOF,IAAI,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEA,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACnC,CAAC;AAED,SAASD,GAAG,GAAE"}
|