@asd14/m 7.8.2 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all/all.js +2 -2
- package/dist/all/all.js.map +1 -1
- package/dist/all/all.test.js.map +1 -1
- package/dist/any/any.js +2 -2
- package/dist/any/any.js.map +1 -1
- package/dist/any/any.test.js +1 -1
- package/dist/any/any.test.js.map +1 -1
- package/dist/append/append.js +2 -2
- package/dist/append/append.js.map +1 -1
- package/dist/append/append.test.js.map +1 -1
- package/dist/bottom/bottom.js +2 -2
- package/dist/bottom/bottom.js.map +1 -1
- package/dist/bottom/bottom.test.js.map +1 -1
- package/dist/cases/cases.js +3 -2
- package/dist/cases/cases.js.map +1 -1
- package/dist/cases/cases.test.js +3 -3
- package/dist/cases/cases.test.js.map +1 -1
- package/dist/clone/clone.js +2 -2
- package/dist/clone/clone.js.map +1 -1
- package/dist/clone/clone.test.js +2 -2
- package/dist/clone/clone.test.js.map +1 -1
- package/dist/compact/compact.js +2 -2
- package/dist/compact/compact.js.map +1 -1
- package/dist/compact/compact.test.js +2 -2
- package/dist/compact/compact.test.js.map +1 -1
- package/dist/contains/contains.js.map +1 -1
- package/dist/contains/contains.test.js.map +1 -1
- package/dist/converge/converge.js +8 -8
- package/dist/converge/converge.js.map +1 -1
- package/dist/converge/converge.test.js +1 -1
- package/dist/converge/converge.test.js.map +1 -1
- package/dist/count/count.js +4 -3
- package/dist/count/count.js.map +1 -1
- package/dist/count/count.test.js +3 -3
- package/dist/count/count.test.js.map +1 -1
- package/dist/curry/curry.js +7 -8
- package/dist/curry/curry.js.map +1 -1
- package/dist/curry/curry.test.js.map +1 -1
- package/dist/debounce/debounce.js +3 -3
- package/dist/debounce/debounce.js.map +1 -1
- package/dist/debounce/debounce.test.js.map +1 -1
- package/dist/dec/dec.js.map +1 -1
- package/dist/dec/dec.test.js.map +1 -1
- package/dist/deep-equal/deep-equal.bench.js.map +1 -1
- package/dist/deep-equal/deep-equal.js +2 -2
- package/dist/deep-equal/deep-equal.js.map +1 -1
- package/dist/deep-equal/deep-equal.own.js +4 -3
- package/dist/deep-equal/deep-equal.own.js.map +1 -1
- package/dist/deep-equal/deep-equal.test.js.map +1 -1
- package/dist/distinct/distinct.bench.js.map +1 -1
- package/dist/distinct/distinct.js.map +1 -1
- package/dist/distinct/distinct.test.js.map +1 -1
- package/dist/drop-last/drop-last.js.map +1 -1
- package/dist/drop-last/drop-last.test.js.map +1 -1
- package/dist/elapsed-time/elapsed-time.js.map +1 -1
- package/dist/elapsed-time/elapsed-time.test.js.map +1 -1
- package/dist/ends-with/ends-with.js.map +1 -1
- package/dist/ends-with/ends-with.test.js.map +1 -1
- package/dist/escape/escape.js.map +1 -1
- package/dist/escape-html/escape-html.js.map +1 -1
- package/dist/escape-html/escape-html.test.js.map +1 -1
- package/dist/escape-reg-exp/escape-reg-exp.js.map +1 -1
- package/dist/escape-reg-exp/escape-reg-exp.test.js.map +1 -1
- package/dist/filter/filter.js +2 -2
- package/dist/filter/filter.js.map +1 -1
- package/dist/filter/filter.test.js +3 -3
- package/dist/filter/filter.test.js.map +1 -1
- package/dist/find/find.js +4 -4
- package/dist/find/find.js.map +1 -1
- package/dist/find/find.test.js +2 -2
- package/dist/find/find.test.js.map +1 -1
- package/dist/find-index/find-index.js +2 -2
- package/dist/find-index/find-index.js.map +1 -1
- package/dist/find-index/find-index.test.js +2 -2
- package/dist/find-index/find-index.test.js.map +1 -1
- package/dist/first/first.js.map +1 -1
- package/dist/first/first.test.js.map +1 -1
- package/dist/flatten/flatten.js +8 -4
- package/dist/flatten/flatten.js.map +1 -1
- package/dist/flatten/flatten.test.js.map +1 -1
- package/dist/for-each/for-each.js +2 -2
- package/dist/for-each/for-each.js.map +1 -1
- package/dist/for-each/for-each.test.js.map +1 -1
- package/dist/group-by/group-by.js.map +1 -1
- package/dist/group-by/group-by.test.js +3 -3
- package/dist/group-by/group-by.test.js.map +1 -1
- package/dist/gt/gt.js.map +1 -1
- package/dist/gt/gt.test.js.map +1 -1
- package/dist/has-key/has-key.js.map +1 -1
- package/dist/has-key/has-key.test.js.map +1 -1
- package/dist/hist/hist.js.map +1 -1
- package/dist/hist/hist.test.js +1 -1
- package/dist/hist/hist.test.js.map +1 -1
- package/dist/i/i.js.map +1 -1
- package/dist/i/i.test.js.map +1 -1
- package/dist/inc/inc.js.map +1 -1
- package/dist/inc/inc.test.js.map +1 -1
- package/dist/index-by/index-by.js.map +1 -1
- package/dist/index-by/index-by.test.js +2 -2
- package/dist/index-by/index-by.test.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.test.js.map +1 -1
- package/dist/intersect/intersect.js +2 -2
- package/dist/intersect/intersect.js.map +1 -1
- package/dist/intersect/intersect.test.js +4 -4
- package/dist/intersect/intersect.test.js.map +1 -1
- package/dist/is/is.js.map +1 -1
- package/dist/is/is.test.js.map +1 -1
- package/dist/is-between/is-between.js.map +1 -1
- package/dist/is-between/is-between.test.js.map +1 -1
- package/dist/is-empty/is-empty.js.map +1 -1
- package/dist/is-empty/is-empty.test.js.map +1 -1
- package/dist/is-equal/is-equal.js.map +1 -1
- package/dist/is-equal/is-equal.test.js.map +1 -1
- package/dist/is-match/is-match.js +4 -3
- package/dist/is-match/is-match.js.map +1 -1
- package/dist/is-match/is-match.test.js.map +1 -1
- package/dist/is-uri/is-uri.js.map +1 -1
- package/dist/is-uri/is-uri.test.js.map +1 -1
- package/dist/join/join.js +2 -2
- package/dist/join/join.js.map +1 -1
- package/dist/join/join.test.js +2 -2
- package/dist/join/join.test.js.map +1 -1
- package/dist/keys/keys.js.map +1 -1
- package/dist/keys/keys.test.js.map +1 -1
- package/dist/last/last.js.map +1 -1
- package/dist/last/last.test.js.map +1 -1
- package/dist/lt/lt.js.map +1 -1
- package/dist/lt/lt.test.js.map +1 -1
- package/dist/map/map.js +2 -2
- package/dist/map/map.js.map +1 -1
- package/dist/map/map.test.js +1 -1
- package/dist/map/map.test.js.map +1 -1
- package/dist/map-matrix/map-matrix.js +2 -2
- package/dist/map-matrix/map-matrix.js.map +1 -1
- package/dist/map-matrix/map-matrix.test.js +6 -6
- package/dist/map-matrix/map-matrix.test.js.map +1 -1
- package/dist/max/max.js +4 -3
- package/dist/max/max.js.map +1 -1
- package/dist/max/max.test.js +1 -1
- package/dist/max/max.test.js.map +1 -1
- package/dist/merge/merge.js +4 -3
- package/dist/merge/merge.js.map +1 -1
- package/dist/merge/merge.test.js +3 -3
- package/dist/merge/merge.test.js.map +1 -1
- package/dist/min/min.js +4 -3
- package/dist/min/min.js.map +1 -1
- package/dist/min/min.test.js +1 -1
- package/dist/min/min.test.js.map +1 -1
- package/dist/move/move.js +6 -5
- package/dist/move/move.js.map +1 -1
- package/dist/move/move.test.js.map +1 -1
- package/dist/mutate/mutate.js +9 -7
- package/dist/mutate/mutate.js.map +1 -1
- package/dist/mutate/mutate.test.js +2 -2
- package/dist/mutate/mutate.test.js.map +1 -1
- package/dist/page/page.js +3 -3
- package/dist/page/page.js.map +1 -1
- package/dist/page/page.test.js.map +1 -1
- package/dist/partition/partition.js +3 -3
- package/dist/partition/partition.js.map +1 -1
- package/dist/partition/partition.test.js +2 -2
- package/dist/partition/partition.test.js.map +1 -1
- package/dist/pick/pick.js +3 -3
- package/dist/pick/pick.js.map +1 -1
- package/dist/pick/pick.test.js +1 -1
- package/dist/pick/pick.test.js.map +1 -1
- package/dist/pipe/pipe.js +5 -5
- package/dist/pipe/pipe.js.map +1 -1
- package/dist/pipe/pipe.test.js.map +1 -1
- package/dist/pipe-p/pipe-p.js +5 -5
- package/dist/pipe-p/pipe-p.js.map +1 -1
- package/dist/pipe-p/pipe-p.test.js +2 -2
- package/dist/pipe-p/pipe-p.test.js.map +1 -1
- package/dist/pluck/pluck.js +2 -2
- package/dist/pluck/pluck.js.map +1 -1
- package/dist/pluck/pluck.test.js +1 -1
- package/dist/pluck/pluck.test.js.map +1 -1
- package/dist/prepend/prepend.js +3 -3
- package/dist/prepend/prepend.js.map +1 -1
- package/dist/prepend/prepend.test.js.map +1 -1
- package/dist/proto-chain/proto-chain.js +3 -3
- package/dist/proto-chain/proto-chain.js.map +1 -1
- package/dist/proto-chain/proto-chain.test.js.map +1 -1
- package/dist/push/push.js +3 -3
- package/dist/push/push.js.map +1 -1
- package/dist/push/push.test.js.map +1 -1
- package/dist/raise/raise.js.map +1 -1
- package/dist/raise/raise.test.js.map +1 -1
- package/dist/random/random.js.map +1 -1
- package/dist/random/random.test.js.map +1 -1
- package/dist/read/read.js +3 -3
- package/dist/read/read.js.map +1 -1
- package/dist/read/read.test.js +1 -1
- package/dist/read/read.test.js.map +1 -1
- package/dist/reduce/reduce.js +3 -3
- package/dist/reduce/reduce.js.map +1 -1
- package/dist/reduce/reduce.test.js +4 -2
- package/dist/reduce/reduce.test.js.map +1 -1
- package/dist/remove/remove.js +6 -5
- package/dist/remove/remove.js.map +1 -1
- package/dist/remove/remove.test.js +2 -2
- package/dist/remove/remove.test.js.map +1 -1
- package/dist/rename/rename.js +7 -5
- package/dist/rename/rename.js.map +1 -1
- package/dist/rename/rename.test.js +1 -1
- package/dist/rename/rename.test.js.map +1 -1
- package/dist/rename-file/rename-file.js.map +1 -1
- package/dist/rename-file/rename-file.test.js.map +1 -1
- package/dist/repeat/repeat.js +3 -3
- package/dist/repeat/repeat.js.map +1 -1
- package/dist/repeat/repeat.test.js.map +1 -1
- package/dist/replace/replace.js.map +1 -1
- package/dist/replace/replace.test.js +9 -8
- package/dist/replace/replace.test.js.map +1 -1
- package/dist/same/same.js.map +1 -1
- package/dist/same/same.test.js.map +1 -1
- package/dist/sequence/sequence.js.map +1 -1
- package/dist/sequence/sequence.test.js +2 -2
- package/dist/sequence/sequence.test.js.map +1 -1
- package/dist/sort/sort-with.js +8 -7
- package/dist/sort/sort-with.js.map +1 -1
- package/dist/sort/sort.js +4 -4
- package/dist/sort/sort.js.map +1 -1
- package/dist/sort/sort.test.js +14 -14
- package/dist/sort/sort.test.js.map +1 -1
- package/dist/split/split.js +5 -4
- package/dist/split/split.js.map +1 -1
- package/dist/split/split.test.js.map +1 -1
- package/dist/split-in-groups-of/split-in-groups-of.js +4 -3
- package/dist/split-in-groups-of/split-in-groups-of.js.map +1 -1
- package/dist/split-in-groups-of/split-in-groups-of.test.js +1 -1
- package/dist/split-in-groups-of/split-in-groups-of.test.js.map +1 -1
- package/dist/spy/spy.js.map +1 -1
- package/dist/spy/spy.test.js.map +1 -1
- package/dist/starts-with/starts-with.js.map +1 -1
- package/dist/starts-with/starts-with.test.js.map +1 -1
- package/dist/throttle/throttle.js +4 -4
- package/dist/throttle/throttle.js.map +1 -1
- package/dist/throttle/throttle.test.js.map +1 -1
- package/dist/to-lower/to-lower.js.map +1 -1
- package/dist/to-lower/to-lower.test.js.map +1 -1
- package/dist/to-upper/to-upper.js.map +1 -1
- package/dist/to-upper/to-upper.test.js.map +1 -1
- package/dist/toggle/toggle.js.map +1 -1
- package/dist/toggle/toggle.test.js.map +1 -1
- package/dist/top/top.js +5 -5
- package/dist/top/top.js.map +1 -1
- package/dist/top/top.test.js.map +1 -1
- package/dist/trim/trim.js +3 -3
- package/dist/trim/trim.js.map +1 -1
- package/dist/trim/trim.test.js.map +1 -1
- package/dist/try-catch/try-catch.js +4 -4
- package/dist/try-catch/try-catch.js.map +1 -1
- package/dist/try-catch/try-catch.test.js.map +1 -1
- package/dist/type/type.js.map +1 -1
- package/dist/type/type.test.js.map +1 -1
- package/dist/unite/unite.js.map +1 -1
- package/dist/unite/unite.test.js.map +1 -1
- package/dist/update/update.js +8 -6
- package/dist/update/update.js.map +1 -1
- package/dist/update/update.test.js.map +1 -1
- package/dist/upsert/upsert.js +2 -2
- package/dist/upsert/upsert.js.map +1 -1
- package/dist/upsert/upsert.test.js.map +1 -1
- package/dist/values/values.js +3 -3
- package/dist/values/values.js.map +1 -1
- package/dist/values/values.test.js.map +1 -1
- package/dist/when/when.js +6 -6
- package/dist/when/when.js.map +1 -1
- package/dist/when/when.test.js.map +1 -1
- package/dist/write/write.js +5 -3
- package/dist/write/write.js.map +1 -1
- package/dist/write/write.test.js.map +1 -1
- package/dist/zip-to-object/zip-to-object.js.map +1 -1
- package/dist/zip-to-object/zip-to-object.test.js.map +1 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-by/index-by.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { indexBy } from \"./index-by.js\"\n\ntest(\"indexBy\", t => {\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n { label: \"foo bar\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.end()\n})\n"],"names":["test","indexBy","t","deepEqual","id","label","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/index-by/index-by.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { indexBy } from \"./index-by.js\"\n\ntest(\"indexBy\", t => {\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.deepEqual(\n indexBy(\"id\")([\n { id: 1, label: \"test\" },\n { id: 2, label: \"foo\" },\n { label: \"foo bar\" },\n ]),\n {\n 1: { id: 1, label: \"test\" },\n 2: { id: 2, label: \"foo\" },\n },\n \"index object array by existing field\"\n )\n\n t.end()\n})\n"],"names":["test","indexBy","t","deepEqual","id","label","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,OAAO,QAAQ,gBAAe;AAEvCD,KAAK,WAAWE,SAAAA,GAAK;IACnBA,EAAEC,SAAS,CACTF,QAAQ,MAAM;QACZ;YAAEG,IAAI;YAAGC,OAAO;QAAO;QACvB;YAAED,IAAI;YAAGC,OAAO;QAAM;KACvB,GACD;QACE,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAO;QAC1B,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAM;IAC3B,GACA;IAGFH,EAAEC,SAAS,CACTF,QAAQ,MAAM;QACZ;YAAEG,IAAI;YAAGC,OAAO;QAAO;QACvB;YAAED,IAAI;YAAGC,OAAO;QAAM;QACtB;YAAEA,OAAO;QAAU;KACpB,GACD;QACE,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAO;QAC1B,GAAG;YAAED,IAAI;YAAGC,OAAO;QAAM;IAC3B,GACA;IAGFH,EAAEI,GAAG;AACP"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"sourcesContent":["export {\n isDeepEqual,\n isDeepEqual as deepEqual,\n} from \"./deep-equal/deep-equal.js\"\nexport { elapsedTime } from \"./elapsed-time/elapsed-time.js\"\nexport { groupBy } from \"./group-by/group-by.js\"\nexport { indexBy } from \"./index-by/index-by.js\"\nexport { hist } from \"./hist/hist.js\"\nexport { protoChain } from \"./proto-chain/proto-chain.js\"\nexport { sequence, sequenceWhile } from \"./sequence/sequence.js\"\nexport { tryCatch } from \"./try-catch/try-catch.js\"\nexport { raise } from \"./raise/raise.js\"\nexport { type } from \"./type/type.js\"\nexport { throttle } from \"./throttle/throttle.js\"\nexport { debounce } from \"./debounce/debounce.js\"\nexport { isURI } from \"./is-uri/is-uri.js\"\nexport { spy } from \"./spy/spy.js\"\n\n// Core\nexport { map } from \"./map/map.js\"\nexport { mapMatrix } from \"./map-matrix/map-matrix.js\"\nexport { reduce } from \"./reduce/reduce.js\"\nexport { converge } from \"./converge/converge.js\"\nexport { forEach } from \"./for-each/for-each.js\"\nexport { pipe } from \"./pipe/pipe.js\"\nexport { pipeP } from \"./pipe-p/pipe-p.js\"\nexport { read as get, read, readMany } from \"./read/read.js\"\nexport { write as set, write } from \"./write/write.js\"\nexport { same } from \"./same/same.js\"\nexport { i } from \"./i/i.js\"\nexport { clone } from \"./clone/clone.js\"\nexport { repeat } from \"./repeat/repeat.js\"\nexport { curry } from \"./curry/curry.js\"\nexport { compact, compactMany } from \"./compact/compact.js\"\n\n// Boolean\nexport { is, isNothing, not, isTrue, isFalse, isObject } from \"./is/is.js\"\nexport { isEmpty, isNotEmpty } from \"./is-empty/is-empty.js\"\nexport {\n isEqual,\n isEqual as equals,\n isEqual as eq,\n} from \"./is-equal/is-equal.js\"\nexport { isBetween, isBetween as between } from \"./is-between/is-between.js\"\nexport { any, any as has, anyWith, anyWith as hasWith } from \"./any/any.js\"\nexport { all, allWith } from \"./all/all.js\"\nexport { when } from \"./when/when.js\"\nexport { cases } from \"./cases/cases.js\"\nexport { isMatch } from \"./is-match/is-match.js\"\n\n// Object\nexport { pick } from \"./pick/pick.js\"\nexport { pluck } from \"./pluck/pluck.js\"\nexport { merge, mergeAll, mergeBy } from \"./merge/merge.js\"\nexport { keys } from \"./keys/keys.js\"\nexport { values } from \"./values/values.js\"\nexport { rename as renameKeys, rename, renameMany } from \"./rename/rename.js\"\nexport {\n zipToObject as zipToObj,\n zipToObject,\n} from \"./zip-to-object/zip-to-object.js\"\nexport { mutate, mutateMany, mutateWith } from \"./mutate/mutate.js\"\nexport { update, updateMany, updateWith } from \"./update/update.js\"\n\n// Array\nexport { top } from \"./top/top.js\"\nexport { bottom } from \"./bottom/bottom.js\"\nexport { first, first as head } from \"./first/first.js\"\nexport { last, last as tail } from \"./last/last.js\"\nexport { page } from \"./page/page.js\"\nexport { push } from \"./push/push.js\"\nexport { max, maxBy } from \"./max/max.js\"\nexport { min, minBy } from \"./min/min.js\"\nexport { move } from \"./move/move.js\"\nexport { flatten } from \"./flatten/flatten.js\"\nexport { distinct, distinctBy } from \"./distinct/distinct.js\"\nexport { dropLast } from \"./drop-last/drop-last.js\"\nexport { upsertWith as upsert, upsertWith } from \"./upsert/upsert.js\"\nexport { append, append as concat } from \"./append/append.js\"\nexport { prepend } from \"./prepend/prepend.js\"\nexport { toggle } from \"./toggle/toggle.js\"\nexport { partition, partitionWith } from \"./partition/partition.js\"\nexport {\n count,\n count as length,\n count as size,\n countBy,\n countWith,\n} from \"./count/count.js\"\nexport { replace, replaceWith } from \"./replace/replace.js\"\nexport { sort, sortBy } from \"./sort/sort.js\"\nexport { sortWith } from \"./sort/sort-with.js\"\nexport { remove, removeWith } from \"./remove/remove.js\"\nexport { hasKey } from \"./has-key/has-key.js\"\nexport { filter, filterWith } from \"./filter/filter.js\"\nexport { find, findWith } from \"./find/find.js\"\nexport { findIndex, findIndexWith } from \"./find-index/find-index.js\"\nexport { join, joinBy } from \"./join/join.js\"\nexport { intersect, intersectBy } from \"./intersect/intersect.js\"\n\n// Number\nexport { dec } from \"./dec/dec.js\"\nexport { inc } from \"./inc/inc.js\"\nexport { gt } from \"./gt/gt.js\"\nexport { lt } from \"./lt/lt.js\"\nexport { random } from \"./random/random.js\"\n\n// String\nexport { split } from \"./split/split.js\"\nexport { splitInGroupsOf } from \"./split-in-groups-of/split-in-groups-of.js\"\nexport { startsWith } from \"./starts-with/starts-with.js\"\nexport { endsWith } from \"./ends-with/ends-with.js\"\nexport { toLower } from \"./to-lower/to-lower.js\"\nexport { toUpper } from \"./to-upper/to-upper.js\"\nexport { trim } from \"./trim/trim.js\"\nexport { contains } from \"./contains/contains.js\"\nexport { unite } from \"./unite/unite.js\"\nexport { escapeHTML } from \"./escape-html/escape-html.js\"\nexport { escapeRegExp } from \"./escape-reg-exp/escape-reg-exp.js\"\n"],"names":["isDeepEqual","deepEqual","elapsedTime","groupBy","indexBy","hist","protoChain","sequence","sequenceWhile","tryCatch","raise","type","throttle","debounce","isURI","spy","map","mapMatrix","reduce","converge","forEach","pipe","pipeP","read","get","readMany","write","set","same","i","clone","repeat","curry","compact","compactMany","is","isNothing","not","isTrue","isFalse","isObject","isEmpty","isNotEmpty","isEqual","equals","eq","isBetween","between","any","has","anyWith","hasWith","all","allWith","when","cases","isMatch","pick","pluck","merge","mergeAll","mergeBy","keys","values","rename","renameKeys","renameMany","zipToObject","zipToObj","mutate","mutateMany","mutateWith","update","updateMany","updateWith","top","bottom","first","head","last","tail","page","push","max","maxBy","min","minBy","move","flatten","distinct","distinctBy","dropLast","upsertWith","upsert","append","concat","prepend","toggle","partition","partitionWith","count","length","size","countBy","countWith","replace","replaceWith","sort","sortBy","sortWith","remove","removeWith","hasKey","filter","filterWith","find","findWith","findIndex","findIndexWith","join","joinBy","intersect","intersectBy","dec","inc","gt","lt","random","split","splitInGroupsOf","startsWith","endsWith","toLower","toUpper","trim","contains","unite","escapeHTML","escapeRegExp"],"mappings":"AAAA,SACEA,WAAW,EACXA,WAAW,IAAIC,SAAS,QACnB,4BAA4B,CAAA;AACnC,SAASC,WAAW,QAAQ,gCAAgC,CAAA;AAC5D,SAASC,OAAO,QAAQ,wBAAwB,CAAA;AAChD,SAASC,OAAO,QAAQ,wBAAwB,CAAA;AAChD,SAASC,IAAI,QAAQ,gBAAgB,CAAA;AACrC,SAASC,UAAU,QAAQ,8BAA8B,CAAA;AACzD,SAASC,QAAQ,EAAEC,aAAa,QAAQ,wBAAwB,CAAA;AAChE,SAASC,QAAQ,QAAQ,0BAA0B,CAAA;AACnD,SAASC,KAAK,QAAQ,kBAAkB,CAAA;AACxC,SAASC,IAAI,QAAQ,gBAAgB,CAAA;AACrC,SAASC,QAAQ,QAAQ,wBAAwB,CAAA;AACjD,SAASC,QAAQ,QAAQ,wBAAwB,CAAA;AACjD,SAASC,KAAK,QAAQ,oBAAoB,CAAA;AAC1C,SAASC,GAAG,QAAQ,cAAc,CAAA;AAElC,OAAO;AACP,SAASC,GAAG,QAAQ,cAAc,CAAA;AAClC,SAASC,SAAS,QAAQ,4BAA4B,CAAA;AACtD,SAASC,MAAM,QAAQ,oBAAoB,CAAA;AAC3C,SAASC,Q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QAAQ,kBAAkB,CAAA;AACxC,SAASC,UAAU,QAAQ,8BAA8B,CAAA;AACzD,SAASC,YAAY,QAAQ,oCAAoC,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"sourcesContent":["export {\n isDeepEqual,\n isDeepEqual as deepEqual,\n} from \"./deep-equal/deep-equal.js\"\nexport { elapsedTime } from \"./elapsed-time/elapsed-time.js\"\nexport { groupBy } from \"./group-by/group-by.js\"\nexport { indexBy } from \"./index-by/index-by.js\"\nexport { hist } from \"./hist/hist.js\"\nexport { protoChain } from \"./proto-chain/proto-chain.js\"\nexport { sequence, sequenceWhile } from \"./sequence/sequence.js\"\nexport { tryCatch } from \"./try-catch/try-catch.js\"\nexport { raise } from \"./raise/raise.js\"\nexport { type } from \"./type/type.js\"\nexport { throttle } from \"./throttle/throttle.js\"\nexport { debounce } from \"./debounce/debounce.js\"\nexport { isURI } from \"./is-uri/is-uri.js\"\nexport { spy } from \"./spy/spy.js\"\n\n// Core\nexport { map } from \"./map/map.js\"\nexport { mapMatrix } from \"./map-matrix/map-matrix.js\"\nexport { reduce } from \"./reduce/reduce.js\"\nexport { converge } from \"./converge/converge.js\"\nexport { forEach } from \"./for-each/for-each.js\"\nexport { pipe } from \"./pipe/pipe.js\"\nexport { pipeP } from \"./pipe-p/pipe-p.js\"\nexport { read as get, read, readMany } from \"./read/read.js\"\nexport { write as set, write } from \"./write/write.js\"\nexport { same } from \"./same/same.js\"\nexport { i } from \"./i/i.js\"\nexport { clone } from \"./clone/clone.js\"\nexport { repeat } from \"./repeat/repeat.js\"\nexport { curry } from \"./curry/curry.js\"\nexport { compact, compactMany } from \"./compact/compact.js\"\n\n// Boolean\nexport { is, isNothing, not, isTrue, isFalse, isObject } from \"./is/is.js\"\nexport { isEmpty, isNotEmpty } from \"./is-empty/is-empty.js\"\nexport {\n isEqual,\n isEqual as equals,\n isEqual as eq,\n} from \"./is-equal/is-equal.js\"\nexport { isBetween, isBetween as between } from \"./is-between/is-between.js\"\nexport { any, any as has, anyWith, anyWith as hasWith } from \"./any/any.js\"\nexport { all, allWith } from \"./all/all.js\"\nexport { when } from \"./when/when.js\"\nexport { cases } from \"./cases/cases.js\"\nexport { isMatch } from \"./is-match/is-match.js\"\n\n// Object\nexport { pick } from \"./pick/pick.js\"\nexport { pluck } from \"./pluck/pluck.js\"\nexport { merge, mergeAll, mergeBy } from \"./merge/merge.js\"\nexport { keys } from \"./keys/keys.js\"\nexport { values } from \"./values/values.js\"\nexport { rename as renameKeys, rename, renameMany } from \"./rename/rename.js\"\nexport {\n zipToObject as zipToObj,\n zipToObject,\n} from \"./zip-to-object/zip-to-object.js\"\nexport { mutate, mutateMany, mutateWith } from \"./mutate/mutate.js\"\nexport { update, updateMany, updateWith } from \"./update/update.js\"\n\n// Array\nexport { top } from \"./top/top.js\"\nexport { bottom } from \"./bottom/bottom.js\"\nexport { first, first as head } from \"./first/first.js\"\nexport { last, last as tail } from \"./last/last.js\"\nexport { page } from \"./page/page.js\"\nexport { push } from \"./push/push.js\"\nexport { max, maxBy } from \"./max/max.js\"\nexport { min, minBy } from \"./min/min.js\"\nexport { move } from \"./move/move.js\"\nexport { flatten } from \"./flatten/flatten.js\"\nexport { distinct, distinctBy } from \"./distinct/distinct.js\"\nexport { dropLast } from \"./drop-last/drop-last.js\"\nexport { upsertWith as upsert, upsertWith } from \"./upsert/upsert.js\"\nexport { append, append as concat } from \"./append/append.js\"\nexport { prepend } from \"./prepend/prepend.js\"\nexport { toggle } from \"./toggle/toggle.js\"\nexport { partition, partitionWith } from \"./partition/partition.js\"\nexport {\n count,\n count as length,\n count as size,\n countBy,\n countWith,\n} from \"./count/count.js\"\nexport { replace, replaceWith } from \"./replace/replace.js\"\nexport { sort, sortBy } from \"./sort/sort.js\"\nexport { sortWith } from \"./sort/sort-with.js\"\nexport { remove, removeWith } from \"./remove/remove.js\"\nexport { hasKey } from \"./has-key/has-key.js\"\nexport { filter, filterWith } from \"./filter/filter.js\"\nexport { find, findWith } from \"./find/find.js\"\nexport { findIndex, findIndexWith } from \"./find-index/find-index.js\"\nexport { join, joinBy } from \"./join/join.js\"\nexport { intersect, intersectBy } from \"./intersect/intersect.js\"\n\n// Number\nexport { dec } from \"./dec/dec.js\"\nexport { inc } from \"./inc/inc.js\"\nexport { gt } from \"./gt/gt.js\"\nexport { lt } from \"./lt/lt.js\"\nexport { random } from \"./random/random.js\"\n\n// String\nexport { split } from \"./split/split.js\"\nexport { splitInGroupsOf } from \"./split-in-groups-of/split-in-groups-of.js\"\nexport { startsWith } from \"./starts-with/starts-with.js\"\nexport { endsWith } from \"./ends-with/ends-with.js\"\nexport { toLower } from \"./to-lower/to-lower.js\"\nexport { toUpper } from \"./to-upper/to-upper.js\"\nexport { trim } from \"./trim/trim.js\"\nexport { contains } from \"./contains/contains.js\"\nexport { unite } from \"./unite/unite.js\"\nexport { escapeHTML } from \"./escape-html/escape-html.js\"\nexport { escapeRegExp } from \"./escape-reg-exp/escape-reg-exp.js\"\n"],"names":["isDeepEqual","deepEqual","elapsedTime","groupBy","indexBy","hist","protoChain","sequence","sequenceWhile","tryCatch","raise","type","throttle","debounce","isURI","spy","map","mapMatrix","reduce","converge","forEach","pipe","pipeP","read","get","readMany","write","set","same","i","clone","repeat","curry","compact","compactMany","is","isNothing","not","isTrue","isFalse","isObject","isEmpty","isNotEmpty","isEqual","equals","eq","isBetween","between","any","has","anyWith","hasWith","all","allWith","when","cases","isMatch","pick","pluck","merge","mergeAll","mergeBy","keys","values","rename","renameKeys","renameMany","zipToObject","zipToObj","mutate","mutateMany","mutateWith","update","updateMany","updateWith","top","bottom","first","head","last","tail","page","push","max","maxBy","min","minBy","move","flatten","distinct","distinctBy","dropLast","upsertWith","upsert","append","concat","prepend","toggle","partition","partitionWith","count","length","size","countBy","countWith","replace","replaceWith","sort","sortBy","sortWith","remove","removeWith","hasKey","filter","filterWith","find","findWith","findIndex","findIndexWith","join","joinBy","intersect","intersectBy","dec","inc","gt","lt","random","split","splitInGroupsOf","startsWith","endsW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AA0B;AACnD,SAASC,OAAO,QAAQ,yBAAwB;AAChD,SAASC,OAAO,QAAQ,yBAAwB;AAChD,SAASC,IAAI,QAAQ,iBAAgB;AACrC,SAASC,QAAQ,QAAQ,yBAAwB;AACjD,SAASC,KAAK,QAAQ,mBAAkB;AACxC,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,YAAY,QAAQ,qCAAoC"}
|
package/dist/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.test.js"],"sourcesContent":["/* eslint-disable unicorn/prefer-module */\n\nimport test from \"tape\"\nimport { createRequire } from \"module\"\n\ntest(\"index\", t => {\n t.doesNotThrow(() => {\n createRequire(new URL(\"index.js\", import.meta.url))\n }, \"Main file loads without errors\")\n\n t.end()\n})\n"],"names":["test","createRequire","t","doesNotThrow","URL","url","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/index.test.js"],"sourcesContent":["/* eslint-disable unicorn/prefer-module */\n\nimport test from \"tape\"\nimport { createRequire } from \"module\"\n\ntest(\"index\", t => {\n t.doesNotThrow(() => {\n createRequire(new URL(\"index.js\", import.meta.url))\n }, \"Main file loads without errors\")\n\n t.end()\n})\n"],"names":["test","createRequire","t","doesNotThrow","URL","url","end"],"mappings":"AAAA,wCAAwC,GAExC,OAAOA,UAAU,OAAM;AACvB,SAASC,aAAa,QAAQ,SAAQ;AAEtCD,KAAK,SAASE,SAAAA,GAAK;IACjBA,EAAEC,YAAY,CAAC,WAAM;QACnBF,cAAc,IAAIG,IAAI,YAAY,YAAYC,GAAG;IACnD,GAAG;IAEHH,EAAEI,GAAG;AACP"}
|
|
@@ -9,7 +9,7 @@ var _intersectBy = function(predicateFn, mergeFn, aList, bList) {
|
|
|
9
9
|
var result = [];
|
|
10
10
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
11
11
|
try {
|
|
12
|
-
var _loop = function(
|
|
12
|
+
var _loop = function() {
|
|
13
13
|
var b = _step.value;
|
|
14
14
|
var a = find(function(item) {
|
|
15
15
|
return predicateFn(item, b);
|
|
@@ -23,7 +23,7 @@ var _intersectBy = function(predicateFn, mergeFn, aList, bList) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
for(var _iterator = bList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop(
|
|
26
|
+
for(var _iterator = bList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
27
27
|
} catch (err) {
|
|
28
28
|
_didIteratorError = true;
|
|
29
29
|
_iteratorError = err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intersect/intersect.js"],"sourcesContent":["import { find } from \"../find/find.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { any } from \"../any/any.js\"\nimport { isEqual } from \"../is-equal/is-equal.js\"\n\nconst _intersectBy = (predicateFn, mergeFn, aList, bList) => {\n if (aList.length === 0 || bList.length === 0) {\n return []\n }\n\n const result = []\n\n for (const b of bList) {\n const a = find(item => predicateFn(item, b), undefined, aList)\n\n if (a) {\n const alreadyAdded = any(item => predicateFn(item, a), result)\n\n if (!alreadyAdded) {\n result.push(mergeFn(a, b))\n }\n }\n }\n\n return result\n}\n\nconst _intersect = (aList, bList) => _intersectBy(isEqual, a => a, aList, bList)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersect\n * @tag Array\n * @signature (aList: any[], bList: any[]): any[]\n *\n * @see {@link intersectBy}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersect([1, 2, 3, 3], [3, 3, 4, 5])\n * // => [3]\n */\nexport const intersect = curry(_intersect)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays. Allow custom predicate and merge functions.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {Function} predicateFn\n * @param {Function} mergeFn\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersectBy\n * @tag Array\n * @signature (predicateFn: Funciton, mergeFn: Function, aList: any[], bList: any[]): any[]\n *\n * @see {@link intersect}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersectBy(\n * (a, b) => a.id === b.id,\n * (a, b) => ({ ...a, ...b }),\n * [\n * { id: 1, lorem: \"ipsum\" },\n * { id: 2, foo: \"bar1\" },\n * { id: 2, foo: \"bar2\" },\n * ],\n * [\n * { id: 2, comments: [] },\n * { id: 3, comments: [] },\n * ]\n * )\n * // => [{ id: 2, foo: \"bar1\", comments: [] }]\n */\nexport const intersectBy = curry(_intersectBy)\n"],"names":["find","curry","any","isEqual","_intersectBy","predicateFn","mergeFn","aList","bList","length","result","b","a","item","undefined","alreadyAdded","push","_intersect","intersect","intersectBy"],"mappings":"AAAA,SAASA,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/intersect/intersect.js"],"sourcesContent":["import { find } from \"../find/find.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { any } from \"../any/any.js\"\nimport { isEqual } from \"../is-equal/is-equal.js\"\n\nconst _intersectBy = (predicateFn, mergeFn, aList, bList) => {\n if (aList.length === 0 || bList.length === 0) {\n return []\n }\n\n const result = []\n\n for (const b of bList) {\n const a = find(item => predicateFn(item, b), undefined, aList)\n\n if (a) {\n const alreadyAdded = any(item => predicateFn(item, a), result)\n\n if (!alreadyAdded) {\n result.push(mergeFn(a, b))\n }\n }\n }\n\n return result\n}\n\nconst _intersect = (aList, bList) => _intersectBy(isEqual, a => a, aList, bList)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersect\n * @tag Array\n * @signature (aList: any[], bList: any[]): any[]\n *\n * @see {@link intersectBy}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersect([1, 2, 3, 3], [3, 3, 4, 5])\n * // => [3]\n */\nexport const intersect = curry(_intersect)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of common\n * items from both arrays. Allow custom predicate and merge functions.\n *\n * The function starts with an empty array and each item of bList will be\n * searched in aList using a shallow equal. If it's found, it's also checked\n * if it has not been already added.\n *\n * @param {Function} predicateFn\n * @param {Function} mergeFn\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name intersectBy\n * @tag Array\n * @signature (predicateFn: Funciton, mergeFn: Function, aList: any[], bList: any[]): any[]\n *\n * @see {@link intersect}\n * @see {@link overlap}\n * @see {@link overlapBy}\n *\n * @example\n * intersectBy(\n * (a, b) => a.id === b.id,\n * (a, b) => ({ ...a, ...b }),\n * [\n * { id: 1, lorem: \"ipsum\" },\n * { id: 2, foo: \"bar1\" },\n * { id: 2, foo: \"bar2\" },\n * ],\n * [\n * { id: 2, comments: [] },\n * { id: 3, comments: [] },\n * ]\n * )\n * // => [{ id: 2, foo: \"bar1\", comments: [] }]\n */\nexport const intersectBy = curry(_intersectBy)\n"],"names":["find","curry","any","isEqual","_intersectBy","predicateFn","mergeFn","aList","bList","length","result","b","a","item","undefined","alreadyAdded","push","_intersect","intersect","intersectBy"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,KAAK,QAAQ,oBAAmB;AACzC,SAASC,GAAG,QAAQ,gBAAe;AACnC,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,IAAMC,eAAe,SAACC,aAAaC,SAASC,OAAOC,OAAU;IAC3D,IAAID,MAAME,MAAM,KAAK,KAAKD,MAAMC,MAAM,KAAK,GAAG;QAC5C,OAAO,EAAE;IACX,CAAC;IAED,IAAMC,SAAS,EAAE;QAEZ,kCAAA,2BAAA;;+BAAkB;YAAlB,IAAMC,IAAN;YACH,IAAMC,IAAIZ,KAAKa,SAAAA;uBAAQR,YAAYQ,MAAMF;eAAIG,WAAWP;YAExD,IAAIK,GAAG;gBACL,IAAMG,eAAeb,IAAIW,SAAAA;2BAAQR,YAAYQ,MAAMD;mBAAIF;gBAEvD,IAAI,CAACK,cAAc;oBACjBL,OAAOM,IAAI,CAACV,QAAQM,GAAGD;gBACzB,CAAC;YACH,CAAC;QACH;QAVA,QAAK,YAAWH,0BAAX,SAAA,6BAAA,QAAA,yBAAA;;QAAA;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAYL,OAAOE;AACT;AAEA,IAAMO,aAAa,SAACV,OAAOC;WAAUJ,aAAaD,SAASS,SAAAA;eAAKA;OAAGL,OAAOC;;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,IAAMU,YAAYjB,MAAMgB,YAAW;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,IAAME,cAAclB,MAAMG,cAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
2
|
import test from "tape";
|
|
3
3
|
import { intersect, intersectBy } from "./intersect.js";
|
|
4
4
|
test("intersect", function(t) {
|
|
@@ -43,7 +43,7 @@ test("intersectBy", function(t) {
|
|
|
43
43
|
t.deepEqual(intersectBy(function(a, b) {
|
|
44
44
|
return a.id === b.id;
|
|
45
45
|
}, function(a, b) {
|
|
46
|
-
return
|
|
46
|
+
return _object_spread({}, a, b);
|
|
47
47
|
}, [
|
|
48
48
|
{
|
|
49
49
|
id: 1,
|
|
@@ -56,7 +56,7 @@ test("intersectBy", function(t) {
|
|
|
56
56
|
{
|
|
57
57
|
id: 2,
|
|
58
58
|
foo: "bar2"
|
|
59
|
-
}
|
|
59
|
+
}
|
|
60
60
|
], [
|
|
61
61
|
{
|
|
62
62
|
id: 2,
|
|
@@ -65,7 +65,7 @@ test("intersectBy", function(t) {
|
|
|
65
65
|
{
|
|
66
66
|
id: 3,
|
|
67
67
|
comments: []
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
]), [
|
|
70
70
|
{
|
|
71
71
|
id: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intersect/intersect.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { intersect, intersectBy } from \"./intersect.js\"\n\ntest(\"intersect\", t => {\n t.deepEqual(\n intersect([], [1, 2, 3]),\n [],\n \"given [empty first array] should [return an empty array]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 3], []),\n [],\n \"given [empty second array] should [return an empty array]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 3, 3, 4], [3, 3, 4, 5]),\n [3, 4],\n \"given [two arrays with common items] should [return an array containing those items]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 2], [3, 3, 4, 5]),\n [],\n \"given [two non empty arrays without common items] should [return an empty array]\"\n )\n\n t.end()\n})\n\ntest(\"intersectBy\", t => {\n t.deepEqual(\n intersectBy(\n (a, b) => a.id === b.id,\n (a, b) => ({ ...a, ...b }),\n [\n { id: 1, lorem: \"ipsum\" },\n { id: 2, foo: \"bar1\" },\n { id: 2, foo: \"bar2\" },\n ],\n [\n { id: 2, comments: [] },\n { id: 3, comments: [] },\n ]\n ),\n [{ id: 2, foo: \"bar1\", comments: [] }],\n \"given [two non empty arrays common object items] should [return an array containing those objects]\"\n )\n\n t.end()\n})\n"],"names":["test","intersect","intersectBy","t","deepEqual","end","a","b","id","lorem","foo","comments"],"mappings":"AAAA;AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/intersect/intersect.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { intersect, intersectBy } from \"./intersect.js\"\n\ntest(\"intersect\", t => {\n t.deepEqual(\n intersect([], [1, 2, 3]),\n [],\n \"given [empty first array] should [return an empty array]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 3], []),\n [],\n \"given [empty second array] should [return an empty array]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 3, 3, 4], [3, 3, 4, 5]),\n [3, 4],\n \"given [two arrays with common items] should [return an array containing those items]\"\n )\n\n t.deepEqual(\n intersect([1, 2, 2], [3, 3, 4, 5]),\n [],\n \"given [two non empty arrays without common items] should [return an empty array]\"\n )\n\n t.end()\n})\n\ntest(\"intersectBy\", t => {\n t.deepEqual(\n intersectBy(\n (a, b) => a.id === b.id,\n (a, b) => ({ ...a, ...b }),\n [\n { id: 1, lorem: \"ipsum\" },\n { id: 2, foo: \"bar1\" },\n { id: 2, foo: \"bar2\" },\n ],\n [\n { id: 2, comments: [] },\n { id: 3, comments: [] },\n ]\n ),\n [{ id: 2, foo: \"bar1\", comments: [] }],\n \"given [two non empty arrays common object items] should [return an array containing those objects]\"\n )\n\n t.end()\n})\n"],"names":["test","intersect","intersectBy","t","deepEqual","end","a","b","id","lorem","foo","comments"],"mappings":"AAAA;AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAgB;AAEvDF,KAAK,aAAaG,SAAAA,GAAK;IACrBA,EAAEC,SAAS,CACTH,UAAU,EAAE,EAAE;QAAC;QAAG;QAAG;KAAE,GACvB,EAAE,EACF;IAGFE,EAAEC,SAAS,CACTH,UAAU;QAAC;QAAG;QAAG;KAAE,EAAE,EAAE,GACvB,EAAE,EACF;IAGFE,EAAEC,SAAS,CACTH,UAAU;QAAC;QAAG;QAAG;QAAG;QAAG;KAAE,EAAE;QAAC;QAAG;QAAG;QAAG;KAAE,GACvC;QAAC;QAAG;KAAE,EACN;IAGFE,EAAEC,SAAS,CACTH,UAAU;QAAC;QAAG;QAAG;KAAE,EAAE;QAAC;QAAG;QAAG;QAAG;KAAE,GACjC,EAAE,EACF;IAGFE,EAAEE,GAAG;AACP;AAEAL,KAAK,eAAeG,SAAAA,GAAK;IACvBA,EAAEC,SAAS,CACTF,YACE,SAACI,GAAGC;eAAMD,EAAEE,EAAE,KAAKD,EAAEC,EAAE;OACvB,SAACF,GAAGC;eAAO,mBAAKD,GAAMC;OACtB;QACE;YAAEC,IAAI;YAAGC,OAAO;QAAQ;QACxB;YAAED,IAAI;YAAGE,KAAK;QAAO;QACrB;YAAEF,IAAI;YAAGE,KAAK;QAAO;KACtB,EACD;QACE;YAAEF,IAAI;YAAGG,UAAU,EAAE;QAAC;QACtB;YAAEH,IAAI;YAAGG,UAAU,EAAE;QAAC;KACvB,GAEH;QAAC;YAAEH,IAAI;YAAGE,KAAK;YAAQC,UAAU,EAAE;QAAC;KAAE,EACtC;IAGFR,EAAEE,GAAG;AACP"}
|
package/dist/is/is.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is/is.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Test if something is not null, undefined or NaN\n *\n * @param {any} input Source variable\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature is(source): boolean\n *\n * @example\n *\n * is(null) // => false\n * is(0) // => true\n * is(undefined) // => false\n * is(\"\") // => true\n * is(false) // => true\n * is(NaN) // => false\n */\nconst is = input =>\n input !== null && input !== undefined && !Number.isNaN(input)\n\nconst isNothing = input =>\n input === null || input === undefined || Number.isNaN(input)\n\nconst isObject = input =>\n input !== null && typeof input === \"object\" && !Array.isArray(input)\n\nconst isTrue = input => input === true\n\nconst isFalse = input => input === false\n\nconst not = curry((fn, input) => !fn(input))\n\nexport { is, not, isNothing, isTrue, isFalse, isObject }\n"],"names":["curry","is","input","undefined","Number","isNaN","isNothing","isObject","Array","isArray","isTrue","isFalse","not","fn"],"mappings":"AAAA,SAASA,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/is/is.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Test if something is not null, undefined or NaN\n *\n * @param {any} input Source variable\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature is(source): boolean\n *\n * @example\n *\n * is(null) // => false\n * is(0) // => true\n * is(undefined) // => false\n * is(\"\") // => true\n * is(false) // => true\n * is(NaN) // => false\n */\nconst is = input =>\n input !== null && input !== undefined && !Number.isNaN(input)\n\nconst isNothing = input =>\n input === null || input === undefined || Number.isNaN(input)\n\nconst isObject = input =>\n input !== null && typeof input === \"object\" && !Array.isArray(input)\n\nconst isTrue = input => input === true\n\nconst isFalse = input => input === false\n\nconst not = curry((fn, input) => !fn(input))\n\nexport { is, not, isNothing, isTrue, isFalse, isObject }\n"],"names":["curry","is","input","undefined","Number","isNaN","isNothing","isObject","Array","isArray","isTrue","isFalse","not","fn"],"mappings":"AAAA,SAASA,KAAK,QAAQ,oBAAmB;AAEzC;;;;;;;;;;;;;;;;;;CAkBC,GACD,IAAMC,KAAKC,SAAAA;WACTA,UAAU,IAAI,IAAIA,UAAUC,aAAa,CAACC,OAAOC,KAAK,CAACH;;AAEzD,IAAMI,YAAYJ,SAAAA;WAChBA,UAAU,IAAI,IAAIA,UAAUC,aAAaC,OAAOC,KAAK,CAACH;;AAExD,IAAMK,WAAWL,SAAAA;WACfA,UAAU,IAAI,IAAI,OAAOA,UAAU,YAAY,CAACM,MAAMC,OAAO,CAACP;;AAEhE,IAAMQ,SAASR,SAAAA;WAASA,UAAU,IAAI;;AAEtC,IAAMS,UAAUT,SAAAA;WAASA,UAAU,KAAK;;AAExC,IAAMU,MAAMZ,MAAM,SAACa,IAAIX;WAAU,CAACW,GAAGX;;AAErC,SAASD,EAAE,EAAEW,GAAG,EAAEN,SAAS,EAAEI,MAAM,EAAEC,OAAO,EAAEJ,QAAQ,GAAE"}
|
package/dist/is/is.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is/is.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { is, isNothing, isTrue, not, isFalse, isObject } from \"./is.js\"\n\ntest(\"is\", t => {\n t.equal(is(false), true, 'Is \"false\" something')\n t.equal(is(0), true, `Is \"0\" something`)\n t.equal(is(\"\"), true, \"Is empty-string something\")\n t.equal(is(null), false, 'Is \"null\" something')\n t.equal(is(undefined), false, 'Is \"undefined\" something')\n t.equal(is(Number.NaN), false, 'Is \"NaN\" something')\n\n t.equal(not(is)(Number.NaN), true, '\"NaN\" is not something')\n\n t.equal(isTrue(\"\"), false, \"empty string is not true\")\n t.equal(isTrue(true), true, \"boolean value true is true\")\n\n t.equal(isFalse(\"\"), false, \"empty string is not false\")\n t.equal(isFalse(false), true, \"boolean value false is false\")\n\n t.equal(isNothing(false), false, '\"false\" is something')\n t.equal(isNothing(0), false, `\"0\" is something`)\n t.equal(isNothing(\"\"), false, \"Empty-string is something\")\n t.equal(isNothing(null), true, '\"null\" is nothing')\n t.equal(isNothing(), true, '\"undefined\" is nothing')\n t.equal(isNothing(Number.NaN), true, '\"NaN\" is nothing')\n\n t.equal(isObject(null), false, \"null is not object\")\n t.equal(isObject({}), true, \"{} is object\")\n t.equal(isObject([]), false, \"[] is not object\")\n t.equal(isObject(\"lorem\"), false, \"string is not object\")\n\n t.end()\n})\n"],"names":["test","is","isNothing","isTrue","not","isFalse","isObject","t","equal","undefined","Number","NaN","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/is/is.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { is, isNothing, isTrue, not, isFalse, isObject } from \"./is.js\"\n\ntest(\"is\", t => {\n t.equal(is(false), true, 'Is \"false\" something')\n t.equal(is(0), true, `Is \"0\" something`)\n t.equal(is(\"\"), true, \"Is empty-string something\")\n t.equal(is(null), false, 'Is \"null\" something')\n t.equal(is(undefined), false, 'Is \"undefined\" something')\n t.equal(is(Number.NaN), false, 'Is \"NaN\" something')\n\n t.equal(not(is)(Number.NaN), true, '\"NaN\" is not something')\n\n t.equal(isTrue(\"\"), false, \"empty string is not true\")\n t.equal(isTrue(true), true, \"boolean value true is true\")\n\n t.equal(isFalse(\"\"), false, \"empty string is not false\")\n t.equal(isFalse(false), true, \"boolean value false is false\")\n\n t.equal(isNothing(false), false, '\"false\" is something')\n t.equal(isNothing(0), false, `\"0\" is something`)\n t.equal(isNothing(\"\"), false, \"Empty-string is something\")\n t.equal(isNothing(null), true, '\"null\" is nothing')\n t.equal(isNothing(), true, '\"undefined\" is nothing')\n t.equal(isNothing(Number.NaN), true, '\"NaN\" is nothing')\n\n t.equal(isObject(null), false, \"null is not object\")\n t.equal(isObject({}), true, \"{} is object\")\n t.equal(isObject([]), false, \"[] is not object\")\n t.equal(isObject(\"lorem\"), false, \"string is not object\")\n\n t.end()\n})\n"],"names":["test","is","isNothing","isTrue","not","isFalse","isObject","t","equal","undefined","Number","NaN","end"],"mappings":"AAAA,kCAAkC,GAElC,OAAOA,UAAU,OAAM;AAEvB,SAASC,EAAE,EAAEC,SAAS,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,UAAS;AAEvEN,KAAK,MAAMO,SAAAA,GAAK;IACdA,EAAEC,KAAK,CAACP,GAAG,KAAK,GAAG,IAAI,EAAE;IACzBM,EAAEC,KAAK,CAACP,GAAG,IAAI,IAAI,EAAG;IACtBM,EAAEC,KAAK,CAACP,GAAG,KAAK,IAAI,EAAE;IACtBM,EAAEC,KAAK,CAACP,GAAG,IAAI,GAAG,KAAK,EAAE;IACzBM,EAAEC,KAAK,CAACP,GAAGQ,YAAY,KAAK,EAAE;IAC9BF,EAAEC,KAAK,CAACP,GAAGS,OAAOC,GAAG,GAAG,KAAK,EAAE;IAE/BJ,EAAEC,KAAK,CAACJ,IAAIH,IAAIS,OAAOC,GAAG,GAAG,IAAI,EAAE;IAEnCJ,EAAEC,KAAK,CAACL,OAAO,KAAK,KAAK,EAAE;IAC3BI,EAAEC,KAAK,CAACL,OAAO,IAAI,GAAG,IAAI,EAAE;IAE5BI,EAAEC,KAAK,CAACH,QAAQ,KAAK,KAAK,EAAE;IAC5BE,EAAEC,KAAK,CAACH,QAAQ,KAAK,GAAG,IAAI,EAAE;IAE9BE,EAAEC,KAAK,CAACN,UAAU,KAAK,GAAG,KAAK,EAAE;IACjCK,EAAEC,KAAK,CAACN,UAAU,IAAI,KAAK,EAAG;IAC9BK,EAAEC,KAAK,CAACN,UAAU,KAAK,KAAK,EAAE;IAC9BK,EAAEC,KAAK,CAACN,UAAU,IAAI,GAAG,IAAI,EAAE;IAC/BK,EAAEC,KAAK,CAACN,aAAa,IAAI,EAAE;IAC3BK,EAAEC,KAAK,CAACN,UAAUQ,OAAOC,GAAG,GAAG,IAAI,EAAE;IAErCJ,EAAEC,KAAK,CAACF,SAAS,IAAI,GAAG,KAAK,EAAE;IAC/BC,EAAEC,KAAK,CAACF,SAAS,CAAC,IAAI,IAAI,EAAE;IAC5BC,EAAEC,KAAK,CAACF,SAAS,EAAE,GAAG,KAAK,EAAE;IAC7BC,EAAEC,KAAK,CAACF,SAAS,UAAU,KAAK,EAAE;IAElCC,EAAEK,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-between/is-between.js"],"sourcesContent":["/**\n * Check if value is inside open or closed interval\n *\n * @param {number} left Left limit\n * @param {number} right Right limit\n * @param {Object} arg3 Props\n * @param {boolean} arg3.closed If intervals is closed or not\n *\n * @returns {boolean}\n *\n * @tag Number\n * @signature (left: number, right: number, props: Object) => (source: number): boolean\n *\n * @example\n * between(2, 5)(5)\n * // => false\n *\n * between(2, 5, {closed: true})(5)\n * // => true\n */\nexport const isBetween =\n (left, right, { closed = false } = {}) =>\n input => {\n if (left > right) {\n throw new Error(\"Left interval limit must be less than right limit\")\n }\n\n return closed === false\n ? input > left && input < right\n : input >= left && input <= right\n }\n"],"names":["isBetween","left","right","closed","input","Error"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/is-between/is-between.js"],"sourcesContent":["/**\n * Check if value is inside open or closed interval\n *\n * @param {number} left Left limit\n * @param {number} right Right limit\n * @param {Object} arg3 Props\n * @param {boolean} arg3.closed If intervals is closed or not\n *\n * @returns {boolean}\n *\n * @tag Number\n * @signature (left: number, right: number, props: Object) => (source: number): boolean\n *\n * @example\n * between(2, 5)(5)\n * // => false\n *\n * between(2, 5, {closed: true})(5)\n * // => true\n */\nexport const isBetween =\n (left, right, { closed = false } = {}) =>\n input => {\n if (left > right) {\n throw new Error(\"Left interval limit must be less than right limit\")\n }\n\n return closed === false\n ? input > left && input < right\n : input >= left && input <= right\n }\n"],"names":["isBetween","left","right","closed","input","Error"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,IAAMA,YACX,SAACC,MAAMC;+EAA4B,CAAC,iBAApBC,QAAAA,8BAAS,KAAK;WAC9BC,SAAAA,OAAS;QACP,IAAIH,OAAOC,OAAO;YAChB,MAAM,IAAIG,MAAM,qDAAoD;QACtE,CAAC;QAED,OAAOF,WAAW,KAAK,GACnBC,QAAQH,QAAQG,QAAQF,QACxBE,SAASH,QAAQG,SAASF,KAAK;IACrC;EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-between/is-between.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { isBetween } from \"./is-between.js\"\n\ntest(\"isBetween\", t => {\n t.equals(isBetween(2, 5)(3), true, \"Number isBetween default open interval\")\n t.equals(isBetween(2, 5)(5), false, \"Number outside default open interval\")\n\n t.equals(\n isBetween(2, 5, { closed: true })(5),\n true,\n \"Number isBetween closed interval\"\n )\n\n t.equals(\n isBetween(2, 5, { closed: true })(1),\n false,\n \"Number outside closed interval\"\n )\n\n t.throws(\n () => isBetween(5, 2)(1),\n /Left interval limit must be less than right limit/,\n \"Left interval limit must be less than right limit\"\n )\n\n t.end()\n})\n"],"names":["test","isBetween","t","equals","closed","throws","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-between/is-between.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { isBetween } from \"./is-between.js\"\n\ntest(\"isBetween\", t => {\n t.equals(isBetween(2, 5)(3), true, \"Number isBetween default open interval\")\n t.equals(isBetween(2, 5)(5), false, \"Number outside default open interval\")\n\n t.equals(\n isBetween(2, 5, { closed: true })(5),\n true,\n \"Number isBetween closed interval\"\n )\n\n t.equals(\n isBetween(2, 5, { closed: true })(1),\n false,\n \"Number outside closed interval\"\n )\n\n t.throws(\n () => isBetween(5, 2)(1),\n /Left interval limit must be less than right limit/,\n \"Left interval limit must be less than right limit\"\n )\n\n t.end()\n})\n"],"names":["test","isBetween","t","equals","closed","throws","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,SAAS,QAAQ,kBAAiB;AAE3CD,KAAK,aAAaE,SAAAA,GAAK;IACrBA,EAAEC,MAAM,CAACF,UAAU,GAAG,GAAG,IAAI,IAAI,EAAE;IACnCC,EAAEC,MAAM,CAACF,UAAU,GAAG,GAAG,IAAI,KAAK,EAAE;IAEpCC,EAAEC,MAAM,CACNF,UAAU,GAAG,GAAG;QAAEG,QAAQ,IAAI;IAAC,GAAG,IAClC,IAAI,EACJ;IAGFF,EAAEC,MAAM,CACNF,UAAU,GAAG,GAAG;QAAEG,QAAQ,IAAI;IAAC,GAAG,IAClC,KAAK,EACL;IAGFF,EAAEG,MAAM,CACN;eAAMJ,UAAU,GAAG,GAAG;OACtB,qDACA;IAGFC,EAAEI,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-empty/is-empty.js"],"sourcesContent":["import { type } from \"../type/type.js\"\n\nconst byType = {\n Null: () => true,\n Undefined: () => true,\n Number: input => Number.isNaN(input),\n String: input => input === \"\",\n Array: input => input.length === 0,\n Object: input => Object.keys(input).length === 0,\n}\n\n/**\n * Check if variable is considered empty\n *\n * @param {any} input Source input\n *\n * @returns {boolean} True if empty, False otherwise\n *\n * @tag Core\n * @signature (source: any): boolean\n *\n * @example\n * isEmpty({}) // true\n * isEmpty(1) // false\n * isEmpty(false) // false\n * isEmpty(\"\") // true\n * isEmpty(null) // true\n * isEmpty(undefined) // true\n * isEmpty([]) // true\n * isEmpty(NaN) // true\n * isEmpty(/[A-z]/) // false\n * isEmpty(new Date()) // false\n * isEmpty(() => {}) // false\n * isEmpty(Promise.resolve()) // false\n */\nexport const isEmpty = input => {\n const inputType = type(input)\n\n return byType[inputType] ? byType[inputType](input) : false\n}\n\nexport const isNotEmpty = input => !isEmpty(input)\n"],"names":["type","byType","Null","Undefined","Number","input","isNaN","String","Array","length","Object","keys","isEmpty","inputType","isNotEmpty"],"mappings":"AAAA,SAASA,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/is-empty/is-empty.js"],"sourcesContent":["import { type } from \"../type/type.js\"\n\nconst byType = {\n Null: () => true,\n Undefined: () => true,\n Number: input => Number.isNaN(input),\n String: input => input === \"\",\n Array: input => input.length === 0,\n Object: input => Object.keys(input).length === 0,\n}\n\n/**\n * Check if variable is considered empty\n *\n * @param {any} input Source input\n *\n * @returns {boolean} True if empty, False otherwise\n *\n * @tag Core\n * @signature (source: any): boolean\n *\n * @example\n * isEmpty({}) // true\n * isEmpty(1) // false\n * isEmpty(false) // false\n * isEmpty(\"\") // true\n * isEmpty(null) // true\n * isEmpty(undefined) // true\n * isEmpty([]) // true\n * isEmpty(NaN) // true\n * isEmpty(/[A-z]/) // false\n * isEmpty(new Date()) // false\n * isEmpty(() => {}) // false\n * isEmpty(Promise.resolve()) // false\n */\nexport const isEmpty = input => {\n const inputType = type(input)\n\n return byType[inputType] ? byType[inputType](input) : false\n}\n\nexport const isNotEmpty = input => !isEmpty(input)\n"],"names":["type","byType","Null","Undefined","Number","input","isNaN","String","Array","length","Object","keys","isEmpty","inputType","isNotEmpty"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAiB;AAEtC,IAAMC,SAAS;IACbC,MAAM;eAAM,IAAI;;IAChBC,WAAW;eAAM,IAAI;;IACrBC,QAAQC,SAAAA;eAASD,OAAOE,KAAK,CAACD;;IAC9BE,QAAQF,SAAAA;eAASA,UAAU;;IAC3BG,OAAOH,SAAAA;eAASA,MAAMI,MAAM,KAAK;;IACjCC,QAAQL,SAAAA;eAASK,OAAOC,IAAI,CAACN,OAAOI,MAAM,KAAK;;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,IAAMG,UAAUP,SAAAA,OAAS;IAC9B,IAAMQ,YAAYb,KAAKK;IAEvB,OAAOJ,MAAM,CAACY,UAAU,GAAGZ,MAAM,CAACY,UAAU,CAACR,SAAS,KAAK;AAC7D,EAAC;AAED,OAAO,IAAMS,aAAaT,SAAAA;WAAS,CAACO,QAAQP;EAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-empty/is-empty.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEmpty, isNotEmpty } from \"./is-empty.js\"\n\ntest(\"isEmpty\", t => {\n t.equal(isEmpty({}), true, \"{} should equal true\")\n t.equal(isEmpty({ a: 2 }), false, \"{a:2} should equal false\")\n t.equal(isEmpty([]), true, \"[] should equal true\")\n t.equal(isEmpty([2]), false, \"[2] should equal false\")\n t.equal(isEmpty(\"\"), true, '\"\" should equal true')\n t.equal(isEmpty(\"2\"), false, '\"2\" should equal false')\n t.equal(isEmpty(2), false, \"2 should equal false\")\n t.equal(isEmpty(Number.NaN), true, \"NaN should equal true\")\n t.equal(isEmpty(null), true, \"null should equal true\")\n t.equal(isEmpty(), true, \"undefined should equal true\")\n t.equal(\n isEmpty(() => {}),\n false,\n \"() => {} should equal false\"\n )\n t.equal(isEmpty(new Date()), false, \"Date() should equal false\")\n t.equal(isEmpty(Promise.resolve(2)), false, \"Promise() should equal false\")\n t.end()\n})\n\ntest(\"isNotEmpty\", t => {\n t.equal(isNotEmpty({ a: 2 }), true, \"{a:2} should equal true\")\n t.equal(isNotEmpty({}), false, \"{} should equal false\")\n t.equal(isNotEmpty([2]), true, \"[2] should equal true\")\n t.equal(isNotEmpty([]), false, \"[] should equal false\")\n t.end()\n})\n"],"names":["test","isEmpty","isNotEmpty","t","equal","a","Number","NaN","Date","Promise","resolve","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-empty/is-empty.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEmpty, isNotEmpty } from \"./is-empty.js\"\n\ntest(\"isEmpty\", t => {\n t.equal(isEmpty({}), true, \"{} should equal true\")\n t.equal(isEmpty({ a: 2 }), false, \"{a:2} should equal false\")\n t.equal(isEmpty([]), true, \"[] should equal true\")\n t.equal(isEmpty([2]), false, \"[2] should equal false\")\n t.equal(isEmpty(\"\"), true, '\"\" should equal true')\n t.equal(isEmpty(\"2\"), false, '\"2\" should equal false')\n t.equal(isEmpty(2), false, \"2 should equal false\")\n t.equal(isEmpty(Number.NaN), true, \"NaN should equal true\")\n t.equal(isEmpty(null), true, \"null should equal true\")\n t.equal(isEmpty(), true, \"undefined should equal true\")\n t.equal(\n isEmpty(() => {}),\n false,\n \"() => {} should equal false\"\n )\n t.equal(isEmpty(new Date()), false, \"Date() should equal false\")\n t.equal(isEmpty(Promise.resolve(2)), false, \"Promise() should equal false\")\n t.end()\n})\n\ntest(\"isNotEmpty\", t => {\n t.equal(isNotEmpty({ a: 2 }), true, \"{a:2} should equal true\")\n t.equal(isNotEmpty({}), false, \"{} should equal false\")\n t.equal(isNotEmpty([2]), true, \"[2] should equal true\")\n t.equal(isNotEmpty([]), false, \"[] should equal false\")\n t.end()\n})\n"],"names":["test","isEmpty","isNotEmpty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AG,KAAK,EAAE;IAC/BC,EAAEQ,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-equal/is-equal.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\nconst _isEqual = (a, b) => (Number.isNaN(a) && Number.isNaN(b) ? true : a === b)\n\n/**\n * Check if a tripple-equals b (accounts for null, undefined and NaN)\n *\n * @param {any} a First value\n * @param {any} b Second value\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (a: Mixed) => (b: Mixed): Boolean\n * @signature (a: Mixed, b: Mixed): Boolean\n *\n * @example\n * equal(2)(2)\n * // => true\n *\n * equal(\"2\")(2)\n * // => false\n *\n * equal(NaN)(NaN)\n * // => true\n *\n * equal([1])([1])\n * // => false\n */\nexport const isEqual = curry(_isEqual)\n"],"names":["curry","_isEqual","a","b","Number","isNaN","isEqual"],"mappings":"AAAA,SAASA,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/is-equal/is-equal.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\nconst _isEqual = (a, b) => (Number.isNaN(a) && Number.isNaN(b) ? true : a === b)\n\n/**\n * Check if a tripple-equals b (accounts for null, undefined and NaN)\n *\n * @param {any} a First value\n * @param {any} b Second value\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (a: Mixed) => (b: Mixed): Boolean\n * @signature (a: Mixed, b: Mixed): Boolean\n *\n * @example\n * equal(2)(2)\n * // => true\n *\n * equal(\"2\")(2)\n * // => false\n *\n * equal(NaN)(NaN)\n * // => true\n *\n * equal([1])([1])\n * // => false\n */\nexport const isEqual = curry(_isEqual)\n"],"names":["curry","_isEqual","a","b","Number","isNaN","isEqual"],"mappings":"AAAA,SAASA,KAAK,QAAQ,oBAAmB;AAEzC,IAAMC,WAAW,SAACC,GAAGC;WAAOC,OAAOC,KAAK,CAACH,MAAME,OAAOC,KAAK,CAACF,KAAK,IAAI,GAAGD,MAAMC,CAAC;;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,IAAMG,UAAUN,MAAMC,UAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-equal/is-equal.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEqual } from \"./is-equal.js\"\n\ntest(\"isEqual\", t => {\n t.equals(isEqual(2)(2), true, \"Compare two equal primitives\")\n\n t.equals(isEqual(\"2\")(2), false, \"Compare two not-equal primitives\")\n\n t.equals(isEqual(Number.NaN)(Number.NaN), true, \"Compare two NaN values\")\n\n t.equals(isEqual(null)(null), true, \"Compare two null values\")\n\n t.equals(isEqual()(), true, \"Compare two undefined values\")\n\n t.equals(isEqual([1])([1]), false, \"Compare two arrays with same content\")\n\n t.equals(\n isEqual({ a: 1 })({ a: 1 }),\n false,\n \"Compare two objects with same content\"\n )\n\n t.end()\n})\n"],"names":["test","isEqual","t","equals","Number","NaN","a","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-equal/is-equal.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEqual } from \"./is-equal.js\"\n\ntest(\"isEqual\", t => {\n t.equals(isEqual(2)(2), true, \"Compare two equal primitives\")\n\n t.equals(isEqual(\"2\")(2), false, \"Compare two not-equal primitives\")\n\n t.equals(isEqual(Number.NaN)(Number.NaN), true, \"Compare two NaN values\")\n\n t.equals(isEqual(null)(null), true, \"Compare two null values\")\n\n t.equals(isEqual()(), true, \"Compare two undefined values\")\n\n t.equals(isEqual([1])([1]), false, \"Compare two arrays with same content\")\n\n t.equals(\n isEqual({ a: 1 })({ a: 1 }),\n false,\n \"Compare two objects with same content\"\n )\n\n t.end()\n})\n"],"names":["test","isEqual","t","equals","Number","NaN","a","end"],"mappings":"AAAA,kCAAkC,GAElC,OAAOA,UAAU,OAAM;AAEvB,SAASC,OAAO,QAAQ,gBAAe;AAEvCD,KAAK,WAAWE,SAAAA,GAAK;IACnBA,EAAEC,MAAM,CAACF,QAAQ,GAAG,IAAI,IAAI,EAAE;IAE9BC,EAAEC,MAAM,CAACF,QAAQ,KAAK,IAAI,KAAK,EAAE;IAEjCC,EAAEC,MAAM,CAACF,QAAQG,OAAOC,GAAG,EAAED,OAAOC,GAAG,GAAG,IAAI,EAAE;IAEhDH,EAAEC,MAAM,CAACF,QAAQ,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE;IAEpCC,EAAEC,MAAM,CAACF,aAAa,IAAI,EAAE;IAE5BC,EAAEC,MAAM,CAACF,QAAQ;QAAC;KAAE,EAAE;QAAC;KAAE,GAAG,KAAK,EAAE;IAEnCC,EAAEC,MAAM,CACNF,QAAQ;QAAEK,GAAG;IAAE,GAAG;QAAEA,GAAG;IAAE,IACzB,KAAK,EACL;IAGFJ,EAAEK,GAAG;AACP"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
2
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
3
|
import { pipe } from "../pipe/pipe.js";
|
|
3
4
|
import { curry } from "../curry/curry.js";
|
|
4
5
|
import { all } from "../all/all.js";
|
|
@@ -11,8 +12,8 @@ var byFn = function(shouldBe, value, not) {
|
|
|
11
12
|
};
|
|
12
13
|
var _isMatch = function(subset, input) {
|
|
13
14
|
return all(function(param) {
|
|
14
|
-
var _param =
|
|
15
|
-
var shouldBe = Array.isArray(_shouldBe) ? pipe.apply(void 0,
|
|
15
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], _shouldBe = _param[1];
|
|
16
|
+
var shouldBe = Array.isArray(_shouldBe) ? pipe.apply(void 0, _to_consumable_array(_shouldBe)) : _shouldBe;
|
|
16
17
|
var shouldTestNegation = key[0] === "!";
|
|
17
18
|
var inputKey = key.replace("!", "");
|
|
18
19
|
var value = input[inputKey];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-match/is-match.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { all } from \"../all/all.js\"\n\nconst byValue = (shouldBe, value, not) =>\n not ? shouldBe !== value : shouldBe === value\n\nconst byFn = (shouldBe, value, not) => {\n const result = shouldBe(value) === true\n\n return not ? !result : result\n}\n\nconst _isMatch = (subset, input) =>\n all(([key, _shouldBe]) => {\n const shouldBe = Array.isArray(_shouldBe) ? pipe(..._shouldBe) : _shouldBe\n const shouldTestNegation = key[0] === \"!\"\n const inputKey = key.replace(\"!\", \"\")\n const value = input[inputKey]\n\n return typeof shouldBe === \"function\"\n ? byFn(shouldBe, value, shouldTestNegation)\n : byValue(shouldBe, value, shouldTestNegation)\n })(Object.entries(subset))\n\n/**\n * Determines if one object's properties are equal to another\n *\n * @name isMatch\n * @tag Core\n * @signature (subset: Object)(source: Object): boolean\n *\n * @param {object} subset Set of properties that should match\n * @param {object} source Object matching against\n *\n * @returns {boolean} True if all \"subset\" properties are of equal (shallow\n * compare) value to properties in \"source\" object, otherwise false\n *\n * @example\n * isMatch({\n * id: 2,\n * parentId: null,\n * })({\n * id: 2,\n * parentId: null\n * name: \"John\",\n * })\n * // true\n *\n * isMatch({\n * \"!parentId\": null,\n * \"name\": \"John\",\n * })({\n * id: 2,\n * parentId: null,\n * name: \"John\",\n * })\n * // false\n */\nexport const isMatch = curry(_isMatch)\n"],"names":["pipe","curry","all","byValue","shouldBe","value","not","byFn","result","_isMatch","subset","input","key","_shouldBe","Array","isArray","shouldTestNegation","inputKey","replace","Object","entries","isMatch"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/is-match/is-match.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { all } from \"../all/all.js\"\n\nconst byValue = (shouldBe, value, not) =>\n not ? shouldBe !== value : shouldBe === value\n\nconst byFn = (shouldBe, value, not) => {\n const result = shouldBe(value) === true\n\n return not ? !result : result\n}\n\nconst _isMatch = (subset, input) =>\n all(([key, _shouldBe]) => {\n const shouldBe = Array.isArray(_shouldBe) ? pipe(..._shouldBe) : _shouldBe\n const shouldTestNegation = key[0] === \"!\"\n const inputKey = key.replace(\"!\", \"\")\n const value = input[inputKey]\n\n return typeof shouldBe === \"function\"\n ? byFn(shouldBe, value, shouldTestNegation)\n : byValue(shouldBe, value, shouldTestNegation)\n })(Object.entries(subset))\n\n/**\n * Determines if one object's properties are equal to another\n *\n * @name isMatch\n * @tag Core\n * @signature (subset: Object)(source: Object): boolean\n *\n * @param {object} subset Set of properties that should match\n * @param {object} source Object matching against\n *\n * @returns {boolean} True if all \"subset\" properties are of equal (shallow\n * compare) value to properties in \"source\" object, otherwise false\n *\n * @example\n * isMatch({\n * id: 2,\n * parentId: null,\n * })({\n * id: 2,\n * parentId: null\n * name: \"John\",\n * })\n * // true\n *\n * isMatch({\n * \"!parentId\": null,\n * \"name\": \"John\",\n * })({\n * id: 2,\n * parentId: null,\n * name: \"John\",\n * })\n * // false\n */\nexport const isMatch = curry(_isMatch)\n"],"names":["pipe","curry","all","byValue","shouldBe","value","not","byFn","result","_isMatch","subset","input","key","_shouldBe","Array","isArray","shouldTestNegation","inputKey","replace","Object","entries","isMatch"],"mappings":"AAAA;;AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,KAAK,QAAQ,oBAAmB;AACzC,SAASC,GAAG,QAAQ,gBAAe;AAEnC,IAAMC,UAAU,SAACC,UAAUC,OAAOC;WAChCA,MAAMF,aAAaC,QAAQD,aAAaC,KAAK;;AAE/C,IAAME,OAAO,SAACH,UAAUC,OAAOC,KAAQ;IACrC,IAAME,SAASJ,SAASC,WAAW,IAAI;IAEvC,OAAOC,MAAM,CAACE,SAASA,MAAM;AAC/B;AAEA,IAAMC,WAAW,SAACC,QAAQC;WACxBT,IAAI,gBAAsB;iDAApBU,iBAAKC;QACT,IAAMT,WAAWU,MAAMC,OAAO,CAACF,aAAab,KAAAA,MAAAA,KAAAA,GAAK,qBAAGa,cAAaA,SAAS;QAC1E,IAAMG,qBAAqBJ,GAAG,CAAC,EAAE,KAAK;QACtC,IAAMK,WAAWL,IAAIM,OAAO,CAAC,KAAK;QAClC,IAAMb,QAAQM,KAAK,CAACM,SAAS;QAE7B,OAAO,OAAOb,aAAa,aACvBG,KAAKH,UAAUC,OAAOW,sBACtBb,QAAQC,UAAUC,OAAOW,mBAAmB;IAClD,GAAGG,OAAOC,OAAO,CAACV;;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,IAAMW,UAAUpB,MAAMQ,UAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-match/is-match.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEqual } from \"../is-equal/is-equal.js\"\nimport { read } from \"../read/read.js\"\nimport { isMatch } from \"./is-match.js\"\n\ntest(\"isMatch\", t => {\n t.deepEqual(\n isMatch({\n id: 2,\n parentId: null,\n })({\n id: 2,\n parentId: null,\n name: \"John\",\n }),\n true,\n \"Properties are present and have equal values\"\n )\n\n t.deepEqual(\n isMatch(\n {\n tag: [read(\"userId\"), isEqual(2)],\n },\n {\n id: 2,\n tag: { id: 1, userId: 2 },\n }\n ),\n true,\n \"Match using piped functions\"\n )\n\n t.deepEqual(\n isMatch({\n name: \"John\",\n parentId: null,\n })({\n id: 2,\n parentId: 3,\n name: \"John\",\n }),\n false,\n \"Properties are present but dont have equal values\"\n )\n\n t.deepEqual(\n isMatch({\n \"name\": \"John\",\n \"!parentId\": null,\n })({\n id: 2,\n parentId: null,\n name: \"John\",\n }),\n false,\n \"Properties are present but dont have equal values (has negation)\"\n )\n\n t.deepEqual(\n isMatch({\n \"name\": \"John\",\n \"!parentId\": null,\n })({\n id: 2,\n name: \"John\",\n }),\n true,\n \"Properties are not present\"\n )\n\n t.deepEqual(\n isMatch({\n \"!id\": item => item === 3,\n \"name\": item => item !== \"John\",\n })({\n id: 2,\n name: \"JohnX\",\n }),\n true,\n \"Matching with predicate functions\"\n )\n\n t.deepEqual(\n isMatch({\n id: 2,\n name: item => item !== \"John\",\n })({\n id: 2,\n name: \"JohnX\",\n }),\n true,\n \"Matching with predicate function and value\"\n )\n\n t.end()\n})\n"],"names":["test","isEqual","read","isMatch","t","deepEqual","id","parentId","name","tag","userId","item","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-match/is-match.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isEqual } from \"../is-equal/is-equal.js\"\nimport { read } from \"../read/read.js\"\nimport { isMatch } from \"./is-match.js\"\n\ntest(\"isMatch\", t => {\n t.deepEqual(\n isMatch({\n id: 2,\n parentId: null,\n })({\n id: 2,\n parentId: null,\n name: \"John\",\n }),\n true,\n \"Properties are present and have equal values\"\n )\n\n t.deepEqual(\n isMatch(\n {\n tag: [read(\"userId\"), isEqual(2)],\n },\n {\n id: 2,\n tag: { id: 1, userId: 2 },\n }\n ),\n true,\n \"Match using piped functions\"\n )\n\n t.deepEqual(\n isMatch({\n name: \"John\",\n parentId: null,\n })({\n id: 2,\n parentId: 3,\n name: \"John\",\n }),\n false,\n \"Properties are present but dont have equal values\"\n )\n\n t.deepEqual(\n isMatch({\n \"name\": \"John\",\n \"!parentId\": null,\n })({\n id: 2,\n parentId: null,\n name: \"John\",\n }),\n false,\n \"Properties are present but dont have equal values (has negation)\"\n )\n\n t.deepEqual(\n isMatch({\n \"name\": \"John\",\n \"!parentId\": null,\n })({\n id: 2,\n name: \"John\",\n }),\n true,\n \"Properties are not present\"\n )\n\n t.deepEqual(\n isMatch({\n \"!id\": item => item === 3,\n \"name\": item => item !== \"John\",\n })({\n id: 2,\n name: \"JohnX\",\n }),\n true,\n \"Matching with predicate functions\"\n )\n\n t.deepEqual(\n isMatch({\n id: 2,\n name: item => item !== \"John\",\n })({\n id: 2,\n name: \"JohnX\",\n }),\n true,\n \"Matching with predicate function and value\"\n )\n\n t.end()\n})\n"],"names":["test","isEqual","read","isMatch","t","deepEqual","id","parentId","name","tag","userId","item","end"],"mappings":"AAAA,kCAAkC,GAElC,OAAOA,UAAU,OAAM;AAEvB,SAASC,OAAO,QAAQ,0BAAyB;AACjD,SAASC,IAAI,QAAQ,kBAAiB;AACtC,SAASC,OAAO,QAAQ,gBAAe;AAEvCH,KAAK,WAAWI,SAAAA,GAAK;IACnBA,EAAEC,SAAS,CACTF,QAAQ;QACNG,IAAI;QACJC,UAAU,IAAI;IAChB,GAAG;QACDD,IAAI;QACJC,UAAU,IAAI;QACdC,MAAM;IACR,IACA,IAAI,EACJ;IAGFJ,EAAEC,SAAS,CACTF,QACE;QACEM,KAAK;YAACP,KAAK;YAAWD,QAAQ;SAAG;IACnC,GACA;QACEK,IAAI;QACJG,KAAK;YAAEH,IAAI;YAAGI,QAAQ;QAAE;IAC1B,IAEF,IAAI,EACJ;IAGFN,EAAEC,SAAS,CACTF,QAAQ;QACNK,MAAM;QACND,UAAU,IAAI;IAChB,GAAG;QACDD,IAAI;QACJC,UAAU;QACVC,MAAM;IACR,IACA,KAAK,EACL;IAGFJ,EAAEC,SAAS,CACTF,QAAQ;QACN,QAAQ;QACR,aAAa,IAAI;IACnB,GAAG;QACDG,IAAI;QACJC,UAAU,IAAI;QACdC,MAAM;IACR,IACA,KAAK,EACL;IAGFJ,EAAEC,SAAS,CACTF,QAAQ;QACN,QAAQ;QACR,aAAa,IAAI;IACnB,GAAG;QACDG,IAAI;QACJE,MAAM;IACR,IACA,IAAI,EACJ;IAGFJ,EAAEC,SAAS,CACTF,QAAQ;QACN,OAAOQ,SAAAA;mBAAQA,SAAS;;QACxB,QAAQA,SAAAA;mBAAQA,SAAS;;IAC3B,GAAG;QACDL,IAAI;QACJE,MAAM;IACR,IACA,IAAI,EACJ;IAGFJ,EAAEC,SAAS,CACTF,QAAQ;QACNG,IAAI;QACJE,MAAMG,SAAAA;mBAAQA,SAAS;;IACzB,GAAG;QACDL,IAAI;QACJE,MAAM;IACR,IACA,IAAI,EACJ;IAGFJ,EAAEQ,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-uri/is-uri.js"],"sourcesContent":["import RFC3986 from \"rfc-3986\"\n\nconst URIRegExp = new RegExp(RFC3986.uri)\n\n/**\n * Check if a string is a valid URI based on [RFC3986](https://tools.ietf.org/html/rfc3986)\n *\n * @param {string} input\n *\n * @returns {boolean}\n *\n * @name isURI\n * @tag Other\n * @signature (source: string): boolean\n *\n * @example\n * isURI(\"lorem\")\n * // false\n *\n * isURI(\"http://www.ietf.org/rfc/rfc2396.txt\")\n * // true\n */\nexport const isURI = input => URIRegExp.test(input)\n"],"names":["RFC3986","URIRegExp","RegExp","uri","isURI","input","test"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-uri/is-uri.js"],"sourcesContent":["import RFC3986 from \"rfc-3986\"\n\nconst URIRegExp = new RegExp(RFC3986.uri)\n\n/**\n * Check if a string is a valid URI based on [RFC3986](https://tools.ietf.org/html/rfc3986)\n *\n * @param {string} input\n *\n * @returns {boolean}\n *\n * @name isURI\n * @tag Other\n * @signature (source: string): boolean\n *\n * @example\n * isURI(\"lorem\")\n * // false\n *\n * isURI(\"http://www.ietf.org/rfc/rfc2396.txt\")\n * // true\n */\nexport const isURI = input => URIRegExp.test(input)\n"],"names":["RFC3986","URIRegExp","RegExp","uri","isURI","input","test"],"mappings":"AAAA,OAAOA,aAAa,WAAU;AAE9B,IAAMC,YAAY,IAAIC,OAAOF,QAAQG,GAAG;AAExC;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,IAAMC,QAAQC,SAAAA;WAASJ,UAAUK,IAAI,CAACD;EAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/is-uri/is-uri.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isURI } from \"./is-uri.js\"\n\ntest(\"isURI\", t => {\n t.equal(isURI(2), false, \"given [a number] should [return false]\")\n\n t.equal(isURI(null), false, \"given [null] should [return false]\")\n\n t.equal(isURI(), false, \"given [undefined] should [return false]\")\n\n t.equal(isURI(\"lorem\"), false, \"given [random word] should [return false]\")\n\n t.equal(\n isURI(\"ftp://ftp.is.co.za/rfc/rfc1808.txt\"),\n true,\n \"given [FTP file address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"http://www.ietf.org/rfc/rfc2396.txt\"),\n true,\n \"given [HTTP file address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"www.ietf.org/rfc/rfc2396.txt\"),\n false,\n \"given [HTTP file address without protocol] should [return false]\"\n )\n\n t.equal(\n isURI(\"mailto:John.Doe@example.com\"),\n true,\n \"given [Email address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"John.Doe@example.com\"),\n false,\n \"given [Email address without protocol] should [return false]\"\n )\n\n t.end()\n})\n"],"names":["test","isURI","t","equal","end"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/is-uri/is-uri.test.js"],"sourcesContent":["/* eslint-disable unicorn/no-null */\n\nimport test from \"tape\"\n\nimport { isURI } from \"./is-uri.js\"\n\ntest(\"isURI\", t => {\n t.equal(isURI(2), false, \"given [a number] should [return false]\")\n\n t.equal(isURI(null), false, \"given [null] should [return false]\")\n\n t.equal(isURI(), false, \"given [undefined] should [return false]\")\n\n t.equal(isURI(\"lorem\"), false, \"given [random word] should [return false]\")\n\n t.equal(\n isURI(\"ftp://ftp.is.co.za/rfc/rfc1808.txt\"),\n true,\n \"given [FTP file address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"http://www.ietf.org/rfc/rfc2396.txt\"),\n true,\n \"given [HTTP file address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"www.ietf.org/rfc/rfc2396.txt\"),\n false,\n \"given [HTTP file address without protocol] should [return false]\"\n )\n\n t.equal(\n isURI(\"mailto:John.Doe@example.com\"),\n true,\n \"given [Email address with protocol] should [return true]\"\n )\n\n t.equal(\n isURI(\"John.Doe@example.com\"),\n false,\n \"given [Email address without protocol] should [return false]\"\n )\n\n t.end()\n})\n"],"names":["test","isURI","t","equal","end"],"mappings":"AAAA,kCAAkC,GAElC,OAAOA,UAAU,OAAM;AAEvB,SAASC,KAAK,QAAQ,cAAa;AAEnCD,KAAK,SAASE,SAAAA,GAAK;IACjBA,EAAEC,KAAK,CAACF,MAAM,IAAI,KAAK,EAAE;IAEzBC,EAAEC,KAAK,CAACF,MAAM,IAAI,GAAG,KAAK,EAAE;IAE5BC,EAAEC,KAAK,CAACF,SAAS,KAAK,EAAE;IAExBC,EAAEC,KAAK,CAACF,MAAM,UAAU,KAAK,EAAE;IAE/BC,EAAEC,KAAK,CACLF,MAAM,uCACN,IAAI,EACJ;IAGFC,EAAEC,KAAK,CACLF,MAAM,wCACN,IAAI,EACJ;IAGFC,EAAEC,KAAK,CACLF,MAAM,iCACN,KAAK,EACL;IAGFC,EAAEC,KAAK,CACLF,MAAM,gCACN,IAAI,EACJ;IAGFC,EAAEC,KAAK,CACLF,MAAM,yBACN,KAAK,EACL;IAGFC,EAAEE,GAAG;AACP"}
|
package/dist/join/join.js
CHANGED
|
@@ -12,7 +12,7 @@ var _joinBy = function(predicateFn, mergeFn, aList, bList) {
|
|
|
12
12
|
var result = distinctBy(predicateFn, aList);
|
|
13
13
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
14
14
|
try {
|
|
15
|
-
var _loop = function(
|
|
15
|
+
var _loop = function() {
|
|
16
16
|
var b = _step.value;
|
|
17
17
|
var aIndex = findIndex(function(item) {
|
|
18
18
|
return predicateFn(item, b);
|
|
@@ -23,7 +23,7 @@ var _joinBy = function(predicateFn, mergeFn, aList, bList) {
|
|
|
23
23
|
result[aIndex] = mergeFn(result[aIndex], b);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
for(var _iterator = bList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop(
|
|
26
|
+
for(var _iterator = bList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
27
27
|
} catch (err) {
|
|
28
28
|
_didIteratorError = true;
|
|
29
29
|
_iteratorError = err;
|
package/dist/join/join.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/join/join.js"],"sourcesContent":["import { findIndex } from \"../find-index/find-index.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { distinctBy } from \"../distinct/distinct.js\"\nimport { isEqual } from \"../is-equal/is-equal.js\"\n\nconst _joinBy = (predicateFn, mergeFn, aList, bList) => {\n if (aList.length === 0) {\n return bList\n }\n\n if (bList.length === 0) {\n return aList\n }\n\n const result = distinctBy(predicateFn, aList)\n\n for (const b of bList) {\n const aIndex = findIndex(item => predicateFn(item, b), result)\n\n if (aIndex === -1) {\n result.push(b)\n } else {\n result[aIndex] = mergeFn(result[aIndex], b)\n }\n }\n\n return result\n}\n\nconst _join = (aList, bList) => _joinBy(isEqual, a => a, aList, bList)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of items\n * from both arrays.\n *\n * The function starts with the distinct items from aList and each item of bList\n * will be searched using a shallow equal. If found, it will be discarded.\n *\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name join\n * @tag Array\n * @signature (aList: any[], bList: any[]): any[]\n *\n * @see {@link overlapBy}\n * @see {@link intersect}\n * @see {@link intersectBy}\n *\n * @example\n * join([1, 1, 2, 3, 3], [3, 3, 4, 4, 5])\n * // => [1, 2, 3, 4, 5]\n */\nexport const join = curry(_join)\n\nexport const joinBy = curry(_joinBy)\n"],"names":["findIndex","curry","distinctBy","isEqual","_joinBy","predicateFn","mergeFn","aList","bList","length","result","b","aIndex","item","push","_join","a","join","joinBy"],"mappings":"AAAA,SAASA,SAAS,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/join/join.js"],"sourcesContent":["import { findIndex } from \"../find-index/find-index.js\"\nimport { curry } from \"../curry/curry.js\"\nimport { distinctBy } from \"../distinct/distinct.js\"\nimport { isEqual } from \"../is-equal/is-equal.js\"\n\nconst _joinBy = (predicateFn, mergeFn, aList, bList) => {\n if (aList.length === 0) {\n return bList\n }\n\n if (bList.length === 0) {\n return aList\n }\n\n const result = distinctBy(predicateFn, aList)\n\n for (const b of bList) {\n const aIndex = findIndex(item => predicateFn(item, b), result)\n\n if (aIndex === -1) {\n result.push(b)\n } else {\n result[aIndex] = mergeFn(result[aIndex], b)\n }\n }\n\n return result\n}\n\nconst _join = (aList, bList) => _joinBy(isEqual, a => a, aList, bList)\n\n/**\n * Combine two arrays into one a set (array of unique items), composed of items\n * from both arrays.\n *\n * The function starts with the distinct items from aList and each item of bList\n * will be searched using a shallow equal. If found, it will be discarded.\n *\n * @param {any[]} aList\n * @param {any[]} bList\n *\n * @returns {any[]}\n *\n * @name join\n * @tag Array\n * @signature (aList: any[], bList: any[]): any[]\n *\n * @see {@link overlapBy}\n * @see {@link intersect}\n * @see {@link intersectBy}\n *\n * @example\n * join([1, 1, 2, 3, 3], [3, 3, 4, 4, 5])\n * // => [1, 2, 3, 4, 5]\n */\nexport const join = curry(_join)\n\nexport const joinBy = curry(_joinBy)\n"],"names":["findIndex","curry","distinctBy","isEqual","_joinBy","predicateFn","mergeFn","aList","bList","length","result","b","aIndex","item","push","_join","a","join","joinBy"],"mappings":"AAAA,SAASA,SAAS,QAAQ,8BAA6B;AACvD,SAASC,KAAK,QAAQ,oBAAmB;AACzC,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,IAAMC,UAAU,SAACC,aAAaC,SAASC,OAAOC,OAAU;IACtD,IAAID,MAAME,MAAM,KAAK,GAAG;QACtB,OAAOD;IACT,CAAC;IAED,IAAIA,MAAMC,MAAM,KAAK,GAAG;QACtB,OAAOF;IACT,CAAC;IAED,IAAMG,SAASR,WAAWG,aAAaE;QAElC,kCAAA,2BAAA;;+BAAkB;YAAlB,IAAMI,IAAN;YACH,IAAMC,SAASZ,UAAUa,SAAAA;uBAAQR,YAAYQ,MAAMF;eAAID;YAEvD,IAAIE,WAAW,CAAC,GAAG;gBACjBF,OAAOI,IAAI,CAACH;YACd,OAAO;gBACLD,MAAM,CAACE,OAAO,GAAGN,QAAQI,MAAM,CAACE,OAAO,EAAED;YAC3C,CAAC;QACH;QARA,QAAK,YAAWH,0BAAX,SAAA,6BAAA,QAAA,yBAAA;;QAAA;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAUL,OAAOE;AACT;AAEA,IAAMK,QAAQ,SAACR,OAAOC;WAAUJ,QAAQD,SAASa,SAAAA;eAAKA;OAAGT,OAAOC;;AAEhE;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,IAAMS,OAAOhB,MAAMc,OAAM;AAEhC,OAAO,IAAMG,SAASjB,MAAMG,SAAQ"}
|
package/dist/join/join.test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
2
|
import test from "tape";
|
|
3
3
|
import { join, joinBy } from "./join.js";
|
|
4
4
|
test("join", function(t) {
|
|
@@ -59,7 +59,7 @@ test("joinBy", function(t) {
|
|
|
59
59
|
t.deepEqual(joinBy(function(a, b) {
|
|
60
60
|
return a.id === b.id;
|
|
61
61
|
}, function(a, b) {
|
|
62
|
-
return
|
|
62
|
+
return _object_spread({}, a, b);
|
|
63
63
|
}, [
|
|
64
64
|
{
|
|
65
65
|
id: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/join/join.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { join, joinBy } from \"./join.js\"\n\ntest(\"join\", t => {\n t.deepEqual(\n join([], [1, 2, 3]),\n [1, 2, 3],\n \"given [empty first array] should [return contents of second array]\"\n )\n\n t.deepEqual(\n join([1, 2, 3], []),\n [1, 2, 3],\n \"given [empty second array] should [return contents of first array]\"\n )\n\n t.deepEqual(\n join([1, 1, 2, 3, 3], [3, 3, 4, 4, 5]),\n [1, 2, 3, 4, 5],\n \"given [two non empty arrays with common items] should [return distinct items of both arrays]\"\n )\n\n t.deepEqual(\n join([1, 2])([3, 4, 5]),\n [1, 2, 3, 4, 5],\n \"given [two non empty arrays without common items] should [return array with items from both arrays]\"\n )\n\n t.end()\n})\n\ntest(\"joinBy\", t => {\n t.deepEqual(\n joinBy(\n (a, b) => a.id === b.id,\n (a, b) => ({ ...a, ...b }),\n [{ id: 1, overwrite: 1 }, { id: 2 }, { id: 2 }],\n [{ id: 1, overwrite: 2, foo: \"bar\" }, { id: 3 }]\n ),\n [{ id: 1, overwrite: 2, foo: \"bar\" }, { id: 2 }, { id: 3 }],\n \"given [two non empty object arrays with common items] should [return array with items from both arrays, with merged values for common ones]\"\n )\n\n t.end()\n})\n"],"names":["test","join","joinBy","t","deepEqual","end","a","b","id","overwrite","foo"],"mappings":"AAAA;AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/join/join.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { join, joinBy } from \"./join.js\"\n\ntest(\"join\", t => {\n t.deepEqual(\n join([], [1, 2, 3]),\n [1, 2, 3],\n \"given [empty first array] should [return contents of second array]\"\n )\n\n t.deepEqual(\n join([1, 2, 3], []),\n [1, 2, 3],\n \"given [empty second array] should [return contents of first array]\"\n )\n\n t.deepEqual(\n join([1, 1, 2, 3, 3], [3, 3, 4, 4, 5]),\n [1, 2, 3, 4, 5],\n \"given [two non empty arrays with common items] should [return distinct items of both arrays]\"\n )\n\n t.deepEqual(\n join([1, 2])([3, 4, 5]),\n [1, 2, 3, 4, 5],\n \"given [two non empty arrays without common items] should [return array with items from both arrays]\"\n )\n\n t.end()\n})\n\ntest(\"joinBy\", t => {\n t.deepEqual(\n joinBy(\n (a, b) => a.id === b.id,\n (a, b) => ({ ...a, ...b }),\n [{ id: 1, overwrite: 1 }, { id: 2 }, { id: 2 }],\n [{ id: 1, overwrite: 2, foo: \"bar\" }, { id: 3 }]\n ),\n [{ id: 1, overwrite: 2, foo: \"bar\" }, { id: 2 }, { id: 3 }],\n \"given [two non empty object arrays with common items] should [return array with items from both arrays, with merged values for common ones]\"\n )\n\n t.end()\n})\n"],"names":["test","join","joinBy","t","deepEqual","end","a","b","id","overwrite","foo"],"mappings":"AAAA;AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,EAAEC,MAAM,QAAQ,YAAW;AAExCF,KAAK,QAAQG,SAAAA,GAAK;IAChBA,EAAEC,SAAS,CACTH,KAAK,EAAE,EAAE;QAAC;QAAG;QAAG;KAAE,GAClB;QAAC;QAAG;QAAG;KAAE,EACT;IAGFE,EAAEC,SAAS,CACTH,KAAK;QAAC;QAAG;QAAG;KAAE,EAAE,EAAE,GAClB;QAAC;QAAG;QAAG;KAAE,EACT;IAGFE,EAAEC,SAAS,CACTH,KAAK;QAAC;QAAG;QAAG;QAAG;QAAG;KAAE,EAAE;QAAC;QAAG;QAAG;QAAG;QAAG;KAAE,GACrC;QAAC;QAAG;QAAG;QAAG;QAAG;KAAE,EACf;IAGFE,EAAEC,SAAS,CACTH,KAAK;QAAC;QAAG;KAAE,EAAE;QAAC;QAAG;QAAG;KAAE,GACtB;QAAC;QAAG;QAAG;QAAG;QAAG;KAAE,EACf;IAGFE,EAAEE,GAAG;AACP;AAEAL,KAAK,UAAUG,SAAAA,GAAK;IAClBA,EAAEC,SAAS,CACTF,OACE,SAACI,GAAGC;eAAMD,EAAEE,EAAE,KAAKD,EAAEC,EAAE;OACvB,SAACF,GAAGC;eAAO,mBAAKD,GAAMC;OACtB;QAAC;YAAEC,IAAI;YAAGC,WAAW;QAAE;QAAG;YAAED,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;KAAE,EAC/C;QAAC;YAAEA,IAAI;YAAGC,WAAW;YAAGC,KAAK;QAAM;QAAG;YAAEF,IAAI;QAAE;KAAE,GAElD;QAAC;YAAEA,IAAI;YAAGC,WAAW;YAAGC,KAAK;QAAM;QAAG;YAAEF,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;KAAE,EAC3D;IAGFL,EAAEE,GAAG;AACP"}
|
package/dist/keys/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/keys/keys.js"],"sourcesContent":["/**\n * Get list with names of all own properties\n *\n * @param {Array|Object} input Array or Object to extract keys from\n *\n * @returns {string[]} List of property names\n *\n * @name keys\n * @tag Array,Object\n * @signature (input: Array|Object): string[]\n *\n * @example\n * keys([\"lorem\", \"ipsum\"])\n * // => [\"0\", \"1\"]\n *\n * keys({ foo: \"bar\", lorem: \"ipsum\"})\n * // => [\"foo\", \"lorem\"]\n *\n * keys(\"foo\"), keys(12), keys(null), etc\n * // => []\n */\nexport const keys = input => {\n const type = Array.isArray(input)\n ? \"array\"\n : input !== null && typeof input === \"object\"\n ? \"object\"\n : \"other\"\n\n switch (type) {\n case \"object\":\n case \"array\": {\n const entries = Object.entries(input)\n const result = []\n\n for (const entry of entries) {\n result.push(entry[0])\n }\n\n return result\n }\n default:\n return []\n }\n}\n"],"names":["keys","input","type","Array","isArray","entries","Object","result","entry","push"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/keys/keys.js"],"sourcesContent":["/**\n * Get list with names of all own properties\n *\n * @param {Array|Object} input Array or Object to extract keys from\n *\n * @returns {string[]} List of property names\n *\n * @name keys\n * @tag Array,Object\n * @signature (input: Array|Object): string[]\n *\n * @example\n * keys([\"lorem\", \"ipsum\"])\n * // => [\"0\", \"1\"]\n *\n * keys({ foo: \"bar\", lorem: \"ipsum\"})\n * // => [\"foo\", \"lorem\"]\n *\n * keys(\"foo\"), keys(12), keys(null), etc\n * // => []\n */\nexport const keys = input => {\n const type = Array.isArray(input)\n ? \"array\"\n : input !== null && typeof input === \"object\"\n ? \"object\"\n : \"other\"\n\n switch (type) {\n case \"object\":\n case \"array\": {\n const entries = Object.entries(input)\n const result = []\n\n for (const entry of entries) {\n result.push(entry[0])\n }\n\n return result\n }\n default:\n return []\n }\n}\n"],"names":["keys","input","type","Array","isArray","entries","Object","result","entry","push"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,IAAMA,OAAOC,SAAAA,OAAS;IAC3B,IAAMC,OAAOC,MAAMC,OAAO,CAACH,SACvB,UACAA,UAAU,IAAI,IAAI,OAAOA,UAAU,WACnC,WACA,OAAO;IAEX,OAAQC;QACN,KAAK;QACL,KAAK;YAAS;gBACZ,IAAMG,UAAUC,OAAOD,OAAO,CAACJ;gBAC/B,IAAMM,SAAS,EAAE;oBAEZ,kCAAA,2BAAA;;oBAAL,QAAK,YAAeF,4BAAf,SAAA,6BAAA,QAAA,yBAAA,iCAAwB;wBAAxB,IAAMG,QAAN;wBACHD,OAAOE,IAAI,CAACD,KAAK,CAAC,EAAE;oBACtB;;oBAFK;oBAAA;;;6BAAA,6BAAA;4BAAA;;;4BAAA;kCAAA;;;;gBAIL,OAAOD;YACT;QACA;YACE,OAAO,EAAE;IACb;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/keys/keys.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { keys } from \"./keys.js\"\n\ntest(\"keys\", t => {\n t.deepEquals(\n keys([\"test\", 1, 2]),\n [\"0\", \"1\", \"2\"],\n \"When passing an array, should return an array of string with the index of each element\"\n )\n\n t.deepEquals(\n keys({ foo: \"bar\", lorem: \"ipsum\" }),\n [\"foo\", \"lorem\"],\n \"When passing an object, should return an array of strings with the key values\"\n )\n\n t.deepEquals(\n keys(\"lorem\"),\n [],\n \"When passing a string, should return an empty array\"\n )\n\n t.deepEquals(\n keys(12),\n [],\n \"when passing a number, should return an empty array\"\n )\n\n t.end()\n})\n"],"names":["test","keys","t","deepEquals","foo","lorem","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/keys/keys.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { keys } from \"./keys.js\"\n\ntest(\"keys\", t => {\n t.deepEquals(\n keys([\"test\", 1, 2]),\n [\"0\", \"1\", \"2\"],\n \"When passing an array, should return an array of string with the index of each element\"\n )\n\n t.deepEquals(\n keys({ foo: \"bar\", lorem: \"ipsum\" }),\n [\"foo\", \"lorem\"],\n \"When passing an object, should return an array of strings with the key values\"\n )\n\n t.deepEquals(\n keys(\"lorem\"),\n [],\n \"When passing a string, should return an empty array\"\n )\n\n t.deepEquals(\n keys(12),\n [],\n \"when passing a number, should return an empty array\"\n )\n\n t.end()\n})\n"],"names":["test","keys","t","deepEquals","foo","lorem","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChBA,EAAEC,UAAU,CACVF,KAAK;QAAC;QAAQ;QAAG;KAAE,GACnB;QAAC;QAAK;QAAK;KAAI,EACf;IAGFC,EAAEC,UAAU,CACVF,KAAK;QAAEG,KAAK;QAAOC,OAAO;IAAQ,IAClC;QAAC;QAAO;KAAQ,EAChB;IAGFH,EAAEC,UAAU,CACVF,KAAK,UACL,EAAE,EACF;IAGFC,EAAEC,UAAU,CACVF,KAAK,KACL,EAAE,EACF;IAGFC,EAAEI,GAAG;AACP"}
|
package/dist/last/last.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/last/last.js"],"sourcesContent":["/**\n * Get right most element of array\n *\n * @param {Array} input The source\n *\n * @returns {any}\n *\n * @name last\n * @tag Array\n * @signature (input: Array): mixed\n *\n * @example\n * last([1, 2, 3])\n * // => 3\n * last([])\n * // => undefined\n */\nconst last = input =>\n (Array.isArray(input) || typeof input === \"string\") && input.length !== 0\n ? input[input.length - 1]\n : undefined\n\nexport { last }\n"],"names":["last","input","Array","isArray","length","undefined"],"mappings":"AAAA;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/last/last.js"],"sourcesContent":["/**\n * Get right most element of array\n *\n * @param {Array} input The source\n *\n * @returns {any}\n *\n * @name last\n * @tag Array\n * @signature (input: Array): mixed\n *\n * @example\n * last([1, 2, 3])\n * // => 3\n * last([])\n * // => undefined\n */\nconst last = input =>\n (Array.isArray(input) || typeof input === \"string\") && input.length !== 0\n ? input[input.length - 1]\n : undefined\n\nexport { last }\n"],"names":["last","input","Array","isArray","length","undefined"],"mappings":"AAAA;;;;;;;;;;;;;;;;CAgBC,GACD,IAAMA,OAAOC,SAAAA;WACX,AAACC,CAAAA,MAAMC,OAAO,CAACF,UAAU,OAAOA,UAAU,QAAO,KAAMA,MAAMG,MAAM,KAAK,IACpEH,KAAK,CAACA,MAAMG,MAAM,GAAG,EAAE,GACvBC,SAAS;;AAEf,SAASL,IAAI,GAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/last/last.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { last } from \"./last.js\"\n\ntest(\"last\", t => {\n t.equals(last([1, 2, 3]), 3, \"Get last element from n array\")\n\n t.equals(last([1]), 1, \"Get last element of an 1 array\")\n\n t.equals(last(\"xyz\"), \"z\", \"From string should return last char\")\n\n t.equals(last([]), undefined, \"Get last element of empty array\")\n\n t.equals(last({}), undefined, \"Get last element of empty object\")\n\n t.end()\n})\n"],"names":["test","last","t","equals","undefined","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/last/last.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { last } from \"./last.js\"\n\ntest(\"last\", t => {\n t.equals(last([1, 2, 3]), 3, \"Get last element from n array\")\n\n t.equals(last([1]), 1, \"Get last element of an 1 array\")\n\n t.equals(last(\"xyz\"), \"z\", \"From string should return last char\")\n\n t.equals(last([]), undefined, \"Get last element of empty array\")\n\n t.equals(last({}), undefined, \"Get last element of empty object\")\n\n t.end()\n})\n"],"names":["test","last","t","equals","undefined","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChBA,EAAEC,MAAM,CAACF,KAAK;QAAC;QAAG;QAAG;KAAE,GAAG,GAAG;IAE7BC,EAAEC,MAAM,CAACF,KAAK;QAAC;KAAE,GAAG,GAAG;IAEvBC,EAAEC,MAAM,CAACF,KAAK,QAAQ,KAAK;IAE3BC,EAAEC,MAAM,CAACF,KAAK,EAAE,GAAGG,WAAW;IAE9BF,EAAEC,MAAM,CAACF,KAAK,CAAC,IAAIG,WAAW;IAE9BF,EAAEG,GAAG;AACP"}
|
package/dist/lt/lt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lt/lt.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Less compare.\n *\n * Since this will mostly be used in pipe, the first param in the curry chain\n * is the second operand.\n *\n * @param {number} second Second number\n * @param {number} first First number\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (first: number) => (second: number): boolean\n * @signature (first: number, second: number): boolean\n *\n * @example\n * lt(10)(4)\n * // => true\n *\n * lt(10)(14)\n * // => false\n */\nexport const lt = curry((second, first) => first < second)\n"],"names":["curry","lt","second","first"],"mappings":"AAAA,SAASA,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/lt/lt.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Less compare.\n *\n * Since this will mostly be used in pipe, the first param in the curry chain\n * is the second operand.\n *\n * @param {number} second Second number\n * @param {number} first First number\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (first: number) => (second: number): boolean\n * @signature (first: number, second: number): boolean\n *\n * @example\n * lt(10)(4)\n * // => true\n *\n * lt(10)(14)\n * // => false\n */\nexport const lt = curry((second, first) => first < second)\n"],"names":["curry","lt","second","first"],"mappings":"AAAA,SAASA,KAAK,QAAQ,oBAAmB;AAEzC;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,IAAMC,KAAKD,MAAM,SAACE,QAAQC;WAAUA,QAAQD;GAAO"}
|