@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
package/dist/lt/lt.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lt/lt.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { lt } from \"./lt.js\"\n\ntest(\"lt\", t => {\n t.equals(lt(10)(14), false, \"14 is not less than 10\")\n\n t.equals(lt(10)(10), false, \"10 is not less than 10\")\n\n t.equals(lt(10)(4), true, \"4 is less than 10\")\n\n t.end()\n})\n"],"names":["test","lt","t","equals","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/lt/lt.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { lt } from \"./lt.js\"\n\ntest(\"lt\", t => {\n t.equals(lt(10)(14), false, \"14 is not less than 10\")\n\n t.equals(lt(10)(10), false, \"10 is not less than 10\")\n\n t.equals(lt(10)(4), true, \"4 is less than 10\")\n\n t.end()\n})\n"],"names":["test","lt","t","equals","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,EAAE,QAAQ,UAAS;AAE5BD,KAAK,MAAME,SAAAA,GAAK;IACdA,EAAEC,MAAM,CAACF,GAAG,IAAI,KAAK,KAAK,EAAE;IAE5BC,EAAEC,MAAM,CAACF,GAAG,IAAI,KAAK,KAAK,EAAE;IAE5BC,EAAEC,MAAM,CAACF,GAAG,IAAI,IAAI,IAAI,EAAE;IAE1BC,EAAEE,GAAG;AACP"}
|
package/dist/map/map.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
2
|
import { pipe } from "../pipe/pipe.js";
|
|
3
3
|
import { curry } from "../curry/curry.js";
|
|
4
4
|
var _map = function(_fn, _input) {
|
|
@@ -6,7 +6,7 @@ var _map = function(_fn, _input) {
|
|
|
6
6
|
var input = Array.isArray(_input) ? _input : [
|
|
7
7
|
_input
|
|
8
8
|
];
|
|
9
|
-
var fn = Array.isArray(_fn) ? pipe.apply(void 0,
|
|
9
|
+
var fn = Array.isArray(_fn) ? pipe.apply(void 0, _to_consumable_array(_fn)) : _fn;
|
|
10
10
|
for(var i = 0, valuesCount = input.length; i < valuesCount; ++i){
|
|
11
11
|
result.push(fn(input[i], i, input));
|
|
12
12
|
}
|
package/dist/map/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/map/map.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _map = (_fn, _input) => {\n const result = []\n const input = Array.isArray(_input) ? _input : [_input]\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (let i = 0, valuesCount = input.length; i < valuesCount; ++i) {\n result.push(fn(input[i], i, input))\n }\n\n return result\n}\n\n/**\n * Iterates over an array and applies a function on each element, returning a\n * new array with the transformed elements.\n *\n * @param {Function|Function[]} fn Transform function called on each element\n * @param {Array} input Source array to iterate over\n *\n * @returns {Array} Returns new instance\n *\n * @name map\n * @tag Array\n * @signature (fn: Fn|Fn[], input: Array) => Array\n *\n * @see {@link mapMatrix}\n *\n * @example\n * const inc = x => x + 1\n *\n * map(inc, [1, 2])\n * // => [2, 3]\n *\n * map([inc, inc], [1, 2])\n * // => [3, 4]\n */\nexport const map = curry(_map)\n"],"names":["pipe","curry","_map","_fn","_input","result","input","Array","isArray","fn","i","valuesCount","length","push","map"],"mappings":"AAAA;AAAA,SAASA,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/map/map.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _map = (_fn, _input) => {\n const result = []\n const input = Array.isArray(_input) ? _input : [_input]\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (let i = 0, valuesCount = input.length; i < valuesCount; ++i) {\n result.push(fn(input[i], i, input))\n }\n\n return result\n}\n\n/**\n * Iterates over an array and applies a function on each element, returning a\n * new array with the transformed elements.\n *\n * @param {Function|Function[]} fn Transform function called on each element\n * @param {Array} input Source array to iterate over\n *\n * @returns {Array} Returns new instance\n *\n * @name map\n * @tag Array\n * @signature (fn: Fn|Fn[], input: Array) => Array\n *\n * @see {@link mapMatrix}\n *\n * @example\n * const inc = x => x + 1\n *\n * map(inc, [1, 2])\n * // => [2, 3]\n *\n * map([inc, inc], [1, 2])\n * // => [3, 4]\n */\nexport const map = curry(_map)\n"],"names":["pipe","curry","_map","_fn","_input","result","input","Array","isArray","fn","i","valuesCount","length","push","map"],"mappings":"AAAA;AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,KAAK,QAAQ,oBAAmB;AAEzC,IAAMC,OAAO,SAACC,KAAKC,QAAW;IAC5B,IAAMC,SAAS,EAAE;IACjB,IAAMC,QAAQC,MAAMC,OAAO,CAACJ,UAAUA,SAAS;QAACA;KAAO;IACvD,IAAMK,KAAKF,MAAMC,OAAO,CAACL,OAAOH,KAAAA,MAAAA,KAAAA,GAAK,qBAAGG,QAAOA,GAAG;IAElD,IAAK,IAAIO,IAAI,GAAGC,cAAcL,MAAMM,MAAM,EAAEF,IAAIC,aAAa,EAAED,EAAG;QAChEL,OAAOQ,IAAI,CAACJ,GAAGH,KAAK,CAACI,EAAE,EAAEA,GAAGJ;IAC9B;IAEA,OAAOD;AACT;AAEA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,IAAMS,MAAMb,MAAMC,MAAK"}
|
package/dist/map/map.test.js
CHANGED
|
@@ -49,7 +49,7 @@ test("map", function(t) {
|
|
|
49
49
|
function(currentValue, index, array) {
|
|
50
50
|
t.equal(currentValue, array[index], 'callback element "'.concat(currentValue, '" should equal [').concat(array, "][").concat(index, "]"));
|
|
51
51
|
return currentValue * currentValue;
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
], [
|
|
54
54
|
1,
|
|
55
55
|
2
|
package/dist/map/map.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/map/map.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { map } from \"./map.js\"\n\nconst square = value => value * value\n\ntest(\"map\", t => {\n t.deepEqual(\n map(square, [1, 2, 3]),\n [1, 4, 9],\n \"(square, [1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)([1, 2, 3]),\n [1, 4, 9],\n \"(square)([1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)(3),\n [9],\n \"Run map for non-array input, treat as array of one\"\n )\n\n t.deepEqual(\n map([square, square], [1, 2, 3]),\n [1, 16, 81],\n \"([square, square], [1,2,3]) // => [1,16,82]\"\n )\n\n t.deepEqual(map(square)([]), [], \"iteration over [] should equal []\")\n\n map((currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n })([1, 2])\n\n map(\n [\n (currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n },\n ],\n [1, 2]\n )\n\n const imutableTestArray = [1, 2, 3]\n\n t.notEqual(map(square)(imutableTestArray), imutableTestArray, \"Imutable\")\n\n t.end()\n})\n"],"names":["test","map","square","value","t","deepEqual","currentValue","index","array","equal","imutableTestArray","notEqual","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/map/map.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { map } from \"./map.js\"\n\nconst square = value => value * value\n\ntest(\"map\", t => {\n t.deepEqual(\n map(square, [1, 2, 3]),\n [1, 4, 9],\n \"(square, [1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)([1, 2, 3]),\n [1, 4, 9],\n \"(square)([1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)(3),\n [9],\n \"Run map for non-array input, treat as array of one\"\n )\n\n t.deepEqual(\n map([square, square], [1, 2, 3]),\n [1, 16, 81],\n \"([square, square], [1,2,3]) // => [1,16,82]\"\n )\n\n t.deepEqual(map(square)([]), [], \"iteration over [] should equal []\")\n\n map((currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n })([1, 2])\n\n map(\n [\n (currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n },\n ],\n [1, 2]\n )\n\n const imutableTestArray = [1, 2, 3]\n\n t.notEqual(map(square)(imutableTestArray), imutableTestArray, \"Imutable\")\n\n t.end()\n})\n"],"names":["test","map","square","value","t","deepEqual","currentValue","index","array","equal","imutableTestArray","notEqual","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,GAAG,QAAQ,WAAU;AAE9B,IAAMC,SAASC,SAAAA;WAASA,QAAQA;;AAEhCH,KAAK,OAAOI,SAAAA,GAAK;IACfA,EAAEC,SAAS,CACTJ,IAAIC,QAAQ;QAAC;QAAG;QAAG;KAAE,GACrB;QAAC;QAAG;QAAG;KAAE,EACT;IAGFE,EAAEC,SAAS,CACTJ,IAAIC,QAAQ;QAAC;QAAG;QAAG;KAAE,GACrB;QAAC;QAAG;QAAG;KAAE,EACT;IAGFE,EAAEC,SAAS,CACTJ,IAAIC,QAAQ,IACZ;QAAC;KAAE,EACH;IAGFE,EAAEC,SAAS,CACTJ,IAAI;QAACC;QAAQA;KAAO,EAAE;QAAC;QAAG;QAAG;KAAE,GAC/B;QAAC;QAAG;QAAI;KAAG,EACX;IAGFE,EAAEC,SAAS,CAACJ,IAAIC,QAAQ,EAAE,GAAG,EAAE,EAAE;IAEjCD,IAAI,SAACK,cAAcC,OAAOC,OAAU;QAClCJ,EAAEK,KAAK,CACLH,cACAE,KAAK,CAACD,MAAM,EACZ,AAAC,qBAAmDC,OAA/BF,cAAa,oBAA4BC,OAAVC,OAAM,MAAU,OAAND,OAAM;QAGtE,OAAOD,eAAeA;IACxB,GAAG;QAAC;QAAG;KAAE;IAETL,IACE;QACE,SAACK,cAAcC,OAAOC,OAAU;YAC9BJ,EAAEK,KAAK,CACLH,cACAE,KAAK,CAACD,MAAM,EACZ,AAAC,qBAAmDC,OAA/BF,cAAa,oBAA4BC,OAAVC,OAAM,MAAU,OAAND,OAAM;YAGtE,OAAOD,eAAeA;QACxB;KACD,EACD;QAAC;QAAG;KAAE;IAGR,IAAMI,oBAAoB;QAAC;QAAG;QAAG;KAAE;IAEnCN,EAAEO,QAAQ,CAACV,IAAIC,QAAQQ,oBAAoBA,mBAAmB;IAE9DN,EAAEQ,GAAG;AACP"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
2
|
import { curry } from "../curry/curry.js";
|
|
3
3
|
import { pipe } from "../pipe/pipe.js";
|
|
4
4
|
var _mapMatrix = function(_fn, input) {
|
|
5
5
|
var result = [];
|
|
6
|
-
var fn = Array.isArray(_fn) ? pipe.apply(void 0,
|
|
6
|
+
var fn = Array.isArray(_fn) ? pipe.apply(void 0, _to_consumable_array(_fn)) : _fn;
|
|
7
7
|
for(var rowIndex = 0, rowCount = input.length; rowIndex < rowCount; ++rowIndex){
|
|
8
8
|
var row = [];
|
|
9
9
|
for(var columnIndex = 0, columnCount = input[rowIndex].length; columnIndex < columnCount; ++columnIndex){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/map-matrix/map-matrix.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _mapMatrix = (_fn, input) => {\n const result = []\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (\n let rowIndex = 0, rowCount = input.length;\n rowIndex < rowCount;\n ++rowIndex\n ) {\n const row = []\n\n for (\n let columnIndex = 0, columnCount = input[rowIndex].length;\n columnIndex < columnCount;\n ++columnIndex\n ) {\n row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input))\n }\n\n result.push(row)\n }\n\n return result\n}\n\n/**\n * Matrix version of \"map\". Iterates over a two-dimensional array and applies\n * a function on each element, returning a new matrix with the transformed\n * elements.\n *\n * @param {Function|Function[]} fn Transform function called on all elements\n * @param {any[][]} input Two-dimensional array to iterate over\n *\n * @returns {any[][]} New array instance\n *\n * @name mapMatrix\n * @tag Array\n * @signature (fn: Fn|Fn[]) => (input: [][]) => [][]\n * @signature (fn: Fn|Fn[], input: [][]) => [][]\n *\n * @see {@link map}\n *\n * @example\n * const inc = x => x + 1\n *\n * mapMatrix(inc, [[1, 2], [3, 4]])\n * // => [[2, 3], [4, 5]]\n *\n * mapMatrix([inc, inc], [[1, 2], [3, 4]])\n * // => [[3, 4], [5, 6]]\n */\nexport const mapMatrix = curry(_mapMatrix)\n"],"names":["curry","pipe","_mapMatrix","_fn","input","result","fn","Array","isArray","rowIndex","rowCount","length","row","columnIndex","columnCount","push","mapMatrix"],"mappings":"AAAA;AAAA,SAASA,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/map-matrix/map-matrix.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _mapMatrix = (_fn, input) => {\n const result = []\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (\n let rowIndex = 0, rowCount = input.length;\n rowIndex < rowCount;\n ++rowIndex\n ) {\n const row = []\n\n for (\n let columnIndex = 0, columnCount = input[rowIndex].length;\n columnIndex < columnCount;\n ++columnIndex\n ) {\n row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input))\n }\n\n result.push(row)\n }\n\n return result\n}\n\n/**\n * Matrix version of \"map\". Iterates over a two-dimensional array and applies\n * a function on each element, returning a new matrix with the transformed\n * elements.\n *\n * @param {Function|Function[]} fn Transform function called on all elements\n * @param {any[][]} input Two-dimensional array to iterate over\n *\n * @returns {any[][]} New array instance\n *\n * @name mapMatrix\n * @tag Array\n * @signature (fn: Fn|Fn[]) => (input: [][]) => [][]\n * @signature (fn: Fn|Fn[], input: [][]) => [][]\n *\n * @see {@link map}\n *\n * @example\n * const inc = x => x + 1\n *\n * mapMatrix(inc, [[1, 2], [3, 4]])\n * // => [[2, 3], [4, 5]]\n *\n * mapMatrix([inc, inc], [[1, 2], [3, 4]])\n * // => [[3, 4], [5, 6]]\n */\nexport const mapMatrix = curry(_mapMatrix)\n"],"names":["curry","pipe","_mapMatrix","_fn","input","result","fn","Array","isArray","rowIndex","rowCount","length","row","columnIndex","columnCount","push","mapMatrix"],"mappings":"AAAA;AAAA,SAASA,KAAK,QAAQ,oBAAmB;AACzC,SAASC,IAAI,QAAQ,kBAAiB;AAEtC,IAAMC,aAAa,SAACC,KAAKC,OAAU;IACjC,IAAMC,SAAS,EAAE;IACjB,IAAMC,KAAKC,MAAMC,OAAO,CAACL,OAAOF,KAAAA,MAAAA,KAAAA,GAAK,qBAAGE,QAAOA,GAAG;IAElD,IACE,IAAIM,WAAW,GAAGC,WAAWN,MAAMO,MAAM,EACzCF,WAAWC,UACX,EAAED,SACF;QACA,IAAMG,MAAM,EAAE;QAEd,IACE,IAAIC,cAAc,GAAGC,cAAcV,KAAK,CAACK,SAAS,CAACE,MAAM,EACzDE,cAAcC,aACd,EAAED,YACF;YACAD,IAAIG,IAAI,CAACT,GAAGF,KAAK,CAACK,SAAS,CAACI,YAAY,EAAEJ,UAAUI,aAAaT;QACnE;QAEAC,OAAOU,IAAI,CAACH;IACd;IAEA,OAAOP;AACT;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,IAAMW,YAAYhB,MAAME,YAAW"}
|
|
@@ -15,7 +15,7 @@ test("mapMatrix", function(t) {
|
|
|
15
15
|
[
|
|
16
16
|
3,
|
|
17
17
|
4
|
|
18
|
-
]
|
|
18
|
+
]
|
|
19
19
|
]), [
|
|
20
20
|
[
|
|
21
21
|
1,
|
|
@@ -24,7 +24,7 @@ test("mapMatrix", function(t) {
|
|
|
24
24
|
[
|
|
25
25
|
9,
|
|
26
26
|
16
|
|
27
|
-
]
|
|
27
|
+
]
|
|
28
28
|
], "Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
|
|
29
29
|
t.deepEqual(mapMatrix(square, [
|
|
30
30
|
[
|
|
@@ -34,7 +34,7 @@ test("mapMatrix", function(t) {
|
|
|
34
34
|
[
|
|
35
35
|
3,
|
|
36
36
|
4
|
|
37
|
-
]
|
|
37
|
+
]
|
|
38
38
|
]), [
|
|
39
39
|
[
|
|
40
40
|
1,
|
|
@@ -43,7 +43,7 @@ test("mapMatrix", function(t) {
|
|
|
43
43
|
[
|
|
44
44
|
9,
|
|
45
45
|
16
|
|
46
|
-
]
|
|
46
|
+
]
|
|
47
47
|
], "Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
|
|
48
48
|
t.deepEqual(mapMatrix([
|
|
49
49
|
square,
|
|
@@ -56,7 +56,7 @@ test("mapMatrix", function(t) {
|
|
|
56
56
|
[
|
|
57
57
|
3,
|
|
58
58
|
4
|
|
59
|
-
]
|
|
59
|
+
]
|
|
60
60
|
]), [
|
|
61
61
|
[
|
|
62
62
|
2,
|
|
@@ -65,7 +65,7 @@ test("mapMatrix", function(t) {
|
|
|
65
65
|
[
|
|
66
66
|
10,
|
|
67
67
|
17
|
|
68
|
-
]
|
|
68
|
+
]
|
|
69
69
|
], "Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]");
|
|
70
70
|
mapMatrix(function(currentValue, rowIndex, columIndex, array) {
|
|
71
71
|
t.equal(currentValue, array[rowIndex][columIndex], 'callback element "'.concat(currentValue, '" should equal [').concat(array, "][").concat(rowIndex, "][").concat(columIndex, "]"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/map-matrix/map-matrix.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { mapMatrix } from \"./map-matrix.js\"\n\nconst square = x => x * x\nconst inc = x => x + 1\n\ntest(\"mapMatrix\", t => {\n t.deepEqual(\n mapMatrix(square)([\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(square, [\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(\n [square, inc],\n [\n [1, 2],\n [3, 4],\n ]\n ),\n [\n [2, 5],\n [10, 17],\n ],\n \"Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]\"\n )\n\n mapMatrix((currentValue, rowIndex, columIndex, array) => {\n t.equal(\n currentValue,\n array[rowIndex][columIndex],\n `callback element \"${currentValue}\" should equal [${array}][${rowIndex}][${columIndex}]`\n )\n\n return currentValue * currentValue\n })([[1, 2]])\n\n t.end()\n})\n"],"names":["test","mapMatrix","square","x","inc","t","deepEqual","currentValue","rowIndex","columIndex","array","equal","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/map-matrix/map-matrix.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { mapMatrix } from \"./map-matrix.js\"\n\nconst square = x => x * x\nconst inc = x => x + 1\n\ntest(\"mapMatrix\", t => {\n t.deepEqual(\n mapMatrix(square)([\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(square, [\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(\n [square, inc],\n [\n [1, 2],\n [3, 4],\n ]\n ),\n [\n [2, 5],\n [10, 17],\n ],\n \"Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]\"\n )\n\n mapMatrix((currentValue, rowIndex, columIndex, array) => {\n t.equal(\n currentValue,\n array[rowIndex][columIndex],\n `callback element \"${currentValue}\" should equal [${array}][${rowIndex}][${columIndex}]`\n )\n\n return currentValue * currentValue\n })([[1, 2]])\n\n t.end()\n})\n"],"names":["test","mapMatrix","square","x","inc","t","deepEqual","currentValue","rowIndex","columIndex","array","equal","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,SAAS,QAAQ,kBAAiB;AAE3C,IAAMC,SAASC,SAAAA;WAAKA,IAAIA;;AACxB,IAAMC,MAAMD,SAAAA;WAAKA,IAAI;;AAErBH,KAAK,aAAaK,SAAAA,GAAK;IACrBA,EAAEC,SAAS,CACTL,UAAUC,QAAQ;QAChB;YAAC;YAAG;SAAE;QACN;YAAC;YAAG;SAAE;KACP,GACD;QACE;YAAC;YAAG;SAAE;QACN;YAAC;YAAG;SAAG;KACR,EACD;IAGFG,EAAEC,SAAS,CACTL,UAAUC,QAAQ;QAChB;YAAC;YAAG;SAAE;QACN;YAAC;YAAG;SAAE;KACP,GACD;QACE;YAAC;YAAG;SAAE;QACN;YAAC;YAAG;SAAG;KACR,EACD;IAGFG,EAAEC,SAAS,CACTL,UACE;QAACC;QAAQE;KAAI,EACb;QACE;YAAC;YAAG;SAAE;QACN;YAAC;YAAG;SAAE;KACP,GAEH;QACE;YAAC;YAAG;SAAE;QACN;YAAC;YAAI;SAAG;KACT,EACD;IAGFH,UAAU,SAACM,cAAcC,UAAUC,YAAYC,OAAU;QACvDL,EAAEM,KAAK,CACLJ,cACAG,KAAK,CAACF,SAAS,CAACC,WAAW,EAC3B,AAAC,qBAAmDC,OAA/BH,cAAa,oBAA4BC,OAAVE,OAAM,MAAiBD,OAAbD,UAAS,MAAe,OAAXC,YAAW;QAGxF,OAAOF,eAAeA;IACxB,GAAG;QAAC;YAAC;YAAG;SAAE;KAAC;IAEXF,EAAEO,GAAG;AACP"}
|
package/dist/max/max.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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 { curry } from "../curry/curry.js";
|
|
3
4
|
import { pipe } from "../pipe/pipe.js";
|
|
4
5
|
var _maxBy = function(_fn, input) {
|
|
5
|
-
var fn = Array.isArray(_fn) ? pipe.apply(void 0,
|
|
6
|
+
var fn = Array.isArray(_fn) ? pipe.apply(void 0, _to_consumable_array(_fn)) : _fn;
|
|
6
7
|
if (input.length === 0) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
@@ -46,7 +47,7 @@ var _maxBy = function(_fn, input) {
|
|
|
46
47
|
if (input.length === 0) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
var _input =
|
|
50
|
+
var _input = _sliced_to_array(input, 1), maxValue = _input[0];
|
|
50
51
|
for(var i = 0, length = input.length; i < length; i++){
|
|
51
52
|
if (maxValue < input[i]) {
|
|
52
53
|
maxValue = input[i];
|
package/dist/max/max.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/max/max.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _maxBy = (_fn, input) => {\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n if (input.length === 0) {\n return\n }\n\n const result = {\n item: input[0],\n value: fn(input[0]),\n }\n\n for (let i = 1, length = input.length; i < length; i++) {\n if (result.value < fn(input[i])) {\n result.item = input[i]\n result.value = fn(result.item)\n }\n }\n\n return result.item\n}\n\n/**\n * Find the maximum value in a source array\n *\n * @param {number[]} input Array of numbers\n *\n * @returns {number}\n *\n * @name max\n * @tag Array\n * @signature (input: Number[]): Number\n * @signature (fn: Function, input: Number[]): Number\n *\n * @example\n * max([-1, 1, 10, 3])\n * // => 10\n *\n * const fn = element => (new Date(element.time))\n * const input = [\n * { time: \"2018-05-15T11:20:07.754110Z\" },\n * { time: \"2018-06-11T09:01:54.337344Z\" },\n * { time: \"2018-06-08T08:26:12.711071Z\" },\n * ]\n * max(fn, input)\n * // => {time: \"2018-06-11T09:01:54.337344Z\"}\n */\nexport const max = input => {\n if (input.length === 0) {\n return\n }\n\n let [maxValue] = input\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (maxValue < input[i]) {\n maxValue = input[i]\n }\n }\n\n return maxValue\n}\n\nexport const maxBy = curry(_maxBy)\n"],"names":["curry","pipe","_maxBy","_fn","input","fn","Array","isArray","length","result","item","value","i","max","maxValue","maxBy"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/max/max.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _maxBy = (_fn, input) => {\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n if (input.length === 0) {\n return\n }\n\n const result = {\n item: input[0],\n value: fn(input[0]),\n }\n\n for (let i = 1, length = input.length; i < length; i++) {\n if (result.value < fn(input[i])) {\n result.item = input[i]\n result.value = fn(result.item)\n }\n }\n\n return result.item\n}\n\n/**\n * Find the maximum value in a source array\n *\n * @param {number[]} input Array of numbers\n *\n * @returns {number}\n *\n * @name max\n * @tag Array\n * @signature (input: Number[]): Number\n * @signature (fn: Function, input: Number[]): Number\n *\n * @example\n * max([-1, 1, 10, 3])\n * // => 10\n *\n * const fn = element => (new Date(element.time))\n * const input = [\n * { time: \"2018-05-15T11:20:07.754110Z\" },\n * { time: \"2018-06-11T09:01:54.337344Z\" },\n * { time: \"2018-06-08T08:26:12.711071Z\" },\n * ]\n * max(fn, input)\n * // => {time: \"2018-06-11T09:01:54.337344Z\"}\n */\nexport const max = input => {\n if (input.length === 0) {\n return\n }\n\n let [maxValue] = input\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (maxValue < input[i]) {\n maxValue = input[i]\n }\n }\n\n return maxValue\n}\n\nexport const maxBy = curry(_maxBy)\n"],"names":["curry","pipe","_maxBy","_fn","input","fn","Array","isArray","length","result","item","value","i","max","maxValue","maxBy"],"mappings":"AAAA;;AAAA,SAASA,KAAK,QAAQ,oBAAmB;AACzC,SAASC,IAAI,QAAQ,kBAAiB;AAEtC,IAAMC,SAAS,SAACC,KAAKC,OAAU;IAC7B,IAAMC,KAAKC,MAAMC,OAAO,CAACJ,OAAOF,KAAAA,MAAAA,KAAAA,GAAK,qBAAGE,QAAOA,GAAG;IAElD,IAAIC,MAAMI,MAAM,KAAK,GAAG;QACtB;IACF,CAAC;IAED,IAAMC,SAAS;QACbC,MAAMN,KAAK,CAAC,EAAE;QACdO,OAAON,GAAGD,KAAK,CAAC,EAAE;IACpB;IAEA,IAAK,IAAIQ,IAAI,GAAGJ,SAASJ,MAAMI,MAAM,EAAEI,IAAIJ,QAAQI,IAAK;QACtD,IAAIH,OAAOE,KAAK,GAAGN,GAAGD,KAAK,CAACQ,EAAE,GAAG;YAC/BH,OAAOC,IAAI,GAAGN,KAAK,CAACQ,EAAE;YACtBH,OAAOE,KAAK,GAAGN,GAAGI,OAAOC,IAAI;QAC/B,CAAC;IACH;IAEA,OAAOD,OAAOC,IAAI;AACpB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,IAAMG,MAAMT,SAAAA,OAAS;IAC1B,IAAIA,MAAMI,MAAM,KAAK,GAAG;QACtB;IACF,CAAC;IAED,IAAiBJ,0BAAAA,WAAZU,WAAYV;IAEjB,IAAK,IAAIQ,IAAI,GAAGJ,SAASJ,MAAMI,MAAM,EAAEI,IAAIJ,QAAQI,IAAK;QACtD,IAAIE,WAAWV,KAAK,CAACQ,EAAE,EAAE;YACvBE,WAAWV,KAAK,CAACQ,EAAE;QACrB,CAAC;IACH;IAEA,OAAOE;AACT,EAAC;AAED,OAAO,IAAMC,QAAQf,MAAME,QAAO"}
|
package/dist/max/max.test.js
CHANGED
package/dist/max/max.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/max/max.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { i } from \"../i/i.js\"\nimport { max, maxBy } from \"./max.js\"\n\ntest(\"max\", t => {\n t.equals(max([-1, 1, 10, 3]), 10, \"Find max in numeric array\")\n t.equals(max([]), undefined, \"Find max in empty array (=> undefined)\")\n t.equals(max([-1, -10, -3]), -1, \"Find max in all negative numeric array\")\n t.equals(max([1, 10, 3]), 10, \"Find max in all positive numeric array\")\n\n t.end()\n})\n\nconst toDate = element => new Date(element.time)\n\ntest(\"maxBy\", t => {\n t.equals(maxBy(i, [1, 10, 3]), 10, \"Find max in all positive numeric array\")\n\n t.equals(\n maxBy(i, []),\n undefined,\n \"Find max in empty array using transform function (=> undefined)\"\n )\n\n t.deepEquals(\n maxBy(toDate, [\n { time: \"2018-05-15T11:20:07.754110Z\" },\n { time: \"2018-06-11T09:01:54.337344Z\" },\n { time: \"2018-06-08T08:26:12.711071Z\" },\n ]),\n { time: \"2018-06-11T09:01:54.337344Z\" },\n \"Custom transform function\"\n )\n\n t.end()\n})\n"],"names":["test","i","max","maxBy","t","equals","undefined","end","toDate","element","Date","time","deepEquals"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/max/max.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { i } from \"../i/i.js\"\nimport { max, maxBy } from \"./max.js\"\n\ntest(\"max\", t => {\n t.equals(max([-1, 1, 10, 3]), 10, \"Find max in numeric array\")\n t.equals(max([]), undefined, \"Find max in empty array (=> undefined)\")\n t.equals(max([-1, -10, -3]), -1, \"Find max in all negative numeric array\")\n t.equals(max([1, 10, 3]), 10, \"Find max in all positive numeric array\")\n\n t.end()\n})\n\nconst toDate = element => new Date(element.time)\n\ntest(\"maxBy\", t => {\n t.equals(maxBy(i, [1, 10, 3]), 10, \"Find max in all positive numeric array\")\n\n t.equals(\n maxBy(i, []),\n undefined,\n \"Find max in empty array using transform function (=> undefined)\"\n )\n\n t.deepEquals(\n maxBy(toDate, [\n { time: \"2018-05-15T11:20:07.754110Z\" },\n { time: \"2018-06-11T09:01:54.337344Z\" },\n { time: \"2018-06-08T08:26:12.711071Z\" },\n ]),\n { time: \"2018-06-11T09:01:54.337344Z\" },\n \"Custom transform function\"\n )\n\n t.end()\n})\n"],"names":["test","i","max","maxBy","t","equals","undefined","end","toDate","element","Date","time","deepEquals"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,CAAC,QAAQ,YAAW;AAC7B,SAASC,GAAG,EAAEC,KAAK,QAAQ,WAAU;AAErCH,KAAK,OAAOI,SAAAA,GAAK;IACfA,EAAEC,MAAM,CAACH,IAAI;QAAC,CAAC;QAAG;QAAG;QAAI;KAAE,GAAG,IAAI;IAClCE,EAAEC,MAAM,CAACH,IAAI,EAAE,GAAGI,WAAW;IAC7BF,EAAEC,MAAM,CAACH,IAAI;QAAC,CAAC;QAAG,CAAC;QAAI,CAAC;KAAE,GAAG,CAAC,GAAG;IACjCE,EAAEC,MAAM,CAACH,IAAI;QAAC;QAAG;QAAI;KAAE,GAAG,IAAI;IAE9BE,EAAEG,GAAG;AACP;AAEA,IAAMC,SAASC,SAAAA;WAAW,IAAIC,KAAKD,QAAQE,IAAI;;AAE/CX,KAAK,SAASI,SAAAA,GAAK;IACjBA,EAAEC,MAAM,CAACF,MAAMF,GAAG;QAAC;QAAG;QAAI;KAAE,GAAG,IAAI;IAEnCG,EAAEC,MAAM,CACNF,MAAMF,GAAG,EAAE,GACXK,WACA;IAGFF,EAAEQ,UAAU,CACVT,MAAMK,QAAQ;QACZ;YAAEG,MAAM;QAA8B;QACtC;YAAEA,MAAM;QAA8B;QACtC;YAAEA,MAAM;QAA8B;KACvC,GACD;QAAEA,MAAM;IAA8B,GACtC;IAGFP,EAAEG,GAAG;AACP"}
|
package/dist/merge/merge.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
3
|
import { is } from "../is/is.js";
|
|
3
4
|
var _merge = function(fn, input) {
|
|
4
5
|
var result = {};
|
|
@@ -6,7 +7,7 @@ var _merge = function(fn, input) {
|
|
|
6
7
|
try {
|
|
7
8
|
for(var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
8
9
|
var object = _step.value;
|
|
9
|
-
result = is(fn) ? fn(result, object) :
|
|
10
|
+
result = is(fn) ? fn(result, object) : _object_spread({}, result, object);
|
|
10
11
|
}
|
|
11
12
|
} catch (err) {
|
|
12
13
|
_didIteratorError = true;
|
|
@@ -69,7 +70,7 @@ export var mergeBy = function() {
|
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
// @signature (fn, input)
|
|
72
|
-
return _merge.apply(void 0,
|
|
73
|
+
return _merge.apply(void 0, _to_consumable_array(params));
|
|
73
74
|
};
|
|
74
75
|
export var mergeAll = function(input) {
|
|
75
76
|
return _merge(undefined, input);
|
package/dist/merge/merge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/merge/merge.js"],"sourcesContent":["import { is } from \"../is/is.js\"\n\nconst _merge = (fn, input) => {\n let result = {}\n\n for (const object of input) {\n result = is(fn) ? fn(result, object) : { ...result, ...object }\n }\n\n return result\n}\n\n/**\n * Combine from left to right, 2 or more objects into a new single one.\n * Properties will be shallow copied. Those with the same name will be\n * overwriten by right most object.\n *\n * @param {Object[]} input Array of objects\n * @param {...any} params Function params\n *\n * @returns {Object}\n *\n * @name merge\n * @tag Object\n * @signature (...input: Object[]): Object\n *\n * @example\n *\n * merge({a: \"lorem\"}, {b: \"ipsum\", c: 41}, {c: 42, b: undefined})\n * // => { a: \"lorem\", b: \"ipsum\", c: 42 }\n */\nexport const merge = (...params) => {\n // @signature (obj1) => (obj2)\n if (params.length <= 1) {\n return nextObject => _merge(undefined, [params[0], nextObject])\n }\n\n // @signature (obj1, obj2)\n return _merge(undefined, params)\n}\n\nexport const mergeBy = (...params) => {\n // @signature (fn) => (input)\n if (params.length <= 1) {\n return input => _merge(params[0], input)\n }\n\n // @signature (fn, input)\n return _merge(...params)\n}\n\nexport const mergeAll = input => _merge(undefined, input)\n"],"names":["is","_merge","fn","input","result","object","merge","params","length","nextObject","undefined","mergeBy","mergeAll"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/merge/merge.js"],"sourcesContent":["import { is } from \"../is/is.js\"\n\nconst _merge = (fn, input) => {\n let result = {}\n\n for (const object of input) {\n result = is(fn) ? fn(result, object) : { ...result, ...object }\n }\n\n return result\n}\n\n/**\n * Combine from left to right, 2 or more objects into a new single one.\n * Properties will be shallow copied. Those with the same name will be\n * overwriten by right most object.\n *\n * @param {Object[]} input Array of objects\n * @param {...any} params Function params\n *\n * @returns {Object}\n *\n * @name merge\n * @tag Object\n * @signature (...input: Object[]): Object\n *\n * @example\n *\n * merge({a: \"lorem\"}, {b: \"ipsum\", c: 41}, {c: 42, b: undefined})\n * // => { a: \"lorem\", b: \"ipsum\", c: 42 }\n */\nexport const merge = (...params) => {\n // @signature (obj1) => (obj2)\n if (params.length <= 1) {\n return nextObject => _merge(undefined, [params[0], nextObject])\n }\n\n // @signature (obj1, obj2)\n return _merge(undefined, params)\n}\n\nexport const mergeBy = (...params) => {\n // @signature (fn) => (input)\n if (params.length <= 1) {\n return input => _merge(params[0], input)\n }\n\n // @signature (fn, input)\n return _merge(...params)\n}\n\nexport const mergeAll = input => _merge(undefined, input)\n"],"names":["is","_merge","fn","input","result","object","merge","params","length","nextObject","undefined","mergeBy","mergeAll"],"mappings":"AAAA;;AAAA,SAASA,EAAE,QAAQ,cAAa;AAEhC,IAAMC,SAAS,SAACC,IAAIC,OAAU;IAC5B,IAAIC,SAAS,CAAC;QAET,kCAAA,2BAAA;;QAAL,QAAK,YAAgBD,0BAAhB,SAAA,6BAAA,QAAA,yBAAA,iCAAuB;YAAvB,IAAME,SAAN;YACHD,SAASJ,GAAGE,MAAMA,GAAGE,QAAQC,UAAU,mBAAKD,QAAWC,OAAQ;QACjE;;QAFK;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAIL,OAAOD;AACT;AAEA;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,IAAME,QAAQ,WAAe;qCAAXC;QAAAA;;IACvB,8BAA8B;IAC9B,IAAIA,OAAOC,MAAM,IAAI,GAAG;QACtB,OAAOC,SAAAA;mBAAcR,OAAOS,WAAW;gBAACH,MAAM,CAAC,EAAE;gBAAEE;aAAW;;IAChE,CAAC;IAED,0BAA0B;IAC1B,OAAOR,OAAOS,WAAWH;AAC3B,EAAC;AAED,OAAO,IAAMI,UAAU,WAAe;qCAAXJ;QAAAA;;IACzB,6BAA6B;IAC7B,IAAIA,OAAOC,MAAM,IAAI,GAAG;QACtB,OAAOL,SAAAA;mBAASF,OAAOM,MAAM,CAAC,EAAE,EAAEJ;;IACpC,CAAC;IAED,yBAAyB;IACzB,OAAOF,OAAAA,MAAAA,KAAAA,GAAO,qBAAGM;AACnB,EAAC;AAED,OAAO,IAAMK,WAAWT,SAAAA;WAASF,OAAOS,WAAWP;EAAM"}
|
package/dist/merge/merge.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 { merge, mergeAll, mergeBy } from "./merge.js";
|
|
4
4
|
test("merge, mergeAll", function(t) {
|
|
@@ -15,7 +15,7 @@ test("merge, mergeAll", function(t) {
|
|
|
15
15
|
b: undefined
|
|
16
16
|
};
|
|
17
17
|
t.deepEqual(mergeBy(function(a, b) {
|
|
18
|
-
return
|
|
18
|
+
return _object_spread({}, a, b);
|
|
19
19
|
}, [
|
|
20
20
|
object1,
|
|
21
21
|
object2,
|
|
@@ -26,7 +26,7 @@ test("merge, mergeAll", function(t) {
|
|
|
26
26
|
c: 42
|
|
27
27
|
}, "mergeBy 3 objects - uncurried");
|
|
28
28
|
t.deepEqual(mergeBy(function(a, b) {
|
|
29
|
-
return
|
|
29
|
+
return _object_spread({}, a, b);
|
|
30
30
|
})([
|
|
31
31
|
object1,
|
|
32
32
|
object2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/merge/merge.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { merge, mergeAll, mergeBy } from \"./merge.js\"\n\ntest(\"merge, mergeAll\", t => {\n const object1 = { a: undefined }\n const object2 = { a: \"lorem\", b: \"ipsum\", c: 41 }\n const object3 = { c: 42, b: undefined }\n\n t.deepEqual(\n mergeBy((a, b) => ({ ...a, ...b }), [object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeBy 3 objects - uncurried\"\n )\n\n t.deepEqual(\n mergeBy((a, b) => ({ ...a, ...b }))([object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeBy 3 objects - curried\"\n )\n\n t.deepEqual(\n mergeAll([object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeAll 3 objects - uncurried\"\n )\n\n t.deepEqual(\n merge(object1)(object2),\n { a: \"lorem\", b: \"ipsum\", c: 41 },\n \"merge 2 objects - curried\"\n )\n\n t.deepEqual(\n merge(object1, object2),\n { a: \"lorem\", b: \"ipsum\", c: 41 },\n \"merge 2 objects - curried\"\n )\n\n t.end()\n})\n"],"names":["test","merge","mergeAll","mergeBy","t","object1","a","undefined","object2","b","c","object3","deepEqual","end"],"mappings":"AAAA;AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/merge/merge.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { merge, mergeAll, mergeBy } from \"./merge.js\"\n\ntest(\"merge, mergeAll\", t => {\n const object1 = { a: undefined }\n const object2 = { a: \"lorem\", b: \"ipsum\", c: 41 }\n const object3 = { c: 42, b: undefined }\n\n t.deepEqual(\n mergeBy((a, b) => ({ ...a, ...b }), [object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeBy 3 objects - uncurried\"\n )\n\n t.deepEqual(\n mergeBy((a, b) => ({ ...a, ...b }))([object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeBy 3 objects - curried\"\n )\n\n t.deepEqual(\n mergeAll([object1, object2, object3]),\n { a: \"lorem\", b: undefined, c: 42 },\n \"mergeAll 3 objects - uncurried\"\n )\n\n t.deepEqual(\n merge(object1)(object2),\n { a: \"lorem\", b: \"ipsum\", c: 41 },\n \"merge 2 objects - curried\"\n )\n\n t.deepEqual(\n merge(object1, object2),\n { a: \"lorem\", b: \"ipsum\", c: 41 },\n \"merge 2 objects - curried\"\n )\n\n t.end()\n})\n"],"names":["test","merge","mergeAll","mergeBy","t","object1","a","undefined","object2","b","c","object3","deepEqual","end"],"mappings":"AAAA;AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,aAAY;AAErDH,KAAK,mBAAmBI,SAAAA,GAAK;IAC3B,IAAMC,UAAU;QAAEC,GAAGC;IAAU;IAC/B,IAAMC,UAAU;QAAEF,GAAG;QAASG,GAAG;QAASC,GAAG;IAAG;IAChD,IAAMC,UAAU;QAAED,GAAG;QAAID,GAAGF;IAAU;IAEtCH,EAAEQ,SAAS,CACTT,QAAQ,SAACG,GAAGG;eAAO,mBAAKH,GAAMG;OAAM;QAACJ;QAASG;QAASG;KAAQ,GAC/D;QAAEL,GAAG;QAASG,GAAGF;QAAWG,GAAG;IAAG,GAClC;IAGFN,EAAEQ,SAAS,CACTT,QAAQ,SAACG,GAAGG;eAAO,mBAAKH,GAAMG;OAAM;QAACJ;QAASG;QAASG;KAAQ,GAC/D;QAAEL,GAAG;QAASG,GAAGF;QAAWG,GAAG;IAAG,GAClC;IAGFN,EAAEQ,SAAS,CACTV,SAAS;QAACG;QAASG;QAASG;KAAQ,GACpC;QAAEL,GAAG;QAASG,GAAGF;QAAWG,GAAG;IAAG,GAClC;IAGFN,EAAEQ,SAAS,CACTX,MAAMI,SAASG,UACf;QAAEF,GAAG;QAASG,GAAG;QAASC,GAAG;IAAG,GAChC;IAGFN,EAAEQ,SAAS,CACTX,MAAMI,SAASG,UACf;QAAEF,GAAG;QAASG,GAAG;QAASC,GAAG;IAAG,GAChC;IAGFN,EAAES,GAAG;AACP"}
|
package/dist/min/min.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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
|
var _minBy = function(_fn, input) {
|
|
5
|
-
var fn = Array.isArray(_fn) ? pipe.apply(void 0,
|
|
6
|
+
var fn = Array.isArray(_fn) ? pipe.apply(void 0, _to_consumable_array(_fn)) : _fn;
|
|
6
7
|
if (input.length === 0) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
@@ -46,7 +47,7 @@ var _minBy = function(_fn, input) {
|
|
|
46
47
|
if (input.length === 0) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
var _input =
|
|
50
|
+
var _input = _sliced_to_array(input, 1), result = _input[0];
|
|
50
51
|
for(var i = 0, length = input.length; i < length; i++){
|
|
51
52
|
if (result > input[i]) {
|
|
52
53
|
result = input[i];
|
package/dist/min/min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/min/min.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _minBy = (_fn, input) => {\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n if (input.length === 0) {\n return\n }\n\n const result = {\n item: input[0],\n value: fn(input[0]),\n }\n\n for (let i = 1, length = input.length; i < length; i++) {\n if (result.value > fn(input[i])) {\n result.item = input[i]\n result.value = fn(result.item)\n }\n }\n\n return result.item\n}\n\n/**\n * Find the minimum value in a source array\n *\n * @param {number[]} input Array of numbers\n *\n * @returns {number}\n *\n * @name min\n * @tag Array\n * @signature ( input: Number[] ): Number\n * @signature ( fn: Function ) => ( input: Number[] ): Number\n *\n * @example\n * min([-1, 1, 10, 3])\n * // => -1\n *\n * const fn = element => ( new Date( element.time ) )\n * const input = [\n * { time: \"2018-05-15T11:20:07.754110Z\" },\n * { time: \"2018-06-11T09:01:54.337344Z\" },\n * { time: \"2018-06-08T08:26:12.711071Z\" },\n * ]\n * min(fn)(input)\n * // => {time: \"2018-05-15T11:20:07.754110Z\"}\n */\nexport const min = input => {\n if (input.length === 0) {\n return\n }\n\n let [result] = input\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (result > input[i]) {\n result = input[i]\n }\n }\n\n return result\n}\n\nexport const minBy = curry(_minBy)\n"],"names":["pipe","curry","_minBy","_fn","input","fn","Array","isArray","length","result","item","value","i","min","minBy"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/min/min.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _minBy = (_fn, input) => {\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n if (input.length === 0) {\n return\n }\n\n const result = {\n item: input[0],\n value: fn(input[0]),\n }\n\n for (let i = 1, length = input.length; i < length; i++) {\n if (result.value > fn(input[i])) {\n result.item = input[i]\n result.value = fn(result.item)\n }\n }\n\n return result.item\n}\n\n/**\n * Find the minimum value in a source array\n *\n * @param {number[]} input Array of numbers\n *\n * @returns {number}\n *\n * @name min\n * @tag Array\n * @signature ( input: Number[] ): Number\n * @signature ( fn: Function ) => ( input: Number[] ): Number\n *\n * @example\n * min([-1, 1, 10, 3])\n * // => -1\n *\n * const fn = element => ( new Date( element.time ) )\n * const input = [\n * { time: \"2018-05-15T11:20:07.754110Z\" },\n * { time: \"2018-06-11T09:01:54.337344Z\" },\n * { time: \"2018-06-08T08:26:12.711071Z\" },\n * ]\n * min(fn)(input)\n * // => {time: \"2018-05-15T11:20:07.754110Z\"}\n */\nexport const min = input => {\n if (input.length === 0) {\n return\n }\n\n let [result] = input\n\n for (let i = 0, length = input.length; i < length; i++) {\n if (result > input[i]) {\n result = input[i]\n }\n }\n\n return result\n}\n\nexport const minBy = curry(_minBy)\n"],"names":["pipe","curry","_minBy","_fn","input","fn","Array","isArray","length","result","item","value","i","min","minBy"],"mappings":"AAAA;;AAAA,SAASA,IAAI,QAAQ,kBAAiB;AACtC,SAASC,KAAK,QAAQ,oBAAmB;AAEzC,IAAMC,SAAS,SAACC,KAAKC,OAAU;IAC7B,IAAMC,KAAKC,MAAMC,OAAO,CAACJ,OAAOH,KAAAA,MAAAA,KAAAA,GAAK,qBAAGG,QAAOA,GAAG;IAElD,IAAIC,MAAMI,MAAM,KAAK,GAAG;QACtB;IACF,CAAC;IAED,IAAMC,SAAS;QACbC,MAAMN,KAAK,CAAC,EAAE;QACdO,OAAON,GAAGD,KAAK,CAAC,EAAE;IACpB;IAEA,IAAK,IAAIQ,IAAI,GAAGJ,SAASJ,MAAMI,MAAM,EAAEI,IAAIJ,QAAQI,IAAK;QACtD,IAAIH,OAAOE,KAAK,GAAGN,GAAGD,KAAK,CAACQ,EAAE,GAAG;YAC/BH,OAAOC,IAAI,GAAGN,KAAK,CAACQ,EAAE;YACtBH,OAAOE,KAAK,GAAGN,GAAGI,OAAOC,IAAI;QAC/B,CAAC;IACH;IAEA,OAAOD,OAAOC,IAAI;AACpB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,IAAMG,MAAMT,SAAAA,OAAS;IAC1B,IAAIA,MAAMI,MAAM,KAAK,GAAG;QACtB;IACF,CAAC;IAED,IAAeJ,0BAAAA,WAAVK,SAAUL;IAEf,IAAK,IAAIQ,IAAI,GAAGJ,SAASJ,MAAMI,MAAM,EAAEI,IAAIJ,QAAQI,IAAK;QACtD,IAAIH,SAASL,KAAK,CAACQ,EAAE,EAAE;YACrBH,SAASL,KAAK,CAACQ,EAAE;QACnB,CAAC;IACH;IAEA,OAAOH;AACT,EAAC;AAED,OAAO,IAAMK,QAAQb,MAAMC,QAAO"}
|
package/dist/min/min.test.js
CHANGED
package/dist/min/min.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/min/min.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { i } from \"../i/i.js\"\nimport { min, minBy } from \"./min.js\"\n\ntest(\"min\", t => {\n t.equals(min([-1, 1, 10, 3]), -1, \"Find min in numeric array\")\n\n t.equals(min([]), undefined, \"Find min in empty array (=> undefined)\")\n\n t.equals(min([1, 10, 3]), 1, \"Find min in all positive numeric array\")\n\n t.equals(min([-1, -10, -3]), -10, \"Find min in all negative numeric array\")\n\n t.end()\n})\n\nconst toDate = element => new Date(element.time)\n\ntest(\"minBy\", t => {\n t.equals(\n minBy(i, []),\n undefined,\n \"Find min in empty array using transform function (=> undefined)\"\n )\n\n t.deepEquals(\n minBy(toDate, [\n { time: \"2018-06-11T09:01:54.337344Z\" },\n { time: \"2018-06-08T08:26:12.711071Z\" },\n { time: \"2018-05-15T11:20:07.754110Z\" },\n ]),\n { time: \"2018-05-15T11:20:07.754110Z\" },\n \"Custom transform function\"\n )\n\n t.end()\n})\n"],"names":["test","i","min","minBy","t","equals","undefined","end","toDate","element","Date","time","deepEquals"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/min/min.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { i } from \"../i/i.js\"\nimport { min, minBy } from \"./min.js\"\n\ntest(\"min\", t => {\n t.equals(min([-1, 1, 10, 3]), -1, \"Find min in numeric array\")\n\n t.equals(min([]), undefined, \"Find min in empty array (=> undefined)\")\n\n t.equals(min([1, 10, 3]), 1, \"Find min in all positive numeric array\")\n\n t.equals(min([-1, -10, -3]), -10, \"Find min in all negative numeric array\")\n\n t.end()\n})\n\nconst toDate = element => new Date(element.time)\n\ntest(\"minBy\", t => {\n t.equals(\n minBy(i, []),\n undefined,\n \"Find min in empty array using transform function (=> undefined)\"\n )\n\n t.deepEquals(\n minBy(toDate, [\n { time: \"2018-06-11T09:01:54.337344Z\" },\n { time: \"2018-06-08T08:26:12.711071Z\" },\n { time: \"2018-05-15T11:20:07.754110Z\" },\n ]),\n { time: \"2018-05-15T11:20:07.754110Z\" },\n \"Custom transform function\"\n )\n\n t.end()\n})\n"],"names":["test","i","min","minBy","t","equals","undefined","end","toDate","element","Date","time","deepEquals"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,CAAC,QAAQ,YAAW;AAC7B,SAASC,GAAG,EAAEC,KAAK,QAAQ,WAAU;AAErCH,KAAK,OAAOI,SAAAA,GAAK;IACfA,EAAEC,MAAM,CAACH,IAAI;QAAC,CAAC;QAAG;QAAG;QAAI;KAAE,GAAG,CAAC,GAAG;IAElCE,EAAEC,MAAM,CAACH,IAAI,EAAE,GAAGI,WAAW;IAE7BF,EAAEC,MAAM,CAACH,IAAI;QAAC;QAAG;QAAI;KAAE,GAAG,GAAG;IAE7BE,EAAEC,MAAM,CAACH,IAAI;QAAC,CAAC;QAAG,CAAC;QAAI,CAAC;KAAE,GAAG,CAAC,IAAI;IAElCE,EAAEG,GAAG;AACP;AAEA,IAAMC,SAASC,SAAAA;WAAW,IAAIC,KAAKD,QAAQE,IAAI;;AAE/CX,KAAK,SAASI,SAAAA,GAAK;IACjBA,EAAEC,MAAM,CACNF,MAAMF,GAAG,EAAE,GACXK,WACA;IAGFF,EAAEQ,UAAU,CACVT,MAAMK,QAAQ;QACZ;YAAEG,MAAM;QAA8B;QACtC;YAAEA,MAAM;QAA8B;QACtC;YAAEA,MAAM;QAA8B;KACvC,GACD;QAAEA,MAAM;IAA8B,GACtC;IAGFP,EAAEG,GAAG;AACP"}
|
package/dist/move/move.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import * as swcHelpers from "@swc/helpers";
|
|
2
1
|
/**
|
|
3
2
|
* @param {number} from
|
|
4
3
|
* @param {number} to
|
|
5
4
|
* @param {Array} input
|
|
6
5
|
*
|
|
7
6
|
* @returns {Array}
|
|
8
|
-
*/
|
|
9
|
-
|
|
7
|
+
*/ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
8
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
9
|
+
var _move = function(from, to, input) {
|
|
10
|
+
var result = _to_consumable_array(input);
|
|
10
11
|
var fromIndex = from < 0 ? result.length + from : from;
|
|
11
12
|
if (fromIndex >= 0 && fromIndex < result.length) {
|
|
12
13
|
var toIndex = to < 0 ? result.length + to : to;
|
|
13
|
-
var ref =
|
|
14
|
+
var ref = _sliced_to_array(result.splice(from, 1), 1), item = ref[0];
|
|
14
15
|
result.splice(toIndex, 0, item);
|
|
15
16
|
}
|
|
16
17
|
return result;
|
|
@@ -41,7 +42,7 @@ import * as swcHelpers from "@swc/helpers";
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
// @signature (from, to, input)
|
|
44
|
-
return _move.apply(void 0,
|
|
45
|
+
return _move.apply(void 0, _to_consumable_array(params));
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=move.js.map
|
package/dist/move/move.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/move/move.js"],"sourcesContent":["/**\n * @param {number} from\n * @param {number} to\n * @param {Array} input\n *\n * @returns {Array}\n */\nconst _move = (from, to, input) => {\n const result = [...input]\n\n const fromIndex = from < 0 ? result.length + from : from\n\n if (fromIndex >= 0 && fromIndex < result.length) {\n const toIndex = to < 0 ? result.length + to : to\n\n const [item] = result.splice(from, 1)\n\n result.splice(toIndex, 0, item)\n }\n\n return result\n}\n\n/**\n * Move element from one position to another\n *\n * @param {...any} params\n *\n * @returns {Array}\n *\n * @name move\n * @tag Array\n * @signature (from: number, to: number) => (input: Array) => Array\n * @signature (from: number, to: number, input: Array) => Array\n *\n * @example\n * move(0, 1, [1, 2])\n * // => [2, 1]\n */\nexport const move = (...params) => {\n // @signature (from, to) => (input)\n if (params.length <= 2) {\n return input => _move(params[0], params[1], input)\n }\n\n // @signature (from, to, input)\n return _move(...params)\n}\n"],"names":["_move","from","to","input","result","fromIndex","length","toIndex","splice","item","move","params"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/move/move.js"],"sourcesContent":["/**\n * @param {number} from\n * @param {number} to\n * @param {Array} input\n *\n * @returns {Array}\n */\nconst _move = (from, to, input) => {\n const result = [...input]\n\n const fromIndex = from < 0 ? result.length + from : from\n\n if (fromIndex >= 0 && fromIndex < result.length) {\n const toIndex = to < 0 ? result.length + to : to\n\n const [item] = result.splice(from, 1)\n\n result.splice(toIndex, 0, item)\n }\n\n return result\n}\n\n/**\n * Move element from one position to another\n *\n * @param {...any} params\n *\n * @returns {Array}\n *\n * @name move\n * @tag Array\n * @signature (from: number, to: number) => (input: Array) => Array\n * @signature (from: number, to: number, input: Array) => Array\n *\n * @example\n * move(0, 1, [1, 2])\n * // => [2, 1]\n */\nexport const move = (...params) => {\n // @signature (from, to) => (input)\n if (params.length <= 2) {\n return input => _move(params[0], params[1], input)\n }\n\n // @signature (from, to, input)\n return _move(...params)\n}\n"],"names":["_move","from","to","input","result","fromIndex","length","toIndex","splice","item","move","params"],"mappings":"AAAA;;;;;;CAMC,GACD;;AAAA,IAAMA,QAAQ,SAACC,MAAMC,IAAIC,OAAU;IACjC,IAAMC,SAAU,qBAAGD;IAEnB,IAAME,YAAYJ,OAAO,IAAIG,OAAOE,MAAM,GAAGL,OAAOA,IAAI;IAExD,IAAII,aAAa,KAAKA,YAAYD,OAAOE,MAAM,EAAE;QAC/C,IAAMC,UAAUL,KAAK,IAAIE,OAAOE,MAAM,GAAGJ,KAAKA,EAAE;QAEhD,IAAeE,uBAAAA,OAAOI,MAAM,CAACP,MAAM,QAA5BQ,OAAQL;QAEfA,OAAOI,MAAM,CAACD,SAAS,GAAGE;IAC5B,CAAC;IAED,OAAOL;AACT;AAEA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,IAAMM,OAAO,WAAe;qCAAXC;QAAAA;;IACtB,mCAAmC;IACnC,IAAIA,OAAOL,MAAM,IAAI,GAAG;QACtB,OAAOH,SAAAA;mBAASH,MAAMW,MAAM,CAAC,EAAE,EAAEA,MAAM,CAAC,EAAE,EAAER;;IAC9C,CAAC;IAED,+BAA+B;IAC/B,OAAOH,MAAAA,MAAAA,KAAAA,GAAM,qBAAGW;AAClB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/move/move.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { move } from \"./move.js\"\n\ntest(\"move\", t => {\n t.deepEqual(\n move(0, 1, [1, 2]),\n [2, 1],\n \"Move element from and to valid positions (uncurried)\"\n )\n\n t.deepEqual(\n move(0, 1, [{ id: 1 }, { id: 2 }]),\n [{ id: 2 }, { id: 1 }],\n \"Move element from and to valid positions (curried)\"\n )\n\n t.deepEqual(\n move(0, 100, [1, 2, 3, 4]),\n [2, 3, 4, 1],\n \"Move element from valid position to out-of-bounds should move it at end of array\"\n )\n\n t.deepEqual(\n move(1, -1, [1, 2, 3, 4]),\n [1, 3, 4, 2],\n \"Move element from valid position to negative position should move it at position starting from the end\"\n )\n\n t.deepEqual(\n move(-1, 0, [1, 2, 3, 4]),\n [4, 1, 2, 3],\n \"Move element from negative position to valid position\"\n )\n\n t.end()\n})\n"],"names":["test","move","t","deepEqual","id","end"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"sources":["../../src/move/move.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { move } from \"./move.js\"\n\ntest(\"move\", t => {\n t.deepEqual(\n move(0, 1, [1, 2]),\n [2, 1],\n \"Move element from and to valid positions (uncurried)\"\n )\n\n t.deepEqual(\n move(0, 1, [{ id: 1 }, { id: 2 }]),\n [{ id: 2 }, { id: 1 }],\n \"Move element from and to valid positions (curried)\"\n )\n\n t.deepEqual(\n move(0, 100, [1, 2, 3, 4]),\n [2, 3, 4, 1],\n \"Move element from valid position to out-of-bounds should move it at end of array\"\n )\n\n t.deepEqual(\n move(1, -1, [1, 2, 3, 4]),\n [1, 3, 4, 2],\n \"Move element from valid position to negative position should move it at position starting from the end\"\n )\n\n t.deepEqual(\n move(-1, 0, [1, 2, 3, 4]),\n [4, 1, 2, 3],\n \"Move element from negative position to valid position\"\n )\n\n t.end()\n})\n"],"names":["test","move","t","deepEqual","id","end"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB,SAASC,IAAI,QAAQ,YAAW;AAEhCD,KAAK,QAAQE,SAAAA,GAAK;IAChBA,EAAEC,SAAS,CACTF,KAAK,GAAG,GAAG;QAAC;QAAG;KAAE,GACjB;QAAC;QAAG;KAAE,EACN;IAGFC,EAAEC,SAAS,CACTF,KAAK,GAAG,GAAG;QAAC;YAAEG,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;KAAE,GACjC;QAAC;YAAEA,IAAI;QAAE;QAAG;YAAEA,IAAI;QAAE;KAAE,EACtB;IAGFF,EAAEC,SAAS,CACTF,KAAK,GAAG,KAAK;QAAC;QAAG;QAAG;QAAG;KAAE,GACzB;QAAC;QAAG;QAAG;QAAG;KAAE,EACZ;IAGFC,EAAEC,SAAS,CACTF,KAAK,GAAG,CAAC,GAAG;QAAC;QAAG;QAAG;QAAG;KAAE,GACxB;QAAC;QAAG;QAAG;QAAG;KAAE,EACZ;IAGFC,EAAEC,SAAS,CACTF,KAAK,CAAC,GAAG,GAAG;QAAC;QAAG;QAAG;QAAG;KAAE,GACxB;QAAC;QAAG;QAAG;QAAG;KAAE,EACZ;IAGFC,EAAEG,GAAG;AACP"}
|
package/dist/mutate/mutate.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
+
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
3
|
+
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
|
2
4
|
import { map } from "../map/map.js";
|
|
3
5
|
import { pipe } from "../pipe/pipe.js";
|
|
4
6
|
import { isMatch } from "../is-match/is-match.js";
|
|
5
7
|
var _mutate = function(transformations, input) {
|
|
6
8
|
var entries = Object.entries(transformations);
|
|
7
|
-
var result =
|
|
9
|
+
var result = _object_spread({}, input);
|
|
8
10
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
9
11
|
try {
|
|
10
12
|
for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
11
|
-
var _value =
|
|
13
|
+
var _value = _sliced_to_array(_step.value, 2), key = _value[0], value = _value[1];
|
|
12
14
|
if (input.hasOwnProperty(key)) {
|
|
13
|
-
var transform = Array.isArray(value) ? pipe.apply(void 0,
|
|
15
|
+
var transform = Array.isArray(value) ? pipe.apply(void 0, _to_consumable_array(value)) : value;
|
|
14
16
|
result[key] = typeof transform === "function" ? transform(input[key], input) : transform;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -55,7 +57,7 @@ export var mutate = function() {
|
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
59
|
// @signature (transformations, source)
|
|
58
|
-
return _mutate.apply(void 0,
|
|
60
|
+
return _mutate.apply(void 0, _to_consumable_array(params));
|
|
59
61
|
};
|
|
60
62
|
export var mutateMany = function() {
|
|
61
63
|
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -68,7 +70,7 @@ export var mutateMany = function() {
|
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
// @signature (transformations, source)
|
|
71
|
-
return _mutateMany.apply(void 0,
|
|
73
|
+
return _mutateMany.apply(void 0, _to_consumable_array(params));
|
|
72
74
|
};
|
|
73
75
|
export var mutateWith = function() {
|
|
74
76
|
for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -81,7 +83,7 @@ export var mutateWith = function() {
|
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
// @signature (filter, transformations, source)
|
|
84
|
-
return _mutateWith.apply(void 0,
|
|
86
|
+
return _mutateWith.apply(void 0, _to_consumable_array(params));
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
//# sourceMappingURL=mutate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mutate/mutate.js"],"sourcesContent":["import { map } from \"../map/map.js\"\nimport { pipe } from \"../pipe/pipe.js\"\nimport { isMatch } from \"../is-match/is-match.js\"\n\nconst _mutate = (transformations, input) => {\n const entries = Object.entries(transformations)\n const result = { ...input }\n\n for (const [key, value] of entries) {\n if (input.hasOwnProperty(key)) {\n const transform = Array.isArray(value) ? pipe(...value) : value\n\n result[key] =\n typeof transform === \"function\"\n ? transform(input[key], input)\n : transform\n }\n }\n\n return result\n}\n\nconst _mutateWith = (filter, transformations, input) => {\n const result = []\n\n for (let i = 0, length = input.length; i < length; ++i) {\n const item = input[i]\n const shouldMutate = isMatch(filter, item)\n\n result.push(shouldMutate ? _mutate(transformations, item) : item)\n }\n\n return result\n}\n\nconst _mutateMany = (transformations, input) =>\n map(item => _mutate(transformations, item), input)\n\nexport const mutate = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _mutate(params[0], input)\n }\n\n // @signature (transformations, source)\n return _mutate(...params)\n}\n\nexport const mutateMany = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _mutateMany(params[0], input)\n }\n\n // @signature (transformations, source)\n return _mutateMany(...params)\n}\n\nexport const mutateWith = (...params) => {\n // @signature (filter, transformations) => (source)\n if (params.length <= 2) {\n return input => _mutateWith(params[0], params[1], input)\n }\n\n // @signature (filter, transformations, source)\n return _mutateWith(...params)\n}\n"],"names":["map","pipe","isMatch","_mutate","transformations","input","entries","Object","result","key","value","hasOwnProperty","transform","Array","isArray","_mutateWith","filter","i","length","item","shouldMutate","push","_mutateMany","mutate","params","mutateMany","mutateWith"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/mutate/mutate.js"],"sourcesContent":["import { map } from \"../map/map.js\"\nimport { pipe } from \"../pipe/pipe.js\"\nimport { isMatch } from \"../is-match/is-match.js\"\n\nconst _mutate = (transformations, input) => {\n const entries = Object.entries(transformations)\n const result = { ...input }\n\n for (const [key, value] of entries) {\n if (input.hasOwnProperty(key)) {\n const transform = Array.isArray(value) ? pipe(...value) : value\n\n result[key] =\n typeof transform === \"function\"\n ? transform(input[key], input)\n : transform\n }\n }\n\n return result\n}\n\nconst _mutateWith = (filter, transformations, input) => {\n const result = []\n\n for (let i = 0, length = input.length; i < length; ++i) {\n const item = input[i]\n const shouldMutate = isMatch(filter, item)\n\n result.push(shouldMutate ? _mutate(transformations, item) : item)\n }\n\n return result\n}\n\nconst _mutateMany = (transformations, input) =>\n map(item => _mutate(transformations, item), input)\n\nexport const mutate = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _mutate(params[0], input)\n }\n\n // @signature (transformations, source)\n return _mutate(...params)\n}\n\nexport const mutateMany = (...params) => {\n // @signature (transformations) => (source)\n if (params.length <= 1) {\n return input => _mutateMany(params[0], input)\n }\n\n // @signature (transformations, source)\n return _mutateMany(...params)\n}\n\nexport const mutateWith = (...params) => {\n // @signature (filter, transformations) => (source)\n if (params.length <= 2) {\n return input => _mutateWith(params[0], params[1], input)\n }\n\n // @signature (filter, transformations, source)\n return _mutateWith(...params)\n}\n"],"names":["map","pipe","isMatch","_mutate","transformations","input","entries","Object","result","key","value","hasOwnProperty","transform","Array","isArray","_mutateWith","filter","i","length","item","shouldMutate","push","_mutateMany","mutate","params","mutateMany","mutateWith"],"mappings":"AAAA;;;AAAA,SAASA,GAAG,QAAQ,gBAAe;AACnC,SAASC,IAAI,QAAQ,kBAAiB;AACtC,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,IAAMC,UAAU,SAACC,iBAAiBC,OAAU;IAC1C,IAAMC,UAAUC,OAAOD,OAAO,CAACF;IAC/B,IAAMI,SAAS,mBAAKH;QAEf,kCAAA,2BAAA;;QAAL,QAAK,YAAsBC,4BAAtB,SAAA,6BAAA,QAAA,yBAAA,iCAA+B;YAA/B,8BAAA,iBAAOG,iBAAKC;YACf,IAAIL,MAAMM,cAAc,CAACF,MAAM;gBAC7B,IAAMG,YAAYC,MAAMC,OAAO,CAACJ,SAAST,KAAAA,MAAAA,KAAAA,GAAK,qBAAGS,UAASA,KAAK;gBAE/DF,MAAM,CAACC,IAAI,GACT,OAAOG,cAAc,aACjBA,UAAUP,KAAK,CAACI,IAAI,EAAEJ,SACtBO,SAAS;YACjB,CAAC;QACH;;QATK;QAAA;;;iBAAA,6BAAA;gBAAA;;;gBAAA;sBAAA;;;;IAWL,OAAOJ;AACT;AAEA,IAAMO,cAAc,SAACC,QAAQZ,iBAAiBC,OAAU;IACtD,IAAMG,SAAS,EAAE;IAEjB,IAAK,IAAIS,IAAI,GAAGC,SAASb,MAAMa,MAAM,EAAED,IAAIC,QAAQ,EAAED,EAAG;QACtD,IAAME,OAAOd,KAAK,CAACY,EAAE;QACrB,IAAMG,eAAelB,QAAQc,QAAQG;QAErCX,OAAOa,IAAI,CAACD,eAAejB,QAAQC,iBAAiBe,QAAQA,IAAI;IAClE;IAEA,OAAOX;AACT;AAEA,IAAMc,cAAc,SAAClB,iBAAiBC;WACpCL,IAAImB,SAAAA;eAAQhB,QAAQC,iBAAiBe;OAAOd;;AAE9C,OAAO,IAAMkB,SAAS,WAAe;qCAAXC;QAAAA;;IACxB,2CAA2C;IAC3C,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOb,SAAAA;mBAASF,QAAQqB,MAAM,CAAC,EAAE,EAAEnB;;IACrC,CAAC;IAED,uCAAuC;IACvC,OAAOF,QAAAA,MAAAA,KAAAA,GAAQ,qBAAGqB;AACpB,EAAC;AAED,OAAO,IAAMC,aAAa,WAAe;qCAAXD;QAAAA;;IAC5B,2CAA2C;IAC3C,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOb,SAAAA;mBAASiB,YAAYE,MAAM,CAAC,EAAE,EAAEnB;;IACzC,CAAC;IAED,uCAAuC;IACvC,OAAOiB,YAAAA,MAAAA,KAAAA,GAAY,qBAAGE;AACxB,EAAC;AAED,OAAO,IAAME,aAAa,WAAe;qCAAXF;QAAAA;;IAC5B,mDAAmD;IACnD,IAAIA,OAAON,MAAM,IAAI,GAAG;QACtB,OAAOb,SAAAA;mBAASU,YAAYS,MAAM,CAAC,EAAE,EAAEA,MAAM,CAAC,EAAE,EAAEnB;;IACpD,CAAC;IAED,+CAA+C;IAC/C,OAAOU,YAAAA,MAAAA,KAAAA,GAAY,qBAAGS;AACxB,EAAC"}
|