From 276b57a9caf5b79c0d7a9b1bdb7dad4afc4c27d6 Mon Sep 17 00:00:00 2001 From: simov Date: Tue, 6 Feb 2018 18:33:49 +0200 Subject: [PATCH 01/43] Add stableSort function --- snippets/stableSort.md | 29 +++++++++++++++++++++++++++++ tag_database | 1 + test/stableSort/stableSort.js | 8 ++++++++ test/stableSort/stableSort.test.js | 25 +++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 snippets/stableSort.md create mode 100644 test/stableSort/stableSort.js create mode 100644 test/stableSort/stableSort.test.js diff --git a/snippets/stableSort.md b/snippets/stableSort.md new file mode 100644 index 000000000..929b34f09 --- /dev/null +++ b/snippets/stableSort.md @@ -0,0 +1,29 @@ +### stableSort + +Performs stable sort. Useful in Chrome and NodeJS. + +Use `Array.map()` to pair each element of the input array with its corresponding index. Then use `Array.sort()` and a user provided `compare()` function. If the items are equal, sort them by their initial index in the input array. Lastly use `Array.map()` to convert back to the initial array items. +Returns new array without modifying the initial one. + +```js +var stableSort = (arr, compare) => + arr + .map((item, index) => ({ item, index })) + .sort((a, b) => + ((result = compare(a.item, b.item)) => (result !== 0 ? result : a.index - b.index))() + ) + .map(({ item }) => item); +``` + +```js +var str = 'abcdefghijklmnopqrstuvwxyz'; +var compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); + +// default Array.sort() is unstable in Chrome and NodeJS + modifies the input array +var arr1 = str.split(''); +console.log(arr1.sort(compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // false + +// stable sort + returns new array +var arr2 = str.split(''); +console.log(stableSort(arr2, compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // true +``` diff --git a/tag_database b/tag_database index 71ed6c7b6..3e5d0e839 100644 --- a/tag_database +++ b/tag_database @@ -221,6 +221,7 @@ sortedLastIndex:array,math sortedLastIndexBy:array,math,function splitLines:string spreadOver:adapter +stableSort:array,sort standardDeviation:math,array stripHTMLTags:string,utility,regexp sum:math,array diff --git a/test/stableSort/stableSort.js b/test/stableSort/stableSort.js new file mode 100644 index 000000000..d5b5db0c8 --- /dev/null +++ b/test/stableSort/stableSort.js @@ -0,0 +1,8 @@ +var stableSort = (arr, compare) => +arr +.map((item, index) => ({ item, index })) +.sort((a, b) => +((result = compare(a.item, b.item)) => (result !== 0 ? result : a.index - b.index))() +) +.map(({ item }) => item); +module.exports = stableSort; \ No newline at end of file diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js new file mode 100644 index 000000000..50e1bbe6b --- /dev/null +++ b/test/stableSort/stableSort.test.js @@ -0,0 +1,25 @@ +const test = require('tape'); +const stableSort = require('./stableSort.js'); + +test('Testing stableSort', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof stableSort === 'function', 'stableSort is a Function'); + //t.deepEqual(stableSort(args..), 'Expected'); + //t.equal(stableSort(args..), 'Expected'); + //t.false(stableSort(args..), 'Expected'); + //t.throws(stableSort(args..), 'Expected'); + + // test if js engine's Array#sort implementation is stable + // https://gist.github.com/leeoniya/5816476 + var str = 'abcdefghijklmnopqrstuvwxyz'; + var compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); + + var input = str.split(''); + var output = stableSort(input, compare); + + t.equal(output.join(''), 'xyzvwtursopqmnklhijfgdeabc'); + t.notDeepEqual(input, output); + + t.end(); +}); \ No newline at end of file From bc6c8633c1c2b37e0c738abb16546f5d6a8dba8d Mon Sep 17 00:00:00 2001 From: simov Date: Wed, 7 Feb 2018 11:17:57 +0200 Subject: [PATCH 02/43] Shorter stableSort function + use const --- snippets/stableSort.md | 12 +++++------- test/stableSort/stableSort.js | 6 ++---- test/stableSort/stableSort.test.js | 8 ++++---- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/snippets/stableSort.md b/snippets/stableSort.md index 929b34f09..96b352b08 100644 --- a/snippets/stableSort.md +++ b/snippets/stableSort.md @@ -6,24 +6,22 @@ Use `Array.map()` to pair each element of the input array with its corresponding Returns new array without modifying the initial one. ```js -var stableSort = (arr, compare) => +const stableSort = (arr, compare) => arr .map((item, index) => ({ item, index })) - .sort((a, b) => - ((result = compare(a.item, b.item)) => (result !== 0 ? result : a.index - b.index))() - ) + .sort((a, b) => compare(a.item, b.item) || a.index - b.index) .map(({ item }) => item); ``` ```js -var str = 'abcdefghijklmnopqrstuvwxyz'; -var compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); +const str = 'abcdefghijklmnopqrstuvwxyz'; +const compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); // default Array.sort() is unstable in Chrome and NodeJS + modifies the input array var arr1 = str.split(''); console.log(arr1.sort(compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // false // stable sort + returns new array -var arr2 = str.split(''); +const arr2 = str.split(''); console.log(stableSort(arr2, compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // true ``` diff --git a/test/stableSort/stableSort.js b/test/stableSort/stableSort.js index d5b5db0c8..452d6b726 100644 --- a/test/stableSort/stableSort.js +++ b/test/stableSort/stableSort.js @@ -1,8 +1,6 @@ -var stableSort = (arr, compare) => +const stableSort = (arr, compare) => arr .map((item, index) => ({ item, index })) -.sort((a, b) => -((result = compare(a.item, b.item)) => (result !== 0 ? result : a.index - b.index))() -) +.sort((a, b) => compare(a.item, b.item) || a.index - b.index) .map(({ item }) => item); module.exports = stableSort; \ No newline at end of file diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index 50e1bbe6b..7c41e06f3 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -12,11 +12,11 @@ test('Testing stableSort', (t) => { // test if js engine's Array#sort implementation is stable // https://gist.github.com/leeoniya/5816476 - var str = 'abcdefghijklmnopqrstuvwxyz'; - var compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); + const str = 'abcdefghijklmnopqrstuvwxyz'; + const compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); - var input = str.split(''); - var output = stableSort(input, compare); + const input = str.split(''); + const output = stableSort(input, compare); t.equal(output.join(''), 'xyzvwtursopqmnklhijfgdeabc'); t.notDeepEqual(input, output); From b82e4c5cf1bcf68fa1c1f66b40a04ba1e0351ec5 Mon Sep 17 00:00:00 2001 From: simov Date: Wed, 7 Feb 2018 23:08:16 +0200 Subject: [PATCH 03/43] Update test and snippet description with easier to understand examples --- snippets/stableSort.md | 62 ++++++++++++++++++++++++++---- test/stableSort/stableSort.test.js | 44 +++++++++++++++++---- 2 files changed, 90 insertions(+), 16 deletions(-) diff --git a/snippets/stableSort.md b/snippets/stableSort.md index 96b352b08..e02c3b3dc 100644 --- a/snippets/stableSort.md +++ b/snippets/stableSort.md @@ -14,14 +14,60 @@ const stableSort = (arr, compare) => ``` ```js -const str = 'abcdefghijklmnopqrstuvwxyz'; -const compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); +// sorted by weight +const input = [ + { height: 100, weight: 80 }, + { height: 90, weight: 90 }, + { height: 70, weight: 95 }, + { height: 100, weight: 100 }, + { height: 80, weight: 110 }, + { height: 110, weight: 115 }, + { height: 100, weight: 120 }, + { height: 70, weight: 125 }, + { height: 70, weight: 130 }, + { height: 100, weight: 135 }, + { height: 75, weight: 140 }, + { height: 70, weight: 140 } +]; -// default Array.sort() is unstable in Chrome and NodeJS + modifies the input array -var arr1 = str.split(''); -console.log(arr1.sort(compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // false +const compare = (a, b) => a.height - b.height; -// stable sort + returns new array -const arr2 = str.split(''); -console.log(stableSort(arr2, compare).join('') === 'xyzvwtursopqmnklhijfgdeabc'); // true +// stable - sorted by height using stableSort() +// Items with the same height are still sorted by weight which means they preserved their relative order. +stableSort(input, compare); +/* + [ + { height: 70, weight: 95 }, + { height: 70, weight: 125 }, + { height: 70, weight: 130 }, + { height: 70, weight: 140 }, + { height: 75, weight: 140 }, + { height: 80, weight: 110 }, + { height: 90, weight: 90 }, + { height: 100, weight: 80 }, + { height: 100, weight: 100 }, + { height: 100, weight: 120 }, + { height: 100, weight: 135 }, + { height: 110, weight: 115 } + ] +*/ + +// unstable - sorted by height using Array.sort() +input.sort(compare); +/* + [ + { height: 70, weight: 140}, + { height: 70, weight: 95 }, + { height: 70, weight: 125 }, + { height: 70, weight: 130 }, + { height: 75, weight: 140 }, + { height: 80, weight: 110 }, + { height: 90, weight: 90 }, + { height: 100, weight: 100 }, + { height: 100, weight: 80 }, + { height: 100, weight: 135 }, + { height: 100, weight: 120 }, + { height: 110, weight: 115 } + ] +*/ ``` diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index 7c41e06f3..cd4a66e9f 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -10,16 +10,44 @@ test('Testing stableSort', (t) => { //t.false(stableSort(args..), 'Expected'); //t.throws(stableSort(args..), 'Expected'); - // test if js engine's Array#sort implementation is stable - // https://gist.github.com/leeoniya/5816476 - const str = 'abcdefghijklmnopqrstuvwxyz'; - const compare = (a, b) => ~~(str.indexOf(b) / 2.3) - ~~(str.indexOf(a) / 2.3); + // sorted by weight + const input = [ + { height: 100, weight: 80 }, + { height: 90, weight: 90 }, + { height: 70, weight: 95 }, + { height: 100, weight: 100 }, + { height: 80, weight: 110 }, + { height: 110, weight: 115 }, + { height: 100, weight: 120 }, + { height: 70, weight: 125 }, + { height: 70, weight: 130 }, + { height: 100, weight: 135 }, + { height: 75, weight: 140 }, + { height: 70, weight: 140 } + ] - const input = str.split(''); - const output = stableSort(input, compare); + // sorted by height (using stableSort) + const target = [ + { height: 70, weight: 95 }, + { height: 70, weight: 125 }, + { height: 70, weight: 130 }, + { height: 70, weight: 140 }, + { height: 75, weight: 140 }, + { height: 80, weight: 110 }, + { height: 90, weight: 90 }, + { height: 100, weight: 80 }, + { height: 100, weight: 100 }, + { height: 100, weight: 120 }, + { height: 100, weight: 135 }, + { height: 110, weight: 115 } + ] - t.equal(output.join(''), 'xyzvwtursopqmnklhijfgdeabc'); - t.notDeepEqual(input, output); + const compare = (a, b) => a.height - b.height; + + // stable + t.deepEqual(stableSort(input, compare), target); + // unstable + t.notDeepEqual(input.sort(compare), target); t.end(); }); \ No newline at end of file From 097ab6ffa10dbe5ec8a3eaaabc983a0c2db59d5a Mon Sep 17 00:00:00 2001 From: simov Date: Thu, 8 Feb 2018 09:01:13 +0200 Subject: [PATCH 04/43] Additional tag for stable sort + shorter example --- snippets/stableSort.md | 28 ++++------------------------ tag_database | 2 +- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/snippets/stableSort.md b/snippets/stableSort.md index e02c3b3dc..ebcffd72b 100644 --- a/snippets/stableSort.md +++ b/snippets/stableSort.md @@ -30,12 +30,12 @@ const input = [ { height: 70, weight: 140 } ]; -const compare = (a, b) => a.height - b.height; +// sort by height +stableSort(input, (a, b) => a.height - b.height); -// stable - sorted by height using stableSort() -// Items with the same height are still sorted by weight which means they preserved their relative order. -stableSort(input, compare); /* + Items with the same height are still sorted by weight + which means they preserved their relative order. [ { height: 70, weight: 95 }, { height: 70, weight: 125 }, @@ -51,23 +51,3 @@ stableSort(input, compare); { height: 110, weight: 115 } ] */ - -// unstable - sorted by height using Array.sort() -input.sort(compare); -/* - [ - { height: 70, weight: 140}, - { height: 70, weight: 95 }, - { height: 70, weight: 125 }, - { height: 70, weight: 130 }, - { height: 75, weight: 140 }, - { height: 80, weight: 110 }, - { height: 90, weight: 90 }, - { height: 100, weight: 100 }, - { height: 100, weight: 80 }, - { height: 100, weight: 135 }, - { height: 100, weight: 120 }, - { height: 110, weight: 115 } - ] -*/ -``` diff --git a/tag_database b/tag_database index 3e5d0e839..804970b04 100644 --- a/tag_database +++ b/tag_database @@ -221,7 +221,7 @@ sortedLastIndex:array,math sortedLastIndexBy:array,math,function splitLines:string spreadOver:adapter -stableSort:array,sort +stableSort:array,sort,advanced standardDeviation:math,array stripHTMLTags:string,utility,regexp sum:math,array From da70ff6e9ca48a008678c4838e97664b3b73de41 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Thu, 8 Feb 2018 20:28:01 +0530 Subject: [PATCH 05/43] test for randomNumberInRange --- test/randomNumberInRange/randomNumberInRange.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/randomNumberInRange/randomNumberInRange.test.js b/test/randomNumberInRange/randomNumberInRange.test.js index 2d3d46bde..0461ae4a9 100644 --- a/test/randomNumberInRange/randomNumberInRange.test.js +++ b/test/randomNumberInRange/randomNumberInRange.test.js @@ -5,6 +5,10 @@ test('Testing randomNumberInRange', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof randomNumberInRange === 'function', 'randomNumberInRange is a Function'); + const lowerLimit = Math.floor(Math.random() * 20); + const upperLimit = Math.floor(lowerLimit + Math.random() * 10); + const numberForTest = randomNumberInRange(lowerLimit,upperLimit); + t.true((numberForTest >= lowerLimit) && (numberForTest <= upperLimit),'The returned value lies between provied lowerLimit and upperLimit (both inclusive).'); //t.deepEqual(randomNumberInRange(args..), 'Expected'); //t.equal(randomNumberInRange(args..), 'Expected'); //t.false(randomNumberInRange(args..), 'Expected'); From f4cd39d1367fbd3c06f4abb45e593d591e1ff047 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Thu, 8 Feb 2018 20:38:16 +0530 Subject: [PATCH 06/43] update test for random hexColorCode --- test/randomHexColorCode/randomHexColorCode.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js index eb2cdba9f..d604bc77e 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -7,6 +7,8 @@ test('Testing randomHexColorCode', (t) => { t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode is a Function'); //t.deepEqual(randomHexColorCode(args..), 'Expected'); t.equal(randomHexColorCode().length, 7); + t.true(randomHexColorCode().startsWith('#'),'The color code starts with "#"'); + t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null) //t.false(randomHexColorCode(args..), 'Expected'); //t.throws(randomHexColorCode(args..), 'Expected'); t.end(); From b55227f7662bb12debcc9477b4f0f21a603c2f32 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Sat, 10 Feb 2018 19:59:42 +0530 Subject: [PATCH 07/43] test for randomIntArray --- test/randomIntArrayInRange/randomIntArrayInRange.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js index 9a7735e44..68c977c4a 100644 --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -5,6 +5,12 @@ test('Testing randomIntArrayInRange', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof randomIntArrayInRange === 'function', 'randomIntArrayInRange is a Function'); + const lowerLimit = Math.floor(Math.random() * 20); + const upperLimit = Math.floor(lowerLimit + Math.random() * 10); + const randLength = Math.floor(Math.random() * 10) + t.true(randomIntArrayInRange(lowerLimit,upperLimit).length === 1,'The default value of returned array is 1'); + t.true(randomIntArrayInRange(lowerLimit,upperLimit,randLength).length === randLength,'The length of returned array is the same as the provided value.') + t.true(randomIntArrayInRange(lowerLimit,upperLimit,randLength).filter(el => !((el>=lowerLimit) && (el <= upperLimit))).length === 0,'The returned values is in range.') //t.deepEqual(randomIntArrayInRange(args..), 'Expected'); //t.equal(randomIntArrayInRange(args..), 'Expected'); //t.false(randomIntArrayInRange(args..), 'Expected'); From ee6456515c6b5e92d1c2d44132b1264efac04a4a Mon Sep 17 00:00:00 2001 From: simov Date: Sun, 11 Feb 2018 15:56:19 +0200 Subject: [PATCH 08/43] Shorter stableSort example and test --- snippets/stableSort.md | 41 +++--------------------------- test/stableSort/stableSort.test.js | 40 +++-------------------------- 2 files changed, 8 insertions(+), 73 deletions(-) diff --git a/snippets/stableSort.md b/snippets/stableSort.md index ebcffd72b..b14535e73 100644 --- a/snippets/stableSort.md +++ b/snippets/stableSort.md @@ -14,40 +14,7 @@ const stableSort = (arr, compare) => ``` ```js -// sorted by weight -const input = [ - { height: 100, weight: 80 }, - { height: 90, weight: 90 }, - { height: 70, weight: 95 }, - { height: 100, weight: 100 }, - { height: 80, weight: 110 }, - { height: 110, weight: 115 }, - { height: 100, weight: 120 }, - { height: 70, weight: 125 }, - { height: 70, weight: 130 }, - { height: 100, weight: 135 }, - { height: 75, weight: 140 }, - { height: 70, weight: 140 } -]; - -// sort by height -stableSort(input, (a, b) => a.height - b.height); - -/* - Items with the same height are still sorted by weight - which means they preserved their relative order. - [ - { height: 70, weight: 95 }, - { height: 70, weight: 125 }, - { height: 70, weight: 130 }, - { height: 70, weight: 140 }, - { height: 75, weight: 140 }, - { height: 80, weight: 110 }, - { height: 90, weight: 90 }, - { height: 100, weight: 80 }, - { height: 100, weight: 100 }, - { height: 100, weight: 120 }, - { height: 100, weight: 135 }, - { height: 110, weight: 115 } - ] -*/ +const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const stable = stableSort(arr, () => 0); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +const unstable = [...arr].sort(() => 0); // [5, 0, 2, 3, 4, 1, 6, 7, 8, 9, 10] (in Chrome/NodeJS) +``` diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index cd4a66e9f..28dcbb057 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -10,44 +10,12 @@ test('Testing stableSort', (t) => { //t.false(stableSort(args..), 'Expected'); //t.throws(stableSort(args..), 'Expected'); - // sorted by weight - const input = [ - { height: 100, weight: 80 }, - { height: 90, weight: 90 }, - { height: 70, weight: 95 }, - { height: 100, weight: 100 }, - { height: 80, weight: 110 }, - { height: 110, weight: 115 }, - { height: 100, weight: 120 }, - { height: 70, weight: 125 }, - { height: 70, weight: 130 }, - { height: 100, weight: 135 }, - { height: 75, weight: 140 }, - { height: 70, weight: 140 } - ] - - // sorted by height (using stableSort) - const target = [ - { height: 70, weight: 95 }, - { height: 70, weight: 125 }, - { height: 70, weight: 130 }, - { height: 70, weight: 140 }, - { height: 75, weight: 140 }, - { height: 80, weight: 110 }, - { height: 90, weight: 90 }, - { height: 100, weight: 80 }, - { height: 100, weight: 100 }, - { height: 100, weight: 120 }, - { height: 100, weight: 135 }, - { height: 110, weight: 115 } - ] - - const compare = (a, b) => a.height - b.height; - + const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + const compare = () => 0; // stable - t.deepEqual(stableSort(input, compare), target); + t.deepEqual(stableSort(arr, compare), arr); // unstable - t.notDeepEqual(input.sort(compare), target); + t.notDeepEqual([...arr].sort(compare), arr); t.end(); }); \ No newline at end of file From 4bb8b8858083e29c54ce4d2005278e91b4ad15d4 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Tue, 13 Feb 2018 20:22:19 +0000 Subject: [PATCH 09/43] Travis build: 1659 [cron] --- test/testlog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testlog b/test/testlog index 061f9c12b..85ec8e717 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Mon Feb 12 2018 20:20:58 GMT+0000 (UTC) +Test log for: Tue Feb 13 2018 20:22:09 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1796,15 +1796,15 @@ Test log for: Mon Feb 12 2018 20:20:58 GMT+0000 (UTC) Testing zipWith ✔ zipWith is a Function - ✔ Sends a GET request - ✔ Sends a POST request ✔ Runs the function provided + ✔ Sends a POST request ✔ Runs promises in series + ✔ Sends a GET request ✔ Works with multiple promises total: 901 passing: 901 - duration: 2.3s + duration: 2.7s From ebc9c51c145476f4dbea198f10c9f905ab304d15 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 14 Feb 2018 11:46:15 +0200 Subject: [PATCH 10/43] Add any, anyBy, all, allBy, none, noneBy --- snippets/all.md | 13 + snippets/allBy.md | 13 + snippets/any.md | 13 + snippets/anyBy.md | 13 + snippets/none.md | 13 + snippets/noneBy.md | 13 + tag_database | 6 + test/all/all.js | 2 + test/all/all.test.js | 19 + test/allBy/allBy.js | 2 + test/allBy/allBy.test.js | 15 + test/any/any.js | 2 + test/any/any.test.js | 16 + test/anyBy/anyBy.js | 2 + test/anyBy/anyBy.test.js | 15 + test/none/none.js | 2 + test/none/none.test.js | 15 + test/noneBy/noneBy.js | 2 + test/noneBy/noneBy.test.js | 15 + test/testlog | 1947 ++++++++++++++++++------------------ 20 files changed, 1185 insertions(+), 953 deletions(-) create mode 100644 snippets/all.md create mode 100644 snippets/allBy.md create mode 100644 snippets/any.md create mode 100644 snippets/anyBy.md create mode 100644 snippets/none.md create mode 100644 snippets/noneBy.md create mode 100644 test/all/all.js create mode 100644 test/all/all.test.js create mode 100644 test/allBy/allBy.js create mode 100644 test/allBy/allBy.test.js create mode 100644 test/any/any.js create mode 100644 test/any/any.test.js create mode 100644 test/anyBy/anyBy.js create mode 100644 test/anyBy/anyBy.test.js create mode 100644 test/none/none.js create mode 100644 test/none/none.test.js create mode 100644 test/noneBy/noneBy.js create mode 100644 test/noneBy/noneBy.test.js diff --git a/snippets/all.md b/snippets/all.md new file mode 100644 index 000000000..cb976da09 --- /dev/null +++ b/snippets/all.md @@ -0,0 +1,13 @@ +### all + +Returns `true` if all elements in a collection are truthy, `false` otherwise. + +Use `Array.every(Boolean)` to test if all elements in the collection are truthy. + +```js +const all = arr => arr.every(Boolean); +``` + +```js +all([1,2,3]); // true +``` diff --git a/snippets/allBy.md b/snippets/allBy.md new file mode 100644 index 000000000..d2dec44f8 --- /dev/null +++ b/snippets/allBy.md @@ -0,0 +1,13 @@ +### allBy + +Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. + +Use `Array.every()` to test if all elements in the collection return `true` based on `fn`. + +```js +const allBy = (arr, fn) => arr.every(fn); +``` + +```js +allBy([4,2,3], x => x > 1); // true +``` diff --git a/snippets/any.md b/snippets/any.md new file mode 100644 index 000000000..d030d4451 --- /dev/null +++ b/snippets/any.md @@ -0,0 +1,13 @@ +### any + +Returns `true` if at least one element in a collection is truthy, `false` otherwise. + +Use `Array.some(Boolean)` to test if any elements in the collection are truthy. + +```js +const any = arr => arr.some(Boolean); +``` + +```js +any([0,0,1,0]); // true +``` diff --git a/snippets/anyBy.md b/snippets/anyBy.md new file mode 100644 index 000000000..244c242d2 --- /dev/null +++ b/snippets/anyBy.md @@ -0,0 +1,13 @@ +### anyBy + +Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. + +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. + +```js +const anyBy = (arr, fn) => arr.some(fn); +``` + +```js +anyBy([0,1,2,0], x => x >= 2); // true +``` diff --git a/snippets/none.md b/snippets/none.md new file mode 100644 index 000000000..8bf8fb830 --- /dev/null +++ b/snippets/none.md @@ -0,0 +1,13 @@ +### none + +Returns `true` if no elements in a collection are truthy, `false` otherwise. + +Use `!Array.some(Boolean)` to test if any elements in the collection are truthy. + +```js +const none = arr => !arr.some(Boolean); +``` + +```js +none([0,0,0]); // true +``` diff --git a/snippets/noneBy.md b/snippets/noneBy.md new file mode 100644 index 000000000..20fcfcfb7 --- /dev/null +++ b/snippets/noneBy.md @@ -0,0 +1,13 @@ +### noneBy + +Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. + +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. + +```js +const noneBy = (arr, fn) => !arr.some(fn); +``` + +```js +noneBy([0,1,3,0], x => x == 2); // true +``` diff --git a/tag_database b/tag_database index ab6f57af0..5c2301db9 100644 --- a/tag_database +++ b/tag_database @@ -1,4 +1,8 @@ +all:array +allBy:array,function anagrams:string,recursion +any:array +anyBy:array,function arrayToHtmlList:browser,array ary:adapter,function atob:node,string,utility @@ -154,6 +158,8 @@ merge:object,array minBy:math,array,function minN:array,math negate:function +none:array +noneBy:array,function nthArg:utility,function nthElement:array objectFromPairs:object,array diff --git a/test/all/all.js b/test/all/all.js new file mode 100644 index 000000000..1a938d602 --- /dev/null +++ b/test/all/all.js @@ -0,0 +1,2 @@ +const all = arr => arr.every(Boolean); +module.exports = all; \ No newline at end of file diff --git a/test/all/all.test.js b/test/all/all.test.js new file mode 100644 index 000000000..5aef8c036 --- /dev/null +++ b/test/all/all.test.js @@ -0,0 +1,19 @@ +const test = require('tape'); +const all = require('./all.js'); + +test('Testing all', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof all === 'function', 'all is a Function'); + t.true(all([4,1,2,3]), 'Returns true for arrays with no falsey values'); + t.false(all([0,1]), 'Returns false for arrays with 0'); + t.false(all([NaN,1]), 'Returns false for arrays with NaN'); + t.false(all([undefined,1]), 'Returns false for arrays with undefined'); + t.false(all([null,1]), 'Returns false for arrays with null'); + t.false(all(['',1]), 'Returns false for arrays with empty strings'); + //t.deepEqual(all(args..), 'Expected'); + //t.equal(all(args..), 'Expected'); + //t.false(all(args..), 'Expected'); + //t.throws(all(args..), 'Expected'); + t.end(); +}); diff --git a/test/allBy/allBy.js b/test/allBy/allBy.js new file mode 100644 index 000000000..d222c885f --- /dev/null +++ b/test/allBy/allBy.js @@ -0,0 +1,2 @@ +const allBy = (arr, fn) => arr.every(fn); +module.exports = allBy; \ No newline at end of file diff --git a/test/allBy/allBy.test.js b/test/allBy/allBy.test.js new file mode 100644 index 000000000..29a018ba1 --- /dev/null +++ b/test/allBy/allBy.test.js @@ -0,0 +1,15 @@ +const test = require('tape'); +const allBy = require('./allBy.js'); + +test('Testing allBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof allBy === 'function', 'allBy is a Function'); + t.true(allBy([4,1,2,3], x => x >= 1), 'Returns true with predicate function'); + t.false(allBy([0,1], x => x >= 1), 'Returns false with a predicate function'); + //t.deepEqual(allBy(args..), 'Expected'); + //t.equal(allBy(args..), 'Expected'); + //t.false(allBy(args..), 'Expected'); + //t.throws(allBy(args..), 'Expected'); + t.end(); +}); diff --git a/test/any/any.js b/test/any/any.js new file mode 100644 index 000000000..701f7cc85 --- /dev/null +++ b/test/any/any.js @@ -0,0 +1,2 @@ +const any = arr => arr.some(Boolean); +module.exports = any; \ No newline at end of file diff --git a/test/any/any.test.js b/test/any/any.test.js new file mode 100644 index 000000000..d9dd8f3a5 --- /dev/null +++ b/test/any/any.test.js @@ -0,0 +1,16 @@ +const test = require('tape'); +const any = require('./any.js'); + +test('Testing any', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof any === 'function', 'any is a Function'); + t.true(any([0,1,2,3]), 'Returns true for arrays with at least one truthy value'); + t.false(any([0,0]), 'Returns false for arrays with no truthy values'); + t.false(any([NaN,0,undefined,null,'']), 'Returns false for arrays with no truthy values'); + //t.deepEqual(any(args..), 'Expected'); + //t.equal(any(args..), 'Expected'); + //t.false(any(args..), 'Expected'); + //t.throws(any(args..), 'Expected'); + t.end(); +}); diff --git a/test/anyBy/anyBy.js b/test/anyBy/anyBy.js new file mode 100644 index 000000000..a72250185 --- /dev/null +++ b/test/anyBy/anyBy.js @@ -0,0 +1,2 @@ +const anyBy = (arr, fn) => arr.some(fn); +module.exports = anyBy; \ No newline at end of file diff --git a/test/anyBy/anyBy.test.js b/test/anyBy/anyBy.test.js new file mode 100644 index 000000000..126690349 --- /dev/null +++ b/test/anyBy/anyBy.test.js @@ -0,0 +1,15 @@ +const test = require('tape'); +const anyBy = require('./anyBy.js'); + +test('Testing anyBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof anyBy === 'function', 'anyBy is a Function'); + t.true(anyBy([4,1,0,3], x => x >= 1), 'Returns true with predicate function'); + t.false(anyBy([0,1], x => x < 0), 'Returns false with a predicate function'); + //t.deepEqual(anyBy(args..), 'Expected'); + //t.equal(anyBy(args..), 'Expected'); + //t.false(anyBy(args..), 'Expected'); + //t.throws(anyBy(args..), 'Expected'); + t.end(); +}); diff --git a/test/none/none.js b/test/none/none.js new file mode 100644 index 000000000..680ac9393 --- /dev/null +++ b/test/none/none.js @@ -0,0 +1,2 @@ +const none = arr => !arr.some(Boolean); +module.exports = none; \ No newline at end of file diff --git a/test/none/none.test.js b/test/none/none.test.js new file mode 100644 index 000000000..02d1a88a9 --- /dev/null +++ b/test/none/none.test.js @@ -0,0 +1,15 @@ +const test = require('tape'); +const none = require('./none.js'); + +test('Testing none', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof none === 'function', 'none is a Function'); + t.true(none([0,undefined,NaN,null,'']), 'Returns true for arrays with no truthy values'); + t.false(none([0,1]), 'Returns false for arrays with at least one truthy value'); + //t.deepEqual(none(args..), 'Expected'); + //t.equal(none(args..), 'Expected'); + //t.false(none(args..), 'Expected'); + //t.throws(none(args..), 'Expected'); + t.end(); +}); diff --git a/test/noneBy/noneBy.js b/test/noneBy/noneBy.js new file mode 100644 index 000000000..21ae86e05 --- /dev/null +++ b/test/noneBy/noneBy.js @@ -0,0 +1,2 @@ +const noneBy = (arr, fn) => !arr.some(fn); +module.exports = noneBy; \ No newline at end of file diff --git a/test/noneBy/noneBy.test.js b/test/noneBy/noneBy.test.js new file mode 100644 index 000000000..9147e5c98 --- /dev/null +++ b/test/noneBy/noneBy.test.js @@ -0,0 +1,15 @@ +const test = require('tape'); +const noneBy = require('./noneBy.js'); + +test('Testing noneBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof noneBy === 'function', 'noneBy is a Function'); + t.true(noneBy([4,1,0,3], x => x < 0), 'Returns true with a predicate function'); + t.false(noneBy([0,1,2], x => x == 1), 'Returns false with predicate function'); + //t.deepEqual(noneBy(args..), 'Expected'); + //t.equal(noneBy(args..), 'Expected'); + //t.false(noneBy(args..), 'Expected'); + //t.throws(noneBy(args..), 'Expected'); + t.end(); +}); diff --git a/test/testlog b/test/testlog index 85ec8e717..871c6bb41 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1810 +1,1851 @@ -Test log for: Tue Feb 13 2018 20:22:09 GMT+0000 (UTC) +Test log for: Wed Feb 14 2018 11:45:44 GMT+0200 (GTB Standard Time) -> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code +> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing JSONToDate + Testing all - ✔ JSONToDate is a Function + √ all is a Function + √ Returns true for arrays with no falsey values + √ Returns false for arrays with 0 + √ Returns false for arrays with NaN + √ Returns false for arrays with undefined + √ Returns false for arrays with null + √ Returns false for arrays with empty strings - Testing JSONToFile + Testing allBy - ✔ JSONToFile is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing RGBToHex - - ✔ RGBToHex is a Function - ✔ Converts the values of RGB components to a color code. - - Testing URLJoin - - ✔ URLJoin is a Function - ✔ Returns proper URL - ✔ Returns proper URL - - Testing UUIDGeneratorBrowser - - ✔ UUIDGeneratorBrowser is a Function - ✔ Tested 09/02/2018 by @chalarangelo - - Testing UUIDGeneratorNode - - ✔ UUIDGeneratorNode is a Function - ✔ Contains dashes in the proper places - ✔ Only contains hexadecimal digits + √ allBy is a Function + √ Returns true with predicate function + √ Returns false with a predicate function Testing anagrams - ✔ anagrams is a Function - ✔ Generates all anagrams of a string - ✔ Works for single-letter strings - ✔ Works for empty strings + √ anagrams is a Function + √ Generates all anagrams of a string + √ Works for single-letter strings + √ Works for empty strings + + Testing any + + √ any is a Function + √ Returns true for arrays with at least one truthy value + √ Returns false for arrays with no truthy values + √ Returns false for arrays with no truthy values + + Testing anyBy + + √ anyBy is a Function + √ Returns true with predicate function + √ Returns false with a predicate function Testing arrayToHtmlList - ✔ arrayToHtmlList is a Function + √ arrayToHtmlList is a Function Testing ary - ✔ ary is a Function - ✔ Discards arguments with index >=n + √ ary is a Function + √ Discards arguments with index >=n Testing atob - ✔ atob is a Function - ✔ atob("Zm9vYmFy") equals "foobar" - ✔ atob("Z") returns "" + √ atob is a Function + √ atob("Zm9vYmFy") equals "foobar" + √ atob("Z") returns "" Testing attempt - ✔ attempt is a Function - ✔ Returns a value - ✔ Returns an error + √ attempt is a Function + √ Returns a value + √ Returns an error Testing average - ✔ average is a Function - ✔ average(true) returns 0 - ✔ average(false) returns 1 - ✔ average(9, 1) returns 5 - ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - ✔ average(1, 2, 3) returns 2 - ✔ average(null) returns 0 - ✔ average(1, 2, 3) returns NaN - ✔ average(String) returns NaN - ✔ average({ a: 123}) returns NaN - ✔ average([undefined, 0, string]) returns NaN - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ average is a Function + √ average(true) returns 0 + √ average(false) returns 1 + √ average(9, 1) returns 5 + √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 + √ average(1, 2, 3) returns 2 + √ average(null) returns 0 + √ average(1, 2, 3) returns NaN + √ average(String) returns NaN + √ average({ a: 123}) returns NaN + √ average([undefined, 0, string]) returns NaN + √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing averageBy - ✔ averageBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ averageBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing binarySearch - ✔ binarySearch is a Function - ✔ Finds item in array - ✔ Returns -1 when not found - ✔ Works with empty arrays - ✔ Works for one element arrays + √ binarySearch is a Function + √ Finds item in array + √ Returns -1 when not found + √ Works with empty arrays + √ Works for one element arrays Testing bind - ✔ bind is a Function - ✔ Binds to an object context + √ bind is a Function + √ Binds to an object context Testing bindAll - ✔ bindAll is a Function - ✔ Binds to an object context + √ bindAll is a Function + √ Binds to an object context Testing bindKey - ✔ bindKey is a Function - ✔ Binds function to an object context + √ bindKey is a Function + √ Binds function to an object context Testing bottomVisible - ✔ bottomVisible is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ bottomVisible is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing btoa - ✔ btoa is a Function - ✔ btoa("foobar") equals "Zm9vYmFy" + √ btoa is a Function + √ btoa("foobar") equals "Zm9vYmFy" Testing byteSize - ✔ byteSize is a Function - ✔ Works for a single letter - ✔ Works for a common string - ✔ Works for emoji + √ byteSize is a Function + √ Works for a single letter + √ Works for a common string + √ Works for emoji Testing call - ✔ call is a Function - ✔ Calls function on given object + √ call is a Function + √ Calls function on given object Testing capitalize - ✔ capitalize is a Function - ✔ Capitalizes the first letter of a string - ✔ Capitalizes the first letter of a string - ✔ Works with characters - ✔ Works with single character words + √ capitalize is a Function + √ Capitalizes the first letter of a string + √ Capitalizes the first letter of a string + √ Works with characters + √ Works with single character words Testing capitalizeEveryWord - ✔ capitalizeEveryWord is a Function - ✔ Capitalizes the first letter of every word in a string - ✔ Works with characters - ✔ Works with one word string + √ capitalizeEveryWord is a Function + √ Capitalizes the first letter of every word in a string + √ Works with characters + √ Works with one word string Testing castArray - ✔ castArray is a Function - ✔ Works for single values - ✔ Works for arrays with one value - ✔ Works for arrays with multiple value - ✔ Works for strings - ✔ Works for objects + √ castArray is a Function + √ Works for single values + √ Works for arrays with one value + √ Works for arrays with multiple value + √ Works for strings + √ Works for objects Testing chainAsync - ✔ chainAsync is a Function + √ chainAsync is a Function Testing chunk - ✔ chunk is a Function - ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - ✔ chunk([]) returns [] - ✔ chunk(123) returns [] - ✔ chunk({ a: 123}) returns [] - ✔ chunk(string, 2) returns [ st, ri, ng ] - ✔ chunk() throws an error - ✔ chunk(undefined) throws an error - ✔ chunk(null) throws an error - ✔ chunk(This is a string, 2) takes less than 2s to run + √ chunk is a Function + √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] + √ chunk([]) returns [] + √ chunk(123) returns [] + √ chunk({ a: 123}) returns [] + √ chunk(string, 2) returns [ st, ri, ng ] + √ chunk() throws an error + √ chunk(undefined) throws an error + √ chunk(null) throws an error + √ chunk(This is a string, 2) takes less than 2s to run Testing clampNumber - ✔ clampNumber is a Function - ✔ Clamps num within the inclusive range specified by the boundary values a and b + √ clampNumber is a Function + √ Clamps num within the inclusive range specified by the boundary values a and b Testing cleanObj - ✔ cleanObj is a Function - ✔ Removes any properties except the ones specified from a JSON object + √ cleanObj is a Function + √ Removes any properties except the ones specified from a JSON object Testing cloneRegExp - ✔ cloneRegExp is a Function - ✔ Clones regular expressions properly + √ cloneRegExp is a Function + √ Clones regular expressions properly Testing coalesce - ✔ coalesce is a Function - ✔ Returns the first non-null/undefined argument + √ coalesce is a Function + √ Returns the first non-null/undefined argument Testing coalesceFactory - ✔ coalesceFactory is a Function - ✔ Returns a customized coalesce function + √ coalesceFactory is a Function + √ Returns a customized coalesce function Testing collatz - ✔ collatz is a Function - ✔ When n is even, divide by 2 - ✔ When n is odd, times by 3 and add 1 - ✔ Eventually reaches 1 + √ collatz is a Function + √ When n is even, divide by 2 + √ When n is odd, times by 3 and add 1 + √ Eventually reaches 1 Testing collectInto - ✔ collectInto is a Function + √ collectInto is a Function Testing colorize - ✔ colorize is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ colorize is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing compact - ✔ compact is a Function - ✔ Removes falsey values from an array + √ compact is a Function + √ Removes falsey values from an array Testing compose - ✔ compose is a Function - ✔ Performs right-to-left function composition + √ compose is a Function + √ Performs right-to-left function composition Testing composeRight - ✔ composeRight is a Function - ✔ Performs left-to-right function composition + √ composeRight is a Function + √ Performs left-to-right function composition Testing converge - ✔ converge is a Function - ✔ Produces the average of the array - ✔ Produces the strange concatenation + √ converge is a Function + √ Produces the average of the array + √ Produces the strange concatenation Testing copyToClipboard - ✔ copyToClipboard is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ copyToClipboard is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing countBy - ✔ countBy is a Function - ✔ Works for functions - ✔ Works for property names + √ countBy is a Function + √ Works for functions + √ Works for property names Testing countOccurrences - ✔ countOccurrences is a Function - ✔ Counts the occurrences of a value in an array + √ countOccurrences is a Function + √ Counts the occurrences of a value in an array Testing countVowels - ✔ countVowels is a Function + √ countVowels is a Function Testing createElement - ✔ createElement is a Function + √ createElement is a Function Testing createEventHub - ✔ createEventHub is a Function + √ createEventHub is a Function Testing currentURL - ✔ currentURL is a Function + √ currentURL is a Function Testing curry - ✔ curry is a Function - ✔ curries a Math.pow - ✔ curries a Math.min + √ curry is a Function + √ curries a Math.pow + √ curries a Math.min Testing debounce - ✔ debounce is a Function + √ debounce is a Function Testing decapitalize - ✔ decapitalize is a Function - ✔ Works with default parameter - ✔ Works with second parameter set to true + √ decapitalize is a Function + √ Works with default parameter + √ Works with second parameter set to true Testing deepClone - ✔ deepClone is a Function - ✔ Shallow cloning works - ✔ Deep cloning works + √ deepClone is a Function + √ Shallow cloning works + √ Deep cloning works Testing deepFlatten - ✔ deepFlatten is a Function - ✔ Deep flattens an array + √ deepFlatten is a Function + √ Deep flattens an array Testing defaults - ✔ defaults is a Function + √ defaults is a Function Testing defer - ✔ defer is a Function + √ defer is a Function Testing delay - ✔ delay is a Function + √ delay is a Function Testing detectDeviceType - ✔ detectDeviceType is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ detectDeviceType is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing difference - ✔ difference is a Function - ✔ Returns the difference between two arrays + √ difference is a Function + √ Returns the difference between two arrays Testing differenceBy - ✔ differenceBy is a Function - ✔ Works using a native function and numbers - ✔ Works with arrow function and objects + √ differenceBy is a Function + √ Works using a native function and numbers + √ Works with arrow function and objects Testing differenceWith - ✔ differenceWith is a Function - ✔ Filters out all values from an array + √ differenceWith is a Function + √ Filters out all values from an array Testing digitize - ✔ digitize is a Function - ✔ Converts a number to an array of digits + √ digitize is a Function + √ Converts a number to an array of digits Testing distance - ✔ distance is a Function - ✔ Calculates the distance between two points + √ distance is a Function + √ Calculates the distance between two points Testing drop - ✔ drop is a Function - ✔ Works without the last argument - ✔ Removes appropriate element count as specified - ✔ Empties array given a count greater than length + √ drop is a Function + √ Works without the last argument + √ Removes appropriate element count as specified + √ Empties array given a count greater than length Testing dropRight - ✔ dropRight is a Function - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right + √ dropRight is a Function + √ Returns a new array with n elements removed from the right + √ Returns a new array with n elements removed from the right + √ Returns a new array with n elements removed from the right Testing dropRightWhile - ✔ dropRightWhile is a Function - ✔ Removes elements from the end of an array until the passed function returns true. + √ dropRightWhile is a Function + √ Removes elements from the end of an array until the passed function returns true. Testing dropWhile - ✔ dropWhile is a Function - ✔ Removes elements in an array until the passed function returns true. + √ dropWhile is a Function + √ Removes elements in an array until the passed function returns true. Testing elementIsVisibleInViewport - ✔ elementIsVisibleInViewport is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ elementIsVisibleInViewport is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing elo - ✔ elo is a Function - ✔ Standard 1v1s - ✔ should be equivalent - ✔ 4 player FFA, all same rank + √ elo is a Function + √ Standard 1v1s + √ should be equivalent + √ 4 player FFA, all same rank Testing equals - ✔ equals is a Function - ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - ✔ [1,2,3] is equal to [1,2,3] - ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - ✔ [1,2,3] is not equal to [1,2,4] - ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + √ equals is a Function + √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } + √ [1,2,3] is equal to [1,2,3] + √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } + √ [1,2,3] is not equal to [1,2,4] + √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. Testing escapeHTML - ✔ escapeHTML is a Function - ✔ Escapes a string for use in HTML + √ escapeHTML is a Function + √ Escapes a string for use in HTML Testing escapeRegExp - ✔ escapeRegExp is a Function - ✔ Escapes a string to use in a regular expression + √ escapeRegExp is a Function + √ Escapes a string to use in a regular expression Testing everyNth - ✔ everyNth is a Function - ✔ Returns every nth element in an array + √ everyNth is a Function + √ Returns every nth element in an array Testing extendHex - ✔ extendHex is a Function - ✔ Extends a 3-digit color code to a 6-digit color code - ✔ Extends a 3-digit color code to a 6-digit color code + √ extendHex is a Function + √ Extends a 3-digit color code to a 6-digit color code + √ Extends a 3-digit color code to a 6-digit color code Testing factorial - ✔ factorial is a Function - ✔ Calculates the factorial of 720 - ✔ Calculates the factorial of 0 - ✔ Calculates the factorial of 1 - ✔ Calculates the factorial of 4 - ✔ Calculates the factorial of 10 + √ factorial is a Function + √ Calculates the factorial of 720 + √ Calculates the factorial of 0 + √ Calculates the factorial of 1 + √ Calculates the factorial of 4 + √ Calculates the factorial of 10 Testing factors - ✔ factors is a Function + √ factors is a Function Testing fibonacci - ✔ fibonacci is a Function - ✔ Generates an array, containing the Fibonacci sequence + √ fibonacci is a Function + √ Generates an array, containing the Fibonacci sequence Testing fibonacciCountUntilNum - ✔ fibonacciCountUntilNum is a Function + √ fibonacciCountUntilNum is a Function Testing fibonacciUntilNum - ✔ fibonacciUntilNum is a Function + √ fibonacciUntilNum is a Function Testing filterNonUnique - ✔ filterNonUnique is a Function - ✔ Filters out the non-unique values in an array + √ filterNonUnique is a Function + √ Filters out the non-unique values in an array Testing findKey - ✔ findKey is a Function - ✔ Returns the appropriate key + √ findKey is a Function + √ Returns the appropriate key Testing findLast - ✔ findLast is a Function - ✔ Finds last element for which the given function returns true + √ findLast is a Function + √ Finds last element for which the given function returns true Testing findLastIndex - ✔ findLastIndex is a Function - ✔ Finds last index for which the given function returns true + √ findLastIndex is a Function + √ Finds last index for which the given function returns true Testing findLastKey - ✔ findLastKey is a Function - ✔ Returns the appropriate key + √ findLastKey is a Function + √ Returns the appropriate key Testing flatten - ✔ flatten is a Function - ✔ Flattens an array - ✔ Flattens an array + √ flatten is a Function + √ Flattens an array + √ Flattens an array Testing flattenObject - ✔ flattenObject is a Function - ✔ Flattens an object with the paths for keys - ✔ Works with arrays + √ flattenObject is a Function + √ Flattens an object with the paths for keys + √ Works with arrays Testing flip - ✔ flip is a Function - ✔ Flips argument order + √ flip is a Function + √ Flips argument order Testing forEachRight - ✔ forEachRight is a Function - ✔ Iterates over the array in reverse - - Testing forOwn - - ✔ forOwn is a Function - ✔ Iterates over an element's key-value pairs - - Testing forOwnRight - - ✔ forOwnRight is a Function - ✔ Iterates over an element's key-value pairs in reverse + √ forEachRight is a Function + √ Iterates over the array in reverse Testing formatDuration - ✔ formatDuration is a Function - ✔ Returns the human readable format of the given number of milliseconds - ✔ Returns the human readable format of the given number of milliseconds + √ formatDuration is a Function + √ Returns the human readable format of the given number of milliseconds + √ Returns the human readable format of the given number of milliseconds + + Testing forOwn + + √ forOwn is a Function + √ Iterates over an element's key-value pairs + + Testing forOwnRight + + √ forOwnRight is a Function + √ Iterates over an element's key-value pairs in reverse Testing fromCamelCase - ✔ fromCamelCase is a Function - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase + √ fromCamelCase is a Function + √ Converts a string from camelcase + √ Converts a string from camelcase + √ Converts a string from camelcase Testing functionName - ✔ functionName is a Function - ✔ Works for native functions - ✔ Works for functions - ✔ Works for arrow functions + √ functionName is a Function + √ Works for native functions + √ Works for functions + √ Works for arrow functions Testing functions - ✔ functions is a Function - ✔ Returns own methods - ✔ Returns own and inherited methods + √ functions is a Function + √ Returns own methods + √ Returns own and inherited methods Testing gcd - ✔ gcd is a Function - ✔ Calculates the greatest common divisor between two or more numbers/arrays - ✔ Calculates the greatest common divisor between two or more numbers/arrays + √ gcd is a Function + √ Calculates the greatest common divisor between two or more numbers/arrays + √ Calculates the greatest common divisor between two or more numbers/arrays Testing geometricProgression - ✔ geometricProgression is a Function - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range + √ geometricProgression is a Function + √ Initializes an array containing the numbers in the specified range + √ Initializes an array containing the numbers in the specified range + √ Initializes an array containing the numbers in the specified range Testing get - ✔ get is a Function - ✔ Retrieve a property indicated by the selector from an object. + √ get is a Function + √ Retrieve a property indicated by the selector from an object. Testing getColonTimeFromDate - ✔ getColonTimeFromDate is a Function + √ getColonTimeFromDate is a Function Testing getDaysDiffBetweenDates - ✔ getDaysDiffBetweenDates is a Function - ✔ Returns the difference in days between two dates + √ getDaysDiffBetweenDates is a Function + √ Returns the difference in days between two dates Testing getMeridiemSuffixOfInteger - ✔ getMeridiemSuffixOfInteger is a Function + √ getMeridiemSuffixOfInteger is a Function Testing getScrollPosition - ✔ getScrollPosition is a Function + √ getScrollPosition is a Function Testing getStyle - ✔ getStyle is a Function + √ getStyle is a Function Testing getType - ✔ getType is a Function - ✔ Returns the native type of a value + √ getType is a Function + √ Returns the native type of a value Testing getURLParameters - ✔ getURLParameters is a Function - ✔ Returns an object containing the parameters of the current URL + √ getURLParameters is a Function + √ Returns an object containing the parameters of the current URL Testing groupBy - ✔ groupBy is a Function - ✔ Groups the elements of an array based on the given function - ✔ Groups the elements of an array based on the given function + √ groupBy is a Function + √ Groups the elements of an array based on the given function + √ Groups the elements of an array based on the given function Testing hammingDistance - ✔ hammingDistance is a Function - ✔ retuns hamming disance between 2 values + √ hammingDistance is a Function + √ retuns hamming disance between 2 values Testing hasClass - ✔ hasClass is a Function + √ hasClass is a Function Testing hasFlags - ✔ hasFlags is a Function + √ hasFlags is a Function Testing hashBrowser - ✔ hashBrowser is a Function + √ hashBrowser is a Function Testing hashNode - ✔ hashNode is a Function + √ hashNode is a Function Testing head - ✔ head is a Function - ✔ head({ a: 1234}) returns undefined - ✔ head([1, 2, 3]) returns 1 - ✔ head({ 0: false}) returns false - ✔ head(String) returns S - ✔ head(null) throws an Error - ✔ head(undefined) throws an Error - ✔ head() throws an Error - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ head is a Function + √ head({ a: 1234}) returns undefined + √ head([1, 2, 3]) returns 1 + √ head({ 0: false}) returns false + √ head(String) returns S + √ head(null) throws an Error + √ head(undefined) throws an Error + √ head() throws an Error + √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing hexToRGB - ✔ hexToRGB is a Function - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string + √ hexToRGB is a Function + √ Converts a color code to a rgb() or rgba() string + √ Converts a color code to a rgb() or rgba() string + √ Converts a color code to a rgb() or rgba() string Testing hide - ✔ hide is a Function + √ hide is a Function Testing howManyTimes - ✔ howManyTimes is a Function + √ howManyTimes is a Function Testing httpDelete - ✔ httpDelete is a Function + √ httpDelete is a Function Testing httpGet - ✔ httpGet is a Function + √ httpGet is a Function Testing httpPost - ✔ httpPost is a Function + √ httpPost is a Function Testing httpPut - ✔ httpPut is a Function + √ httpPut is a Function Testing httpsRedirect - ✔ httpsRedirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing inRange - - ✔ inRange is a Function - ✔ The given number falls within the given range - ✔ The given number falls within the given range - ✔ The given number does not falls within the given range - ✔ The given number does not falls within the given range + √ httpsRedirect is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing indexOfAll - ✔ indexOfAll is a Function - ✔ Returns all indices of val in an array - ✔ Returns all indices of val in an array + √ indexOfAll is a Function + √ Returns all indices of val in an array + √ Returns all indices of val in an array Testing initial - ✔ initial is a Function - ✔ Returns all the elements of an array except the last one + √ initial is a Function + √ Returns all the elements of an array except the last one Testing initialize2DArray - ✔ initialize2DArray is a Function - ✔ Initializes a 2D array of given width and height and value + √ initialize2DArray is a Function + √ Initializes a 2D array of given width and height and value Testing initializeArrayWithRange - ✔ initializeArrayWithRange is a Function - ✔ Initializes an array containing the numbers in the specified range + √ initializeArrayWithRange is a Function + √ Initializes an array containing the numbers in the specified range Testing initializeArrayWithRangeRight - ✔ initializeArrayWithRangeRight is a Function + √ initializeArrayWithRangeRight is a Function Testing initializeArrayWithValues - ✔ initializeArrayWithValues is a Function - ✔ Initializes and fills an array with the specified values + √ initializeArrayWithValues is a Function + √ Initializes and fills an array with the specified values + + Testing inRange + + √ inRange is a Function + √ The given number falls within the given range + √ The given number falls within the given range + √ The given number does not falls within the given range + √ The given number does not falls within the given range Testing intersection - ✔ intersection is a Function - ✔ Returns a list of elements that exist in both arrays + √ intersection is a Function + √ Returns a list of elements that exist in both arrays Testing intersectionBy - ✔ intersectionBy is a Function - ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + √ intersectionBy is a Function + √ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both Testing intersectionWith - ✔ intersectionWith is a Function - ✔ Returns a list of elements that exist in both arrays, using a provided comparator function + √ intersectionWith is a Function + √ Returns a list of elements that exist in both arrays, using a provided comparator function Testing invertKeyValues - ✔ invertKeyValues is a Function - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + √ invertKeyValues is a Function + √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } + √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } Testing is - ✔ is is a Function - ✔ Works for arrays with data - ✔ Works for empty arrays - ✔ Works for arrays, not objects - ✔ Works for objects - ✔ Works for maps - ✔ Works for regular expressions - ✔ Works for sets - ✔ Works for weak maps - ✔ Works for weak sets - ✔ Works for strings - returns false for primitive - ✔ Works for strings - returns true when using constructor - ✔ Works for numbers - returns false for primitive - ✔ Works for numbers - returns true when using constructor - ✔ Works for booleans - returns false for primitive - ✔ Works for booleans - returns true when using constructor - ✔ Works for functions + √ is is a Function + √ Works for arrays with data + √ Works for empty arrays + √ Works for arrays, not objects + √ Works for objects + √ Works for maps + √ Works for regular expressions + √ Works for sets + √ Works for weak maps + √ Works for weak sets + √ Works for strings - returns false for primitive + √ Works for strings - returns true when using constructor + √ Works for numbers - returns false for primitive + √ Works for numbers - returns true when using constructor + √ Works for booleans - returns false for primitive + √ Works for booleans - returns true when using constructor + √ Works for functions Testing isAbsoluteURL - ✔ isAbsoluteURL is a Function - ✔ Given string is an absolute URL - ✔ Given string is an absolute URL - ✔ Given string is not an absolute URL + √ isAbsoluteURL is a Function + √ Given string is an absolute URL + √ Given string is an absolute URL + √ Given string is not an absolute URL Testing isArmstrongNumber - ✔ isArmstrongNumber is a Function + √ isArmstrongNumber is a Function Testing isArray - ✔ isArray is a Function - ✔ passed value is an array - ✔ passed value is not an array + √ isArray is a Function + √ passed value is an array + √ passed value is not an array Testing isArrayBuffer - ✔ isArrayBuffer is a Function + √ isArrayBuffer is a Function Testing isArrayLike - ✔ isArrayLike is a Function - ✔ Returns true for a string - ✔ Returns true for an array - ✔ Returns false for null + √ isArrayLike is a Function + √ Returns true for a string + √ Returns true for an array + √ Returns false for null Testing isBoolean - ✔ isBoolean is a Function - ✔ passed value is not a boolean - ✔ passed value is not a boolean + √ isBoolean is a Function + √ passed value is not a boolean + √ passed value is not a boolean Testing isDivisible - ✔ isDivisible is a Function - ✔ The number 6 is divisible by 3 + √ isDivisible is a Function + √ The number 6 is divisible by 3 Testing isEmpty - ✔ isEmpty is a Function - ✔ Returns true for empty Map - ✔ Returns true for empty Set - ✔ Returns true for empty array - ✔ Returns true for empty object - ✔ Returns true for empty string - ✔ Returns false for non-empty array - ✔ Returns false for non-empty object - ✔ Returns false for non-empty string - ✔ Returns true - type is not considered a collection - ✔ Returns true - type is not considered a collection + √ isEmpty is a Function + √ Returns true for empty Map + √ Returns true for empty Set + √ Returns true for empty array + √ Returns true for empty object + √ Returns true for empty string + √ Returns false for non-empty array + √ Returns false for non-empty object + √ Returns false for non-empty string + √ Returns true - type is not considered a collection + √ Returns true - type is not considered a collection Testing isEven - ✔ isEven is a Function - ✔ 4 is even number - ✔ undefined + √ isEven is a Function + √ 4 is even number + √ undefined Testing isFunction - ✔ isFunction is a Function - ✔ passed value is a function - ✔ passed value is not a function + √ isFunction is a Function + √ passed value is a function + √ passed value is not a function Testing isLowerCase - ✔ isLowerCase is a Function - ✔ passed string is a lowercase - ✔ passed string is a lowercase - ✔ passed value is not a lowercase + √ isLowerCase is a Function + √ passed string is a lowercase + √ passed string is a lowercase + √ passed value is not a lowercase Testing isMap - ✔ isMap is a Function + √ isMap is a Function Testing isNil - ✔ isNil is a Function - ✔ Returns true for null - ✔ Returns true for undefined - ✔ Returns false for an empty string + √ isNil is a Function + √ Returns true for null + √ Returns true for undefined + √ Returns false for an empty string Testing isNull - ✔ isNull is a Function - ✔ passed argument is a null - ✔ passed argument is a null + √ isNull is a Function + √ passed argument is a null + √ passed argument is a null Testing isNumber - ✔ isNumber is a Function - ✔ passed argument is a number - ✔ passed argument is not a number + √ isNumber is a Function + √ passed argument is a number + √ passed argument is not a number Testing isObject - ✔ isObject is a Function - ✔ isObject([1, 2, 3, 4]) is a object - ✔ isObject([]) is a object - ✔ isObject({ a:1 }) is a object - ✔ isObject(true) is not a object + √ isObject is a Function + √ isObject([1, 2, 3, 4]) is a object + √ isObject([]) is a object + √ isObject({ a:1 }) is a object + √ isObject(true) is not a object Testing isObjectLike - ✔ isObjectLike is a Function - ✔ Returns true for an object - ✔ Returns true for an array - ✔ Returns false for a function - ✔ Returns false for null + √ isObjectLike is a Function + √ Returns true for an object + √ Returns true for an array + √ Returns false for a function + √ Returns false for null Testing isPlainObject - ✔ isPlainObject is a Function - ✔ Returns true for a plain object - ✔ Returns false for a Map (example of non-plain object) + √ isPlainObject is a Function + √ Returns true for a plain object + √ Returns false for a Map (example of non-plain object) Testing isPrime - ✔ isPrime is a Function - ✔ passed number is a prime + √ isPrime is a Function + √ passed number is a prime Testing isPrimitive - ✔ isPrimitive is a Function - ✔ isPrimitive(null) is primitive - ✔ isPrimitive(undefined) is primitive - ✔ isPrimitive(string) is primitive - ✔ isPrimitive(true) is primitive - ✔ isPrimitive(50) is primitive - ✔ isPrimitive('Hello') is primitive - ✔ isPrimitive(false) is primitive - ✔ isPrimitive(Symbol()) is primitive - ✔ isPrimitive([1, 2, 3]) is not primitive - ✔ isPrimitive({ a: 123 }) is not primitive - ✔ isPrimitive({ a: 123 }) takes less than 2s to run + √ isPrimitive is a Function + √ isPrimitive(null) is primitive + √ isPrimitive(undefined) is primitive + √ isPrimitive(string) is primitive + √ isPrimitive(true) is primitive + √ isPrimitive(50) is primitive + √ isPrimitive('Hello') is primitive + √ isPrimitive(false) is primitive + √ isPrimitive(Symbol()) is primitive + √ isPrimitive([1, 2, 3]) is not primitive + √ isPrimitive({ a: 123 }) is not primitive + √ isPrimitive({ a: 123 }) takes less than 2s to run Testing isPromiseLike - ✔ isPromiseLike is a Function - ✔ Returns true for a promise-like object - ✔ Returns false for null - ✔ Returns false for an empty object + √ isPromiseLike is a Function + √ Returns true for a promise-like object + √ Returns false for null + √ Returns false for an empty object Testing isRegExp - ✔ isRegExp is a Function + √ isRegExp is a Function Testing isSet - ✔ isSet is a Function + √ isSet is a Function Testing isSorted - ✔ isSorted is a Function - ✔ Array is sorted in ascending order - ✔ Array is sorted in descending order - ✔ Array is not sorted, direction changed in array + √ isSorted is a Function + √ Array is sorted in ascending order + √ Array is sorted in descending order + √ Array is not sorted, direction changed in array Testing isString - ✔ isString is a Function - ✔ foo is a string - ✔ "10" is a string - ✔ Empty string is a string - ✔ 10 is not a string - ✔ true is not string + √ isString is a Function + √ foo is a string + √ "10" is a string + √ Empty string is a string + √ 10 is not a string + √ true is not string Testing isSymbol - ✔ isSymbol is a Function - ✔ Checks if the given argument is a symbol + √ isSymbol is a Function + √ Checks if the given argument is a symbol Testing isTravisCI - ✔ isTravisCI is a Function - ✔ Running on Travis, correctly evaluates + √ isTravisCI is a Function + √ Not running on Travis, correctly evaluates Testing isTypedArray - ✔ isTypedArray is a Function + √ isTypedArray is a Function Testing isUndefined - ✔ isUndefined is a Function - ✔ Returns true for undefined + √ isUndefined is a Function + √ Returns true for undefined Testing isUpperCase - ✔ isUpperCase is a Function - ✔ ABC is all upper case - ✔ abc is not all upper case - ✔ A3@$ is all uppercase + √ isUpperCase is a Function + √ ABC is all upper case + √ abc is not all upper case + √ A3@$ is all uppercase Testing isValidJSON - ✔ isValidJSON is a Function - ✔ {"name":"Adam","age":20} is a valid JSON - ✔ {"name":"Adam",age:"20"} is not a valid JSON - ✔ null is a valid JSON + √ isValidJSON is a Function + √ {"name":"Adam","age":20} is a valid JSON + √ {"name":"Adam",age:"20"} is not a valid JSON + √ null is a valid JSON Testing isWeakMap - ✔ isWeakMap is a Function + √ isWeakMap is a Function Testing isWeakSet - ✔ isWeakSet is a Function + √ isWeakSet is a Function Testing join - ✔ join is a Function - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string + √ join is a Function + √ Joins all elements of an array into a string and returns this string + √ Joins all elements of an array into a string and returns this string + √ Joins all elements of an array into a string and returns this string + + Testing JSONToDate + + √ JSONToDate is a Function + + Testing JSONToFile + + √ JSONToFile is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing last - ✔ last is a Function - ✔ last({ a: 1234}) returns undefined - ✔ last([1, 2, 3]) returns 3 - ✔ last({ 0: false}) returns undefined - ✔ last(String) returns g - ✔ last(null) throws an Error - ✔ last(undefined) throws an Error - ✔ last() throws an Error - ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ last is a Function + √ last({ a: 1234}) returns undefined + √ last([1, 2, 3]) returns 3 + √ last({ 0: false}) returns undefined + √ last(String) returns g + √ last(null) throws an Error + √ last(undefined) throws an Error + √ last() throws an Error + √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing lcm - ✔ lcm is a Function - ✔ Returns the least common multiple of two or more numbers. - ✔ Returns the least common multiple of two or more numbers. + √ lcm is a Function + √ Returns the least common multiple of two or more numbers. + √ Returns the least common multiple of two or more numbers. Testing longestItem - ✔ longestItem is a Function - ✔ Returns the longest object + √ longestItem is a Function + √ Returns the longest object Testing lowercaseKeys - ✔ lowercaseKeys is a Function - ✔ Lowercases object keys - ✔ Does not mutate original object + √ lowercaseKeys is a Function + √ Lowercases object keys + √ Does not mutate original object Testing luhnCheck - ✔ luhnCheck is a Function - ✔ validates identification number - ✔ validates identification number - ✔ validates identification number + √ luhnCheck is a Function + √ validates identification number + √ validates identification number + √ validates identification number Testing mapKeys - ✔ mapKeys is a Function - ✔ Maps keys + √ mapKeys is a Function + √ Maps keys Testing mapObject - ✔ mapObject is a Function - ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } - ✔ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } + √ mapObject is a Function + √ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } + √ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } + √ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } Testing mapValues - ✔ mapValues is a Function - ✔ Maps values + √ mapValues is a Function + √ Maps values Testing mask - ✔ mask is a Function - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character + √ mask is a Function + √ Replaces all but the last num of characters with the specified mask character + √ Replaces all but the last num of characters with the specified mask character + √ Replaces all but the last num of characters with the specified mask character Testing matches - ✔ matches is a Function - ✔ Matches returns true for two similar objects - ✔ Matches returns false for two non-similar objects + √ matches is a Function + √ Matches returns true for two similar objects + √ Matches returns false for two non-similar objects Testing matchesWith - ✔ matchesWith is a Function - ✔ Returns true for two objects with similar values, based on the provided function + √ matchesWith is a Function + √ Returns true for two objects with similar values, based on the provided function Testing maxBy - ✔ maxBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ maxBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing maxN - ✔ maxN is a Function - ✔ Returns the n maximum elements from the provided array - ✔ Returns the n maximum elements from the provided array + √ maxN is a Function + √ Returns the n maximum elements from the provided array + √ Returns the n maximum elements from the provided array Testing median - ✔ median is a Function - ✔ Returns the median of an array of numbers - ✔ Returns the median of an array of numbers + √ median is a Function + √ Returns the median of an array of numbers + √ Returns the median of an array of numbers Testing memoize - ✔ memoize is a Function - ✔ Function works properly - ✔ Function works properly - ✔ Cache stores values + √ memoize is a Function + √ Function works properly + √ Function works properly + √ Cache stores values Testing merge - ✔ merge is a Function - ✔ Merges two objects + √ merge is a Function + √ Merges two objects Testing minBy - ✔ minBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ minBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing minN - ✔ minN is a Function - ✔ Returns the n minimum elements from the provided array - ✔ Returns the n minimum elements from the provided array + √ minN is a Function + √ Returns the n minimum elements from the provided array + √ Returns the n minimum elements from the provided array Testing negate - ✔ negate is a Function - ✔ Negates a predicate function + √ negate is a Function + √ Negates a predicate function + + Testing none + + √ none is a Function + √ Returns true for arrays with no truthy values + √ Returns false for arrays with at least one truthy value + + Testing noneBy + + √ noneBy is a Function + √ Returns true with a predicate function + √ Returns false with predicate function Testing nthArg - ✔ nthArg is a Function - ✔ Returns the nth argument - ✔ Returns undefined if arguments too few - ✔ Works for negative values + √ nthArg is a Function + √ Returns the nth argument + √ Returns undefined if arguments too few + √ Works for negative values Testing nthElement - ✔ nthElement is a Function - ✔ Returns the nth element of an array. - ✔ Returns the nth element of an array. + √ nthElement is a Function + √ Returns the nth element of an array. + √ Returns the nth element of an array. Testing objectFromPairs - ✔ objectFromPairs is a Function - ✔ Creates an object from the given key-value pairs. + √ objectFromPairs is a Function + √ Creates an object from the given key-value pairs. Testing objectToPairs - ✔ objectToPairs is a Function - ✔ Creates an array of key-value pair arrays from an object. + √ objectToPairs is a Function + √ Creates an array of key-value pair arrays from an object. Testing observeMutations - ✔ observeMutations is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ observeMutations is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing off - ✔ off is a Function + √ off is a Function Testing omit - ✔ omit is a Function - ✔ Omits the key-value pairs corresponding to the given keys from an object + √ omit is a Function + √ Omits the key-value pairs corresponding to the given keys from an object Testing omitBy - ✔ omitBy is a Function - ✔ Creates an object composed of the properties the given function returns falsey for + √ omitBy is a Function + √ Creates an object composed of the properties the given function returns falsey for Testing on - ✔ on is a Function - - Testing onUserInputChange - - ✔ onUserInputChange is a Function + √ on is a Function Testing once - ✔ once is a Function + √ once is a Function + + Testing onUserInputChange + + √ onUserInputChange is a Function Testing orderBy - ✔ orderBy is a Function - ✔ Returns a sorted array of objects ordered by properties and orders. - ✔ Returns a sorted array of objects ordered by properties and orders. + √ orderBy is a Function + √ Returns a sorted array of objects ordered by properties and orders. + √ Returns a sorted array of objects ordered by properties and orders. Testing over - ✔ over is a Function - ✔ Applies given functions over multiple arguments + √ over is a Function + √ Applies given functions over multiple arguments Testing overArgs - ✔ overArgs is a Function - ✔ Invokes the provided function with its arguments transformed + √ overArgs is a Function + √ Invokes the provided function with its arguments transformed Testing palindrome - ✔ palindrome is a Function - ✔ Given string is a palindrome - ✔ Given string is not a palindrome + √ palindrome is a Function + √ Given string is a palindrome + √ Given string is not a palindrome Testing parseCookie - ✔ parseCookie is a Function - ✔ Parses the cookie + √ parseCookie is a Function + √ Parses the cookie Testing partial - ✔ partial is a Function - ✔ Prepends arguments + √ partial is a Function + √ Prepends arguments Testing partialRight - ✔ partialRight is a Function - ✔ Appends arguments + √ partialRight is a Function + √ Appends arguments Testing partition - ✔ partition is a Function - ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. + √ partition is a Function + √ Groups the elements into two arrays, depending on the provided function's truthiness for each element. Testing percentile - ✔ percentile is a Function - ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + √ percentile is a Function + √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. Testing pick - ✔ pick is a Function - ✔ Picks the key-value pairs corresponding to the given keys from an object. + √ pick is a Function + √ Picks the key-value pairs corresponding to the given keys from an object. Testing pickBy - ✔ pickBy is a Function - ✔ Creates an object composed of the properties the given function returns truthy for. + √ pickBy is a Function + √ Creates an object composed of the properties the given function returns truthy for. Testing pipeAsyncFunctions - ✔ pipeAsyncFunctions is a Function - ✔ Produces the appropriate hash - ✔ pipeAsyncFunctions result should be 15 + √ pipeAsyncFunctions is a Function + √ Produces the appropriate hash + √ pipeAsyncFunctions result should be 15 Testing pipeFunctions - ✔ pipeFunctions is a Function - ✔ Performs left-to-right function composition + √ pipeFunctions is a Function + √ Performs left-to-right function composition Testing pluralize - ✔ pluralize is a Function - ✔ Produces the plural of the word - ✔ Produces the singular of the word - ✔ Produces the plural of the word - ✔ Prodices the defined plural of the word - ✔ Works with a dictionary + √ pluralize is a Function + √ Produces the plural of the word + √ Produces the singular of the word + √ Produces the plural of the word + √ Prodices the defined plural of the word + √ Works with a dictionary Testing powerset - ✔ powerset is a Function - ✔ Returns the powerset of a given array of numbers. + √ powerset is a Function + √ Returns the powerset of a given array of numbers. Testing prettyBytes - ✔ prettyBytes is a Function - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. + √ prettyBytes is a Function + √ Converts a number in bytes to a human-readable string. + √ Converts a number in bytes to a human-readable string. + √ Converts a number in bytes to a human-readable string. Testing primes - ✔ primes is a Function - ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. + √ primes is a Function + √ Generates primes up to a given number, using the Sieve of Eratosthenes. Testing promisify - ✔ promisify is a Function - ✔ Returns a promise + √ promisify is a Function + √ Returns a promise Testing pull - ✔ pull is a Function - ✔ Pulls the specified values + √ pull is a Function + √ Pulls the specified values Testing pullAtIndex - ✔ pullAtIndex is a Function - ✔ Pulls the given values - ✔ Pulls the given values + √ pullAtIndex is a Function + √ Pulls the given values + √ Pulls the given values Testing pullAtValue - ✔ pullAtValue is a Function - ✔ Pulls the specified values - ✔ Pulls the specified values + √ pullAtValue is a Function + √ Pulls the specified values + √ Pulls the specified values Testing pullBy - ✔ pullBy is a Function - ✔ Pulls the specified values + √ pullBy is a Function + √ Pulls the specified values Testing quickSort - ✔ quickSort is a Function - ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] - ✔ quickSort() throws an error - ✔ quickSort(123) throws an error - ✔ quickSort({ 234: string}) throws an error - ✔ quickSort(null) throws an error - ✔ quickSort(undefined) throws an error - ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + √ quickSort is a Function + √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] + √ quickSort([-1, 0, -2]) returns [-2, -1, 0] + √ quickSort() throws an error + √ quickSort(123) throws an error + √ quickSort({ 234: string}) throws an error + √ quickSort(null) throws an error + √ quickSort(undefined) throws an error + √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run Testing randomHexColorCode - ✔ randomHexColorCode is a Function - ✔ should be equal + √ randomHexColorCode is a Function + √ should be equal Testing randomIntArrayInRange - ✔ randomIntArrayInRange is a Function - ✔ The returned array contains only integers - ✔ The returned array has the proper length - ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + √ randomIntArrayInRange is a Function + √ The returned array contains only integers + √ The returned array has the proper length + √ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). Testing randomIntegerInRange - ✔ randomIntegerInRange is a Function - ✔ The returned value is an integer - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + √ randomIntegerInRange is a Function + √ The returned value is an integer + √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). Testing randomNumberInRange - ✔ randomNumberInRange is a Function - ✔ The returned value is a number - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + √ randomNumberInRange is a Function + √ The returned value is a number + √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). Testing readFileLines - ✔ readFileLines is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ readFileLines is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing rearg - ✔ rearg is a Function - ✔ Reorders arguments in invoked function + √ rearg is a Function + √ Reorders arguments in invoked function Testing redirect - ✔ redirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing reduceSuccessive - - ✔ reduceSuccessive is a Function - ✔ Returns the array of successively reduced values - - Testing reduceWhich - - ✔ reduceWhich is a Function - ✔ Returns the minimum of an array - ✔ Returns the maximum of an array - ✔ Returns the object with the minimum specified value in an array + √ redirect is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing reducedFilter - ✔ reducedFilter is a Function - ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. + √ reducedFilter is a Function + √ Filter an array of objects based on a condition while also filtering out unspecified keys. + + Testing reduceSuccessive + + √ reduceSuccessive is a Function + √ Returns the array of successively reduced values + + Testing reduceWhich + + √ reduceWhich is a Function + √ Returns the minimum of an array + √ Returns the maximum of an array + √ Returns the object with the minimum specified value in an array Testing remove - ✔ remove is a Function - ✔ Removes elements from an array for which the given function returns false + √ remove is a Function + √ Removes elements from an array for which the given function returns false Testing removeNonASCII - ✔ removeNonASCII is a Function - ✔ Removes non-ASCII characters + √ removeNonASCII is a Function + √ Removes non-ASCII characters Testing removeVowels - ✔ removeVowels is a Function + √ removeVowels is a Function Testing reverseString - ✔ reverseString is a Function - ✔ Reverses a string. + √ reverseString is a Function + √ Reverses a string. + + Testing RGBToHex + + √ RGBToHex is a Function + √ Converts the values of RGB components to a color code. Testing round - ✔ round is a Function - ✔ round(1.005, 2) returns 1.01 - ✔ round(123.3423345345345345344, 11) returns 123.34233453453 - ✔ round(3.342, 11) returns 3.342 - ✔ round(1.005) returns 1 - ✔ round([1.005, 2]) returns NaN - ✔ round(string) returns NaN - ✔ round() returns NaN - ✔ round(132, 413, 4134) returns NaN - ✔ round({a: 132}, 413) returns NaN - ✔ round(123.3423345345345345344, 11) takes less than 2s to run + √ round is a Function + √ round(1.005, 2) returns 1.01 + √ round(123.3423345345345345344, 11) returns 123.34233453453 + √ round(3.342, 11) returns 3.342 + √ round(1.005) returns 1 + √ round([1.005, 2]) returns NaN + √ round(string) returns NaN + √ round() returns NaN + √ round(132, 413, 4134) returns NaN + √ round({a: 132}, 413) returns NaN + √ round(123.3423345345345345344, 11) takes less than 2s to run Testing runAsync - ✔ runAsync is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ runAsync is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing runPromisesInSeries - ✔ runPromisesInSeries is a Function + √ runPromisesInSeries is a Function Testing sample - ✔ sample is a Function - ✔ Returns a random element from the array - ✔ Works for single-element arrays - ✔ Returns undefined for empty array + √ sample is a Function + √ Returns a random element from the array + √ Works for single-element arrays + √ Returns undefined for empty array Testing sampleSize - ✔ sampleSize is a Function - ✔ Returns a single element without n specified - ✔ Returns a random sample of specified size from an array - ✔ Returns all elements in an array if n >= length - ✔ Returns an empty array if original array is empty - ✔ Returns an empty array if n = 0 + √ sampleSize is a Function + √ Returns a single element without n specified + √ Returns a random sample of specified size from an array + √ Returns all elements in an array if n >= length + √ Returns an empty array if original array is empty + √ Returns an empty array if n = 0 Testing scrollToTop - ✔ scrollToTop is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ scrollToTop is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing sdbm - ✔ sdbm is a Function - ✔ Hashes the input string into a whole number. + √ sdbm is a Function + √ Hashes the input string into a whole number. Testing serializeCookie - ✔ serializeCookie is a Function - ✔ Serializes the cookie + √ serializeCookie is a Function + √ Serializes the cookie Testing setStyle - ✔ setStyle is a Function + √ setStyle is a Function Testing shallowClone - ✔ shallowClone is a Function - ✔ Shallow cloning works - ✔ Does not clone deeply + √ shallowClone is a Function + √ Shallow cloning works + √ Does not clone deeply Testing show - ✔ show is a Function + √ show is a Function Testing shuffle - ✔ shuffle is a Function - ✔ Shuffles the array - ✔ New array contains all original elements - ✔ Works for empty arrays - ✔ Works for single-element arrays + √ shuffle is a Function + √ Shuffles the array + √ New array contains all original elements + √ Works for empty arrays + √ Works for single-element arrays Testing similarity - ✔ similarity is a Function - ✔ Returns an array of elements that appear in both arrays. + √ similarity is a Function + √ Returns an array of elements that appear in both arrays. Testing size - ✔ size is a Function - ✔ Get size of arrays, objects or strings. - ✔ Get size of arrays, objects or strings. + √ size is a Function + √ Get size of arrays, objects or strings. + √ Get size of arrays, objects or strings. Testing sleep - ✔ sleep is a Function + √ sleep is a Function Testing solveRPN - ✔ solveRPN is a Function + √ solveRPN is a Function Testing sortCharactersInString - ✔ sortCharactersInString is a Function - ✔ Alphabetically sorts the characters in a string. + √ sortCharactersInString is a Function + √ Alphabetically sorts the characters in a string. Testing sortedIndex - ✔ sortedIndex is a Function - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + √ sortedIndex is a Function + √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. Testing sortedIndexBy - ✔ sortedIndexBy is a Function - ✔ Returns the lowest index to insert the element without messing up the list order + √ sortedIndexBy is a Function + √ Returns the lowest index to insert the element without messing up the list order Testing sortedLastIndex - ✔ sortedLastIndex is a Function - ✔ Returns the highest index to insert the element without messing up the list order + √ sortedLastIndex is a Function + √ Returns the highest index to insert the element without messing up the list order Testing sortedLastIndexBy - ✔ sortedLastIndexBy is a Function - ✔ Returns the highest index to insert the element without messing up the list order + √ sortedLastIndexBy is a Function + √ Returns the highest index to insert the element without messing up the list order Testing speechSynthesis - ✔ speechSynthesis is a Function + √ speechSynthesis is a Function Testing splitLines - ✔ splitLines is a Function - ✔ Splits a multiline string into an array of lines. + √ splitLines is a Function + √ Splits a multiline string into an array of lines. Testing spreadOver - ✔ spreadOver is a Function - ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + √ spreadOver is a Function + √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. Testing standardDeviation - ✔ standardDeviation is a Function - ✔ Returns the standard deviation of an array of numbers - ✔ Returns the standard deviation of an array of numbers + √ standardDeviation is a Function + √ Returns the standard deviation of an array of numbers + √ Returns the standard deviation of an array of numbers Testing stripHTMLTags - ✔ stripHTMLTags is a Function - ✔ Removes HTML tags + √ stripHTMLTags is a Function + √ Removes HTML tags Testing sum - ✔ sum is a Function - ✔ Returns the sum of two or more numbers/arrays. + √ sum is a Function + √ Returns the sum of two or more numbers/arrays. Testing sumBy - ✔ sumBy is a Function + √ sumBy is a Function Testing sumPower - ✔ sumPower is a Function - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end + √ sumPower is a Function + √ Returns the sum of the powers of all the numbers from start to end + √ Returns the sum of the powers of all the numbers from start to end + √ Returns the sum of the powers of all the numbers from start to end Testing symmetricDifference - ✔ symmetricDifference is a Function - ✔ Returns the symmetric difference between two arrays. + √ symmetricDifference is a Function + √ Returns the symmetric difference between two arrays. Testing symmetricDifferenceBy - ✔ symmetricDifferenceBy is a Function - ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + √ symmetricDifferenceBy is a Function + √ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both Testing symmetricDifferenceWith - ✔ symmetricDifferenceWith is a Function - ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator + √ symmetricDifferenceWith is a Function + √ Returns the symmetric difference between two arrays, using a provided function as a comparator Testing tail - ✔ tail is a Function - ✔ Returns tail - ✔ Returns tail + √ tail is a Function + √ Returns tail + √ Returns tail Testing take - ✔ take is a Function - ✔ Returns an array with n elements removed from the beginning. - ✔ Returns an array with n elements removed from the beginning. + √ take is a Function + √ Returns an array with n elements removed from the beginning. + √ Returns an array with n elements removed from the beginning. Testing takeRight - ✔ takeRight is a Function - ✔ Returns an array with n elements removed from the end - ✔ Returns an array with n elements removed from the end + √ takeRight is a Function + √ Returns an array with n elements removed from the end + √ Returns an array with n elements removed from the end Testing takeRightWhile - ✔ takeRightWhile is a Function - ✔ Removes elements until the function returns true + √ takeRightWhile is a Function + √ Removes elements until the function returns true Testing takeWhile - ✔ takeWhile is a Function - ✔ Removes elements until the function returns true + √ takeWhile is a Function + √ Removes elements until the function returns true Testing throttle - ✔ throttle is a Function - - Testing timeTaken - - ✔ timeTaken is a Function + √ throttle is a Function Testing times - ✔ times is a Function - ✔ Runs a function the specified amount of times + √ times is a Function + √ Runs a function the specified amount of times + + Testing timeTaken + + √ timeTaken is a Function Testing toCamelCase - ✔ toCamelCase is a Function - ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName - ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - ✔ toCamelCase('some-javascript-property') return someJavascriptProperty - ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - ✔ toCamelCase() throws a error - ✔ toCamelCase([]) throws a error - ✔ toCamelCase({}) throws a error - ✔ toCamelCase(123) throws a error - ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + √ toCamelCase is a Function + √ toCamelCase('some_database_field_name') returns someDatabaseFieldName + √ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized + √ toCamelCase('some-javascript-property') return someJavascriptProperty + √ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens + √ toCamelCase() throws a error + √ toCamelCase([]) throws a error + √ toCamelCase({}) throws a error + √ toCamelCase(123) throws a error + √ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run Testing toCurrency - ✔ toCurrency is a Function - ✔ currency: Euro | currencyLangFormat: Local - ✔ currency: US Dollar | currencyLangFormat: English (United States) - ✔ currency: Japanese Yen | currencyLangFormat: Local + √ toCurrency is a Function + √ currency: Euro | currencyLangFormat: Local + √ currency: US Dollar | currencyLangFormat: English (United States) + √ currency: Japanese Yen | currencyLangFormat: Local Testing toDecimalMark - ✔ toDecimalMark is a Function - ✔ convert a float-point arithmetic to the Decimal mark form - - Testing toKebabCase - - ✔ toKebabCase is a Function - ✔ toKebabCase('camelCase') returns camel-case - ✔ toKebabCase('some text') returns some-text - ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - ✔ toKebabCase() return undefined - ✔ toKebabCase([]) throws an error - ✔ toKebabCase({}) throws an error - ✔ toKebabCase(123) throws an error - ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toOrdinalSuffix - - ✔ toOrdinalSuffix is a Function - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - - Testing toSafeInteger - - ✔ toSafeInteger is a Function - ✔ Number(toSafeInteger(3.2)) is a number - ✔ Converts a value to a safe integer - ✔ toSafeInteger('4.2') returns 4 - ✔ toSafeInteger(4.6) returns 5 - ✔ toSafeInteger([]) returns 0 - ✔ isNaN(toSafeInteger([1.5, 3124])) is true - ✔ isNaN(toSafeInteger('string')) is true - ✔ isNaN(toSafeInteger({})) is true - ✔ isNaN(toSafeInteger()) is true - ✔ toSafeInteger(Infinity) returns 9007199254740991 - ✔ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - ✔ toSnakeCase is a Function - ✔ toSnakeCase('camelCase') returns camel_case - ✔ toSnakeCase('some text') returns some_text - ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - ✔ toSnakeCase() returns undefined - ✔ toSnakeCase([]) throws an error - ✔ toSnakeCase({}) throws an error - ✔ toSnakeCase(123) throws an error - ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + √ toDecimalMark is a Function + √ convert a float-point arithmetic to the Decimal mark form Testing toggleClass - ✔ toggleClass is a Function + √ toggleClass is a Function + + Testing toKebabCase + + √ toKebabCase is a Function + √ toKebabCase('camelCase') returns camel-case + √ toKebabCase('some text') returns some-text + √ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens + √ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html + √ toKebabCase() return undefined + √ toKebabCase([]) throws an error + √ toKebabCase({}) throws an error + √ toKebabCase(123) throws an error + √ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run Testing tomorrow - ✔ tomorrow is a Function - ✔ Returns the correct year - ✔ Returns the correct month - ✔ Returns the correct date + √ tomorrow is a Function + √ Returns the correct year + √ Returns the correct month + √ Returns the correct date + + Testing toOrdinalSuffix + + √ toOrdinalSuffix is a Function + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + + Testing toSafeInteger + + √ toSafeInteger is a Function + √ Number(toSafeInteger(3.2)) is a number + √ Converts a value to a safe integer + √ toSafeInteger('4.2') returns 4 + √ toSafeInteger(4.6) returns 5 + √ toSafeInteger([]) returns 0 + √ isNaN(toSafeInteger([1.5, 3124])) is true + √ isNaN(toSafeInteger('string')) is true + √ isNaN(toSafeInteger({})) is true + √ isNaN(toSafeInteger()) is true + √ toSafeInteger(Infinity) returns 9007199254740991 + √ toSafeInteger(3.2) takes less than 2s to run + + Testing toSnakeCase + + √ toSnakeCase is a Function + √ toSnakeCase('camelCase') returns camel_case + √ toSnakeCase('some text') returns some_text + √ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens + √ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html + √ toSnakeCase() returns undefined + √ toSnakeCase([]) throws an error + √ toSnakeCase({}) throws an error + √ toSnakeCase(123) throws an error + √ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run Testing transform - ✔ transform is a Function - ✔ Transforms an object + √ transform is a Function + √ Transforms an object Testing truncateString - ✔ truncateString is a Function - ✔ Truncates a "boomerang" up to a specified length. + √ truncateString is a Function + √ Truncates a "boomerang" up to a specified length. Testing truthCheckCollection - ✔ truthCheckCollection is a Function - ✔ second argument is truthy on all elements of a collection + √ truthCheckCollection is a Function + √ second argument is truthy on all elements of a collection Testing unary - ✔ unary is a Function - ✔ Discards arguments after the first one + √ unary is a Function + √ Discards arguments after the first one Testing unescapeHTML - ✔ unescapeHTML is a Function - ✔ Unescapes escaped HTML characters. + √ unescapeHTML is a Function + √ Unescapes escaped HTML characters. Testing unflattenObject - ✔ unflattenObject is a Function - ✔ Unflattens an object with the paths for keys + √ unflattenObject is a Function + √ Unflattens an object with the paths for keys Testing unfold - ✔ unfold is a Function - ✔ Works with a given function, producing an array + √ unfold is a Function + √ Works with a given function, producing an array Testing union - ✔ union is a Function - ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - ✔ union([], []) returns [] - ✔ union() throws an error - ✔ union(true, str) throws an error - ✔ union(false, true) throws an error - ✔ union(123, {}) throws an error - ✔ union([], {}) throws an error - ✔ union(undefined, null) throws an error - ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + √ union is a Function + √ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] + √ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] + √ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] + √ union([], []) returns [] + √ union() throws an error + √ union(true, str) throws an error + √ union(false, true) throws an error + √ union(123, {}) throws an error + √ union([], {}) throws an error + √ union(undefined, null) throws an error + √ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run Testing unionBy - ✔ unionBy is a Function - ✔ Produces the appropriate results + √ unionBy is a Function + √ Produces the appropriate results Testing unionWith - ✔ unionWith is a Function - ✔ Produces the appropriate results + √ unionWith is a Function + √ Produces the appropriate results Testing uniqueElements - ✔ uniqueElements is a Function - ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] - ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - ✔ uniqueElements() returns [] - ✔ uniqueElements(null) returns [] - ✔ uniqueElements(undefined) returns [] - ✔ uniqueElements('strt') returns ['s', 't', 'r'] - ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error - ✔ uniqueElements({}) throws an error - ✔ uniqueElements(true) throws an error - ✔ uniqueElements(false) throws an error - ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + √ uniqueElements is a Function + √ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] + √ uniqueElements([1, 23, 53]) returns [1, 23, 53] + √ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] + √ uniqueElements() returns [] + √ uniqueElements(null) returns [] + √ uniqueElements(undefined) returns [] + √ uniqueElements('strt') returns ['s', 't', 'r'] + √ uniqueElements(1, 1, 2543, 534, 5) throws an error + √ uniqueElements({}) throws an error + √ uniqueElements(true) throws an error + √ uniqueElements(false) throws an error + √ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run Testing untildify - ✔ untildify is a Function - ✔ Contains no tildes - ✔ Does not alter the rest of the path - ✔ Does not alter paths without tildes + √ untildify is a Function + √ Contains no tildes + √ Does not alter the rest of the path + √ Does not alter paths without tildes Testing unzip - ✔ unzip is a Function - ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] + √ unzip is a Function + √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] + √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] Testing unzipWith - ✔ unzipWith is a Function - ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + √ unzipWith is a Function + √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + + Testing URLJoin + + √ URLJoin is a Function + √ Returns proper URL + √ Returns proper URL + + Testing UUIDGeneratorBrowser + + √ UUIDGeneratorBrowser is a Function + √ Tested 09/02/2018 by @chalarangelo + + Testing UUIDGeneratorNode + + √ UUIDGeneratorNode is a Function + √ Contains dashes in the proper places + √ Only contains hexadecimal digits Testing validateNumber - ✔ validateNumber is a Function - ✔ validateNumber(9) returns true - ✔ validateNumber(234asd.slice(0, 2)) returns true - ✔ validateNumber(1232) returns true - ✔ validateNumber(1232 + 13423) returns true - ✔ validateNumber(1232 * 2342 * 123) returns true - ✔ validateNumber(1232.23423536) returns true - ✔ validateNumber(234asd) returns false - ✔ validateNumber(e234d) returns false - ✔ validateNumber(false) returns false - ✔ validateNumber(true) returns false - ✔ validateNumber(null) returns false - ✔ validateNumber(123 * asd) returns false + √ validateNumber is a Function + √ validateNumber(9) returns true + √ validateNumber(234asd.slice(0, 2)) returns true + √ validateNumber(1232) returns true + √ validateNumber(1232 + 13423) returns true + √ validateNumber(1232 * 2342 * 123) returns true + √ validateNumber(1232.23423536) returns true + √ validateNumber(234asd) returns false + √ validateNumber(e234d) returns false + √ validateNumber(false) returns false + √ validateNumber(true) returns false + √ validateNumber(null) returns false + √ validateNumber(123 * asd) returns false Testing without - ✔ without is a Function - ✔ without([2, 1, 2, 3], 1, 2) returns [3] - ✔ without([]) returns [] - ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] - ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - ✔ without() throws an error - ✔ without(null) throws an error - ✔ without(undefined) throws an error - ✔ without() throws an error - ✔ without({}) throws an error + √ without is a Function + √ without([2, 1, 2, 3], 1, 2) returns [3] + √ without([]) returns [] + √ without([3, 1, true, '3', true], '3', true) returns [3, 1] + √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] + √ without() throws an error + √ without(null) throws an error + √ without(undefined) throws an error + √ without() throws an error + √ without({}) throws an error Testing words - ✔ words is a Function - ✔ words('I love javaScript!!') returns [I, love, javaScript] - ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] - ✔ words(I love javaScript!!) returns an array - ✔ words() throws a error - ✔ words(null) throws a error - ✔ words(undefined) throws a error - ✔ words({}) throws a error - ✔ words([]) throws a error - ✔ words(1234) throws a error + √ words is a Function + √ words('I love javaScript!!') returns [I, love, javaScript] + √ words('python, javaScript & coffee') returns [python, javaScript, coffee] + √ words(I love javaScript!!) returns an array + √ words() throws a error + √ words(null) throws a error + √ words(undefined) throws a error + √ words({}) throws a error + √ words([]) throws a error + √ words(1234) throws a error Testing xProd - ✔ xProd is a Function - ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + √ xProd is a Function + √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] Testing yesNo - ✔ yesNo is a Function - ✔ yesNo(Y) returns true - ✔ yesNo(yes) returns true - ✔ yesNo(foo, true) returns true - ✔ yesNo(No) returns false - ✔ yesNo() returns false - ✔ yesNo(null) returns false - ✔ yesNo(undefined) returns false - ✔ yesNo([123, null]) returns false - ✔ yesNo([Yes, No]) returns false - ✔ yesNo({ 2: Yes }) returns false - ✔ yesNo([Yes, No], true) returns true - ✔ yesNo({ 2: Yes }, true) returns true + √ yesNo is a Function + √ yesNo(Y) returns true + √ yesNo(yes) returns true + √ yesNo(foo, true) returns true + √ yesNo(No) returns false + √ yesNo() returns false + √ yesNo(null) returns false + √ yesNo(undefined) returns false + √ yesNo([123, null]) returns false + √ yesNo([Yes, No]) returns false + √ yesNo({ 2: Yes }) returns false + √ yesNo([Yes, No], true) returns true + √ yesNo({ 2: Yes }, true) returns true Testing zip - ✔ zip is a Function - ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - ✔ zip([]) returns [] - ✔ zip(123) returns [] - ✔ zip([a, b], [1, 2], [true, false]) returns an Array - ✔ zip([a], [1, 2], [true, false]) returns an Array - ✔ zip(null) throws an error - ✔ zip(undefined) throws an error + √ zip is a Function + √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] + √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] + √ zip([]) returns [] + √ zip(123) returns [] + √ zip([a, b], [1, 2], [true, false]) returns an Array + √ zip([a], [1, 2], [true, false]) returns an Array + √ zip(null) throws an error + √ zip(undefined) throws an error Testing zipObject - ✔ zipObject is a Function - ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - ✔ zipObject([a], string) returns { a: s } - ✔ zipObject() throws an error - ✔ zipObject([string], null) throws an error - ✔ zipObject(null, [1]) throws an error - ✔ zipObject(string) throws an error - ✔ zipObject(test, string) throws an error + √ zipObject is a Function + √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} + √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} + √ zipObject([a, b, c], string) returns { a: s, b: t, c: r } + √ zipObject([a], string) returns { a: s } + √ zipObject() throws an error + √ zipObject([string], null) throws an error + √ zipObject(null, [1]) throws an error + √ zipObject(string) throws an error + √ zipObject(test, string) throws an error Testing zipWith - ✔ zipWith is a Function - ✔ Runs the function provided - ✔ Sends a POST request - ✔ Runs promises in series - ✔ Sends a GET request - ✔ Works with multiple promises + √ zipWith is a Function + √ Runs the function provided + √ Sends a GET request + √ Runs promises in series + √ Sends a POST request + √ Works with multiple promises - total: 901 - passing: 901 - duration: 2.7s + total: 924 + passing: 924 + duration: 2.4s From 3900189a778fb228617e4eae7b7f067407b947c6 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 14 Feb 2018 11:56:44 +0200 Subject: [PATCH 11/43] Add uncurry --- snippets/uncurry.md | 23 + tag_database | 1 + test/testlog | 1921 +++++++++++++++++----------------- test/uncurry/uncurry.js | 6 + test/uncurry/uncurry.test.js | 20 + 5 files changed, 1014 insertions(+), 957 deletions(-) create mode 100644 snippets/uncurry.md create mode 100644 test/uncurry/uncurry.js create mode 100644 test/uncurry/uncurry.test.js diff --git a/snippets/uncurry.md b/snippets/uncurry.md new file mode 100644 index 000000000..c5757e88d --- /dev/null +++ b/snippets/uncurry.md @@ -0,0 +1,23 @@ +### uncurry + +Uncurries a function up to depth `n`. + +Return a variadic function. +Use `Array.reduce()` on the provided arguments to call each subsequent curry level of the function. +If the `length` of the provided arguments is less than `n` throw an error. +Otherwise, call `fn` with the proper amount of arguments, using `Array.slice(0, n)`. +Omit the second argument, `n`, to uncurry up to depth `1`. + +```js +const uncurry = (fn, n = 1) => (...args) => { + const next = acc => args => args.reduce((x, y) => x(y), acc); + if (n > args.length) throw new RangeError('Arguments too few!'); + return next(fn)(args.slice(0, n)); +}; +``` + +```js +const add = x => y => z => x + y + z; +const uncurriedAdd = uncurry(add, 3); +uncurriedAdd(1, 2, 3); // 6 +``` diff --git a/tag_database b/tag_database index ab6f57af0..6459c8aae 100644 --- a/tag_database +++ b/tag_database @@ -252,6 +252,7 @@ transform:object,array truncateString:string truthCheckCollection:object,logic,array unary:adapter,function +uncurry:function unescapeHTML:string,browser unflattenObject:object,advanced unfold:function,array diff --git a/test/testlog b/test/testlog index 85ec8e717..9ffd675a9 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1810 +1,1817 @@ -Test log for: Tue Feb 13 2018 20:22:09 GMT+0000 (UTC) +Test log for: Wed Feb 14 2018 11:56:24 GMT+0200 (GTB Standard Time) -> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code +> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing JSONToDate - - ✔ JSONToDate is a Function - - Testing JSONToFile - - ✔ JSONToFile is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing RGBToHex - - ✔ RGBToHex is a Function - ✔ Converts the values of RGB components to a color code. - - Testing URLJoin - - ✔ URLJoin is a Function - ✔ Returns proper URL - ✔ Returns proper URL - - Testing UUIDGeneratorBrowser - - ✔ UUIDGeneratorBrowser is a Function - ✔ Tested 09/02/2018 by @chalarangelo - - Testing UUIDGeneratorNode - - ✔ UUIDGeneratorNode is a Function - ✔ Contains dashes in the proper places - ✔ Only contains hexadecimal digits - Testing anagrams - ✔ anagrams is a Function - ✔ Generates all anagrams of a string - ✔ Works for single-letter strings - ✔ Works for empty strings + √ anagrams is a Function + √ Generates all anagrams of a string + √ Works for single-letter strings + √ Works for empty strings Testing arrayToHtmlList - ✔ arrayToHtmlList is a Function + √ arrayToHtmlList is a Function Testing ary - ✔ ary is a Function - ✔ Discards arguments with index >=n + √ ary is a Function + √ Discards arguments with index >=n Testing atob - ✔ atob is a Function - ✔ atob("Zm9vYmFy") equals "foobar" - ✔ atob("Z") returns "" + √ atob is a Function + √ atob("Zm9vYmFy") equals "foobar" + √ atob("Z") returns "" Testing attempt - ✔ attempt is a Function - ✔ Returns a value - ✔ Returns an error + √ attempt is a Function + √ Returns a value + √ Returns an error Testing average - ✔ average is a Function - ✔ average(true) returns 0 - ✔ average(false) returns 1 - ✔ average(9, 1) returns 5 - ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - ✔ average(1, 2, 3) returns 2 - ✔ average(null) returns 0 - ✔ average(1, 2, 3) returns NaN - ✔ average(String) returns NaN - ✔ average({ a: 123}) returns NaN - ✔ average([undefined, 0, string]) returns NaN - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ average is a Function + √ average(true) returns 0 + √ average(false) returns 1 + √ average(9, 1) returns 5 + √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 + √ average(1, 2, 3) returns 2 + √ average(null) returns 0 + √ average(1, 2, 3) returns NaN + √ average(String) returns NaN + √ average({ a: 123}) returns NaN + √ average([undefined, 0, string]) returns NaN + √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing averageBy - ✔ averageBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ averageBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing binarySearch - ✔ binarySearch is a Function - ✔ Finds item in array - ✔ Returns -1 when not found - ✔ Works with empty arrays - ✔ Works for one element arrays + √ binarySearch is a Function + √ Finds item in array + √ Returns -1 when not found + √ Works with empty arrays + √ Works for one element arrays Testing bind - ✔ bind is a Function - ✔ Binds to an object context + √ bind is a Function + √ Binds to an object context Testing bindAll - ✔ bindAll is a Function - ✔ Binds to an object context + √ bindAll is a Function + √ Binds to an object context Testing bindKey - ✔ bindKey is a Function - ✔ Binds function to an object context + √ bindKey is a Function + √ Binds function to an object context Testing bottomVisible - ✔ bottomVisible is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ bottomVisible is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing btoa - ✔ btoa is a Function - ✔ btoa("foobar") equals "Zm9vYmFy" + √ btoa is a Function + √ btoa("foobar") equals "Zm9vYmFy" Testing byteSize - ✔ byteSize is a Function - ✔ Works for a single letter - ✔ Works for a common string - ✔ Works for emoji + √ byteSize is a Function + √ Works for a single letter + √ Works for a common string + √ Works for emoji Testing call - ✔ call is a Function - ✔ Calls function on given object + √ call is a Function + √ Calls function on given object Testing capitalize - ✔ capitalize is a Function - ✔ Capitalizes the first letter of a string - ✔ Capitalizes the first letter of a string - ✔ Works with characters - ✔ Works with single character words + √ capitalize is a Function + √ Capitalizes the first letter of a string + √ Capitalizes the first letter of a string + √ Works with characters + √ Works with single character words Testing capitalizeEveryWord - ✔ capitalizeEveryWord is a Function - ✔ Capitalizes the first letter of every word in a string - ✔ Works with characters - ✔ Works with one word string + √ capitalizeEveryWord is a Function + √ Capitalizes the first letter of every word in a string + √ Works with characters + √ Works with one word string Testing castArray - ✔ castArray is a Function - ✔ Works for single values - ✔ Works for arrays with one value - ✔ Works for arrays with multiple value - ✔ Works for strings - ✔ Works for objects + √ castArray is a Function + √ Works for single values + √ Works for arrays with one value + √ Works for arrays with multiple value + √ Works for strings + √ Works for objects Testing chainAsync - ✔ chainAsync is a Function + √ chainAsync is a Function Testing chunk - ✔ chunk is a Function - ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - ✔ chunk([]) returns [] - ✔ chunk(123) returns [] - ✔ chunk({ a: 123}) returns [] - ✔ chunk(string, 2) returns [ st, ri, ng ] - ✔ chunk() throws an error - ✔ chunk(undefined) throws an error - ✔ chunk(null) throws an error - ✔ chunk(This is a string, 2) takes less than 2s to run + √ chunk is a Function + √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] + √ chunk([]) returns [] + √ chunk(123) returns [] + √ chunk({ a: 123}) returns [] + √ chunk(string, 2) returns [ st, ri, ng ] + √ chunk() throws an error + √ chunk(undefined) throws an error + √ chunk(null) throws an error + √ chunk(This is a string, 2) takes less than 2s to run Testing clampNumber - ✔ clampNumber is a Function - ✔ Clamps num within the inclusive range specified by the boundary values a and b + √ clampNumber is a Function + √ Clamps num within the inclusive range specified by the boundary values a and b Testing cleanObj - ✔ cleanObj is a Function - ✔ Removes any properties except the ones specified from a JSON object + √ cleanObj is a Function + √ Removes any properties except the ones specified from a JSON object Testing cloneRegExp - ✔ cloneRegExp is a Function - ✔ Clones regular expressions properly + √ cloneRegExp is a Function + √ Clones regular expressions properly Testing coalesce - ✔ coalesce is a Function - ✔ Returns the first non-null/undefined argument + √ coalesce is a Function + √ Returns the first non-null/undefined argument Testing coalesceFactory - ✔ coalesceFactory is a Function - ✔ Returns a customized coalesce function + √ coalesceFactory is a Function + √ Returns a customized coalesce function Testing collatz - ✔ collatz is a Function - ✔ When n is even, divide by 2 - ✔ When n is odd, times by 3 and add 1 - ✔ Eventually reaches 1 + √ collatz is a Function + √ When n is even, divide by 2 + √ When n is odd, times by 3 and add 1 + √ Eventually reaches 1 Testing collectInto - ✔ collectInto is a Function + √ collectInto is a Function Testing colorize - ✔ colorize is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ colorize is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing compact - ✔ compact is a Function - ✔ Removes falsey values from an array + √ compact is a Function + √ Removes falsey values from an array Testing compose - ✔ compose is a Function - ✔ Performs right-to-left function composition + √ compose is a Function + √ Performs right-to-left function composition Testing composeRight - ✔ composeRight is a Function - ✔ Performs left-to-right function composition + √ composeRight is a Function + √ Performs left-to-right function composition Testing converge - ✔ converge is a Function - ✔ Produces the average of the array - ✔ Produces the strange concatenation + √ converge is a Function + √ Produces the average of the array + √ Produces the strange concatenation Testing copyToClipboard - ✔ copyToClipboard is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ copyToClipboard is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing countBy - ✔ countBy is a Function - ✔ Works for functions - ✔ Works for property names + √ countBy is a Function + √ Works for functions + √ Works for property names Testing countOccurrences - ✔ countOccurrences is a Function - ✔ Counts the occurrences of a value in an array + √ countOccurrences is a Function + √ Counts the occurrences of a value in an array Testing countVowels - ✔ countVowels is a Function + √ countVowels is a Function Testing createElement - ✔ createElement is a Function + √ createElement is a Function Testing createEventHub - ✔ createEventHub is a Function + √ createEventHub is a Function Testing currentURL - ✔ currentURL is a Function + √ currentURL is a Function Testing curry - ✔ curry is a Function - ✔ curries a Math.pow - ✔ curries a Math.min + √ curry is a Function + √ curries a Math.pow + √ curries a Math.min Testing debounce - ✔ debounce is a Function + √ debounce is a Function Testing decapitalize - ✔ decapitalize is a Function - ✔ Works with default parameter - ✔ Works with second parameter set to true + √ decapitalize is a Function + √ Works with default parameter + √ Works with second parameter set to true Testing deepClone - ✔ deepClone is a Function - ✔ Shallow cloning works - ✔ Deep cloning works + √ deepClone is a Function + √ Shallow cloning works + √ Deep cloning works Testing deepFlatten - ✔ deepFlatten is a Function - ✔ Deep flattens an array + √ deepFlatten is a Function + √ Deep flattens an array Testing defaults - ✔ defaults is a Function + √ defaults is a Function Testing defer - ✔ defer is a Function + √ defer is a Function Testing delay - ✔ delay is a Function + √ delay is a Function Testing detectDeviceType - ✔ detectDeviceType is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ detectDeviceType is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing difference - ✔ difference is a Function - ✔ Returns the difference between two arrays + √ difference is a Function + √ Returns the difference between two arrays Testing differenceBy - ✔ differenceBy is a Function - ✔ Works using a native function and numbers - ✔ Works with arrow function and objects + √ differenceBy is a Function + √ Works using a native function and numbers + √ Works with arrow function and objects Testing differenceWith - ✔ differenceWith is a Function - ✔ Filters out all values from an array + √ differenceWith is a Function + √ Filters out all values from an array Testing digitize - ✔ digitize is a Function - ✔ Converts a number to an array of digits + √ digitize is a Function + √ Converts a number to an array of digits Testing distance - ✔ distance is a Function - ✔ Calculates the distance between two points + √ distance is a Function + √ Calculates the distance between two points Testing drop - ✔ drop is a Function - ✔ Works without the last argument - ✔ Removes appropriate element count as specified - ✔ Empties array given a count greater than length + √ drop is a Function + √ Works without the last argument + √ Removes appropriate element count as specified + √ Empties array given a count greater than length Testing dropRight - ✔ dropRight is a Function - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right + √ dropRight is a Function + √ Returns a new array with n elements removed from the right + √ Returns a new array with n elements removed from the right + √ Returns a new array with n elements removed from the right Testing dropRightWhile - ✔ dropRightWhile is a Function - ✔ Removes elements from the end of an array until the passed function returns true. + √ dropRightWhile is a Function + √ Removes elements from the end of an array until the passed function returns true. Testing dropWhile - ✔ dropWhile is a Function - ✔ Removes elements in an array until the passed function returns true. + √ dropWhile is a Function + √ Removes elements in an array until the passed function returns true. Testing elementIsVisibleInViewport - ✔ elementIsVisibleInViewport is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ elementIsVisibleInViewport is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing elo - ✔ elo is a Function - ✔ Standard 1v1s - ✔ should be equivalent - ✔ 4 player FFA, all same rank + √ elo is a Function + √ Standard 1v1s + √ should be equivalent + √ 4 player FFA, all same rank Testing equals - ✔ equals is a Function - ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - ✔ [1,2,3] is equal to [1,2,3] - ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - ✔ [1,2,3] is not equal to [1,2,4] - ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + √ equals is a Function + √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } + √ [1,2,3] is equal to [1,2,3] + √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } + √ [1,2,3] is not equal to [1,2,4] + √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. Testing escapeHTML - ✔ escapeHTML is a Function - ✔ Escapes a string for use in HTML + √ escapeHTML is a Function + √ Escapes a string for use in HTML Testing escapeRegExp - ✔ escapeRegExp is a Function - ✔ Escapes a string to use in a regular expression + √ escapeRegExp is a Function + √ Escapes a string to use in a regular expression Testing everyNth - ✔ everyNth is a Function - ✔ Returns every nth element in an array + √ everyNth is a Function + √ Returns every nth element in an array Testing extendHex - ✔ extendHex is a Function - ✔ Extends a 3-digit color code to a 6-digit color code - ✔ Extends a 3-digit color code to a 6-digit color code + √ extendHex is a Function + √ Extends a 3-digit color code to a 6-digit color code + √ Extends a 3-digit color code to a 6-digit color code Testing factorial - ✔ factorial is a Function - ✔ Calculates the factorial of 720 - ✔ Calculates the factorial of 0 - ✔ Calculates the factorial of 1 - ✔ Calculates the factorial of 4 - ✔ Calculates the factorial of 10 + √ factorial is a Function + √ Calculates the factorial of 720 + √ Calculates the factorial of 0 + √ Calculates the factorial of 1 + √ Calculates the factorial of 4 + √ Calculates the factorial of 10 Testing factors - ✔ factors is a Function + √ factors is a Function Testing fibonacci - ✔ fibonacci is a Function - ✔ Generates an array, containing the Fibonacci sequence + √ fibonacci is a Function + √ Generates an array, containing the Fibonacci sequence Testing fibonacciCountUntilNum - ✔ fibonacciCountUntilNum is a Function + √ fibonacciCountUntilNum is a Function Testing fibonacciUntilNum - ✔ fibonacciUntilNum is a Function + √ fibonacciUntilNum is a Function Testing filterNonUnique - ✔ filterNonUnique is a Function - ✔ Filters out the non-unique values in an array + √ filterNonUnique is a Function + √ Filters out the non-unique values in an array Testing findKey - ✔ findKey is a Function - ✔ Returns the appropriate key + √ findKey is a Function + √ Returns the appropriate key Testing findLast - ✔ findLast is a Function - ✔ Finds last element for which the given function returns true + √ findLast is a Function + √ Finds last element for which the given function returns true Testing findLastIndex - ✔ findLastIndex is a Function - ✔ Finds last index for which the given function returns true + √ findLastIndex is a Function + √ Finds last index for which the given function returns true Testing findLastKey - ✔ findLastKey is a Function - ✔ Returns the appropriate key + √ findLastKey is a Function + √ Returns the appropriate key Testing flatten - ✔ flatten is a Function - ✔ Flattens an array - ✔ Flattens an array + √ flatten is a Function + √ Flattens an array + √ Flattens an array Testing flattenObject - ✔ flattenObject is a Function - ✔ Flattens an object with the paths for keys - ✔ Works with arrays + √ flattenObject is a Function + √ Flattens an object with the paths for keys + √ Works with arrays Testing flip - ✔ flip is a Function - ✔ Flips argument order + √ flip is a Function + √ Flips argument order Testing forEachRight - ✔ forEachRight is a Function - ✔ Iterates over the array in reverse - - Testing forOwn - - ✔ forOwn is a Function - ✔ Iterates over an element's key-value pairs - - Testing forOwnRight - - ✔ forOwnRight is a Function - ✔ Iterates over an element's key-value pairs in reverse + √ forEachRight is a Function + √ Iterates over the array in reverse Testing formatDuration - ✔ formatDuration is a Function - ✔ Returns the human readable format of the given number of milliseconds - ✔ Returns the human readable format of the given number of milliseconds + √ formatDuration is a Function + √ Returns the human readable format of the given number of milliseconds + √ Returns the human readable format of the given number of milliseconds + + Testing forOwn + + √ forOwn is a Function + √ Iterates over an element's key-value pairs + + Testing forOwnRight + + √ forOwnRight is a Function + √ Iterates over an element's key-value pairs in reverse Testing fromCamelCase - ✔ fromCamelCase is a Function - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase + √ fromCamelCase is a Function + √ Converts a string from camelcase + √ Converts a string from camelcase + √ Converts a string from camelcase Testing functionName - ✔ functionName is a Function - ✔ Works for native functions - ✔ Works for functions - ✔ Works for arrow functions + √ functionName is a Function + √ Works for native functions + √ Works for functions + √ Works for arrow functions Testing functions - ✔ functions is a Function - ✔ Returns own methods - ✔ Returns own and inherited methods + √ functions is a Function + √ Returns own methods + √ Returns own and inherited methods Testing gcd - ✔ gcd is a Function - ✔ Calculates the greatest common divisor between two or more numbers/arrays - ✔ Calculates the greatest common divisor between two or more numbers/arrays + √ gcd is a Function + √ Calculates the greatest common divisor between two or more numbers/arrays + √ Calculates the greatest common divisor between two or more numbers/arrays Testing geometricProgression - ✔ geometricProgression is a Function - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range + √ geometricProgression is a Function + √ Initializes an array containing the numbers in the specified range + √ Initializes an array containing the numbers in the specified range + √ Initializes an array containing the numbers in the specified range Testing get - ✔ get is a Function - ✔ Retrieve a property indicated by the selector from an object. + √ get is a Function + √ Retrieve a property indicated by the selector from an object. Testing getColonTimeFromDate - ✔ getColonTimeFromDate is a Function + √ getColonTimeFromDate is a Function Testing getDaysDiffBetweenDates - ✔ getDaysDiffBetweenDates is a Function - ✔ Returns the difference in days between two dates + √ getDaysDiffBetweenDates is a Function + √ Returns the difference in days between two dates Testing getMeridiemSuffixOfInteger - ✔ getMeridiemSuffixOfInteger is a Function + √ getMeridiemSuffixOfInteger is a Function Testing getScrollPosition - ✔ getScrollPosition is a Function + √ getScrollPosition is a Function Testing getStyle - ✔ getStyle is a Function + √ getStyle is a Function Testing getType - ✔ getType is a Function - ✔ Returns the native type of a value + √ getType is a Function + √ Returns the native type of a value Testing getURLParameters - ✔ getURLParameters is a Function - ✔ Returns an object containing the parameters of the current URL + √ getURLParameters is a Function + √ Returns an object containing the parameters of the current URL Testing groupBy - ✔ groupBy is a Function - ✔ Groups the elements of an array based on the given function - ✔ Groups the elements of an array based on the given function + √ groupBy is a Function + √ Groups the elements of an array based on the given function + √ Groups the elements of an array based on the given function Testing hammingDistance - ✔ hammingDistance is a Function - ✔ retuns hamming disance between 2 values + √ hammingDistance is a Function + √ retuns hamming disance between 2 values Testing hasClass - ✔ hasClass is a Function + √ hasClass is a Function Testing hasFlags - ✔ hasFlags is a Function + √ hasFlags is a Function Testing hashBrowser - ✔ hashBrowser is a Function + √ hashBrowser is a Function Testing hashNode - ✔ hashNode is a Function + √ hashNode is a Function Testing head - ✔ head is a Function - ✔ head({ a: 1234}) returns undefined - ✔ head([1, 2, 3]) returns 1 - ✔ head({ 0: false}) returns false - ✔ head(String) returns S - ✔ head(null) throws an Error - ✔ head(undefined) throws an Error - ✔ head() throws an Error - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ head is a Function + √ head({ a: 1234}) returns undefined + √ head([1, 2, 3]) returns 1 + √ head({ 0: false}) returns false + √ head(String) returns S + √ head(null) throws an Error + √ head(undefined) throws an Error + √ head() throws an Error + √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing hexToRGB - ✔ hexToRGB is a Function - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string + √ hexToRGB is a Function + √ Converts a color code to a rgb() or rgba() string + √ Converts a color code to a rgb() or rgba() string + √ Converts a color code to a rgb() or rgba() string Testing hide - ✔ hide is a Function + √ hide is a Function Testing howManyTimes - ✔ howManyTimes is a Function + √ howManyTimes is a Function Testing httpDelete - ✔ httpDelete is a Function + √ httpDelete is a Function Testing httpGet - ✔ httpGet is a Function + √ httpGet is a Function Testing httpPost - ✔ httpPost is a Function + √ httpPost is a Function Testing httpPut - ✔ httpPut is a Function + √ httpPut is a Function Testing httpsRedirect - ✔ httpsRedirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing inRange - - ✔ inRange is a Function - ✔ The given number falls within the given range - ✔ The given number falls within the given range - ✔ The given number does not falls within the given range - ✔ The given number does not falls within the given range + √ httpsRedirect is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing indexOfAll - ✔ indexOfAll is a Function - ✔ Returns all indices of val in an array - ✔ Returns all indices of val in an array + √ indexOfAll is a Function + √ Returns all indices of val in an array + √ Returns all indices of val in an array Testing initial - ✔ initial is a Function - ✔ Returns all the elements of an array except the last one + √ initial is a Function + √ Returns all the elements of an array except the last one Testing initialize2DArray - ✔ initialize2DArray is a Function - ✔ Initializes a 2D array of given width and height and value + √ initialize2DArray is a Function + √ Initializes a 2D array of given width and height and value Testing initializeArrayWithRange - ✔ initializeArrayWithRange is a Function - ✔ Initializes an array containing the numbers in the specified range + √ initializeArrayWithRange is a Function + √ Initializes an array containing the numbers in the specified range Testing initializeArrayWithRangeRight - ✔ initializeArrayWithRangeRight is a Function + √ initializeArrayWithRangeRight is a Function Testing initializeArrayWithValues - ✔ initializeArrayWithValues is a Function - ✔ Initializes and fills an array with the specified values + √ initializeArrayWithValues is a Function + √ Initializes and fills an array with the specified values + + Testing inRange + + √ inRange is a Function + √ The given number falls within the given range + √ The given number falls within the given range + √ The given number does not falls within the given range + √ The given number does not falls within the given range Testing intersection - ✔ intersection is a Function - ✔ Returns a list of elements that exist in both arrays + √ intersection is a Function + √ Returns a list of elements that exist in both arrays Testing intersectionBy - ✔ intersectionBy is a Function - ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + √ intersectionBy is a Function + √ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both Testing intersectionWith - ✔ intersectionWith is a Function - ✔ Returns a list of elements that exist in both arrays, using a provided comparator function + √ intersectionWith is a Function + √ Returns a list of elements that exist in both arrays, using a provided comparator function Testing invertKeyValues - ✔ invertKeyValues is a Function - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + √ invertKeyValues is a Function + √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } + √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } Testing is - ✔ is is a Function - ✔ Works for arrays with data - ✔ Works for empty arrays - ✔ Works for arrays, not objects - ✔ Works for objects - ✔ Works for maps - ✔ Works for regular expressions - ✔ Works for sets - ✔ Works for weak maps - ✔ Works for weak sets - ✔ Works for strings - returns false for primitive - ✔ Works for strings - returns true when using constructor - ✔ Works for numbers - returns false for primitive - ✔ Works for numbers - returns true when using constructor - ✔ Works for booleans - returns false for primitive - ✔ Works for booleans - returns true when using constructor - ✔ Works for functions + √ is is a Function + √ Works for arrays with data + √ Works for empty arrays + √ Works for arrays, not objects + √ Works for objects + √ Works for maps + √ Works for regular expressions + √ Works for sets + √ Works for weak maps + √ Works for weak sets + √ Works for strings - returns false for primitive + √ Works for strings - returns true when using constructor + √ Works for numbers - returns false for primitive + √ Works for numbers - returns true when using constructor + √ Works for booleans - returns false for primitive + √ Works for booleans - returns true when using constructor + √ Works for functions Testing isAbsoluteURL - ✔ isAbsoluteURL is a Function - ✔ Given string is an absolute URL - ✔ Given string is an absolute URL - ✔ Given string is not an absolute URL + √ isAbsoluteURL is a Function + √ Given string is an absolute URL + √ Given string is an absolute URL + √ Given string is not an absolute URL Testing isArmstrongNumber - ✔ isArmstrongNumber is a Function + √ isArmstrongNumber is a Function Testing isArray - ✔ isArray is a Function - ✔ passed value is an array - ✔ passed value is not an array + √ isArray is a Function + √ passed value is an array + √ passed value is not an array Testing isArrayBuffer - ✔ isArrayBuffer is a Function + √ isArrayBuffer is a Function Testing isArrayLike - ✔ isArrayLike is a Function - ✔ Returns true for a string - ✔ Returns true for an array - ✔ Returns false for null + √ isArrayLike is a Function + √ Returns true for a string + √ Returns true for an array + √ Returns false for null Testing isBoolean - ✔ isBoolean is a Function - ✔ passed value is not a boolean - ✔ passed value is not a boolean + √ isBoolean is a Function + √ passed value is not a boolean + √ passed value is not a boolean Testing isDivisible - ✔ isDivisible is a Function - ✔ The number 6 is divisible by 3 + √ isDivisible is a Function + √ The number 6 is divisible by 3 Testing isEmpty - ✔ isEmpty is a Function - ✔ Returns true for empty Map - ✔ Returns true for empty Set - ✔ Returns true for empty array - ✔ Returns true for empty object - ✔ Returns true for empty string - ✔ Returns false for non-empty array - ✔ Returns false for non-empty object - ✔ Returns false for non-empty string - ✔ Returns true - type is not considered a collection - ✔ Returns true - type is not considered a collection + √ isEmpty is a Function + √ Returns true for empty Map + √ Returns true for empty Set + √ Returns true for empty array + √ Returns true for empty object + √ Returns true for empty string + √ Returns false for non-empty array + √ Returns false for non-empty object + √ Returns false for non-empty string + √ Returns true - type is not considered a collection + √ Returns true - type is not considered a collection Testing isEven - ✔ isEven is a Function - ✔ 4 is even number - ✔ undefined + √ isEven is a Function + √ 4 is even number + √ undefined Testing isFunction - ✔ isFunction is a Function - ✔ passed value is a function - ✔ passed value is not a function + √ isFunction is a Function + √ passed value is a function + √ passed value is not a function Testing isLowerCase - ✔ isLowerCase is a Function - ✔ passed string is a lowercase - ✔ passed string is a lowercase - ✔ passed value is not a lowercase + √ isLowerCase is a Function + √ passed string is a lowercase + √ passed string is a lowercase + √ passed value is not a lowercase Testing isMap - ✔ isMap is a Function + √ isMap is a Function Testing isNil - ✔ isNil is a Function - ✔ Returns true for null - ✔ Returns true for undefined - ✔ Returns false for an empty string + √ isNil is a Function + √ Returns true for null + √ Returns true for undefined + √ Returns false for an empty string Testing isNull - ✔ isNull is a Function - ✔ passed argument is a null - ✔ passed argument is a null + √ isNull is a Function + √ passed argument is a null + √ passed argument is a null Testing isNumber - ✔ isNumber is a Function - ✔ passed argument is a number - ✔ passed argument is not a number + √ isNumber is a Function + √ passed argument is a number + √ passed argument is not a number Testing isObject - ✔ isObject is a Function - ✔ isObject([1, 2, 3, 4]) is a object - ✔ isObject([]) is a object - ✔ isObject({ a:1 }) is a object - ✔ isObject(true) is not a object + √ isObject is a Function + √ isObject([1, 2, 3, 4]) is a object + √ isObject([]) is a object + √ isObject({ a:1 }) is a object + √ isObject(true) is not a object Testing isObjectLike - ✔ isObjectLike is a Function - ✔ Returns true for an object - ✔ Returns true for an array - ✔ Returns false for a function - ✔ Returns false for null + √ isObjectLike is a Function + √ Returns true for an object + √ Returns true for an array + √ Returns false for a function + √ Returns false for null Testing isPlainObject - ✔ isPlainObject is a Function - ✔ Returns true for a plain object - ✔ Returns false for a Map (example of non-plain object) + √ isPlainObject is a Function + √ Returns true for a plain object + √ Returns false for a Map (example of non-plain object) Testing isPrime - ✔ isPrime is a Function - ✔ passed number is a prime + √ isPrime is a Function + √ passed number is a prime Testing isPrimitive - ✔ isPrimitive is a Function - ✔ isPrimitive(null) is primitive - ✔ isPrimitive(undefined) is primitive - ✔ isPrimitive(string) is primitive - ✔ isPrimitive(true) is primitive - ✔ isPrimitive(50) is primitive - ✔ isPrimitive('Hello') is primitive - ✔ isPrimitive(false) is primitive - ✔ isPrimitive(Symbol()) is primitive - ✔ isPrimitive([1, 2, 3]) is not primitive - ✔ isPrimitive({ a: 123 }) is not primitive - ✔ isPrimitive({ a: 123 }) takes less than 2s to run + √ isPrimitive is a Function + √ isPrimitive(null) is primitive + √ isPrimitive(undefined) is primitive + √ isPrimitive(string) is primitive + √ isPrimitive(true) is primitive + √ isPrimitive(50) is primitive + √ isPrimitive('Hello') is primitive + √ isPrimitive(false) is primitive + √ isPrimitive(Symbol()) is primitive + √ isPrimitive([1, 2, 3]) is not primitive + √ isPrimitive({ a: 123 }) is not primitive + √ isPrimitive({ a: 123 }) takes less than 2s to run Testing isPromiseLike - ✔ isPromiseLike is a Function - ✔ Returns true for a promise-like object - ✔ Returns false for null - ✔ Returns false for an empty object + √ isPromiseLike is a Function + √ Returns true for a promise-like object + √ Returns false for null + √ Returns false for an empty object Testing isRegExp - ✔ isRegExp is a Function + √ isRegExp is a Function Testing isSet - ✔ isSet is a Function + √ isSet is a Function Testing isSorted - ✔ isSorted is a Function - ✔ Array is sorted in ascending order - ✔ Array is sorted in descending order - ✔ Array is not sorted, direction changed in array + √ isSorted is a Function + √ Array is sorted in ascending order + √ Array is sorted in descending order + √ Array is not sorted, direction changed in array Testing isString - ✔ isString is a Function - ✔ foo is a string - ✔ "10" is a string - ✔ Empty string is a string - ✔ 10 is not a string - ✔ true is not string + √ isString is a Function + √ foo is a string + √ "10" is a string + √ Empty string is a string + √ 10 is not a string + √ true is not string Testing isSymbol - ✔ isSymbol is a Function - ✔ Checks if the given argument is a symbol + √ isSymbol is a Function + √ Checks if the given argument is a symbol Testing isTravisCI - ✔ isTravisCI is a Function - ✔ Running on Travis, correctly evaluates + √ isTravisCI is a Function + √ Not running on Travis, correctly evaluates Testing isTypedArray - ✔ isTypedArray is a Function + √ isTypedArray is a Function Testing isUndefined - ✔ isUndefined is a Function - ✔ Returns true for undefined + √ isUndefined is a Function + √ Returns true for undefined Testing isUpperCase - ✔ isUpperCase is a Function - ✔ ABC is all upper case - ✔ abc is not all upper case - ✔ A3@$ is all uppercase + √ isUpperCase is a Function + √ ABC is all upper case + √ abc is not all upper case + √ A3@$ is all uppercase Testing isValidJSON - ✔ isValidJSON is a Function - ✔ {"name":"Adam","age":20} is a valid JSON - ✔ {"name":"Adam",age:"20"} is not a valid JSON - ✔ null is a valid JSON + √ isValidJSON is a Function + √ {"name":"Adam","age":20} is a valid JSON + √ {"name":"Adam",age:"20"} is not a valid JSON + √ null is a valid JSON Testing isWeakMap - ✔ isWeakMap is a Function + √ isWeakMap is a Function Testing isWeakSet - ✔ isWeakSet is a Function + √ isWeakSet is a Function Testing join - ✔ join is a Function - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string + √ join is a Function + √ Joins all elements of an array into a string and returns this string + √ Joins all elements of an array into a string and returns this string + √ Joins all elements of an array into a string and returns this string + + Testing JSONToDate + + √ JSONToDate is a Function + + Testing JSONToFile + + √ JSONToFile is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing last - ✔ last is a Function - ✔ last({ a: 1234}) returns undefined - ✔ last([1, 2, 3]) returns 3 - ✔ last({ 0: false}) returns undefined - ✔ last(String) returns g - ✔ last(null) throws an Error - ✔ last(undefined) throws an Error - ✔ last() throws an Error - ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + √ last is a Function + √ last({ a: 1234}) returns undefined + √ last([1, 2, 3]) returns 3 + √ last({ 0: false}) returns undefined + √ last(String) returns g + √ last(null) throws an Error + √ last(undefined) throws an Error + √ last() throws an Error + √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run Testing lcm - ✔ lcm is a Function - ✔ Returns the least common multiple of two or more numbers. - ✔ Returns the least common multiple of two or more numbers. + √ lcm is a Function + √ Returns the least common multiple of two or more numbers. + √ Returns the least common multiple of two or more numbers. Testing longestItem - ✔ longestItem is a Function - ✔ Returns the longest object + √ longestItem is a Function + √ Returns the longest object Testing lowercaseKeys - ✔ lowercaseKeys is a Function - ✔ Lowercases object keys - ✔ Does not mutate original object + √ lowercaseKeys is a Function + √ Lowercases object keys + √ Does not mutate original object Testing luhnCheck - ✔ luhnCheck is a Function - ✔ validates identification number - ✔ validates identification number - ✔ validates identification number + √ luhnCheck is a Function + √ validates identification number + √ validates identification number + √ validates identification number Testing mapKeys - ✔ mapKeys is a Function - ✔ Maps keys + √ mapKeys is a Function + √ Maps keys Testing mapObject - ✔ mapObject is a Function - ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } - ✔ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } + √ mapObject is a Function + √ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } + √ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } + √ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } Testing mapValues - ✔ mapValues is a Function - ✔ Maps values + √ mapValues is a Function + √ Maps values Testing mask - ✔ mask is a Function - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character + √ mask is a Function + √ Replaces all but the last num of characters with the specified mask character + √ Replaces all but the last num of characters with the specified mask character + √ Replaces all but the last num of characters with the specified mask character Testing matches - ✔ matches is a Function - ✔ Matches returns true for two similar objects - ✔ Matches returns false for two non-similar objects + √ matches is a Function + √ Matches returns true for two similar objects + √ Matches returns false for two non-similar objects Testing matchesWith - ✔ matchesWith is a Function - ✔ Returns true for two objects with similar values, based on the provided function + √ matchesWith is a Function + √ Returns true for two objects with similar values, based on the provided function Testing maxBy - ✔ maxBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ maxBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing maxN - ✔ maxN is a Function - ✔ Returns the n maximum elements from the provided array - ✔ Returns the n maximum elements from the provided array + √ maxN is a Function + √ Returns the n maximum elements from the provided array + √ Returns the n maximum elements from the provided array Testing median - ✔ median is a Function - ✔ Returns the median of an array of numbers - ✔ Returns the median of an array of numbers + √ median is a Function + √ Returns the median of an array of numbers + √ Returns the median of an array of numbers Testing memoize - ✔ memoize is a Function - ✔ Function works properly - ✔ Function works properly - ✔ Cache stores values + √ memoize is a Function + √ Function works properly + √ Function works properly + √ Cache stores values Testing merge - ✔ merge is a Function - ✔ Merges two objects + √ merge is a Function + √ Merges two objects Testing minBy - ✔ minBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name + √ minBy is a Function + √ Produces the right result with a function + √ Produces the right result with a property name Testing minN - ✔ minN is a Function - ✔ Returns the n minimum elements from the provided array - ✔ Returns the n minimum elements from the provided array + √ minN is a Function + √ Returns the n minimum elements from the provided array + √ Returns the n minimum elements from the provided array Testing negate - ✔ negate is a Function - ✔ Negates a predicate function + √ negate is a Function + √ Negates a predicate function Testing nthArg - ✔ nthArg is a Function - ✔ Returns the nth argument - ✔ Returns undefined if arguments too few - ✔ Works for negative values + √ nthArg is a Function + √ Returns the nth argument + √ Returns undefined if arguments too few + √ Works for negative values Testing nthElement - ✔ nthElement is a Function - ✔ Returns the nth element of an array. - ✔ Returns the nth element of an array. + √ nthElement is a Function + √ Returns the nth element of an array. + √ Returns the nth element of an array. Testing objectFromPairs - ✔ objectFromPairs is a Function - ✔ Creates an object from the given key-value pairs. + √ objectFromPairs is a Function + √ Creates an object from the given key-value pairs. Testing objectToPairs - ✔ objectToPairs is a Function - ✔ Creates an array of key-value pair arrays from an object. + √ objectToPairs is a Function + √ Creates an array of key-value pair arrays from an object. Testing observeMutations - ✔ observeMutations is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ observeMutations is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing off - ✔ off is a Function + √ off is a Function Testing omit - ✔ omit is a Function - ✔ Omits the key-value pairs corresponding to the given keys from an object + √ omit is a Function + √ Omits the key-value pairs corresponding to the given keys from an object Testing omitBy - ✔ omitBy is a Function - ✔ Creates an object composed of the properties the given function returns falsey for + √ omitBy is a Function + √ Creates an object composed of the properties the given function returns falsey for Testing on - ✔ on is a Function - - Testing onUserInputChange - - ✔ onUserInputChange is a Function + √ on is a Function Testing once - ✔ once is a Function + √ once is a Function + + Testing onUserInputChange + + √ onUserInputChange is a Function Testing orderBy - ✔ orderBy is a Function - ✔ Returns a sorted array of objects ordered by properties and orders. - ✔ Returns a sorted array of objects ordered by properties and orders. + √ orderBy is a Function + √ Returns a sorted array of objects ordered by properties and orders. + √ Returns a sorted array of objects ordered by properties and orders. Testing over - ✔ over is a Function - ✔ Applies given functions over multiple arguments + √ over is a Function + √ Applies given functions over multiple arguments Testing overArgs - ✔ overArgs is a Function - ✔ Invokes the provided function with its arguments transformed + √ overArgs is a Function + √ Invokes the provided function with its arguments transformed Testing palindrome - ✔ palindrome is a Function - ✔ Given string is a palindrome - ✔ Given string is not a palindrome + √ palindrome is a Function + √ Given string is a palindrome + √ Given string is not a palindrome Testing parseCookie - ✔ parseCookie is a Function - ✔ Parses the cookie + √ parseCookie is a Function + √ Parses the cookie Testing partial - ✔ partial is a Function - ✔ Prepends arguments + √ partial is a Function + √ Prepends arguments Testing partialRight - ✔ partialRight is a Function - ✔ Appends arguments + √ partialRight is a Function + √ Appends arguments Testing partition - ✔ partition is a Function - ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. + √ partition is a Function + √ Groups the elements into two arrays, depending on the provided function's truthiness for each element. Testing percentile - ✔ percentile is a Function - ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + √ percentile is a Function + √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. Testing pick - ✔ pick is a Function - ✔ Picks the key-value pairs corresponding to the given keys from an object. + √ pick is a Function + √ Picks the key-value pairs corresponding to the given keys from an object. Testing pickBy - ✔ pickBy is a Function - ✔ Creates an object composed of the properties the given function returns truthy for. + √ pickBy is a Function + √ Creates an object composed of the properties the given function returns truthy for. Testing pipeAsyncFunctions - ✔ pipeAsyncFunctions is a Function - ✔ Produces the appropriate hash - ✔ pipeAsyncFunctions result should be 15 + √ pipeAsyncFunctions is a Function + √ Produces the appropriate hash + √ pipeAsyncFunctions result should be 15 Testing pipeFunctions - ✔ pipeFunctions is a Function - ✔ Performs left-to-right function composition + √ pipeFunctions is a Function + √ Performs left-to-right function composition Testing pluralize - ✔ pluralize is a Function - ✔ Produces the plural of the word - ✔ Produces the singular of the word - ✔ Produces the plural of the word - ✔ Prodices the defined plural of the word - ✔ Works with a dictionary + √ pluralize is a Function + √ Produces the plural of the word + √ Produces the singular of the word + √ Produces the plural of the word + √ Prodices the defined plural of the word + √ Works with a dictionary Testing powerset - ✔ powerset is a Function - ✔ Returns the powerset of a given array of numbers. + √ powerset is a Function + √ Returns the powerset of a given array of numbers. Testing prettyBytes - ✔ prettyBytes is a Function - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. + √ prettyBytes is a Function + √ Converts a number in bytes to a human-readable string. + √ Converts a number in bytes to a human-readable string. + √ Converts a number in bytes to a human-readable string. Testing primes - ✔ primes is a Function - ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. + √ primes is a Function + √ Generates primes up to a given number, using the Sieve of Eratosthenes. Testing promisify - ✔ promisify is a Function - ✔ Returns a promise + √ promisify is a Function + √ Returns a promise Testing pull - ✔ pull is a Function - ✔ Pulls the specified values + √ pull is a Function + √ Pulls the specified values Testing pullAtIndex - ✔ pullAtIndex is a Function - ✔ Pulls the given values - ✔ Pulls the given values + √ pullAtIndex is a Function + √ Pulls the given values + √ Pulls the given values Testing pullAtValue - ✔ pullAtValue is a Function - ✔ Pulls the specified values - ✔ Pulls the specified values + √ pullAtValue is a Function + √ Pulls the specified values + √ Pulls the specified values Testing pullBy - ✔ pullBy is a Function - ✔ Pulls the specified values + √ pullBy is a Function + √ Pulls the specified values Testing quickSort - ✔ quickSort is a Function - ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] - ✔ quickSort() throws an error - ✔ quickSort(123) throws an error - ✔ quickSort({ 234: string}) throws an error - ✔ quickSort(null) throws an error - ✔ quickSort(undefined) throws an error - ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + √ quickSort is a Function + √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] + √ quickSort([-1, 0, -2]) returns [-2, -1, 0] + √ quickSort() throws an error + √ quickSort(123) throws an error + √ quickSort({ 234: string}) throws an error + √ quickSort(null) throws an error + √ quickSort(undefined) throws an error + √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run Testing randomHexColorCode - ✔ randomHexColorCode is a Function - ✔ should be equal + √ randomHexColorCode is a Function + √ should be equal Testing randomIntArrayInRange - ✔ randomIntArrayInRange is a Function - ✔ The returned array contains only integers - ✔ The returned array has the proper length - ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + √ randomIntArrayInRange is a Function + √ The returned array contains only integers + √ The returned array has the proper length + √ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). Testing randomIntegerInRange - ✔ randomIntegerInRange is a Function - ✔ The returned value is an integer - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + √ randomIntegerInRange is a Function + √ The returned value is an integer + √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). Testing randomNumberInRange - ✔ randomNumberInRange is a Function - ✔ The returned value is a number - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + √ randomNumberInRange is a Function + √ The returned value is a number + √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). Testing readFileLines - ✔ readFileLines is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ readFileLines is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing rearg - ✔ rearg is a Function - ✔ Reorders arguments in invoked function + √ rearg is a Function + √ Reorders arguments in invoked function Testing redirect - ✔ redirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing reduceSuccessive - - ✔ reduceSuccessive is a Function - ✔ Returns the array of successively reduced values - - Testing reduceWhich - - ✔ reduceWhich is a Function - ✔ Returns the minimum of an array - ✔ Returns the maximum of an array - ✔ Returns the object with the minimum specified value in an array + √ redirect is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing reducedFilter - ✔ reducedFilter is a Function - ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. + √ reducedFilter is a Function + √ Filter an array of objects based on a condition while also filtering out unspecified keys. + + Testing reduceSuccessive + + √ reduceSuccessive is a Function + √ Returns the array of successively reduced values + + Testing reduceWhich + + √ reduceWhich is a Function + √ Returns the minimum of an array + √ Returns the maximum of an array + √ Returns the object with the minimum specified value in an array Testing remove - ✔ remove is a Function - ✔ Removes elements from an array for which the given function returns false + √ remove is a Function + √ Removes elements from an array for which the given function returns false Testing removeNonASCII - ✔ removeNonASCII is a Function - ✔ Removes non-ASCII characters + √ removeNonASCII is a Function + √ Removes non-ASCII characters Testing removeVowels - ✔ removeVowels is a Function + √ removeVowels is a Function Testing reverseString - ✔ reverseString is a Function - ✔ Reverses a string. + √ reverseString is a Function + √ Reverses a string. + + Testing RGBToHex + + √ RGBToHex is a Function + √ Converts the values of RGB components to a color code. Testing round - ✔ round is a Function - ✔ round(1.005, 2) returns 1.01 - ✔ round(123.3423345345345345344, 11) returns 123.34233453453 - ✔ round(3.342, 11) returns 3.342 - ✔ round(1.005) returns 1 - ✔ round([1.005, 2]) returns NaN - ✔ round(string) returns NaN - ✔ round() returns NaN - ✔ round(132, 413, 4134) returns NaN - ✔ round({a: 132}, 413) returns NaN - ✔ round(123.3423345345345345344, 11) takes less than 2s to run + √ round is a Function + √ round(1.005, 2) returns 1.01 + √ round(123.3423345345345345344, 11) returns 123.34233453453 + √ round(3.342, 11) returns 3.342 + √ round(1.005) returns 1 + √ round([1.005, 2]) returns NaN + √ round(string) returns NaN + √ round() returns NaN + √ round(132, 413, 4134) returns NaN + √ round({a: 132}, 413) returns NaN + √ round(123.3423345345345345344, 11) takes less than 2s to run Testing runAsync - ✔ runAsync is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ runAsync is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing runPromisesInSeries - ✔ runPromisesInSeries is a Function + √ runPromisesInSeries is a Function Testing sample - ✔ sample is a Function - ✔ Returns a random element from the array - ✔ Works for single-element arrays - ✔ Returns undefined for empty array + √ sample is a Function + √ Returns a random element from the array + √ Works for single-element arrays + √ Returns undefined for empty array Testing sampleSize - ✔ sampleSize is a Function - ✔ Returns a single element without n specified - ✔ Returns a random sample of specified size from an array - ✔ Returns all elements in an array if n >= length - ✔ Returns an empty array if original array is empty - ✔ Returns an empty array if n = 0 + √ sampleSize is a Function + √ Returns a single element without n specified + √ Returns a random sample of specified size from an array + √ Returns all elements in an array if n >= length + √ Returns an empty array if original array is empty + √ Returns an empty array if n = 0 Testing scrollToTop - ✔ scrollToTop is a Function - ✔ Tested on 09/02/2018 by @chalarangelo + √ scrollToTop is a Function + √ Tested on 09/02/2018 by @chalarangelo Testing sdbm - ✔ sdbm is a Function - ✔ Hashes the input string into a whole number. + √ sdbm is a Function + √ Hashes the input string into a whole number. Testing serializeCookie - ✔ serializeCookie is a Function - ✔ Serializes the cookie + √ serializeCookie is a Function + √ Serializes the cookie Testing setStyle - ✔ setStyle is a Function + √ setStyle is a Function Testing shallowClone - ✔ shallowClone is a Function - ✔ Shallow cloning works - ✔ Does not clone deeply + √ shallowClone is a Function + √ Shallow cloning works + √ Does not clone deeply Testing show - ✔ show is a Function + √ show is a Function Testing shuffle - ✔ shuffle is a Function - ✔ Shuffles the array - ✔ New array contains all original elements - ✔ Works for empty arrays - ✔ Works for single-element arrays + √ shuffle is a Function + √ Shuffles the array + √ New array contains all original elements + √ Works for empty arrays + √ Works for single-element arrays Testing similarity - ✔ similarity is a Function - ✔ Returns an array of elements that appear in both arrays. + √ similarity is a Function + √ Returns an array of elements that appear in both arrays. Testing size - ✔ size is a Function - ✔ Get size of arrays, objects or strings. - ✔ Get size of arrays, objects or strings. + √ size is a Function + √ Get size of arrays, objects or strings. + √ Get size of arrays, objects or strings. Testing sleep - ✔ sleep is a Function + √ sleep is a Function Testing solveRPN - ✔ solveRPN is a Function + √ solveRPN is a Function Testing sortCharactersInString - ✔ sortCharactersInString is a Function - ✔ Alphabetically sorts the characters in a string. + √ sortCharactersInString is a Function + √ Alphabetically sorts the characters in a string. Testing sortedIndex - ✔ sortedIndex is a Function - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + √ sortedIndex is a Function + √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. Testing sortedIndexBy - ✔ sortedIndexBy is a Function - ✔ Returns the lowest index to insert the element without messing up the list order + √ sortedIndexBy is a Function + √ Returns the lowest index to insert the element without messing up the list order Testing sortedLastIndex - ✔ sortedLastIndex is a Function - ✔ Returns the highest index to insert the element without messing up the list order + √ sortedLastIndex is a Function + √ Returns the highest index to insert the element without messing up the list order Testing sortedLastIndexBy - ✔ sortedLastIndexBy is a Function - ✔ Returns the highest index to insert the element without messing up the list order + √ sortedLastIndexBy is a Function + √ Returns the highest index to insert the element without messing up the list order Testing speechSynthesis - ✔ speechSynthesis is a Function + √ speechSynthesis is a Function Testing splitLines - ✔ splitLines is a Function - ✔ Splits a multiline string into an array of lines. + √ splitLines is a Function + √ Splits a multiline string into an array of lines. Testing spreadOver - ✔ spreadOver is a Function - ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + √ spreadOver is a Function + √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. Testing standardDeviation - ✔ standardDeviation is a Function - ✔ Returns the standard deviation of an array of numbers - ✔ Returns the standard deviation of an array of numbers + √ standardDeviation is a Function + √ Returns the standard deviation of an array of numbers + √ Returns the standard deviation of an array of numbers Testing stripHTMLTags - ✔ stripHTMLTags is a Function - ✔ Removes HTML tags + √ stripHTMLTags is a Function + √ Removes HTML tags Testing sum - ✔ sum is a Function - ✔ Returns the sum of two or more numbers/arrays. + √ sum is a Function + √ Returns the sum of two or more numbers/arrays. Testing sumBy - ✔ sumBy is a Function + √ sumBy is a Function Testing sumPower - ✔ sumPower is a Function - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end + √ sumPower is a Function + √ Returns the sum of the powers of all the numbers from start to end + √ Returns the sum of the powers of all the numbers from start to end + √ Returns the sum of the powers of all the numbers from start to end Testing symmetricDifference - ✔ symmetricDifference is a Function - ✔ Returns the symmetric difference between two arrays. + √ symmetricDifference is a Function + √ Returns the symmetric difference between two arrays. Testing symmetricDifferenceBy - ✔ symmetricDifferenceBy is a Function - ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + √ symmetricDifferenceBy is a Function + √ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both Testing symmetricDifferenceWith - ✔ symmetricDifferenceWith is a Function - ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator + √ symmetricDifferenceWith is a Function + √ Returns the symmetric difference between two arrays, using a provided function as a comparator Testing tail - ✔ tail is a Function - ✔ Returns tail - ✔ Returns tail + √ tail is a Function + √ Returns tail + √ Returns tail Testing take - ✔ take is a Function - ✔ Returns an array with n elements removed from the beginning. - ✔ Returns an array with n elements removed from the beginning. + √ take is a Function + √ Returns an array with n elements removed from the beginning. + √ Returns an array with n elements removed from the beginning. Testing takeRight - ✔ takeRight is a Function - ✔ Returns an array with n elements removed from the end - ✔ Returns an array with n elements removed from the end + √ takeRight is a Function + √ Returns an array with n elements removed from the end + √ Returns an array with n elements removed from the end Testing takeRightWhile - ✔ takeRightWhile is a Function - ✔ Removes elements until the function returns true + √ takeRightWhile is a Function + √ Removes elements until the function returns true Testing takeWhile - ✔ takeWhile is a Function - ✔ Removes elements until the function returns true + √ takeWhile is a Function + √ Removes elements until the function returns true Testing throttle - ✔ throttle is a Function - - Testing timeTaken - - ✔ timeTaken is a Function + √ throttle is a Function Testing times - ✔ times is a Function - ✔ Runs a function the specified amount of times + √ times is a Function + √ Runs a function the specified amount of times + + Testing timeTaken + + √ timeTaken is a Function Testing toCamelCase - ✔ toCamelCase is a Function - ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName - ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - ✔ toCamelCase('some-javascript-property') return someJavascriptProperty - ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - ✔ toCamelCase() throws a error - ✔ toCamelCase([]) throws a error - ✔ toCamelCase({}) throws a error - ✔ toCamelCase(123) throws a error - ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + √ toCamelCase is a Function + √ toCamelCase('some_database_field_name') returns someDatabaseFieldName + √ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized + √ toCamelCase('some-javascript-property') return someJavascriptProperty + √ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens + √ toCamelCase() throws a error + √ toCamelCase([]) throws a error + √ toCamelCase({}) throws a error + √ toCamelCase(123) throws a error + √ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run Testing toCurrency - ✔ toCurrency is a Function - ✔ currency: Euro | currencyLangFormat: Local - ✔ currency: US Dollar | currencyLangFormat: English (United States) - ✔ currency: Japanese Yen | currencyLangFormat: Local + √ toCurrency is a Function + √ currency: Euro | currencyLangFormat: Local + √ currency: US Dollar | currencyLangFormat: English (United States) + √ currency: Japanese Yen | currencyLangFormat: Local Testing toDecimalMark - ✔ toDecimalMark is a Function - ✔ convert a float-point arithmetic to the Decimal mark form - - Testing toKebabCase - - ✔ toKebabCase is a Function - ✔ toKebabCase('camelCase') returns camel-case - ✔ toKebabCase('some text') returns some-text - ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - ✔ toKebabCase() return undefined - ✔ toKebabCase([]) throws an error - ✔ toKebabCase({}) throws an error - ✔ toKebabCase(123) throws an error - ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toOrdinalSuffix - - ✔ toOrdinalSuffix is a Function - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - - Testing toSafeInteger - - ✔ toSafeInteger is a Function - ✔ Number(toSafeInteger(3.2)) is a number - ✔ Converts a value to a safe integer - ✔ toSafeInteger('4.2') returns 4 - ✔ toSafeInteger(4.6) returns 5 - ✔ toSafeInteger([]) returns 0 - ✔ isNaN(toSafeInteger([1.5, 3124])) is true - ✔ isNaN(toSafeInteger('string')) is true - ✔ isNaN(toSafeInteger({})) is true - ✔ isNaN(toSafeInteger()) is true - ✔ toSafeInteger(Infinity) returns 9007199254740991 - ✔ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - ✔ toSnakeCase is a Function - ✔ toSnakeCase('camelCase') returns camel_case - ✔ toSnakeCase('some text') returns some_text - ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - ✔ toSnakeCase() returns undefined - ✔ toSnakeCase([]) throws an error - ✔ toSnakeCase({}) throws an error - ✔ toSnakeCase(123) throws an error - ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + √ toDecimalMark is a Function + √ convert a float-point arithmetic to the Decimal mark form Testing toggleClass - ✔ toggleClass is a Function + √ toggleClass is a Function + + Testing toKebabCase + + √ toKebabCase is a Function + √ toKebabCase('camelCase') returns camel-case + √ toKebabCase('some text') returns some-text + √ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens + √ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html + √ toKebabCase() return undefined + √ toKebabCase([]) throws an error + √ toKebabCase({}) throws an error + √ toKebabCase(123) throws an error + √ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run Testing tomorrow - ✔ tomorrow is a Function - ✔ Returns the correct year - ✔ Returns the correct month - ✔ Returns the correct date + √ tomorrow is a Function + √ Returns the correct year + √ Returns the correct month + √ Returns the correct date + + Testing toOrdinalSuffix + + √ toOrdinalSuffix is a Function + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + √ Adds an ordinal suffix to a number + + Testing toSafeInteger + + √ toSafeInteger is a Function + √ Number(toSafeInteger(3.2)) is a number + √ Converts a value to a safe integer + √ toSafeInteger('4.2') returns 4 + √ toSafeInteger(4.6) returns 5 + √ toSafeInteger([]) returns 0 + √ isNaN(toSafeInteger([1.5, 3124])) is true + √ isNaN(toSafeInteger('string')) is true + √ isNaN(toSafeInteger({})) is true + √ isNaN(toSafeInteger()) is true + √ toSafeInteger(Infinity) returns 9007199254740991 + √ toSafeInteger(3.2) takes less than 2s to run + + Testing toSnakeCase + + √ toSnakeCase is a Function + √ toSnakeCase('camelCase') returns camel_case + √ toSnakeCase('some text') returns some_text + √ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens + √ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html + √ toSnakeCase() returns undefined + √ toSnakeCase([]) throws an error + √ toSnakeCase({}) throws an error + √ toSnakeCase(123) throws an error + √ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run Testing transform - ✔ transform is a Function - ✔ Transforms an object + √ transform is a Function + √ Transforms an object Testing truncateString - ✔ truncateString is a Function - ✔ Truncates a "boomerang" up to a specified length. + √ truncateString is a Function + √ Truncates a "boomerang" up to a specified length. Testing truthCheckCollection - ✔ truthCheckCollection is a Function - ✔ second argument is truthy on all elements of a collection + √ truthCheckCollection is a Function + √ second argument is truthy on all elements of a collection Testing unary - ✔ unary is a Function - ✔ Discards arguments after the first one + √ unary is a Function + √ Discards arguments after the first one + + Testing uncurry + + √ uncurry is a Function + √ Works without a provided value for n + √ Works without n = 2 + √ Works withoutn = 3 Testing unescapeHTML - ✔ unescapeHTML is a Function - ✔ Unescapes escaped HTML characters. + √ unescapeHTML is a Function + √ Unescapes escaped HTML characters. Testing unflattenObject - ✔ unflattenObject is a Function - ✔ Unflattens an object with the paths for keys + √ unflattenObject is a Function + √ Unflattens an object with the paths for keys Testing unfold - ✔ unfold is a Function - ✔ Works with a given function, producing an array + √ unfold is a Function + √ Works with a given function, producing an array Testing union - ✔ union is a Function - ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - ✔ union([], []) returns [] - ✔ union() throws an error - ✔ union(true, str) throws an error - ✔ union(false, true) throws an error - ✔ union(123, {}) throws an error - ✔ union([], {}) throws an error - ✔ union(undefined, null) throws an error - ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + √ union is a Function + √ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] + √ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] + √ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] + √ union([], []) returns [] + √ union() throws an error + √ union(true, str) throws an error + √ union(false, true) throws an error + √ union(123, {}) throws an error + √ union([], {}) throws an error + √ union(undefined, null) throws an error + √ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run Testing unionBy - ✔ unionBy is a Function - ✔ Produces the appropriate results + √ unionBy is a Function + √ Produces the appropriate results Testing unionWith - ✔ unionWith is a Function - ✔ Produces the appropriate results + √ unionWith is a Function + √ Produces the appropriate results Testing uniqueElements - ✔ uniqueElements is a Function - ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] - ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - ✔ uniqueElements() returns [] - ✔ uniqueElements(null) returns [] - ✔ uniqueElements(undefined) returns [] - ✔ uniqueElements('strt') returns ['s', 't', 'r'] - ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error - ✔ uniqueElements({}) throws an error - ✔ uniqueElements(true) throws an error - ✔ uniqueElements(false) throws an error - ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + √ uniqueElements is a Function + √ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] + √ uniqueElements([1, 23, 53]) returns [1, 23, 53] + √ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] + √ uniqueElements() returns [] + √ uniqueElements(null) returns [] + √ uniqueElements(undefined) returns [] + √ uniqueElements('strt') returns ['s', 't', 'r'] + √ uniqueElements(1, 1, 2543, 534, 5) throws an error + √ uniqueElements({}) throws an error + √ uniqueElements(true) throws an error + √ uniqueElements(false) throws an error + √ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run Testing untildify - ✔ untildify is a Function - ✔ Contains no tildes - ✔ Does not alter the rest of the path - ✔ Does not alter paths without tildes + √ untildify is a Function + √ Contains no tildes + √ Does not alter the rest of the path + √ Does not alter paths without tildes Testing unzip - ✔ unzip is a Function - ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] + √ unzip is a Function + √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] + √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] Testing unzipWith - ✔ unzipWith is a Function - ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + √ unzipWith is a Function + √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + + Testing URLJoin + + √ URLJoin is a Function + √ Returns proper URL + √ Returns proper URL + + Testing UUIDGeneratorBrowser + + √ UUIDGeneratorBrowser is a Function + √ Tested 09/02/2018 by @chalarangelo + + Testing UUIDGeneratorNode + + √ UUIDGeneratorNode is a Function + √ Contains dashes in the proper places + √ Only contains hexadecimal digits Testing validateNumber - ✔ validateNumber is a Function - ✔ validateNumber(9) returns true - ✔ validateNumber(234asd.slice(0, 2)) returns true - ✔ validateNumber(1232) returns true - ✔ validateNumber(1232 + 13423) returns true - ✔ validateNumber(1232 * 2342 * 123) returns true - ✔ validateNumber(1232.23423536) returns true - ✔ validateNumber(234asd) returns false - ✔ validateNumber(e234d) returns false - ✔ validateNumber(false) returns false - ✔ validateNumber(true) returns false - ✔ validateNumber(null) returns false - ✔ validateNumber(123 * asd) returns false + √ validateNumber is a Function + √ validateNumber(9) returns true + √ validateNumber(234asd.slice(0, 2)) returns true + √ validateNumber(1232) returns true + √ validateNumber(1232 + 13423) returns true + √ validateNumber(1232 * 2342 * 123) returns true + √ validateNumber(1232.23423536) returns true + √ validateNumber(234asd) returns false + √ validateNumber(e234d) returns false + √ validateNumber(false) returns false + √ validateNumber(true) returns false + √ validateNumber(null) returns false + √ validateNumber(123 * asd) returns false Testing without - ✔ without is a Function - ✔ without([2, 1, 2, 3], 1, 2) returns [3] - ✔ without([]) returns [] - ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] - ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - ✔ without() throws an error - ✔ without(null) throws an error - ✔ without(undefined) throws an error - ✔ without() throws an error - ✔ without({}) throws an error + √ without is a Function + √ without([2, 1, 2, 3], 1, 2) returns [3] + √ without([]) returns [] + √ without([3, 1, true, '3', true], '3', true) returns [3, 1] + √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] + √ without() throws an error + √ without(null) throws an error + √ without(undefined) throws an error + √ without() throws an error + √ without({}) throws an error Testing words - ✔ words is a Function - ✔ words('I love javaScript!!') returns [I, love, javaScript] - ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] - ✔ words(I love javaScript!!) returns an array - ✔ words() throws a error - ✔ words(null) throws a error - ✔ words(undefined) throws a error - ✔ words({}) throws a error - ✔ words([]) throws a error - ✔ words(1234) throws a error + √ words is a Function + √ words('I love javaScript!!') returns [I, love, javaScript] + √ words('python, javaScript & coffee') returns [python, javaScript, coffee] + √ words(I love javaScript!!) returns an array + √ words() throws a error + √ words(null) throws a error + √ words(undefined) throws a error + √ words({}) throws a error + √ words([]) throws a error + √ words(1234) throws a error Testing xProd - ✔ xProd is a Function - ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + √ xProd is a Function + √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] Testing yesNo - ✔ yesNo is a Function - ✔ yesNo(Y) returns true - ✔ yesNo(yes) returns true - ✔ yesNo(foo, true) returns true - ✔ yesNo(No) returns false - ✔ yesNo() returns false - ✔ yesNo(null) returns false - ✔ yesNo(undefined) returns false - ✔ yesNo([123, null]) returns false - ✔ yesNo([Yes, No]) returns false - ✔ yesNo({ 2: Yes }) returns false - ✔ yesNo([Yes, No], true) returns true - ✔ yesNo({ 2: Yes }, true) returns true + √ yesNo is a Function + √ yesNo(Y) returns true + √ yesNo(yes) returns true + √ yesNo(foo, true) returns true + √ yesNo(No) returns false + √ yesNo() returns false + √ yesNo(null) returns false + √ yesNo(undefined) returns false + √ yesNo([123, null]) returns false + √ yesNo([Yes, No]) returns false + √ yesNo({ 2: Yes }) returns false + √ yesNo([Yes, No], true) returns true + √ yesNo({ 2: Yes }, true) returns true Testing zip - ✔ zip is a Function - ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - ✔ zip([]) returns [] - ✔ zip(123) returns [] - ✔ zip([a, b], [1, 2], [true, false]) returns an Array - ✔ zip([a], [1, 2], [true, false]) returns an Array - ✔ zip(null) throws an error - ✔ zip(undefined) throws an error + √ zip is a Function + √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] + √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] + √ zip([]) returns [] + √ zip(123) returns [] + √ zip([a, b], [1, 2], [true, false]) returns an Array + √ zip([a], [1, 2], [true, false]) returns an Array + √ zip(null) throws an error + √ zip(undefined) throws an error Testing zipObject - ✔ zipObject is a Function - ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - ✔ zipObject([a], string) returns { a: s } - ✔ zipObject() throws an error - ✔ zipObject([string], null) throws an error - ✔ zipObject(null, [1]) throws an error - ✔ zipObject(string) throws an error - ✔ zipObject(test, string) throws an error + √ zipObject is a Function + √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} + √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} + √ zipObject([a, b, c], string) returns { a: s, b: t, c: r } + √ zipObject([a], string) returns { a: s } + √ zipObject() throws an error + √ zipObject([string], null) throws an error + √ zipObject(null, [1]) throws an error + √ zipObject(string) throws an error + √ zipObject(test, string) throws an error Testing zipWith - ✔ zipWith is a Function - ✔ Runs the function provided - ✔ Sends a POST request - ✔ Runs promises in series - ✔ Sends a GET request - ✔ Works with multiple promises + √ zipWith is a Function + √ Runs the function provided + √ Sends a GET request + √ Runs promises in series + √ Sends a POST request + √ Works with multiple promises - total: 901 - passing: 901 - duration: 2.7s + total: 905 + passing: 905 + duration: 2.4s diff --git a/test/uncurry/uncurry.js b/test/uncurry/uncurry.js new file mode 100644 index 000000000..a926982d5 --- /dev/null +++ b/test/uncurry/uncurry.js @@ -0,0 +1,6 @@ +const uncurry = (fn, n = 1) => (...args) => { +const next = acc => args => args.reduce((x, y) => x(y), acc); +if (n > args.length) throw new RangeError('Arguments too few!'); +return next(fn)(args.slice(0, n)); +}; +module.exports = uncurry; \ No newline at end of file diff --git a/test/uncurry/uncurry.test.js b/test/uncurry/uncurry.test.js new file mode 100644 index 000000000..76ef507fa --- /dev/null +++ b/test/uncurry/uncurry.test.js @@ -0,0 +1,20 @@ +const test = require('tape'); +const uncurry = require('./uncurry.js'); + +test('Testing uncurry', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof uncurry === 'function', 'uncurry is a Function'); + const add = x => y => z => x + y + z; + const add1 = uncurry(add); + const add2 = uncurry(add, 2); + const add3 = uncurry(add, 3); + t.equal(add1(1)(2)(3), 6, 'Works without a provided value for n'); + t.equal(add2(1,2)(3), 6, 'Works without n = 2'); + t.equal(add3(1,2,3), 6, 'Works withoutn = 3'); + //t.deepEqual(uncurry(args..), 'Expected'); + //t.equal(uncurry(args..), 'Expected'); + //t.false(uncurry(args..), 'Expected'); + //t.throws(uncurry(args..), 'Expected'); + t.end(); +}); From d241e5a7648ba368c9941fecaee1d57afd913148 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 14 Feb 2018 11:58:12 +0200 Subject: [PATCH 12/43] Resolves Codacy quality test issue --- test/noneBy/noneBy.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/noneBy/noneBy.test.js b/test/noneBy/noneBy.test.js index 9147e5c98..f76aa990e 100644 --- a/test/noneBy/noneBy.test.js +++ b/test/noneBy/noneBy.test.js @@ -6,7 +6,7 @@ test('Testing noneBy', (t) => { //Please go to https://github.com/substack/tape t.true(typeof noneBy === 'function', 'noneBy is a Function'); t.true(noneBy([4,1,0,3], x => x < 0), 'Returns true with a predicate function'); - t.false(noneBy([0,1,2], x => x == 1), 'Returns false with predicate function'); + t.false(noneBy([0,1,2], x => x === 1), 'Returns false with predicate function'); //t.deepEqual(noneBy(args..), 'Expected'); //t.equal(noneBy(args..), 'Expected'); //t.false(noneBy(args..), 'Expected'); From 4b9d00fe112a8f3c20fe0b28235e223c24c30659 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 14 Feb 2018 09:58:38 +0000 Subject: [PATCH 13/43] Travis build: 1662 --- README.md | 33 +++++++++++++++++++++++++++++++++ docs/index.html | 10 +++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7083b13b8..94145e6ee 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,7 @@ average(1, 2, 3); * [`sleep`](#sleep) * [`throttle`](#throttle) * [`times`](#times) +* [`uncurry`](#uncurry) * [`unfold`](#unfold) @@ -4199,6 +4200,38 @@ console.log(output); // 01234
[⬆ Back to top](#table-of-contents) +### uncurry + +Uncurries a function up to depth `n`. + +Return a variadic function. +Use `Array.reduce()` on the provided arguments to call each subsequent curry level of the function. +If the `length` of the provided arguments is less than `n` throw an error. +Otherwise, call `fn` with the proper amount of arguments, using `Array.slice(0, n)`. +Omit the second argument, `n`, to uncurry up to depth `1`. + +```js +const uncurry = (fn, n = 1) => (...args) => { + const next = acc => args => args.reduce((x, y) => x(y), acc); + if (n > args.length) throw new RangeError('Arguments too few!'); + return next(fn)(args.slice(0, n)); +}; +``` + +
+Examples + +```js +const add = x => y => z => x + y + z; +const uncurriedAdd = uncurry(add, 3); +uncurriedAdd(1, 2, 3); // 6 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### unfold Builds an array, using an iterator function and an initial seed value. diff --git a/docs/index.html b/docs/index.html index 385f479a6..6404e8899 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -967,6 +967,14 @@ document.bodyShow examples
var output = '';
 times(5, i => (output += i));
 console.log(output); // 01234
+

uncurry

Uncurries a function up to depth n.

Return a variadic function. Use Array.reduce() on the provided arguments to call each subsequent curry level of the function. If the length of the provided arguments is less than n throw an error. Otherwise, call fn with the proper amount of arguments, using Array.slice(0, n). Omit the second argument, n, to uncurry up to depth 1.

const uncurry = (fn, n = 1) => (...args) => {
+  const next = acc => args => args.reduce((x, y) => x(y), acc);
+  if (n > args.length) throw new RangeError('Arguments too few!');
+  return next(fn)(args.slice(0, n));
+};
+
const add = x => y => z => x + y + z;
+const uncurriedAdd = uncurry(add, 3);
+uncurriedAdd(1, 2, 3); // 6
 

unfold

Builds an array, using an iterator function and an initial seed value.

Use a while loop and Array.push() to call the function repeatedly until it returns false. The iterator function accepts one argument (seed) and must always return an array with two elements ([value, nextSeed]) or false to terminate.

const unfold = (fn, seed) => {
   let result = [],
     val = [null, seed];

From a1a99021d3b782ddc4ae32dd6bdfc7d2ca87b29f Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 12:13:07 +0200
Subject: [PATCH 14/43] Add bifurcate, bifurcateBy

---
 snippets/bifurcate.md                | 17 +++++++++++++++++
 snippets/bifurcateBy.md              | 17 +++++++++++++++++
 tag_database                         |  2 ++
 test/bifurcate/bifurcate.js          |  6 ++++++
 test/bifurcate/bifurcate.test.js     | 14 ++++++++++++++
 test/bifurcateBy/bifurcateBy.js      |  6 ++++++
 test/bifurcateBy/bifurcateBy.test.js | 14 ++++++++++++++
 test/testlog                         | 18 ++++++++++++++----
 8 files changed, 90 insertions(+), 4 deletions(-)
 create mode 100644 snippets/bifurcate.md
 create mode 100644 snippets/bifurcateBy.md
 create mode 100644 test/bifurcate/bifurcate.js
 create mode 100644 test/bifurcate/bifurcate.test.js
 create mode 100644 test/bifurcateBy/bifurcateBy.js
 create mode 100644 test/bifurcateBy/bifurcateBy.test.js

diff --git a/snippets/bifurcate.md b/snippets/bifurcate.md
new file mode 100644
index 000000000..4177c9483
--- /dev/null
+++ b/snippets/bifurcate.md
@@ -0,0 +1,17 @@
+### bifurcate
+
+Splits values into two groups. If an element in `filter` is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.
+
+Use `Array.reduce()` and `Array.push()` to add elements to groups, based on `filter`.
+
+```js
+const bifurcate = (arr, filter) =>
+  arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [
+    [],
+    [],
+  ]);
+```
+
+```js
+bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+```
diff --git a/snippets/bifurcateBy.md b/snippets/bifurcateBy.md
new file mode 100644
index 000000000..23f81b06f
--- /dev/null
+++ b/snippets/bifurcateBy.md
@@ -0,0 +1,17 @@
+### bifurcateBy
+
+Splits values into two groups according to a predicate function, which specifies which group an element in the input collection belongs to. If the predicate function returns a truthy value, the collection element belongs to the first group; otherwise, it belongs to the second group.
+
+Use `Array.reduce()` and `Array.push()` to add elements to groups, based on the value returned by `fn` for each element.
+
+```js
+const bifurcateBy = (arr, fn) =>
+  arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [
+    [],
+    [],
+  ]);
+```
+
+```js
+bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+```
diff --git a/tag_database b/tag_database
index 6459c8aae..c69f793c6 100644
--- a/tag_database
+++ b/tag_database
@@ -5,6 +5,8 @@ atob:node,string,utility
 attempt:function
 average:math,array
 averageBy:math,array,function
+bifurcate:array
+bifurcateBy:array,function
 bind:function,object
 bindAll:object,function
 bindKey:function,object
diff --git a/test/bifurcate/bifurcate.js b/test/bifurcate/bifurcate.js
new file mode 100644
index 000000000..86fc9f7c1
--- /dev/null
+++ b/test/bifurcate/bifurcate.js
@@ -0,0 +1,6 @@
+const bifurcate = (arr, filter) =>
+arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [
+[],
+[],
+]);
+module.exports = bifurcate;
\ No newline at end of file
diff --git a/test/bifurcate/bifurcate.test.js b/test/bifurcate/bifurcate.test.js
new file mode 100644
index 000000000..c65333ee0
--- /dev/null
+++ b/test/bifurcate/bifurcate.test.js
@@ -0,0 +1,14 @@
+const test = require('tape');
+const bifurcate = require('./bifurcate.js');
+
+test('Testing bifurcate', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  t.true(typeof bifurcate === 'function', 'bifurcate is a Function');
+  t.deepEqual(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups');
+  //t.deepEqual(bifurcate(args..), 'Expected');
+  //t.equal(bifurcate(args..), 'Expected');
+  //t.false(bifurcate(args..), 'Expected');
+  //t.throws(bifurcate(args..), 'Expected');
+  t.end();
+});
diff --git a/test/bifurcateBy/bifurcateBy.js b/test/bifurcateBy/bifurcateBy.js
new file mode 100644
index 000000000..fb153edd7
--- /dev/null
+++ b/test/bifurcateBy/bifurcateBy.js
@@ -0,0 +1,6 @@
+const bifurcateBy = (arr, fn) =>
+arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [
+[],
+[],
+]);
+module.exports = bifurcateBy;
\ No newline at end of file
diff --git a/test/bifurcateBy/bifurcateBy.test.js b/test/bifurcateBy/bifurcateBy.test.js
new file mode 100644
index 000000000..a6c293638
--- /dev/null
+++ b/test/bifurcateBy/bifurcateBy.test.js
@@ -0,0 +1,14 @@
+const test = require('tape');
+const bifurcateBy = require('./bifurcateBy.js');
+
+test('Testing bifurcateBy', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  t.true(typeof bifurcateBy === 'function', 'bifurcateBy is a Function');
+  t.deepEqual(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups');
+  //t.deepEqual(bifurcateBy(args..), 'Expected');
+  //t.equal(bifurcateBy(args..), 'Expected');
+  //t.false(bifurcateBy(args..), 'Expected');
+  //t.throws(bifurcateBy(args..), 'Expected');
+  t.end();
+});
diff --git a/test/testlog b/test/testlog
index 9ffd675a9..f7972c818 100644
--- a/test/testlog
+++ b/test/testlog
@@ -1,4 +1,4 @@
-Test log for: Wed Feb 14 2018 11:56:24 GMT+0200 (GTB Standard Time)
+Test log for: Wed Feb 14 2018 12:12:48 GMT+0200 (GTB Standard Time)
 
 > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
 > tape test/**/*.test.js | tap-spec
@@ -53,6 +53,16 @@ Test log for: Wed Feb 14 2018 11:56:24 GMT+0200 (GTB Standard Time)
     √ Produces the right result with a function
     √ Produces the right result with a property name
 
+  Testing bifurcate
+
+    √ bifurcate is a Function
+    √ Splits the collection into two groups
+
+  Testing bifurcateBy
+
+    √ bifurcateBy is a Function
+    √ Splits the collection into two groups
+
   Testing binarySearch
 
     √ binarySearch is a Function
@@ -1803,15 +1813,15 @@ Test log for: Wed Feb 14 2018 11:56:24 GMT+0200 (GTB Standard Time)
   Testing zipWith
 
     √ zipWith is a Function
-    √ Runs the function provided
     √ Sends a GET request
+    √ Runs the function provided
     √ Runs promises in series
     √ Sends a POST request
     √ Works with multiple promises
 
 
-  total:     905
-  passing:   905
+  total:     909
+  passing:   909
   duration:  2.4s
 
 

From 566653206bc18c62684759e170313254fbc90894 Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 10:14:34 +0000
Subject: [PATCH 15/43] Travis build: 1665

---
 README.md               | 48 +++++++++++++++++++++++++++++++++++++++++
 docs/index.html         | 10 +++++++--
 snippets/bifurcate.md   |  7 ++----
 snippets/bifurcateBy.md |  7 ++----
 4 files changed, 60 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 94145e6ee..3189f39ca 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,8 @@ average(1, 2, 3);
 
View contents +* [`bifurcate`](#bifurcate) +* [`bifurcateBy`](#bifurcateby) * [`chunk`](#chunk) * [`compact`](#compact) * [`countBy`](#countby) @@ -761,6 +763,52 @@ const unary = fn => val => fn(val); --- ## 📚 Array +### bifurcate + +Splits values into two groups. If an element in `filter` is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group. + +Use `Array.reduce()` and `Array.push()` to add elements to groups, based on `filter`. + +```js +const bifurcate = (arr, filter) => + arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]); +``` + +
+Examples + +```js +bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ] +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + +### bifurcateBy + +Splits values into two groups according to a predicate function, which specifies which group an element in the input collection belongs to. If the predicate function returns a truthy value, the collection element belongs to the first group; otherwise, it belongs to the second group. + +Use `Array.reduce()` and `Array.push()` to add elements to groups, based on the value returned by `fn` for each element. + +```js +const bifurcateBy = (arr, fn) => + arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]); +``` + +
+Examples + +```js +bifurcateBy(['beep', 'boop', 'foo', 'bar'], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ] +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### chunk Chunks an array into smaller arrays of a specified size. diff --git a/docs/index.html b/docs/index.html index 6404e8899..1da3415cf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -123,7 +123,13 @@ Object.assig
 arrayMax([1, 2, 3]); // 3
 

unary

Creates a function that accepts up to one argument, ignoring any additional arguments.

Call the provided function, fn, with just the first argument given.

const unary = fn => val => fn(val);
 
['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
-

Array

chunk

Chunks an array into smaller arrays of a specified size.

Use Array.from() to create a new array, that fits the number of chunks that will be produced. Use Array.slice() to map each element of the new array to a chunk the length of size. If the original array can't be split evenly, the final chunk will contain the remaining elements.

const chunk = (arr, size) =>
+

Array

bifurcate

Splits values into two groups. If an element in filter is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.

Use Array.reduce() and Array.push() to add elements to groups, based on filter.

const bifurcate = (arr, filter) =>
+  arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]);
+
bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+

bifurcateBy

Splits values into two groups according to a predicate function, which specifies which group an element in the input collection belongs to. If the predicate function returns a truthy value, the collection element belongs to the first group; otherwise, it belongs to the second group.

Use Array.reduce() and Array.push() to add elements to groups, based on the value returned by fn for each element.

const bifurcateBy = (arr, fn) =>
+  arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]);
+
bifurcateBy(['beep', 'boop', 'foo', 'bar'], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+

chunk

Chunks an array into smaller arrays of a specified size.

Use Array.from() to create a new array, that fits the number of chunks that will be produced. Use Array.slice() to map each element of the new array to a chunk the length of size. If the original array can't be split evenly, the final chunk will contain the remaining elements.

const chunk = (arr, size) =>
   Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
     arr.slice(i * size, i * size + size)
   );
diff --git a/snippets/bifurcate.md b/snippets/bifurcate.md
index 4177c9483..2e124711f 100644
--- a/snippets/bifurcate.md
+++ b/snippets/bifurcate.md
@@ -6,12 +6,9 @@ Use `Array.reduce()` and `Array.push()` to add elements to groups, based on `fil
 
 ```js
 const bifurcate = (arr, filter) =>
-  arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [
-    [],
-    [],
-  ]);
+  arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]);
 ```
 
 ```js
-bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
 ```
diff --git a/snippets/bifurcateBy.md b/snippets/bifurcateBy.md
index 23f81b06f..46a00116f 100644
--- a/snippets/bifurcateBy.md
+++ b/snippets/bifurcateBy.md
@@ -6,12 +6,9 @@ Use `Array.reduce()` and `Array.push()` to add elements to groups, based on the
 
 ```js
 const bifurcateBy = (arr, fn) =>
-  arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [
-    [],
-    [],
-  ]);
+  arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]);
 ```
 
 ```js
-bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ]
+bifurcateBy(['beep', 'boop', 'foo', 'bar'], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ]
 ```

From 4590cf2b9572d6ec31032b1e3712d3949602f043 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 12:24:50 +0200
Subject: [PATCH 16/43] Add degreesToRads and radsToDegrees

---
 snippet-template.md                      |  2 +-
 snippets/degreesToRads.md                | 13 +++++++++++++
 snippets/radsToDegrees.md                | 13 +++++++++++++
 tag_database                             |  2 ++
 test/bifurcate/bifurcate.js              |  5 +----
 test/bifurcateBy/bifurcateBy.js          |  5 +----
 test/degreesToRads/degreesToRads.js      |  2 ++
 test/degreesToRads/degreesToRads.test.js | 15 +++++++++++++++
 test/radsToDegrees/radsToDegrees.js      |  2 ++
 test/radsToDegrees/radsToDegrees.test.js | 14 ++++++++++++++
 test/testlog                             | 16 +++++++++++++---
 11 files changed, 77 insertions(+), 12 deletions(-)
 create mode 100644 snippets/degreesToRads.md
 create mode 100644 snippets/radsToDegrees.md
 create mode 100644 test/degreesToRads/degreesToRads.js
 create mode 100644 test/degreesToRads/degreesToRads.test.js
 create mode 100644 test/radsToDegrees/radsToDegrees.js
 create mode 100644 test/radsToDegrees/radsToDegrees.test.js

diff --git a/snippet-template.md b/snippet-template.md
index 1ee62a2f0..31cc8b26d 100644
--- a/snippet-template.md
+++ b/snippet-template.md
@@ -10,5 +10,5 @@ const functionName = arguments =>
 ```
 
 ```js
-functionName('sampleInput') // 'sampleOutput'
+functionName('sampleInput'); // 'sampleOutput'
 ```
diff --git a/snippets/degreesToRads.md b/snippets/degreesToRads.md
new file mode 100644
index 000000000..ed3a2ee0e
--- /dev/null
+++ b/snippets/degreesToRads.md
@@ -0,0 +1,13 @@
+### degreesToRads
+
+Converts an angle from degrees to radians.
+
+Use `Math.PI` and the degree to radian formula to convert the angle from degrees to radians.
+
+```js
+const degreesToRads = deg => deg * Math.PI / 180.0;
+```
+
+```js
+degreesToRads(90.0); // ~1.5708
+```
diff --git a/snippets/radsToDegrees.md b/snippets/radsToDegrees.md
new file mode 100644
index 000000000..d8dd54958
--- /dev/null
+++ b/snippets/radsToDegrees.md
@@ -0,0 +1,13 @@
+### radsToDegrees
+
+Converts an angle from radians to degrees.
+
+Use `Math.PI` and the radian to degree formula to convert the angle from radians to degrees.
+
+```js
+const radsToDegrees = rad => rad * 180.0 / Math.PI;
+```
+
+```js
+radsToDegrees(Math.PI / 2); // 90
+```
diff --git a/tag_database b/tag_database
index c69f793c6..b608bd0c8 100644
--- a/tag_database
+++ b/tag_database
@@ -42,6 +42,7 @@ deepClone:object,recursion
 deepFlatten:array,recursion
 defaults:object
 defer:function
+degreesToRads:math
 delay:function
 detectDeviceType:browser
 difference:array,math
@@ -189,6 +190,7 @@ pull:array
 pullAtIndex:array
 pullAtValue:array
 pullBy:array,function,advanced
+radsToDegrees:math
 randomHexColorCode:utility,random
 randomIntArrayInRange:math,utility,random
 randomIntegerInRange:math,utility,random
diff --git a/test/bifurcate/bifurcate.js b/test/bifurcate/bifurcate.js
index 86fc9f7c1..95d7f8f50 100644
--- a/test/bifurcate/bifurcate.js
+++ b/test/bifurcate/bifurcate.js
@@ -1,6 +1,3 @@
 const bifurcate = (arr, filter) =>
-arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [
-[],
-[],
-]);
+arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]);
 module.exports = bifurcate;
\ No newline at end of file
diff --git a/test/bifurcateBy/bifurcateBy.js b/test/bifurcateBy/bifurcateBy.js
index fb153edd7..bdf04a7ce 100644
--- a/test/bifurcateBy/bifurcateBy.js
+++ b/test/bifurcateBy/bifurcateBy.js
@@ -1,6 +1,3 @@
 const bifurcateBy = (arr, fn) =>
-arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [
-[],
-[],
-]);
+arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]);
 module.exports = bifurcateBy;
\ No newline at end of file
diff --git a/test/degreesToRads/degreesToRads.js b/test/degreesToRads/degreesToRads.js
new file mode 100644
index 000000000..da6d51836
--- /dev/null
+++ b/test/degreesToRads/degreesToRads.js
@@ -0,0 +1,2 @@
+const degreesToRads = deg => deg * Math.PI / 180.0;
+module.exports = degreesToRads;
\ No newline at end of file
diff --git a/test/degreesToRads/degreesToRads.test.js b/test/degreesToRads/degreesToRads.test.js
new file mode 100644
index 000000000..8ec980a10
--- /dev/null
+++ b/test/degreesToRads/degreesToRads.test.js
@@ -0,0 +1,15 @@
+const test = require('tape');
+const degreesToRads = require('./degreesToRads.js');
+
+test('Testing degreesToRads', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff; // Use to account for rounding errors
+  t.true(typeof degreesToRads === 'function', 'degreesToRads is a Function');
+  t.true(approxeq(degreesToRads(90.0), Math.PI / 2), 'Returns the appropriate value');
+  //t.deepEqual(degreesToRads(args..), 'Expected');
+  //t.equal(degreesToRads(args..), 'Expected');
+  //t.false(degreesToRads(args..), 'Expected');
+  //t.throws(degreesToRads(args..), 'Expected');
+  t.end();
+});
diff --git a/test/radsToDegrees/radsToDegrees.js b/test/radsToDegrees/radsToDegrees.js
new file mode 100644
index 000000000..d9a370b78
--- /dev/null
+++ b/test/radsToDegrees/radsToDegrees.js
@@ -0,0 +1,2 @@
+const radsToDegrees = rad => rad * 180.0 / Math.PI;
+module.exports = radsToDegrees;
\ No newline at end of file
diff --git a/test/radsToDegrees/radsToDegrees.test.js b/test/radsToDegrees/radsToDegrees.test.js
new file mode 100644
index 000000000..446485d76
--- /dev/null
+++ b/test/radsToDegrees/radsToDegrees.test.js
@@ -0,0 +1,14 @@
+const test = require('tape');
+const radsToDegrees = require('./radsToDegrees.js');
+
+test('Testing radsToDegrees', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  t.true(typeof radsToDegrees === 'function', 'radsToDegrees is a Function');
+  t.equal(radsToDegrees(Math.PI / 2), 90, 'Returns the appropriate value');
+  //t.deepEqual(radsToDegrees(args..), 'Expected');
+  //t.equal(radsToDegrees(args..), 'Expected');
+  //t.false(radsToDegrees(args..), 'Expected');
+  //t.throws(radsToDegrees(args..), 'Expected');
+  t.end();
+});
diff --git a/test/testlog b/test/testlog
index f7972c818..f4af90680 100644
--- a/test/testlog
+++ b/test/testlog
@@ -1,4 +1,4 @@
-Test log for: Wed Feb 14 2018 12:12:48 GMT+0200 (GTB Standard Time)
+Test log for: Wed Feb 14 2018 12:24:07 GMT+0200 (GTB Standard Time)
 
 > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
 > tape test/**/*.test.js | tap-spec
@@ -278,6 +278,11 @@ Test log for: Wed Feb 14 2018 12:12:48 GMT+0200 (GTB Standard Time)
 
     √ defer is a Function
 
+  Testing degreesToRads
+
+    √ degreesToRads is a Function
+    √ Returns the appropriate value
+
   Testing delay
 
     √ delay is a Function
@@ -1221,6 +1226,11 @@ Test log for: Wed Feb 14 2018 12:12:48 GMT+0200 (GTB Standard Time)
     √ quickSort(undefined) throws an error
     √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run
 
+  Testing radsToDegrees
+
+    √ radsToDegrees is a Function
+    √ Returns the appropriate value
+
   Testing randomHexColorCode
 
     √ randomHexColorCode is a Function
@@ -1820,8 +1830,8 @@ Test log for: Wed Feb 14 2018 12:12:48 GMT+0200 (GTB Standard Time)
     √ Works with multiple promises
 
 
-  total:     909
-  passing:   909
+  total:     913
+  passing:   913
   duration:  2.4s
 
 

From 4a7534f44cb08c0f1f70725be3409f88d22cec23 Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 10:26:47 +0000
Subject: [PATCH 17/43] Travis build: 1667

---
 README.md       | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 docs/index.html |  6 +++++-
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 3189f39ca..0f083e4a2 100644
--- a/README.md
+++ b/README.md
@@ -261,6 +261,7 @@ average(1, 2, 3);
 * [`average`](#average)
 * [`averageBy`](#averageby)
 * [`clampNumber`](#clampnumber)
+* [`degreesToRads`](#degreestorads)
 * [`digitize`](#digitize)
 * [`distance`](#distance)
 * [`elo`](#elo-)
@@ -281,6 +282,7 @@ average(1, 2, 3);
 * [`percentile`](#percentile)
 * [`powerset`](#powerset)
 * [`primes`](#primes)
+* [`radsToDegrees`](#radstodegrees)
 * [`randomIntArrayInRange`](#randomintarrayinrange)
 * [`randomIntegerInRange`](#randomintegerinrange)
 * [`randomNumberInRange`](#randomnumberinrange)
@@ -4383,6 +4385,28 @@ clampNumber(1, -1, -5); // -1
 
[⬆ Back to top](#table-of-contents) +### degreesToRads + +Converts an angle from degrees to radians. + +Use `Math.PI` and the degree to radian formula to convert the angle from degrees to radians. + +```js +const degreesToRads = deg => deg * Math.PI / 180.0; +``` + +
+Examples + +```js +degreesToRads(90.0); // ~1.5708 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### digitize Converts a number to an array of digits. @@ -4931,6 +4955,28 @@ primes(10); // [2,3,5,7]
[⬆ Back to top](#table-of-contents) +### radsToDegrees + +Converts an angle from radians to degrees. + +Use `Math.PI` and the radian to degree formula to convert the angle from radians to degrees. + +```js +const radsToDegrees = rad => rad * 180.0 / Math.PI; +``` + +
+Examples + +```js +radsToDegrees(Math.PI / 2); // 90 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### randomIntArrayInRange Returns an array of n random integers in the specified range. diff --git a/docs/index.html b/docs/index.html index 1da3415cf..7aa7f51ad 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -1000,6 +1000,8 @@ console.log<
 

clampNumber

Clamps num within the inclusive range specified by the boundary values a and b.

If num falls within the range, return num. Otherwise, return the nearest number in the range.

const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
 
clampNumber(2, 3, 5); // 3
 clampNumber(1, -1, -5); // -1
+

degreesToRads

Converts an angle from degrees to radians.

Use Math.PI and the degree to radian formula to convert the angle from degrees to radians.

const degreesToRads = deg => deg * Math.PI / 180.0;
+
degreesToRads(90.0); // ~1.5708
 

digitize

Converts a number to an array of digits.

Convert the number to a string, using the spread operator (...) to build an array. Use Array.map() and parseInt() to transform each value to an integer.

const digitize = n => [...`${n}`].map(i => parseInt(i));
 
digitize(123); // [1, 2, 3]
 

distance

Returns the distance between two points.

Use Math.hypot() to calculate the Euclidean distance between two points.

const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
@@ -1123,6 +1125,8 @@ own individual rating by supplying it as the third argument.
   return arr;
 };
 
primes(10); // [2,3,5,7]
+

radsToDegrees

Converts an angle from radians to degrees.

Use Math.PI and the radian to degree formula to convert the angle from radians to degrees.

const radsToDegrees = rad => rad * 180.0 / Math.PI;
+
radsToDegrees(Math.PI / 2); // 90
 

randomIntArrayInRange

Returns an array of n random integers in the specified range.

Use Array.from() to create an empty array of the specific length, Math.random() to generate a random number and map it to the desired range, using Math.floor() to make it an integer.

const randomIntArrayInRange = (min, max, n = 1) =>
   Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min);
 
randomIntArrayInRange(12, 35, 10); // [ 34, 14, 27, 17, 30, 27, 20, 26, 21, 14 ]

From f1086e8a45cacdff2f97df8aa174250109f29936 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 12:34:02 +0200
Subject: [PATCH 18/43] Add binomialCoefficient

---
 snippets/binomialCoefficient.md               | 26 +++++++++++++++++++
 tag_database                                  |  1 +
 .../binomialCoefficient.js                    | 11 ++++++++
 .../binomialCoefficient.test.js               | 18 +++++++++++++
 test/testlog                                  | 15 ++++++++---
 5 files changed, 68 insertions(+), 3 deletions(-)
 create mode 100644 snippets/binomialCoefficient.md
 create mode 100644 test/binomialCoefficient/binomialCoefficient.js
 create mode 100644 test/binomialCoefficient/binomialCoefficient.test.js

diff --git a/snippets/binomialCoefficient.md b/snippets/binomialCoefficient.md
new file mode 100644
index 000000000..d5ff87d16
--- /dev/null
+++ b/snippets/binomialCoefficient.md
@@ -0,0 +1,26 @@
+### binomialCoefficient
+
+Evaluates the binomial coefficient of two integers `n` and `k`.
+
+Use `Number.isNaN()` to check if any of the two values is `NaN`.
+Check if `k` is less than `0`, greater than or equal to `n`, equal to `1` or `n - 1` and return the appropriate result.
+Check if `n - k` is less than `k` and switch their values accordingly.
+Loop from `2` through `k` and calculate the binomial coefficient.
+Use `Math.round()` to account for rounding errors in the calculation.
+
+```js
+const binomialCoefficient = (n, k) => {
+  if (Number.isNaN(n) || Number.isNaN(k)) return NaN;
+  if (k < 0 || k > n) return 0;
+  if (k === 0 || k === n) return 1;
+  if (k === 1 || k === n - 1) return n;
+  if (n - k < k) k = n - k;
+  let res = n;
+  for (let j = 2; j <= k; j++) res *= (n - j + 1) / j;
+  return Math.round(res);
+};
+```
+
+```js
+binomialCoefficient(8, 2); // 28
+```
diff --git a/tag_database b/tag_database
index b608bd0c8..cad9870dc 100644
--- a/tag_database
+++ b/tag_database
@@ -10,6 +10,7 @@ bifurcateBy:array,function
 bind:function,object
 bindAll:object,function
 bindKey:function,object
+binomialCoefficient:math
 bottomVisible:browser
 btoa:node,string,utility
 byteSize:string
diff --git a/test/binomialCoefficient/binomialCoefficient.js b/test/binomialCoefficient/binomialCoefficient.js
new file mode 100644
index 000000000..a9808585d
--- /dev/null
+++ b/test/binomialCoefficient/binomialCoefficient.js
@@ -0,0 +1,11 @@
+const binomialCoefficient = (n, k) => {
+if (Number.isNaN(n) || Number.isNaN(k)) return NaN;
+if (k < 0 || k > n) return 0;
+if (k === 0 || k === n) return 1;
+if (k === 1 || k === n - 1) return n;
+if (n - k < k) k = n - k;
+let res = n;
+for (let j = 2; j <= k; j++) res *= (n - j + 1) / j;
+return Math.round(res);
+};
+module.exports = binomialCoefficient;
\ No newline at end of file
diff --git a/test/binomialCoefficient/binomialCoefficient.test.js b/test/binomialCoefficient/binomialCoefficient.test.js
new file mode 100644
index 000000000..2f0e8ab20
--- /dev/null
+++ b/test/binomialCoefficient/binomialCoefficient.test.js
@@ -0,0 +1,18 @@
+const test = require('tape');
+const binomialCoefficient = require('./binomialCoefficient.js');
+
+test('Testing binomialCoefficient', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  t.true(typeof binomialCoefficient === 'function', 'binomialCoefficient is a Function');
+  t.equal(binomialCoefficient(8, 2), 28, 'Returns the appropriate value');
+  t.equal(binomialCoefficient(0, 0), 1, 'Returns the appropriate value');
+  t.equal(binomialCoefficient(5, 3), 10, 'Returns the appropriate value');
+  t.true(Number.isNaN(binomialCoefficient(NaN, 3)), 'Returns NaN');
+  t.true(Number.isNaN(binomialCoefficient(5, NaN)), 'Returns NaN');
+  //t.deepEqual(binomialCoefficient(args..), 'Expected');
+  //t.equal(binomialCoefficient(args..), 'Expected');
+  //t.false(binomialCoefficient(args..), 'Expected');
+  //t.throws(binomialCoefficient(args..), 'Expected');
+  t.end();
+});
diff --git a/test/testlog b/test/testlog
index f4af90680..ab29b55f5 100644
--- a/test/testlog
+++ b/test/testlog
@@ -1,4 +1,4 @@
-Test log for: Wed Feb 14 2018 12:24:07 GMT+0200 (GTB Standard Time)
+Test log for: Wed Feb 14 2018 12:33:42 GMT+0200 (GTB Standard Time)
 
 > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
 > tape test/**/*.test.js | tap-spec
@@ -86,6 +86,15 @@ Test log for: Wed Feb 14 2018 12:24:07 GMT+0200 (GTB Standard Time)
     √ bindKey is a Function
     √ Binds function to an object context
 
+  Testing binomialCoefficient
+
+    √ binomialCoefficient is a Function
+    √ Returns the appropriate value
+    √ Returns the appropriate value
+    √ Returns the appropriate value
+    √ Returns NaN
+    √ Returns NaN
+
   Testing bottomVisible
 
     √ bottomVisible is a Function
@@ -1830,8 +1839,8 @@ Test log for: Wed Feb 14 2018 12:24:07 GMT+0200 (GTB Standard Time)
     √ Works with multiple promises
 
 
-  total:     913
-  passing:   913
+  total:     919
+  passing:   919
   duration:  2.4s
 
 

From a8caa9c75dde9e7c58cff1bbc3e8c2a5ae7d42f9 Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 10:35:33 +0000
Subject: [PATCH 19/43] Travis build: 1669

---
 README.md       | 36 ++++++++++++++++++++++++++++++++++++
 docs/index.html | 13 ++++++++++++-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 0f083e4a2..0b99c993a 100644
--- a/README.md
+++ b/README.md
@@ -260,6 +260,7 @@ average(1, 2, 3);
 
 * [`average`](#average)
 * [`averageBy`](#averageby)
+* [`binomialCoefficient`](#binomialcoefficient)
 * [`clampNumber`](#clampnumber)
 * [`degreesToRads`](#degreestorads)
 * [`digitize`](#digitize)
@@ -4361,6 +4362,41 @@ averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 5
 
[⬆ Back to top](#table-of-contents) +### binomialCoefficient + +Evaluates the binomial coefficient of two integers `n` and `k`. + +Use `Number.isNaN()` to check if any of the two values is `NaN`. +Check if `k` is less than `0`, greater than or equal to `n`, equal to `1` or `n - 1` and return the appropriate result. +Check if `n - k` is less than `k` and switch their values accordingly. +Loop from `2` through `k` and calculate the binomial coefficient. +Use `Math.round()` to account for rounding errors in the calculation. + +```js +const binomialCoefficient = (n, k) => { + if (Number.isNaN(n) || Number.isNaN(k)) return NaN; + if (k < 0 || k > n) return 0; + if (k === 0 || k === n) return 1; + if (k === 1 || k === n - 1) return n; + if (n - k < k) k = n - k; + let res = n; + for (let j = 2; j <= k; j++) res *= (n - j + 1) / j; + return Math.round(res); +}; +``` + +
+Examples + +```js +binomialCoefficient(8, 2); // 28 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### clampNumber Clamps `num` within the inclusive range specified by the boundary values `a` and `b`. diff --git a/docs/index.html b/docs/index.html index 7aa7f51ad..45e2c52bc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -997,6 +997,17 @@ console.log<
   arr.length;
 
averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 5
 averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 5
+

binomialCoefficient

Evaluates the binomial coefficient of two integers n and k.

Use Number.isNaN() to check if any of the two values is NaN. Check if k is less than 0, greater than or equal to n, equal to 1 or n - 1 and return the appropriate result. Check if n - k is less than k and switch their values accordingly. Loop from 2 through k and calculate the binomial coefficient. Use Math.round() to account for rounding errors in the calculation.

const binomialCoefficient = (n, k) => {
+  if (Number.isNaN(n) || Number.isNaN(k)) return NaN;
+  if (k < 0 || k > n) return 0;
+  if (k === 0 || k === n) return 1;
+  if (k === 1 || k === n - 1) return n;
+  if (n - k < k) k = n - k;
+  let res = n;
+  for (let j = 2; j <= k; j++) res *= (n - j + 1) / j;
+  return Math.round(res);
+};
+
binomialCoefficient(8, 2); // 28
 

clampNumber

Clamps num within the inclusive range specified by the boundary values a and b.

If num falls within the range, return num. Otherwise, return the nearest number in the range.

const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
 
clampNumber(2, 3, 5); // 3
 clampNumber(1, -1, -5); // -1

From ba59e8020accabab1e65770551d60fc85db7c96b Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 12:47:13 +0200
Subject: [PATCH 20/43] Add approximatelyEqual

---
 snippets/approximatelyEqual.md                  | 14 ++++++++++++++
 tag_database                                    |  1 +
 test/approximatelyEqual/approximatelyEqual.js   |  2 ++
 .../approximatelyEqual.test.js                  | 17 +++++++++++++++++
 test/testlog                                    | 16 ++++++++++++----
 5 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100644 snippets/approximatelyEqual.md
 create mode 100644 test/approximatelyEqual/approximatelyEqual.js
 create mode 100644 test/approximatelyEqual/approximatelyEqual.test.js

diff --git a/snippets/approximatelyEqual.md b/snippets/approximatelyEqual.md
new file mode 100644
index 000000000..e93864536
--- /dev/null
+++ b/snippets/approximatelyEqual.md
@@ -0,0 +1,14 @@
+### approximatelyEqual
+
+Checks if two numbers are approximately equal to each other.
+
+Use `Math.abs()` to compare the absolute difference of the two values to `epsilon`.
+Omit the third parameter, `epsilon`, to use a default value of `0.001`.
+
+```js
+const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
+```
+
+```js
+approximatelyEqual(Math.PI / 2.0 , 1.5708); // true
+```
diff --git a/tag_database b/tag_database
index cad9870dc..09ba68764 100644
--- a/tag_database
+++ b/tag_database
@@ -1,4 +1,5 @@
 anagrams:string,recursion
+approximatelyEqual:math
 arrayToHtmlList:browser,array
 ary:adapter,function
 atob:node,string,utility
diff --git a/test/approximatelyEqual/approximatelyEqual.js b/test/approximatelyEqual/approximatelyEqual.js
new file mode 100644
index 000000000..85fecb15b
--- /dev/null
+++ b/test/approximatelyEqual/approximatelyEqual.js
@@ -0,0 +1,2 @@
+const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
+module.exports = approximatelyEqual;
\ No newline at end of file
diff --git a/test/approximatelyEqual/approximatelyEqual.test.js b/test/approximatelyEqual/approximatelyEqual.test.js
new file mode 100644
index 000000000..44221aeb8
--- /dev/null
+++ b/test/approximatelyEqual/approximatelyEqual.test.js
@@ -0,0 +1,17 @@
+const test = require('tape');
+const approximatelyEqual = require('./approximatelyEqual.js');
+
+test('Testing approximatelyEqual', (t) => {
+  //For more information on all the methods supported by tape
+  //Please go to https://github.com/substack/tape
+  t.true(typeof approximatelyEqual === 'function', 'approximatelyEqual is a Function');
+  t.true(approximatelyEqual(Math.PI / 2.0 , 1.5708), 'Works for PI / 2');
+  t.true(approximatelyEqual(0.1 + 0.2, 0.3), 'Works for 0.1 + 0.2 === 0.3');
+  t.true(approximatelyEqual(0.5, 0.5), 'Works for exactly equal values');
+  t.true(approximatelyEqual(0.501, 0.5, 0.1), 'Works for a custom epsilon');
+  //t.deepEqual(approximatelyEqual(args..), 'Expected');
+  //t.equal(approximatelyEqual(args..), 'Expected');
+  //t.false(approximatelyEqual(args..), 'Expected');
+  //t.throws(approximatelyEqual(args..), 'Expected');
+  t.end();
+});
diff --git a/test/testlog b/test/testlog
index ab29b55f5..804151df6 100644
--- a/test/testlog
+++ b/test/testlog
@@ -1,4 +1,4 @@
-Test log for: Wed Feb 14 2018 12:33:42 GMT+0200 (GTB Standard Time)
+Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time)
 
 > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
 > tape test/**/*.test.js | tap-spec
@@ -11,6 +11,14 @@ Test log for: Wed Feb 14 2018 12:33:42 GMT+0200 (GTB Standard Time)
     √ Works for single-letter strings
     √ Works for empty strings
 
+  Testing approximatelyEqual
+
+    √ approximatelyEqual is a Function
+    √ Works for PI / 2
+    √ Works for 0.1 + 0.2 === 0.3
+    √ Works for exactly equal values
+    √ Works for a custom epsilon
+
   Testing arrayToHtmlList
 
     √ arrayToHtmlList is a Function
@@ -1839,8 +1847,8 @@ Test log for: Wed Feb 14 2018 12:33:42 GMT+0200 (GTB Standard Time)
     √ Works with multiple promises
 
 
-  total:     919
-  passing:   919
-  duration:  2.4s
+  total:     924
+  passing:   924
+  duration:  2.5s
 
 

From 422e5be4868e82313b6fc7114575314be6f1be5b Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 10:48:38 +0000
Subject: [PATCH 21/43] Travis build: 1671

---
 README.md                      | 24 ++++++++++++++++++++++++
 docs/index.html                |  6 ++++--
 snippets/approximatelyEqual.md |  2 +-
 3 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 0b99c993a..5194f20c3 100644
--- a/README.md
+++ b/README.md
@@ -258,6 +258,7 @@ average(1, 2, 3);
 
View contents +* [`approximatelyEqual`](#approximatelyequal) * [`average`](#average) * [`averageBy`](#averageby) * [`binomialCoefficient`](#binomialcoefficient) @@ -4314,6 +4315,29 @@ unfold(f, 10); // [-10, -20, -30, -40, -50] --- ## ➗ Math +### approximatelyEqual + +Checks if two numbers are approximately equal to each other. + +Use `Math.abs()` to compare the absolute difference of the two values to `epsilon`. +Omit the third parameter, `epsilon`, to use a default value of `0.001`. + +```js +const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon; +``` + +
+Examples + +```js +approximatelyEqual(Math.PI / 2.0, 1.5708); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### average Returns the average of two or more numbers. diff --git a/docs/index.html b/docs/index.html index 45e2c52bc..75890c2f5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -989,7 +989,9 @@ console.log<
 };
 
var f = n => (n > 50 ? false : [-n, n + 10]);
 unfold(f, 10); // [-10, -20, -30, -40, -50]
-

Math

average

Returns the average of two or more numbers.

Use Array.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
+

Math

approximatelyEqual

Checks if two numbers are approximately equal to each other.

Use Math.abs() to compare the absolute difference of the two values to epsilon. Omit the third parameter, epsilon, to use a default value of 0.001.

const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
+
approximatelyEqual(Math.PI / 2.0, 1.5708); // true
+

average

Returns the average of two or more numbers.

Use Array.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
 
average(...[1, 2, 3]); // 2
 average(1, 2, 3); // 2
 

averageBy

Returns the average of an array, after mapping each element to a value using the provided function.

Use Array.map() to map each element to the value returned by fn, Array.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

const averageBy = (arr, fn) =>
diff --git a/snippets/approximatelyEqual.md b/snippets/approximatelyEqual.md
index e93864536..88773c163 100644
--- a/snippets/approximatelyEqual.md
+++ b/snippets/approximatelyEqual.md
@@ -10,5 +10,5 @@ const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsi
 ```
 
 ```js
-approximatelyEqual(Math.PI / 2.0 , 1.5708); // true
+approximatelyEqual(Math.PI / 2.0, 1.5708); // true
 ```

From 6e5a86c7b1a97e9028d2414c615bb5a90408b40a Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 11:32:14 +0000
Subject: [PATCH 22/43] Travis build: 1674

---
 README.md          | 138 +++++++++++++++++++++++++++++++++++++++++++++
 docs/index.html    |  16 +++++-
 snippets/all.md    |   2 +-
 snippets/allBy.md  |   2 +-
 snippets/any.md    |   2 +-
 snippets/anyBy.md  |   2 +-
 snippets/none.md   |   2 +-
 snippets/noneBy.md |   2 +-
 8 files changed, 158 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 5194f20c3..a258307c9 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,10 @@ average(1, 2, 3);
 
View contents +* [`all`](#all) +* [`allBy`](#allby) +* [`any`](#any) +* [`anyBy`](#anyby) * [`bifurcate`](#bifurcate) * [`bifurcateBy`](#bifurcateby) * [`chunk`](#chunk) @@ -136,6 +140,8 @@ average(1, 2, 3); * [`mapObject`](#mapobject-) * [`maxN`](#maxn) * [`minN`](#minn) +* [`none`](#none) +* [`noneBy`](#noneby) * [`nthElement`](#nthelement) * [`partition`](#partition) * [`pull`](#pull) @@ -767,6 +773,94 @@ const unary = fn => val => fn(val); --- ## 📚 Array +### all + +Returns `true` if all elements in a collection are truthy, `false` otherwise. + +Use `Array.every(Boolean)` to test if all elements in the collection are truthy. + +```js +const all = arr => arr.every(Boolean); +``` + +
+Examples + +```js +all([1, 2, 3]); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + +### allBy + +Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. + +Use `Array.every()` to test if all elements in the collection return `true` based on `fn`. + +```js +const allBy = (arr, fn) => arr.every(fn); +``` + +
+Examples + +```js +allBy([4, 2, 3], x => x > 1); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + +### any + +Returns `true` if at least one element in a collection is truthy, `false` otherwise. + +Use `Array.some(Boolean)` to test if any elements in the collection are truthy. + +```js +const any = arr => arr.some(Boolean); +``` + +
+Examples + +```js +any([0, 0, 1, 0]); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + +### anyBy + +Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. + +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. + +```js +const anyBy = (arr, fn) => arr.some(fn); +``` + +
+Examples + +```js +anyBy([0, 1, 2, 0], x => x >= 2); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### bifurcate Splits values into two groups. If an element in `filter` is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group. @@ -1718,6 +1812,50 @@ minN([1, 2, 3], 2); // [1,2]
[⬆ Back to top](#table-of-contents) +### none + +Returns `true` if no elements in a collection are truthy, `false` otherwise. + +Use `!Array.some(Boolean)` to test if any elements in the collection are truthy. + +```js +const none = arr => !arr.some(Boolean); +``` + +
+Examples + +```js +none([0, 0, 0]); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + +### noneBy + +Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. + +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. + +```js +const noneBy = (arr, fn) => !arr.some(fn); +``` + +
+Examples + +```js +noneBy([0, 1, 3, 0], x => x == 2); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### nthElement Returns the nth element of an array. diff --git a/docs/index.html b/docs/index.html index 75890c2f5..62c8251c6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -123,7 +123,15 @@ Object.assig
 arrayMax([1, 2, 3]); // 3
 

unary

Creates a function that accepts up to one argument, ignoring any additional arguments.

Call the provided function, fn, with just the first argument given.

const unary = fn => val => fn(val);
 
['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
-

Array

bifurcate

Splits values into two groups. If an element in filter is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.

Use Array.reduce() and Array.push() to add elements to groups, based on filter.

const bifurcate = (arr, filter) =>
+

Array

all

Returns true if all elements in a collection are truthy, false otherwise.

Use Array.every(Boolean) to test if all elements in the collection are truthy.

const all = arr => arr.every(Boolean);
+
all([1, 2, 3]); // true
+

allBy

Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

Use Array.every() to test if all elements in the collection return true based on fn.

const allBy = (arr, fn) => arr.every(fn);
+
allBy([4, 2, 3], x => x > 1); // true
+

any

Returns true if at least one element in a collection is truthy, false otherwise.

Use Array.some(Boolean) to test if any elements in the collection are truthy.

const any = arr => arr.some(Boolean);
+
any([0, 0, 1, 0]); // true
+

anyBy

Returns true if the provided predicate function returns true for at least one element in a collection, false otherwise.

Use Array.some() to test if any elements in the collection return true based on fn.

const anyBy = (arr, fn) => arr.some(fn);
+
anyBy([0, 1, 2, 0], x => x >= 2); // true
+

bifurcate

Splits values into two groups. If an element in filter is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.

Use Array.reduce() and Array.push() to add elements to groups, based on filter.

const bifurcate = (arr, filter) =>
   arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]);
 
bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
 

bifurcateBy

Splits values into two groups according to a predicate function, which specifies which group an element in the input collection belongs to. If the predicate function returns a truthy value, the collection element belongs to the first group; otherwise, it belongs to the second group.

Use Array.reduce() and Array.push() to add elements to groups, based on the value returned by fn for each element.

const bifurcateBy = (arr, fn) =>
@@ -289,6 +297,10 @@ Object.assig
 

minN

Returns the n minimum elements from the provided array. If n is greater than or equal to the provided array's length, then return the original array(sorted in ascending order).

Use Array.sort() combined with the spread operator (...) to create a shallow clone of the array and sort it in ascending order. Use Array.slice() to get the specified number of elements. Omit the second argument, n, to get a one-element array.

const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n);
 
minN([1, 2, 3]); // [1]
 minN([1, 2, 3], 2); // [1,2]
+

none

Returns true if no elements in a collection are truthy, false otherwise.

Use !Array.some(Boolean) to test if any elements in the collection are truthy.

const none = arr => !arr.some(Boolean);
+
none([0, 0, 0]); // true
+

noneBy

Returns true if the provided predicate function returns false for all elements in a collection, false otherwise.

Use Array.some() to test if any elements in the collection return true based on fn.

const noneBy = (arr, fn) => !arr.some(fn);
+
noneBy([0, 1, 3, 0], x => x == 2); // true
 

nthElement

Returns the nth element of an array.

Use Array.slice() to get an array containing the nth element at the first place. If the index is out of bounds, return []. Omit the second argument, n, to get the first element of the array.

const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0];
 
nthElement(['a', 'b', 'c'], 1); // 'b'
 nthElement(['a', 'b', 'b'], -3); // 'a'
diff --git a/snippets/all.md b/snippets/all.md
index cb976da09..e9faecd9d 100644
--- a/snippets/all.md
+++ b/snippets/all.md
@@ -9,5 +9,5 @@ const all = arr => arr.every(Boolean);
 ```
 
 ```js
-all([1,2,3]); // true
+all([1, 2, 3]); // true
 ```
diff --git a/snippets/allBy.md b/snippets/allBy.md
index d2dec44f8..36335714f 100644
--- a/snippets/allBy.md
+++ b/snippets/allBy.md
@@ -9,5 +9,5 @@ const allBy = (arr, fn) => arr.every(fn);
 ```
 
 ```js
-allBy([4,2,3], x => x > 1); // true
+allBy([4, 2, 3], x => x > 1); // true
 ```
diff --git a/snippets/any.md b/snippets/any.md
index d030d4451..09a5afad8 100644
--- a/snippets/any.md
+++ b/snippets/any.md
@@ -9,5 +9,5 @@ const any = arr => arr.some(Boolean);
 ```
 
 ```js
-any([0,0,1,0]); // true
+any([0, 0, 1, 0]); // true
 ```
diff --git a/snippets/anyBy.md b/snippets/anyBy.md
index 244c242d2..2345f82bc 100644
--- a/snippets/anyBy.md
+++ b/snippets/anyBy.md
@@ -9,5 +9,5 @@ const anyBy = (arr, fn) => arr.some(fn);
 ```
 
 ```js
-anyBy([0,1,2,0], x => x >= 2); // true
+anyBy([0, 1, 2, 0], x => x >= 2); // true
 ```
diff --git a/snippets/none.md b/snippets/none.md
index 8bf8fb830..a243b0409 100644
--- a/snippets/none.md
+++ b/snippets/none.md
@@ -9,5 +9,5 @@ const none = arr => !arr.some(Boolean);
 ```
 
 ```js
-none([0,0,0]); // true
+none([0, 0, 0]); // true
 ```
diff --git a/snippets/noneBy.md b/snippets/noneBy.md
index 20fcfcfb7..fa719d2df 100644
--- a/snippets/noneBy.md
+++ b/snippets/noneBy.md
@@ -9,5 +9,5 @@ const noneBy = (arr, fn) => !arr.some(fn);
 ```
 
 ```js
-noneBy([0,1,3,0], x => x == 2); // true
+noneBy([0, 1, 3, 0], x => x == 2); // true
 ```

From 5c2e81cfd59452f01493e4e634fc2b0149e2ff28 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Wed, 14 Feb 2018 22:38:45 +1100
Subject: [PATCH 23/43] Add mostPerformant snippet

---
 snippets/mostPerformant.md | 33 +++++++++++++++++++++++++++++++++
 tag_database               |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 snippets/mostPerformant.md

diff --git a/snippets/mostPerformant.md b/snippets/mostPerformant.md
new file mode 100644
index 000000000..192c85a90
--- /dev/null
+++ b/snippets/mostPerformant.md
@@ -0,0 +1,33 @@
+### mostPerformant
+
+Returns the index of the function in an array of functions which executed the fastest.
+
+Use `Array.map()` to generate an array where each value is the total time taken to execute the function
+after `iterations` times. Use the difference in `performance.now()` values before and after to get the total time
+in milliseconds to a high degree of accuracy.
+Use `Math.min()` to find the minimum execution time, and return the index of that shortest time which
+corresponds to the index of the most performant function. Omit the second argument, `iterations`, to use a default of 10,000 iterations. The more iterations, the more reliable the result but the longer it will take.
+
+```js
+const mostPerformant = (fns, iterations = 10000) => {
+  const times = fns.map(fn => {
+    const before = performance.now();
+    for (let i = 0; i < iterations; i++) fn();
+    return performance.now() - before;
+  });
+  return times.indexOf(Math.min(...times));
+};
+```
+
+```js
+mostPerformant([
+  () => {
+    // Loops through the entire array before returning `false`
+    [1, 2, 3, 4, 5, 6, 7, 8, 9, '10'].every(el => typeof el === 'number')
+  },
+  () => {
+    // Only needs to reach index `1` before returning false
+    [1, '2', 3, 4, 5, 6, 7, 8, 9, 10].every(el => typeof el === 'number')
+  }
+]); // 1
+```
diff --git a/tag_database b/tag_database
index 09ba68764..649d26e2f 100644
--- a/tag_database
+++ b/tag_database
@@ -158,6 +158,7 @@ memoize:function
 merge:object,array
 minBy:math,array,function
 minN:array,math
+mostPerformant:function
 negate:function
 nthArg:utility,function
 nthElement:array

From 4e314dd1ffc3bae8f6c3b4cbb4c1bcaebee0a1da Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 13:45:47 +0200
Subject: [PATCH 24/43] Update mostPerformant.md

---
 snippets/mostPerformant.md | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/snippets/mostPerformant.md b/snippets/mostPerformant.md
index 192c85a90..2185b7a29 100644
--- a/snippets/mostPerformant.md
+++ b/snippets/mostPerformant.md
@@ -2,11 +2,9 @@
 
 Returns the index of the function in an array of functions which executed the fastest.
 
-Use `Array.map()` to generate an array where each value is the total time taken to execute the function
-after `iterations` times. Use the difference in `performance.now()` values before and after to get the total time
-in milliseconds to a high degree of accuracy.
-Use `Math.min()` to find the minimum execution time, and return the index of that shortest time which
-corresponds to the index of the most performant function. Omit the second argument, `iterations`, to use a default of 10,000 iterations. The more iterations, the more reliable the result but the longer it will take.
+Use `Array.map()` to generate an array where each value is the total time taken to execute the function after `iterations` times. Use the difference in `performance.now()` values before and after to get the total time in milliseconds to a high degree of accuracy.
+Use `Math.min()` to find the minimum execution time, and return the index of that shortest time which corresponds to the index of the most performant function. 
+Omit the second argument, `iterations`, to use a default of 10,000 iterations. The more iterations, the more reliable the result but the longer it will take.
 
 ```js
 const mostPerformant = (fns, iterations = 10000) => {

From f2e775457c435148da0818475ecc3a395c762eef Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Wed, 14 Feb 2018 13:46:23 +0200
Subject: [PATCH 25/43] Update tag_database

---
 tag_database | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tag_database b/tag_database
index 649d26e2f..af6cb99ff 100644
--- a/tag_database
+++ b/tag_database
@@ -158,7 +158,7 @@ memoize:function
 merge:object,array
 minBy:math,array,function
 minN:array,math
-mostPerformant:function
+mostPerformant:utility,function
 negate:function
 nthArg:utility,function
 nthElement:array

From ce77e2b8b79c659966dcf3f2fa736f6f11324280 Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 11:55:14 +0000
Subject: [PATCH 26/43] Travis build: 1676

---
 README.md                  | 41 ++++++++++++++++++++++++++++++++++++++
 docs/index.html            | 20 ++++++++++++++++++-
 snippets/mostPerformant.md |  4 ++--
 3 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index a258307c9..223fd8bbd 100644
--- a/README.md
+++ b/README.md
@@ -434,6 +434,7 @@ average(1, 2, 3);
 * [`hexToRGB`](#hextorgb-)
 * [`httpGet`](#httpget)
 * [`httpPost`](#httppost)
+* [`mostPerformant`](#mostperformant)
 * [`nthArg`](#ntharg)
 * [`parseCookie`](#parsecookie)
 * [`prettyBytes`](#prettybytes)
@@ -8044,6 +8045,46 @@ Logs: {
 
[⬆ Back to top](#table-of-contents) +### mostPerformant + +Returns the index of the function in an array of functions which executed the fastest. + +Use `Array.map()` to generate an array where each value is the total time taken to execute the function after `iterations` times. Use the difference in `performance.now()` values before and after to get the total time in milliseconds to a high degree of accuracy. +Use `Math.min()` to find the minimum execution time, and return the index of that shortest time which corresponds to the index of the most performant function. +Omit the second argument, `iterations`, to use a default of 10,000 iterations. The more iterations, the more reliable the result but the longer it will take. + +```js +const mostPerformant = (fns, iterations = 10000) => { + const times = fns.map(fn => { + const before = performance.now(); + for (let i = 0; i < iterations; i++) fn(); + return performance.now() - before; + }); + return times.indexOf(Math.min(...times)); +}; +``` + +
+Examples + +```js +mostPerformant([ + () => { + // Loops through the entire array before returning `false` + [1, 2, 3, 4, 5, 6, 7, 8, 9, '10'].every(el => typeof el === 'number'); + }, + () => { + // Only needs to reach index `1` before returning false + [1, '2', 3, 4, 5, 6, 7, 8, 9, 10].every(el => typeof el === 'number'); + } +]); // 1 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### nthArg Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned. diff --git a/docs/index.html b/docs/index.html index 62c8251c6..e56217194 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
+      }

logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

 

Adapter

ary

Creates a function that accepts up to n arguments, ignoring any additional arguments.

Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
 
const firstTwoMax = ary(Math.max, 2);
 [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
 

call

Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

Use a closure to call a stored key with stored arguments.

const call = (key, ...args) => context => context[key](...args);
@@ -1883,6 +1883,24 @@ Logs: {
   "id": 101
 }
 */
+

mostPerformant

Returns the index of the function in an array of functions which executed the fastest.

Use Array.map() to generate an array where each value is the total time taken to execute the function after iterations times. Use the difference in performance.now() values before and after to get the total time in milliseconds to a high degree of accuracy. Use Math.min() to find the minimum execution time, and return the index of that shortest time which corresponds to the index of the most performant function. Omit the second argument, iterations, to use a default of 10,000 iterations. The more iterations, the more reliable the result but the longer it will take.

const mostPerformant = (fns, iterations = 10000) => {
+  const times = fns.map(fn => {
+    const before = performance.now();
+    for (let i = 0; i < iterations; i++) fn();
+    return performance.now() - before;
+  });
+  return times.indexOf(Math.min(...times));
+};
+
mostPerformant([
+  () => {
+    // Loops through the entire array before returning `false`
+    [1, 2, 3, 4, 5, 6, 7, 8, 9, '10'].every(el => typeof el === 'number');
+  },
+  () => {
+    // Only needs to reach index `1` before returning false
+    [1, '2', 3, 4, 5, 6, 7, 8, 9, 10].every(el => typeof el === 'number');
+  }
+]); // 1
 

nthArg

Creates a function that gets the argument at index n. If n is negative, the nth argument from the end is returned.

Use Array.slice() to get the desired argument at index n.

const nthArg = n => (...args) => args.slice(n)[0];
 
const third = nthArg(2);
 third(1, 2, 3); // 3
diff --git a/snippets/mostPerformant.md b/snippets/mostPerformant.md
index 2185b7a29..66cd591e2 100644
--- a/snippets/mostPerformant.md
+++ b/snippets/mostPerformant.md
@@ -21,11 +21,11 @@ const mostPerformant = (fns, iterations = 10000) => {
 mostPerformant([
   () => {
     // Loops through the entire array before returning `false`
-    [1, 2, 3, 4, 5, 6, 7, 8, 9, '10'].every(el => typeof el === 'number')
+    [1, 2, 3, 4, 5, 6, 7, 8, 9, '10'].every(el => typeof el === 'number');
   },
   () => {
     // Only needs to reach index `1` before returning false
-    [1, '2', 3, 4, 5, 6, 7, 8, 9, 10].every(el => typeof el === 'number')
+    [1, '2', 3, 4, 5, 6, 7, 8, 9, 10].every(el => typeof el === 'number');
   }
 ]); // 1
 ```

From 3d13db0790a5ee502c0564a20df0b539add35259 Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Wed, 14 Feb 2018 20:22:35 +0000
Subject: [PATCH 27/43] Travis build: 1678 [cron]

---
 dist/_30s.es5.js                           |  200 +-
 dist/_30s.es5.min.js                       |    2 +-
 dist/_30s.esm.js                           |   52 +-
 dist/_30s.js                               |   52 +-
 dist/_30s.min.js                           |    2 +-
 test/mostPerformant/mostPerformant.js      |    9 +
 test/mostPerformant/mostPerformant.test.js |   13 +
 test/testlog                               | 3707 ++++++++++----------
 8 files changed, 2123 insertions(+), 1914 deletions(-)
 create mode 100644 test/mostPerformant/mostPerformant.js
 create mode 100644 test/mostPerformant/mostPerformant.test.js

diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js
index dfae2893e..74d832712 100644
--- a/dist/_30s.es5.js
+++ b/dist/_30s.es5.js
@@ -34,6 +34,14 @@ var UUIDGeneratorNode = function UUIDGeneratorNode() {
   });
 };
 
+var all = function all(arr) {
+  return arr.every(Boolean);
+};
+
+var allBy = function allBy(arr, fn) {
+  return arr.every(fn);
+};
+
 var anagrams = function anagrams(str) {
   if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
   return str.split('').reduce(function (acc, letter, i) {
@@ -43,6 +51,19 @@ var anagrams = function anagrams(str) {
   }, []);
 };
 
+var any = function any(arr) {
+  return arr.some(Boolean);
+};
+
+var anyBy = function anyBy(arr, fn) {
+  return arr.some(fn);
+};
+
+var approximatelyEqual = function approximatelyEqual(v1, v2) {
+  var epsilon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.001;
+  return Math.abs(v1 - v2) < epsilon;
+};
+
 var arrayToHtmlList = function arrayToHtmlList(arr, listID) {
   return arr.map(function (item) {
     return document.querySelector('#' + listID).innerHTML += '
  • ' + item + '
  • '; @@ -95,6 +116,18 @@ var averageBy = function averageBy(arr, fn) { }, 0) / arr.length; }; +var bifurcate = function bifurcate(arr, filter) { + return arr.reduce(function (acc, val, i) { + return acc[filter[i] ? 0 : 1].push(val), acc; + }, [[], []]); +}; + +var bifurcateBy = function bifurcateBy(arr, fn) { + return arr.reduce(function (acc, val, i) { + return acc[fn(val, i) ? 0 : 1].push(val), acc; + }, [[], []]); +}; + var bind = function bind(fn, context) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; @@ -127,6 +160,18 @@ var bindKey = function bindKey(context, fn) { }; }; +var binomialCoefficient = function binomialCoefficient(n, k) { + if (Number.isNaN(n) || Number.isNaN(k)) return NaN; + if (k < 0 || k > n) return 0; + if (k === 0 || k === n) return 1; + if (k === 1 || k === n - 1) return n; + if (n - k < k) k = n - k; + var res = n; + for (var j = 2; j <= k; j++) { + res *= (n - j + 1) / j; + }return Math.round(res); +}; + var bottomVisible = function bottomVisible() { return document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); }; @@ -428,6 +473,10 @@ var defer = function defer(fn) { return setTimeout.apply(undefined, [fn, 1].concat(args)); }; +var degreesToRads = function degreesToRads(deg) { + return deg * Math.PI / 180.0; +}; + var delay = function delay(fn, wait) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; @@ -1294,12 +1343,34 @@ var minN = function minN(arr) { }).slice(0, n); }; +function _toConsumableArray$13(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var mostPerformant = function mostPerformant(fns) { + var iterations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10000; + + var times = fns.map(function (fn) { + var before = performance.now(); + for (var i = 0; i < iterations; i++) { + fn(); + }return performance.now() - before; + }); + return times.indexOf(Math.min.apply(Math, _toConsumableArray$13(times))); +}; + var negate = function negate(func) { return function () { return !func.apply(undefined, arguments); }; }; +var none = function none(arr) { + return !arr.some(Boolean); +}; + +var noneBy = function noneBy(arr, fn) { + return !arr.some(fn); +}; + var nthArg = function nthArg(n) { return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { @@ -1405,10 +1476,10 @@ var once = function once(fn) { var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -function _toConsumableArray$13(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$14(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var orderBy = function orderBy(arr, props, orders) { - return [].concat(_toConsumableArray$13(arr)).sort(function (a, b) { + return [].concat(_toConsumableArray$14(arr)).sort(function (a, b) { return props.reduce(function (acc, prop, i) { if (acc === 0) { var _ref = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]], @@ -1439,7 +1510,7 @@ var over = function over() { }; }; -function _toConsumableArray$14(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$15(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var overArgs = function overArgs(fn, transforms) { return function () { @@ -1447,7 +1518,7 @@ var overArgs = function overArgs(fn, transforms) { args[_key] = arguments[_key]; } - return fn.apply(undefined, _toConsumableArray$14(args.map(function (val, i) { + return fn.apply(undefined, _toConsumableArray$15(args.map(function (val, i) { return transforms[i](val); }))); }; @@ -1674,6 +1745,10 @@ var pullBy = function pullBy(arr) { }); }; +var radsToDegrees = function radsToDegrees(rad) { + return rad * 180.0 / Math.PI; +}; + var randomHexColorCode = function randomHexColorCode() { var n = (Math.random() * 0xfffff * 1000000).toString(16); return '#' + n.slice(0, 6); @@ -1699,7 +1774,7 @@ var readFileLines = function readFileLines(filename) { return fs$1.readFileSync(filename).toString('UTF8').split('\n'); }; -function _toConsumableArray$15(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$16(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var rearg = function rearg(fn, indexes) { return function () { @@ -1707,7 +1782,7 @@ var rearg = function rearg(fn, indexes) { args[_key] = arguments[_key]; } - return fn.apply(undefined, _toConsumableArray$15(args.reduce(function (acc, val, i) { + return fn.apply(undefined, _toConsumableArray$16(args.reduce(function (acc, val, i) { return acc[indexes.indexOf(i)] = val, acc; }, Array.from({ length: indexes.length })))); }; @@ -1753,10 +1828,10 @@ var removeNonASCII = function removeNonASCII(str) { return str.replace(/[^\x20-\x7E]/g, ''); }; -function _toConsumableArray$16(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$17(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var reverseString = function reverseString(str) { - return [].concat(_toConsumableArray$16(str)).reverse().join(''); + return [].concat(_toConsumableArray$17(str)).reverse().join(''); }; var round = function round(n) { @@ -1879,10 +1954,10 @@ var sleep = function sleep(ms) { }); }; -function _toConsumableArray$17(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$18(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var sortCharactersInString = function sortCharactersInString(str) { - return [].concat(_toConsumableArray$17(str)).sort(function (a, b) { + return [].concat(_toConsumableArray$18(str)).sort(function (a, b) { return a.localeCompare(b); }).join(''); }; @@ -1929,11 +2004,11 @@ var splitLines = function splitLines(str) { return str.split(/\r?\n/); }; -function _toConsumableArray$18(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$19(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var spreadOver = function spreadOver(fn) { return function (argsArr) { - return fn.apply(undefined, _toConsumableArray$18(argsArr)); + return fn.apply(undefined, _toConsumableArray$19(argsArr)); }; }; @@ -1982,19 +2057,19 @@ var sumPower = function sumPower(end) { }, 0); }; -function _toConsumableArray$19(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$20(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var symmetricDifference = function symmetricDifference(a, b) { var sA = new Set(a), sB = new Set(b); - return [].concat(_toConsumableArray$19(a.filter(function (x) { + return [].concat(_toConsumableArray$20(a.filter(function (x) { return !sB.has(x); - })), _toConsumableArray$19(b.filter(function (x) { + })), _toConsumableArray$20(b.filter(function (x) { return !sA.has(x); }))); }; -function _toConsumableArray$20(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$21(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var symmetricDifferenceBy = function symmetricDifferenceBy(a, b, fn) { var sA = new Set(a.map(function (v) { @@ -2003,21 +2078,21 @@ var symmetricDifferenceBy = function symmetricDifferenceBy(a, b, fn) { sB = new Set(b.map(function (v) { return fn(v); })); - return [].concat(_toConsumableArray$20(a.filter(function (x) { + return [].concat(_toConsumableArray$21(a.filter(function (x) { return !sB.has(fn(x)); - })), _toConsumableArray$20(b.filter(function (x) { + })), _toConsumableArray$21(b.filter(function (x) { return !sA.has(fn(x)); }))); }; -function _toConsumableArray$21(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$22(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var symmetricDifferenceWith = function symmetricDifferenceWith(arr, val, comp) { - return [].concat(_toConsumableArray$21(arr.filter(function (a) { + return [].concat(_toConsumableArray$22(arr.filter(function (a) { return val.findIndex(function (b) { return comp(a, b); }) === -1; - })), _toConsumableArray$21(val.filter(function (a) { + })), _toConsumableArray$22(val.filter(function (a) { return arr.findIndex(function (b) { return comp(a, b); }) === -1; @@ -2205,6 +2280,25 @@ var unary = function unary(fn) { }; }; +var uncurry = function uncurry(fn) { + var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var next = function next(acc) { + return function (args) { + return args.reduce(function (x, y) { + return x(y); + }, acc); + }; + }; + if (n > args.length) throw new RangeError('Arguments too few!'); + return next(fn)(args.slice(0, n)); + }; +}; + var unescapeHTML = function unescapeHTML(str) { return str.replace(/&|<|>|'|"/g, function (tag) { return { @@ -2237,62 +2331,46 @@ var unfold = function unfold(fn, seed) { }return result; }; -function _toConsumableArray$22(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$23(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var union = function union(a, b) { - return Array.from(new Set([].concat(_toConsumableArray$22(a), _toConsumableArray$22(b)))); + return Array.from(new Set([].concat(_toConsumableArray$23(a), _toConsumableArray$23(b)))); }; -function _toConsumableArray$23(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$24(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var unionBy = function unionBy(a, b, fn) { var s = new Set(a.map(function (v) { return fn(v); })); - return Array.from(new Set([].concat(_toConsumableArray$23(a), _toConsumableArray$23(b.filter(function (x) { + return Array.from(new Set([].concat(_toConsumableArray$24(a), _toConsumableArray$24(b.filter(function (x) { return !s.has(fn(x)); }))))); }; -function _toConsumableArray$24(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$25(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var unionWith = function unionWith(a, b, comp) { - return Array.from(new Set([].concat(_toConsumableArray$24(a), _toConsumableArray$24(b.filter(function (x) { + return Array.from(new Set([].concat(_toConsumableArray$25(a), _toConsumableArray$25(b.filter(function (x) { return a.findIndex(function (y) { return comp(x, y); }) === -1; }))))); }; -function _toConsumableArray$25(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$26(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var uniqueElements = function uniqueElements(arr) { - return [].concat(_toConsumableArray$25(new Set(arr))); + return [].concat(_toConsumableArray$26(new Set(arr))); }; var untildify = function untildify(str) { return str.replace(/^~($|\/|\\)/, (typeof require !== "undefined" && require('os').homedir()) + "$1"); }; -function _toConsumableArray$26(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var unzip = function unzip(arr) { - return arr.reduce(function (acc, val) { - return val.forEach(function (v, i) { - return acc[i].push(v); - }), acc; - }, Array.from({ - length: Math.max.apply(Math, _toConsumableArray$26(arr.map(function (x) { - return x.length; - }))) - }).map(function (x) { - return []; - })); -}; - function _toConsumableArray$27(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } -var unzipWith = function unzipWith(arr, fn) { +var unzip = function unzip(arr) { return arr.reduce(function (acc, val) { return val.forEach(function (v, i) { return acc[i].push(v); @@ -2303,8 +2381,24 @@ var unzipWith = function unzipWith(arr, fn) { }))) }).map(function (x) { return []; + })); +}; + +function _toConsumableArray$28(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var unzipWith = function unzipWith(arr, fn) { + return arr.reduce(function (acc, val) { + return val.forEach(function (v, i) { + return acc[i].push(v); + }), acc; + }, Array.from({ + length: Math.max.apply(Math, _toConsumableArray$28(arr.map(function (x) { + return x.length; + }))) + }).map(function (x) { + return []; })).map(function (val) { - return fn.apply(undefined, _toConsumableArray$27(val)); + return fn.apply(undefined, _toConsumableArray$28(val)); }); }; @@ -2341,14 +2435,14 @@ var yesNo = function yesNo(val) { ); }; -function _toConsumableArray$28(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$29(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var zip = function zip() { for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) { arrays[_key] = arguments[_key]; } - var maxLength = Math.max.apply(Math, _toConsumableArray$28(arrays.map(function (x) { + var maxLength = Math.max.apply(Math, _toConsumableArray$29(arrays.map(function (x) { return x.length; }))); return Array.from({ length: maxLength }).map(function (_, i) { @@ -2364,7 +2458,7 @@ var zipObject = function zipObject(props, values) { }, {}); }; -function _toConsumableArray$29(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray$30(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var zipWith = function zipWith() { for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) { @@ -2374,7 +2468,7 @@ var zipWith = function zipWith() { var length = arrays.length; var fn = length > 1 ? arrays[length - 1] : undefined; fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; - var maxLength = Math.max.apply(Math, _toConsumableArray$29(arrays.map(function (x) { + var maxLength = Math.max.apply(Math, _toConsumableArray$30(arrays.map(function (x) { return x.length; }))); var result = Array.from({ length: maxLength }).map(function (_, i) { @@ -2383,11 +2477,11 @@ var zipWith = function zipWith() { }); }); return fn ? result.map(function (arr) { - return fn.apply(undefined, _toConsumableArray$29(arr)); + return fn.apply(undefined, _toConsumableArray$30(arr)); }) : result; }; -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bind: bind, bindAll: bindAll, bindKey: bindKey, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith }; +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, all: all, allBy: allBy, anagrams: anagrams, any: any, anyBy: anyBy, approximatelyEqual: approximatelyEqual, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bifurcate: bifurcate, bifurcateBy: bifurcateBy, bind: bind, bindAll: bindAll, bindKey: bindKey, binomialCoefficient: binomialCoefficient, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, degreesToRads: degreesToRads, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, mostPerformant: mostPerformant, negate: negate, none: none, noneBy: noneBy, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, radsToDegrees: radsToDegrees, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, uncurry: uncurry, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith }; return imports; diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js index 6cc06c235..f671c25cc 100644 --- a/dist/_30s.es5.min.js +++ b/dist/_30s.es5.min.js @@ -1 +1 @@ -(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e._30s=t()})(this,function(){'use strict';function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^V.randomBytes(1)[0]&15>>e/4).toString(16)})},anagrams:function e(t){return 2>=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},arrayToHtmlList:function(e,t){return e.map(function(e){return document.querySelector('#'+t).innerHTML+='
  • '+e+'
  • '})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;l=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:U(e/8.64e7),hour:U(e/3.6e6)%24,minute:U(e/6e4)%60,second:U(e/1e3)%60,millisecond:U(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=ee(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':te(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sMath.abs(e))return e+(r?' ':'')+i[0];var l=P(U(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/W(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=U(D(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,x(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(L(e),L(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(I(e),I(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(w(e),w(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(T(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:F.apply(Math,B(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:F.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,R(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^$.randomBytes(1)[0]&15>>e/4).toString(16)})},all:function(e){return e.every(Boolean)},allBy:function(e,t){return e.every(t)},anagrams:function e(t){return 2>=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},any:function(e){return e.some(Boolean)},anyBy:function(e,t){return e.some(t)},approximatelyEqual:function(e,t){var n=2'})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;lt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:P(e/8.64e7),hour:P(e/3.6e6)%24,minute:P(e/6e4)%60,second:P(e/1e3)%60,millisecond:P(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=re(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':ie(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sG(e))return e+(r?' ':'')+i[0];var l=F(P(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/U(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=P(z(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,C(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return function(e){return function(t){return t.reduce(function(e,t){return e(t)},e)}}(e)(r.slice(0,t))}},unescapeHTML:function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(w(e),w(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(L(e),L(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(B(e),B(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(T(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,O(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,O(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1 (c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16) ); +const all = arr => arr.every(Boolean); + +const allBy = (arr, fn) => arr.every(fn); + const anagrams = str => { if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str]; return str @@ -36,6 +40,12 @@ const anagrams = str => { ); }; +const any = arr => arr.some(Boolean); + +const anyBy = (arr, fn) => arr.some(fn); + +const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon; + const arrayToHtmlList = (arr, listID) => arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); @@ -57,6 +67,12 @@ const averageBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0) / arr.length; +const bifurcate = (arr, filter) => + arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]); + +const bifurcateBy = (arr, fn) => + arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]); + const bind = (fn, context, ...args) => function() { return fn.apply(context, args.concat(...arguments)); @@ -75,6 +91,17 @@ const bindKey = (context, fn, ...args) => return context[fn].apply(context, args.concat(...arguments)); }; +const binomialCoefficient = (n, k) => { + if (Number.isNaN(n) || Number.isNaN(k)) return NaN; + if (k < 0 || k > n) return 0; + if (k === 0 || k === n) return 1; + if (k === 1 || k === n - 1) return n; + if (n - k < k) k = n - k; + let res = n; + for (let j = 2; j <= k; j++) res *= (n - j + 1) / j; + return Math.round(res); +}; + const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); @@ -217,6 +244,8 @@ const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj const defer = (fn, ...args) => setTimeout(fn, 1, ...args); +const degreesToRads = deg => deg * Math.PI / 180.0; + const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args); const detectDeviceType = () => @@ -752,8 +781,21 @@ const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : v const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); +const mostPerformant = (fns, iterations = 10000) => { + const times = fns.map(fn => { + const before = performance.now(); + for (let i = 0; i < iterations; i++) fn(); + return performance.now() - before; + }); + return times.indexOf(Math.min(...times)); +}; + const negate = func => (...args) => !func(...args); +const none = arr => !arr.some(Boolean); + +const noneBy = (arr, fn) => !arr.some(fn); + const nthArg = n => (...args) => args.slice(n)[0]; const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0]; @@ -952,6 +994,8 @@ const pullBy = (arr, ...args) => { pulled.forEach(v => arr.push(v)); }; +const radsToDegrees = rad => rad * 180.0 / Math.PI; + const randomHexColorCode = () => { let n = (Math.random() * 0xfffff * 1000000).toString(16); return '#' + n.slice(0, 6); @@ -1272,6 +1316,12 @@ const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pr const unary = fn => val => fn(val); +const uncurry = (fn, n = 1) => (...args) => { + const next = acc => args => args.reduce((x, y) => x(y), acc); + if (n > args.length) throw new RangeError('Arguments too few!'); + return next(fn)(args.slice(0, n)); +}; + const unescapeHTML = str => str.replace( /&|<|>|'|"/g, @@ -1373,6 +1423,6 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,attempt,average,averageBy,bind,bindAll,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index e18bc84a1..6237d7389 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -31,6 +31,10 @@ const UUIDGeneratorNode = () => (c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16) ); +const all = arr => arr.every(Boolean); + +const allBy = (arr, fn) => arr.every(fn); + const anagrams = str => { if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str]; return str @@ -42,6 +46,12 @@ const anagrams = str => { ); }; +const any = arr => arr.some(Boolean); + +const anyBy = (arr, fn) => arr.some(fn); + +const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon; + const arrayToHtmlList = (arr, listID) => arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); @@ -63,6 +73,12 @@ const averageBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0) / arr.length; +const bifurcate = (arr, filter) => + arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]); + +const bifurcateBy = (arr, fn) => + arr.reduce((acc, val, i) => (acc[fn(val, i) ? 0 : 1].push(val), acc), [[], []]); + const bind = (fn, context, ...args) => function() { return fn.apply(context, args.concat(...arguments)); @@ -81,6 +97,17 @@ const bindKey = (context, fn, ...args) => return context[fn].apply(context, args.concat(...arguments)); }; +const binomialCoefficient = (n, k) => { + if (Number.isNaN(n) || Number.isNaN(k)) return NaN; + if (k < 0 || k > n) return 0; + if (k === 0 || k === n) return 1; + if (k === 1 || k === n - 1) return n; + if (n - k < k) k = n - k; + let res = n; + for (let j = 2; j <= k; j++) res *= (n - j + 1) / j; + return Math.round(res); +}; + const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); @@ -223,6 +250,8 @@ const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj const defer = (fn, ...args) => setTimeout(fn, 1, ...args); +const degreesToRads = deg => deg * Math.PI / 180.0; + const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args); const detectDeviceType = () => @@ -758,8 +787,21 @@ const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : v const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); +const mostPerformant = (fns, iterations = 10000) => { + const times = fns.map(fn => { + const before = performance.now(); + for (let i = 0; i < iterations; i++) fn(); + return performance.now() - before; + }); + return times.indexOf(Math.min(...times)); +}; + const negate = func => (...args) => !func(...args); +const none = arr => !arr.some(Boolean); + +const noneBy = (arr, fn) => !arr.some(fn); + const nthArg = n => (...args) => args.slice(n)[0]; const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0]; @@ -958,6 +1000,8 @@ const pullBy = (arr, ...args) => { pulled.forEach(v => arr.push(v)); }; +const radsToDegrees = rad => rad * 180.0 / Math.PI; + const randomHexColorCode = () => { let n = (Math.random() * 0xfffff * 1000000).toString(16); return '#' + n.slice(0, 6); @@ -1278,6 +1322,12 @@ const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pr const unary = fn => val => fn(val); +const uncurry = (fn, n = 1) => (...args) => { + const next = acc => args => args.reduce((x, y) => x(y), acc); + if (n > args.length) throw new RangeError('Arguments too few!'); + return next(fn)(args.slice(0, n)); +}; + const unescapeHTML = str => str.replace( /&|<|>|'|"/g, @@ -1379,7 +1429,7 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,attempt,average,averageBy,bind,bindAll,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index 5004ecf1b..98745c13f 100644 --- a/dist/_30s.min.js +++ b/dist/_30s.min.js @@ -1 +1 @@ -(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.round,b=Math.sqrt,c=Math.log,d=Math.floor,e=Math.min,g=Math.max,h=Math.ceil;const i='undefined'!=typeof require&&require('fs'),j='undefined'!=typeof require&&require('crypto'),k=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(k(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),l=(a,b=a.length,...c)=>b<=c.length?a(...c):l.bind(null,a,b,...c),m=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?m(a[c]):a[c]),b},n=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?n(a):a)),o=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>p(c[a],d[a]))},q=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*q(a-1),r=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?r(a,b-1):a),[]),s=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,s(a[d],e+d)):c[e+d]=a[d],c},{}),t=(...a)=>{const c=(a,b)=>b?t(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},u='undefined'!=typeof require&&require('crypto'),v='undefined'!=typeof require&&require('fs'),w=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0i.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^j.randomBytes(1)[0]&15>>a/4).toString(16)),anagrams:k,arrayToHtmlList:(a,b)=>a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},bottomVisible:()=>document.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:l,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:m,deepFlatten:n,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:q,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:r,flattenObject:s,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:d(a/8.64e7),hour:d(a/3.6e6)%24,minute:d(a/6e4)%60,second:d(a/1e3)%60,millisecond:d(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:t,geometricProgression:(a,b=1,e=2)=>Array.from({length:d(c(a/b)/c(e))+1}).map((a,c)=>b*e**c),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(u.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(a)=>{const c=d(b(a));for(var e=2;e<=c;e++)if(0==a%e)return!1;return 2<=a},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=d(a.length/2),c=[...a].sort((c,a)=>c-a);return 0==a.length%2?(c[b-1]+c[b])/2:c[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),negate:(a)=>(...b)=>!a(...b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,c=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>Math.abs(a))return a+(c?' ':'')+g[0];const h=e(d(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(c?' ':'')+g[h]},primes:(a)=>{let c=Array.from({length:a-1}).map((a,b)=>b+2),e=d(b(a)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>c=c.filter((b)=>0!=b%a||b===a)),c},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,c=1)=>Array.from({length:c},()=>d(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>d(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>v.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(b,c=0)=>+`${a(`${b}e${c}`)}e-${c}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[d(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let c=a.length;c;){const b=d(Math.random()*c--);[a[c],a[b]]=[a[b],a[c]]}return a.slice(0,b)},scrollToTop:w,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const c=d(Math.random()*b--);[a[b],a[c]]=[a[c],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(a,c=!1)=>{const d=a.reduce((a,b)=>a+b,0)/a.length;return b(a.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(a.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(b)=>a(g(e(b,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); +(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.sqrt,b=Math.log,c=Math.floor,d=Math.PI,e=Math.min,g=Math.max,h=Math.ceil,i=Math.round,j=Math.abs;const k='undefined'!=typeof require&&require('fs'),l='undefined'!=typeof require&&require('crypto'),m=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(m(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),n=(a,b=a.length,...c)=>b<=c.length?a(...c):n.bind(null,a,b,...c),o=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?o(a[c]):a[c]),b},p=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?p(a):a)),q=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>r(c[a],d[a]))},s=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*s(a-1),t=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?t(a,b-1):a),[]),u=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,u(a[d],e+d)):c[e+d]=a[d],c},{}),v=(...a)=>{const c=(a,b)=>b?v(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},w='undefined'!=typeof require&&require('crypto'),x='undefined'!=typeof require&&require('fs'),y=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0k.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^l.randomBytes(1)[0]&15>>a/4).toString(16)),all:(a)=>a.every(Boolean),allBy:(a,b)=>a.every(b),anagrams:m,any:(a)=>a.some(Boolean),anyBy:(a,b)=>a.some(b),approximatelyEqual:(a,b,c=1e-3)=>j(a-b)a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bifurcate:(a,b)=>a.reduce((a,c,d)=>(a[b[d]?0:1].push(c),a),[[],[]]),bifurcateBy:(a,b)=>a.reduce((a,c,d)=>(a[b(c,d)?0:1].push(c),a),[[],[]]),bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},binomialCoefficient:(a,b)=>{var c=Number.isNaN;if(c(a)||c(b))return NaN;if(0>b||b>a)return 0;if(0===b||b===a)return 1;if(1===b||b===a-1)return a;a-bdocument.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:n,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:o,deepFlatten:p,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),degreesToRads:(a)=>a*d/180,delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:s,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:t,flattenObject:u,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:c(a/8.64e7),hour:c(a/3.6e6)%24,minute:c(a/6e4)%60,second:c(a/1e3)%60,millisecond:c(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:v,geometricProgression:(a,d=1,e=2)=>Array.from({length:c(b(a/d)/b(e))+1}).map((a,b)=>d*e**b),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(w.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(b)=>{const d=c(a(b));for(var e=2;e<=d;e++)if(0==b%e)return!1;return 2<=b},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=c(a.length/2),d=[...a].sort((c,a)=>c-a);return 0==a.length%2?(d[b-1]+d[b])/2:d[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),mostPerformant:(a,b=1e4)=>{const c=a.map((a)=>{const c=performance.now();for(let c=0;c(...b)=>!a(...b),none:(a)=>!a.some(Boolean),noneBy:(a,b)=>!a.some(b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,d=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>j(a))return a+(d?' ':'')+g[0];const h=e(c(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(d?' ':'')+g[h]},primes:(b)=>{let d=Array.from({length:b-1}).map((a,b)=>b+2),e=c(a(b)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>d=d.filter((b)=>0!=b%a||b===a)),d},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},radsToDegrees:(a)=>180*a/d,randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,d=1)=>Array.from({length:d},()=>c(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>c(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>x.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(a,b=0)=>+`${i(`${a}e${b}`)}e-${b}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[c(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let d=a.length;d;){const b=c(Math.random()*d--);[a[d],a[b]]=[a[b],a[d]]}return a.slice(0,b)},scrollToTop:y,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const d=c(Math.random()*b--);[a[b],a[d]]=[a[d],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(b,c=!1)=>{const d=b.reduce((a,b)=>a+b,0)/b.length;return a(b.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(b.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(a)=>i(g(e(a,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),uncurry:(a,b=1)=>(...c)=>{if(b>c.length)throw new RangeError('Arguments too few!');return((a)=>(b)=>b.reduce((a,b)=>a(b),a))(a)(c.slice(0,b))},unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); diff --git a/test/mostPerformant/mostPerformant.js b/test/mostPerformant/mostPerformant.js new file mode 100644 index 000000000..ae084a5cf --- /dev/null +++ b/test/mostPerformant/mostPerformant.js @@ -0,0 +1,9 @@ +const mostPerformant = (fns, iterations = 10000) => { +const times = fns.map(fn => { +const before = performance.now(); +for (let i = 0; i < iterations; i++) fn(); +return performance.now() - before; +}); +return times.indexOf(Math.min(...times)); +}; +module.exports = mostPerformant; \ No newline at end of file diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js new file mode 100644 index 000000000..ab09a13b0 --- /dev/null +++ b/test/mostPerformant/mostPerformant.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const mostPerformant = require('./mostPerformant.js'); + +test('Testing mostPerformant', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof mostPerformant === 'function', 'mostPerformant is a Function'); + //t.deepEqual(mostPerformant(args..), 'Expected'); + //t.equal(mostPerformant(args..), 'Expected'); + //t.false(mostPerformant(args..), 'Expected'); + //t.throws(mostPerformant(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 8b77ecac0..a7b7fc01e 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1906 +1,1899 @@ -Test log for: Wed Feb 14 2018 11:45:44 GMT+0200 (GTB Standard Time) -Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) +Test log for: Wed Feb 14 2018 20:22:28 GMT+0000 (UTC) -> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code +> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec - - Testing all - - √ all is a Function - √ Returns true for arrays with no falsey values - √ Returns false for arrays with 0 - √ Returns false for arrays with NaN - √ Returns false for arrays with undefined - √ Returns false for arrays with null - √ Returns false for arrays with empty strings - - Testing allBy - - √ allBy is a Function - √ Returns true with predicate function - √ Returns false with a predicate function - - Testing anagrams - - √ anagrams is a Function - √ Generates all anagrams of a string - √ Works for single-letter strings - √ Works for empty strings - - Testing any - - √ any is a Function - √ Returns true for arrays with at least one truthy value - √ Returns false for arrays with no truthy values - √ Returns false for arrays with no truthy values - - Testing anyBy - - √ anyBy is a Function - √ Returns true with predicate function - √ Returns false with a predicate function - - Testing anagrams - - √ anagrams is a Function - √ Generates all anagrams of a string - √ Works for single-letter strings - √ Works for empty strings - - Testing approximatelyEqual - - √ approximatelyEqual is a Function - √ Works for PI / 2 - √ Works for 0.1 + 0.2 === 0.3 - √ Works for exactly equal values - √ Works for a custom epsilon - - Testing arrayToHtmlList - - √ arrayToHtmlList is a Function - - Testing ary - - √ ary is a Function - √ Discards arguments with index >=n - - Testing atob - - √ atob is a Function - √ atob("Zm9vYmFy") equals "foobar" - √ atob("Z") returns "" - - Testing attempt - - √ attempt is a Function - √ Returns a value - √ Returns an error - - Testing average - - √ average is a Function - √ average(true) returns 0 - √ average(false) returns 1 - √ average(9, 1) returns 5 - √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - √ average(1, 2, 3) returns 2 - √ average(null) returns 0 - √ average(1, 2, 3) returns NaN - √ average(String) returns NaN - √ average({ a: 123}) returns NaN - √ average([undefined, 0, string]) returns NaN - √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing averageBy - - √ averageBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing bifurcate - - √ bifurcate is a Function - √ Splits the collection into two groups - - Testing bifurcateBy - - √ bifurcateBy is a Function - √ Splits the collection into two groups - - Testing binarySearch - - √ binarySearch is a Function - √ Finds item in array - √ Returns -1 when not found - √ Works with empty arrays - √ Works for one element arrays - - Testing bind - - √ bind is a Function - √ Binds to an object context - - Testing bindAll - - √ bindAll is a Function - √ Binds to an object context - - Testing bindKey - - √ bindKey is a Function - √ Binds function to an object context - - Testing binomialCoefficient - - √ binomialCoefficient is a Function - √ Returns the appropriate value - √ Returns the appropriate value - √ Returns the appropriate value - √ Returns NaN - √ Returns NaN - - Testing bottomVisible - - √ bottomVisible is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing btoa - - √ btoa is a Function - √ btoa("foobar") equals "Zm9vYmFy" - - Testing byteSize - - √ byteSize is a Function - √ Works for a single letter - √ Works for a common string - √ Works for emoji - - Testing call - - √ call is a Function - √ Calls function on given object - - Testing capitalize - - √ capitalize is a Function - √ Capitalizes the first letter of a string - √ Capitalizes the first letter of a string - √ Works with characters - √ Works with single character words - - Testing capitalizeEveryWord - - √ capitalizeEveryWord is a Function - √ Capitalizes the first letter of every word in a string - √ Works with characters - √ Works with one word string - - Testing castArray - - √ castArray is a Function - √ Works for single values - √ Works for arrays with one value - √ Works for arrays with multiple value - √ Works for strings - √ Works for objects - - Testing chainAsync - - √ chainAsync is a Function - - Testing chunk - - √ chunk is a Function - √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - √ chunk([]) returns [] - √ chunk(123) returns [] - √ chunk({ a: 123}) returns [] - √ chunk(string, 2) returns [ st, ri, ng ] - √ chunk() throws an error - √ chunk(undefined) throws an error - √ chunk(null) throws an error - √ chunk(This is a string, 2) takes less than 2s to run - - Testing clampNumber - - √ clampNumber is a Function - √ Clamps num within the inclusive range specified by the boundary values a and b - - Testing cleanObj - - √ cleanObj is a Function - √ Removes any properties except the ones specified from a JSON object - - Testing cloneRegExp - - √ cloneRegExp is a Function - √ Clones regular expressions properly - - Testing coalesce - - √ coalesce is a Function - √ Returns the first non-null/undefined argument - - Testing coalesceFactory - - √ coalesceFactory is a Function - √ Returns a customized coalesce function - - Testing collatz - - √ collatz is a Function - √ When n is even, divide by 2 - √ When n is odd, times by 3 and add 1 - √ Eventually reaches 1 - - Testing collectInto - - √ collectInto is a Function - - Testing colorize - - √ colorize is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing compact - - √ compact is a Function - √ Removes falsey values from an array - - Testing compose - - √ compose is a Function - √ Performs right-to-left function composition - - Testing composeRight - - √ composeRight is a Function - √ Performs left-to-right function composition - - Testing converge - - √ converge is a Function - √ Produces the average of the array - √ Produces the strange concatenation - - Testing copyToClipboard - - √ copyToClipboard is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing countBy - - √ countBy is a Function - √ Works for functions - √ Works for property names - - Testing countOccurrences - - √ countOccurrences is a Function - √ Counts the occurrences of a value in an array - - Testing countVowels - - √ countVowels is a Function - - Testing createElement - - √ createElement is a Function - - Testing createEventHub - - √ createEventHub is a Function - - Testing currentURL - - √ currentURL is a Function - - Testing curry - - √ curry is a Function - √ curries a Math.pow - √ curries a Math.min - - Testing debounce - - √ debounce is a Function - - Testing decapitalize - - √ decapitalize is a Function - √ Works with default parameter - √ Works with second parameter set to true - - Testing deepClone - - √ deepClone is a Function - √ Shallow cloning works - √ Deep cloning works - - Testing deepFlatten - - √ deepFlatten is a Function - √ Deep flattens an array - - Testing defaults - - √ defaults is a Function - - Testing defer - - √ defer is a Function - - Testing degreesToRads - - √ degreesToRads is a Function - √ Returns the appropriate value - - Testing delay - - √ delay is a Function - - Testing detectDeviceType - - √ detectDeviceType is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing difference - - √ difference is a Function - √ Returns the difference between two arrays - - Testing differenceBy - - √ differenceBy is a Function - √ Works using a native function and numbers - √ Works with arrow function and objects - - Testing differenceWith - - √ differenceWith is a Function - √ Filters out all values from an array - - Testing digitize - - √ digitize is a Function - √ Converts a number to an array of digits - - Testing distance - - √ distance is a Function - √ Calculates the distance between two points - - Testing drop - - √ drop is a Function - √ Works without the last argument - √ Removes appropriate element count as specified - √ Empties array given a count greater than length - - Testing dropRight - - √ dropRight is a Function - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - - Testing dropRightWhile - - √ dropRightWhile is a Function - √ Removes elements from the end of an array until the passed function returns true. - - Testing dropWhile - - √ dropWhile is a Function - √ Removes elements in an array until the passed function returns true. - - Testing elementIsVisibleInViewport - - √ elementIsVisibleInViewport is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing elo - - √ elo is a Function - √ Standard 1v1s - √ should be equivalent - √ 4 player FFA, all same rank - - Testing equals - - √ equals is a Function - √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - √ [1,2,3] is equal to [1,2,3] - √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - √ [1,2,3] is not equal to [1,2,4] - √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. - - Testing escapeHTML - - √ escapeHTML is a Function - √ Escapes a string for use in HTML - - Testing escapeRegExp - - √ escapeRegExp is a Function - √ Escapes a string to use in a regular expression - - Testing everyNth - - √ everyNth is a Function - √ Returns every nth element in an array - - Testing extendHex - - √ extendHex is a Function - √ Extends a 3-digit color code to a 6-digit color code - √ Extends a 3-digit color code to a 6-digit color code - - Testing factorial - - √ factorial is a Function - √ Calculates the factorial of 720 - √ Calculates the factorial of 0 - √ Calculates the factorial of 1 - √ Calculates the factorial of 4 - √ Calculates the factorial of 10 - - Testing factors - - √ factors is a Function - - Testing fibonacci - - √ fibonacci is a Function - √ Generates an array, containing the Fibonacci sequence - - Testing fibonacciCountUntilNum - - √ fibonacciCountUntilNum is a Function - - Testing fibonacciUntilNum - - √ fibonacciUntilNum is a Function - - Testing filterNonUnique - - √ filterNonUnique is a Function - √ Filters out the non-unique values in an array - - Testing findKey - - √ findKey is a Function - √ Returns the appropriate key - - Testing findLast - - √ findLast is a Function - √ Finds last element for which the given function returns true - - Testing findLastIndex - - √ findLastIndex is a Function - √ Finds last index for which the given function returns true - - Testing findLastKey - - √ findLastKey is a Function - √ Returns the appropriate key - - Testing flatten - - √ flatten is a Function - √ Flattens an array - √ Flattens an array - - Testing flattenObject - - √ flattenObject is a Function - √ Flattens an object with the paths for keys - √ Works with arrays - - Testing flip - - √ flip is a Function - √ Flips argument order - - Testing forEachRight - - √ forEachRight is a Function - √ Iterates over the array in reverse - - Testing formatDuration - - √ formatDuration is a Function - √ Returns the human readable format of the given number of milliseconds - √ Returns the human readable format of the given number of milliseconds - - Testing forOwn - - √ forOwn is a Function - √ Iterates over an element's key-value pairs - - Testing forOwnRight - - √ forOwnRight is a Function - √ Iterates over an element's key-value pairs in reverse - - Testing fromCamelCase - - √ fromCamelCase is a Function - √ Converts a string from camelcase - √ Converts a string from camelcase - √ Converts a string from camelcase - - Testing functionName - - √ functionName is a Function - √ Works for native functions - √ Works for functions - √ Works for arrow functions - - Testing functions - - √ functions is a Function - √ Returns own methods - √ Returns own and inherited methods - - Testing gcd - - √ gcd is a Function - √ Calculates the greatest common divisor between two or more numbers/arrays - √ Calculates the greatest common divisor between two or more numbers/arrays - - Testing geometricProgression - - √ geometricProgression is a Function - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - - Testing get - - √ get is a Function - √ Retrieve a property indicated by the selector from an object. - - Testing getColonTimeFromDate - - √ getColonTimeFromDate is a Function - - Testing getDaysDiffBetweenDates - - √ getDaysDiffBetweenDates is a Function - √ Returns the difference in days between two dates - - Testing getMeridiemSuffixOfInteger - - √ getMeridiemSuffixOfInteger is a Function - - Testing getScrollPosition - - √ getScrollPosition is a Function - - Testing getStyle - - √ getStyle is a Function - - Testing getType - - √ getType is a Function - √ Returns the native type of a value - - Testing getURLParameters - - √ getURLParameters is a Function - √ Returns an object containing the parameters of the current URL - - Testing groupBy - - √ groupBy is a Function - √ Groups the elements of an array based on the given function - √ Groups the elements of an array based on the given function - - Testing hammingDistance - - √ hammingDistance is a Function - √ retuns hamming disance between 2 values - - Testing hasClass - - √ hasClass is a Function - - Testing hasFlags - - √ hasFlags is a Function - - Testing hashBrowser - - √ hashBrowser is a Function - - Testing hashNode - - √ hashNode is a Function - - Testing head - - √ head is a Function - √ head({ a: 1234}) returns undefined - √ head([1, 2, 3]) returns 1 - √ head({ 0: false}) returns false - √ head(String) returns S - √ head(null) throws an Error - √ head(undefined) throws an Error - √ head() throws an Error - √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing hexToRGB - - √ hexToRGB is a Function - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - - Testing hide - - √ hide is a Function - - Testing howManyTimes - - √ howManyTimes is a Function - - Testing httpDelete - - √ httpDelete is a Function - - Testing httpGet - - √ httpGet is a Function - - Testing httpPost - - √ httpPost is a Function - - Testing httpPut - - √ httpPut is a Function - - Testing httpsRedirect - - √ httpsRedirect is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing indexOfAll - - √ indexOfAll is a Function - √ Returns all indices of val in an array - √ Returns all indices of val in an array - - Testing initial - - √ initial is a Function - √ Returns all the elements of an array except the last one - - Testing initialize2DArray - - √ initialize2DArray is a Function - √ Initializes a 2D array of given width and height and value - - Testing initializeArrayWithRange - - √ initializeArrayWithRange is a Function - √ Initializes an array containing the numbers in the specified range - - Testing initializeArrayWithRangeRight - - √ initializeArrayWithRangeRight is a Function - - Testing initializeArrayWithValues - - √ initializeArrayWithValues is a Function - √ Initializes and fills an array with the specified values - - Testing inRange - - √ inRange is a Function - √ The given number falls within the given range - √ The given number falls within the given range - √ The given number does not falls within the given range - √ The given number does not falls within the given range - - Testing intersection - - √ intersection is a Function - √ Returns a list of elements that exist in both arrays - - Testing intersectionBy - - √ intersectionBy is a Function - √ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both - - Testing intersectionWith - - √ intersectionWith is a Function - √ Returns a list of elements that exist in both arrays, using a provided comparator function - - Testing invertKeyValues - - √ invertKeyValues is a Function - √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } - - Testing is - - √ is is a Function - √ Works for arrays with data - √ Works for empty arrays - √ Works for arrays, not objects - √ Works for objects - √ Works for maps - √ Works for regular expressions - √ Works for sets - √ Works for weak maps - √ Works for weak sets - √ Works for strings - returns false for primitive - √ Works for strings - returns true when using constructor - √ Works for numbers - returns false for primitive - √ Works for numbers - returns true when using constructor - √ Works for booleans - returns false for primitive - √ Works for booleans - returns true when using constructor - √ Works for functions - - Testing isAbsoluteURL - - √ isAbsoluteURL is a Function - √ Given string is an absolute URL - √ Given string is an absolute URL - √ Given string is not an absolute URL - - Testing isArmstrongNumber - - √ isArmstrongNumber is a Function - - Testing isArray - - √ isArray is a Function - √ passed value is an array - √ passed value is not an array - - Testing isArrayBuffer - - √ isArrayBuffer is a Function - - Testing isArrayLike - - √ isArrayLike is a Function - √ Returns true for a string - √ Returns true for an array - √ Returns false for null - - Testing isBoolean - - √ isBoolean is a Function - √ passed value is not a boolean - √ passed value is not a boolean - - Testing isDivisible - - √ isDivisible is a Function - √ The number 6 is divisible by 3 - - Testing isEmpty - - √ isEmpty is a Function - √ Returns true for empty Map - √ Returns true for empty Set - √ Returns true for empty array - √ Returns true for empty object - √ Returns true for empty string - √ Returns false for non-empty array - √ Returns false for non-empty object - √ Returns false for non-empty string - √ Returns true - type is not considered a collection - √ Returns true - type is not considered a collection - - Testing isEven - - √ isEven is a Function - √ 4 is even number - √ undefined - - Testing isFunction - - √ isFunction is a Function - √ passed value is a function - √ passed value is not a function - - Testing isLowerCase - - √ isLowerCase is a Function - √ passed string is a lowercase - √ passed string is a lowercase - √ passed value is not a lowercase - - Testing isMap - - √ isMap is a Function - - Testing isNil - - √ isNil is a Function - √ Returns true for null - √ Returns true for undefined - √ Returns false for an empty string - - Testing isNull - - √ isNull is a Function - √ passed argument is a null - √ passed argument is a null - - Testing isNumber - - √ isNumber is a Function - √ passed argument is a number - √ passed argument is not a number - - Testing isObject - - √ isObject is a Function - √ isObject([1, 2, 3, 4]) is a object - √ isObject([]) is a object - √ isObject({ a:1 }) is a object - √ isObject(true) is not a object - - Testing isObjectLike - - √ isObjectLike is a Function - √ Returns true for an object - √ Returns true for an array - √ Returns false for a function - √ Returns false for null - - Testing isPlainObject - - √ isPlainObject is a Function - √ Returns true for a plain object - √ Returns false for a Map (example of non-plain object) - - Testing isPrime - - √ isPrime is a Function - √ passed number is a prime - - Testing isPrimitive - - √ isPrimitive is a Function - √ isPrimitive(null) is primitive - √ isPrimitive(undefined) is primitive - √ isPrimitive(string) is primitive - √ isPrimitive(true) is primitive - √ isPrimitive(50) is primitive - √ isPrimitive('Hello') is primitive - √ isPrimitive(false) is primitive - √ isPrimitive(Symbol()) is primitive - √ isPrimitive([1, 2, 3]) is not primitive - √ isPrimitive({ a: 123 }) is not primitive - √ isPrimitive({ a: 123 }) takes less than 2s to run - - Testing isPromiseLike - - √ isPromiseLike is a Function - √ Returns true for a promise-like object - √ Returns false for null - √ Returns false for an empty object - - Testing isRegExp - - √ isRegExp is a Function - - Testing isSet - - √ isSet is a Function - - Testing isSorted - - √ isSorted is a Function - √ Array is sorted in ascending order - √ Array is sorted in descending order - √ Array is not sorted, direction changed in array - - Testing isString - - √ isString is a Function - √ foo is a string - √ "10" is a string - √ Empty string is a string - √ 10 is not a string - √ true is not string - - Testing isSymbol - - √ isSymbol is a Function - √ Checks if the given argument is a symbol - - Testing isTravisCI - - √ isTravisCI is a Function - √ Not running on Travis, correctly evaluates - - Testing isTypedArray - - √ isTypedArray is a Function - - Testing isUndefined - - √ isUndefined is a Function - √ Returns true for undefined - - Testing isUpperCase - - √ isUpperCase is a Function - √ ABC is all upper case - √ abc is not all upper case - √ A3@$ is all uppercase - - Testing isValidJSON - - √ isValidJSON is a Function - √ {"name":"Adam","age":20} is a valid JSON - √ {"name":"Adam",age:"20"} is not a valid JSON - √ null is a valid JSON - - Testing isWeakMap - - √ isWeakMap is a Function - - Testing isWeakSet - - √ isWeakSet is a Function - - Testing join - - √ join is a Function - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - Testing JSONToDate - √ JSONToDate is a Function + ✔ JSONToDate is a Function Testing JSONToFile - √ JSONToFile is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing last - - √ last is a Function - √ last({ a: 1234}) returns undefined - √ last([1, 2, 3]) returns 3 - √ last({ 0: false}) returns undefined - √ last(String) returns g - √ last(null) throws an Error - √ last(undefined) throws an Error - √ last() throws an Error - √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing lcm - - √ lcm is a Function - √ Returns the least common multiple of two or more numbers. - √ Returns the least common multiple of two or more numbers. - - Testing longestItem - - √ longestItem is a Function - √ Returns the longest object - - Testing lowercaseKeys - - √ lowercaseKeys is a Function - √ Lowercases object keys - √ Does not mutate original object - - Testing luhnCheck - - √ luhnCheck is a Function - √ validates identification number - √ validates identification number - √ validates identification number - - Testing mapKeys - - √ mapKeys is a Function - √ Maps keys - - Testing mapObject - - √ mapObject is a Function - √ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - √ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } - √ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } - - Testing mapValues - - √ mapValues is a Function - √ Maps values - - Testing mask - - √ mask is a Function - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - - Testing matches - - √ matches is a Function - √ Matches returns true for two similar objects - √ Matches returns false for two non-similar objects - - Testing matchesWith - - √ matchesWith is a Function - √ Returns true for two objects with similar values, based on the provided function - - Testing maxBy - - √ maxBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing maxN - - √ maxN is a Function - √ Returns the n maximum elements from the provided array - √ Returns the n maximum elements from the provided array - - Testing median - - √ median is a Function - √ Returns the median of an array of numbers - √ Returns the median of an array of numbers - - Testing memoize - - √ memoize is a Function - √ Function works properly - √ Function works properly - √ Cache stores values - - Testing merge - - √ merge is a Function - √ Merges two objects - - Testing minBy - - √ minBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing minN - - √ minN is a Function - √ Returns the n minimum elements from the provided array - √ Returns the n minimum elements from the provided array - - Testing negate - - √ negate is a Function - √ Negates a predicate function - - Testing none - - √ none is a Function - √ Returns true for arrays with no truthy values - √ Returns false for arrays with at least one truthy value - - Testing noneBy - - √ noneBy is a Function - √ Returns true with a predicate function - √ Returns false with predicate function - - Testing nthArg - - √ nthArg is a Function - √ Returns the nth argument - √ Returns undefined if arguments too few - √ Works for negative values - - Testing nthElement - - √ nthElement is a Function - √ Returns the nth element of an array. - √ Returns the nth element of an array. - - Testing objectFromPairs - - √ objectFromPairs is a Function - √ Creates an object from the given key-value pairs. - - Testing objectToPairs - - √ objectToPairs is a Function - √ Creates an array of key-value pair arrays from an object. - - Testing observeMutations - - √ observeMutations is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing off - - √ off is a Function - - Testing omit - - √ omit is a Function - √ Omits the key-value pairs corresponding to the given keys from an object - - Testing omitBy - - √ omitBy is a Function - √ Creates an object composed of the properties the given function returns falsey for - - Testing on - - √ on is a Function - - Testing once - - √ once is a Function - - Testing onUserInputChange - - √ onUserInputChange is a Function - - Testing orderBy - - √ orderBy is a Function - √ Returns a sorted array of objects ordered by properties and orders. - √ Returns a sorted array of objects ordered by properties and orders. - - Testing over - - √ over is a Function - √ Applies given functions over multiple arguments - - Testing overArgs - - √ overArgs is a Function - √ Invokes the provided function with its arguments transformed - - Testing palindrome - - √ palindrome is a Function - √ Given string is a palindrome - √ Given string is not a palindrome - - Testing parseCookie - - √ parseCookie is a Function - √ Parses the cookie - - Testing partial - - √ partial is a Function - √ Prepends arguments - - Testing partialRight - - √ partialRight is a Function - √ Appends arguments - - Testing partition - - √ partition is a Function - √ Groups the elements into two arrays, depending on the provided function's truthiness for each element. - - Testing percentile - - √ percentile is a Function - √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. - - Testing pick - - √ pick is a Function - √ Picks the key-value pairs corresponding to the given keys from an object. - - Testing pickBy - - √ pickBy is a Function - √ Creates an object composed of the properties the given function returns truthy for. - - Testing pipeAsyncFunctions - - √ pipeAsyncFunctions is a Function - √ Produces the appropriate hash - √ pipeAsyncFunctions result should be 15 - - Testing pipeFunctions - - √ pipeFunctions is a Function - √ Performs left-to-right function composition - - Testing pluralize - - √ pluralize is a Function - √ Produces the plural of the word - √ Produces the singular of the word - √ Produces the plural of the word - √ Prodices the defined plural of the word - √ Works with a dictionary - - Testing powerset - - √ powerset is a Function - √ Returns the powerset of a given array of numbers. - - Testing prettyBytes - - √ prettyBytes is a Function - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - - Testing primes - - √ primes is a Function - √ Generates primes up to a given number, using the Sieve of Eratosthenes. - - Testing promisify - - √ promisify is a Function - √ Returns a promise - - Testing pull - - √ pull is a Function - √ Pulls the specified values - - Testing pullAtIndex - - √ pullAtIndex is a Function - √ Pulls the given values - √ Pulls the given values - - Testing pullAtValue - - √ pullAtValue is a Function - √ Pulls the specified values - √ Pulls the specified values - - Testing pullBy - - √ pullBy is a Function - √ Pulls the specified values - - Testing quickSort - - √ quickSort is a Function - √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - √ quickSort([-1, 0, -2]) returns [-2, -1, 0] - √ quickSort() throws an error - √ quickSort(123) throws an error - √ quickSort({ 234: string}) throws an error - √ quickSort(null) throws an error - √ quickSort(undefined) throws an error - √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run - - Testing radsToDegrees - - √ radsToDegrees is a Function - √ Returns the appropriate value - - Testing randomHexColorCode - - √ randomHexColorCode is a Function - √ should be equal - - Testing randomIntArrayInRange - - √ randomIntArrayInRange is a Function - √ The returned array contains only integers - √ The returned array has the proper length - √ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). - - Testing randomIntegerInRange - - √ randomIntegerInRange is a Function - √ The returned value is an integer - √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing randomNumberInRange - - √ randomNumberInRange is a Function - √ The returned value is a number - √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing readFileLines - - √ readFileLines is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing rearg - - √ rearg is a Function - √ Reorders arguments in invoked function - - Testing redirect - - √ redirect is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing reducedFilter - - √ reducedFilter is a Function - √ Filter an array of objects based on a condition while also filtering out unspecified keys. - - Testing reduceSuccessive - - √ reduceSuccessive is a Function - √ Returns the array of successively reduced values - - Testing reduceWhich - - √ reduceWhich is a Function - √ Returns the minimum of an array - √ Returns the maximum of an array - √ Returns the object with the minimum specified value in an array - - Testing remove - - √ remove is a Function - √ Removes elements from an array for which the given function returns false - - Testing removeNonASCII - - √ removeNonASCII is a Function - √ Removes non-ASCII characters - - Testing removeVowels - - √ removeVowels is a Function - - Testing reverseString - - √ reverseString is a Function - √ Reverses a string. + ✔ JSONToFile is a Function + ✔ Tested on 09/02/2018 by @chalarangelo Testing RGBToHex - √ RGBToHex is a Function - √ Converts the values of RGB components to a color code. - - Testing round - - √ round is a Function - √ round(1.005, 2) returns 1.01 - √ round(123.3423345345345345344, 11) returns 123.34233453453 - √ round(3.342, 11) returns 3.342 - √ round(1.005) returns 1 - √ round([1.005, 2]) returns NaN - √ round(string) returns NaN - √ round() returns NaN - √ round(132, 413, 4134) returns NaN - √ round({a: 132}, 413) returns NaN - √ round(123.3423345345345345344, 11) takes less than 2s to run - - Testing runAsync - - √ runAsync is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing runPromisesInSeries - - √ runPromisesInSeries is a Function - - Testing sample - - √ sample is a Function - √ Returns a random element from the array - √ Works for single-element arrays - √ Returns undefined for empty array - - Testing sampleSize - - √ sampleSize is a Function - √ Returns a single element without n specified - √ Returns a random sample of specified size from an array - √ Returns all elements in an array if n >= length - √ Returns an empty array if original array is empty - √ Returns an empty array if n = 0 - - Testing scrollToTop - - √ scrollToTop is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing sdbm - - √ sdbm is a Function - √ Hashes the input string into a whole number. - - Testing serializeCookie - - √ serializeCookie is a Function - √ Serializes the cookie - - Testing setStyle - - √ setStyle is a Function - - Testing shallowClone - - √ shallowClone is a Function - √ Shallow cloning works - √ Does not clone deeply - - Testing show - - √ show is a Function - - Testing shuffle - - √ shuffle is a Function - √ Shuffles the array - √ New array contains all original elements - √ Works for empty arrays - √ Works for single-element arrays - - Testing similarity - - √ similarity is a Function - √ Returns an array of elements that appear in both arrays. - - Testing size - - √ size is a Function - √ Get size of arrays, objects or strings. - √ Get size of arrays, objects or strings. - - Testing sleep - - √ sleep is a Function - - Testing solveRPN - - √ solveRPN is a Function - - Testing sortCharactersInString - - √ sortCharactersInString is a Function - √ Alphabetically sorts the characters in a string. - - Testing sortedIndex - - √ sortedIndex is a Function - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - - Testing sortedIndexBy - - √ sortedIndexBy is a Function - √ Returns the lowest index to insert the element without messing up the list order - - Testing sortedLastIndex - - √ sortedLastIndex is a Function - √ Returns the highest index to insert the element without messing up the list order - - Testing sortedLastIndexBy - - √ sortedLastIndexBy is a Function - √ Returns the highest index to insert the element without messing up the list order - - Testing speechSynthesis - - √ speechSynthesis is a Function - - Testing splitLines - - √ splitLines is a Function - √ Splits a multiline string into an array of lines. - - Testing spreadOver - - √ spreadOver is a Function - √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. - - Testing standardDeviation - - √ standardDeviation is a Function - √ Returns the standard deviation of an array of numbers - √ Returns the standard deviation of an array of numbers - - Testing stripHTMLTags - - √ stripHTMLTags is a Function - √ Removes HTML tags - - Testing sum - - √ sum is a Function - √ Returns the sum of two or more numbers/arrays. - - Testing sumBy - - √ sumBy is a Function - - Testing sumPower - - √ sumPower is a Function - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - - Testing symmetricDifference - - √ symmetricDifference is a Function - √ Returns the symmetric difference between two arrays. - - Testing symmetricDifferenceBy - - √ symmetricDifferenceBy is a Function - √ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both - - Testing symmetricDifferenceWith - - √ symmetricDifferenceWith is a Function - √ Returns the symmetric difference between two arrays, using a provided function as a comparator - - Testing tail - - √ tail is a Function - √ Returns tail - √ Returns tail - - Testing take - - √ take is a Function - √ Returns an array with n elements removed from the beginning. - √ Returns an array with n elements removed from the beginning. - - Testing takeRight - - √ takeRight is a Function - √ Returns an array with n elements removed from the end - √ Returns an array with n elements removed from the end - - Testing takeRightWhile - - √ takeRightWhile is a Function - √ Removes elements until the function returns true - - Testing takeWhile - - √ takeWhile is a Function - √ Removes elements until the function returns true - - Testing throttle - - √ throttle is a Function - - Testing times - - √ times is a Function - √ Runs a function the specified amount of times - - Testing timeTaken - - √ timeTaken is a Function - - Testing toCamelCase - - √ toCamelCase is a Function - √ toCamelCase('some_database_field_name') returns someDatabaseFieldName - √ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - √ toCamelCase('some-javascript-property') return someJavascriptProperty - √ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - √ toCamelCase() throws a error - √ toCamelCase([]) throws a error - √ toCamelCase({}) throws a error - √ toCamelCase(123) throws a error - √ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run - - Testing toCurrency - - √ toCurrency is a Function - √ currency: Euro | currencyLangFormat: Local - √ currency: US Dollar | currencyLangFormat: English (United States) - √ currency: Japanese Yen | currencyLangFormat: Local - - Testing toDecimalMark - - √ toDecimalMark is a Function - √ convert a float-point arithmetic to the Decimal mark form - - Testing toggleClass - - √ toggleClass is a Function - - Testing toKebabCase - - √ toKebabCase is a Function - √ toKebabCase('camelCase') returns camel-case - √ toKebabCase('some text') returns some-text - √ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - √ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - √ toKebabCase() return undefined - √ toKebabCase([]) throws an error - √ toKebabCase({}) throws an error - √ toKebabCase(123) throws an error - √ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing tomorrow - - √ tomorrow is a Function - √ Returns the correct year - √ Returns the correct month - √ Returns the correct date - - Testing toOrdinalSuffix - - √ toOrdinalSuffix is a Function - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - - Testing toSafeInteger - - √ toSafeInteger is a Function - √ Number(toSafeInteger(3.2)) is a number - √ Converts a value to a safe integer - √ toSafeInteger('4.2') returns 4 - √ toSafeInteger(4.6) returns 5 - √ toSafeInteger([]) returns 0 - √ isNaN(toSafeInteger([1.5, 3124])) is true - √ isNaN(toSafeInteger('string')) is true - √ isNaN(toSafeInteger({})) is true - √ isNaN(toSafeInteger()) is true - √ toSafeInteger(Infinity) returns 9007199254740991 - √ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - √ toSnakeCase is a Function - √ toSnakeCase('camelCase') returns camel_case - √ toSnakeCase('some text') returns some_text - √ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - √ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - √ toSnakeCase() returns undefined - √ toSnakeCase([]) throws an error - √ toSnakeCase({}) throws an error - √ toSnakeCase(123) throws an error - √ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing transform - - √ transform is a Function - √ Transforms an object - - Testing truncateString - - √ truncateString is a Function - √ Truncates a "boomerang" up to a specified length. - - Testing truthCheckCollection - - √ truthCheckCollection is a Function - √ second argument is truthy on all elements of a collection - - Testing unary - - √ unary is a Function - √ Discards arguments after the first one - - Testing uncurry - - √ uncurry is a Function - √ Works without a provided value for n - √ Works without n = 2 - √ Works withoutn = 3 - - Testing unescapeHTML - - √ unescapeHTML is a Function - √ Unescapes escaped HTML characters. - - Testing unflattenObject - - √ unflattenObject is a Function - √ Unflattens an object with the paths for keys - - Testing unfold - - √ unfold is a Function - √ Works with a given function, producing an array - - Testing union - - √ union is a Function - √ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - √ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - √ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - √ union([], []) returns [] - √ union() throws an error - √ union(true, str) throws an error - √ union(false, true) throws an error - √ union(123, {}) throws an error - √ union([], {}) throws an error - √ union(undefined, null) throws an error - √ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run - - Testing unionBy - - √ unionBy is a Function - √ Produces the appropriate results - - Testing unionWith - - √ unionWith is a Function - √ Produces the appropriate results - - Testing uniqueElements - - √ uniqueElements is a Function - √ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - √ uniqueElements([1, 23, 53]) returns [1, 23, 53] - √ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - √ uniqueElements() returns [] - √ uniqueElements(null) returns [] - √ uniqueElements(undefined) returns [] - √ uniqueElements('strt') returns ['s', 't', 'r'] - √ uniqueElements(1, 1, 2543, 534, 5) throws an error - √ uniqueElements({}) throws an error - √ uniqueElements(true) throws an error - √ uniqueElements(false) throws an error - √ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run - - Testing untildify - - √ untildify is a Function - √ Contains no tildes - √ Does not alter the rest of the path - √ Does not alter paths without tildes - - Testing unzip - - √ unzip is a Function - √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] - - Testing unzipWith - - √ unzipWith is a Function - √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + ✔ RGBToHex is a Function + ✔ Converts the values of RGB components to a color code. Testing URLJoin - √ URLJoin is a Function - √ Returns proper URL - √ Returns proper URL + ✔ URLJoin is a Function + ✔ Returns proper URL + ✔ Returns proper URL Testing UUIDGeneratorBrowser - √ UUIDGeneratorBrowser is a Function - √ Tested 09/02/2018 by @chalarangelo + ✔ UUIDGeneratorBrowser is a Function + ✔ Tested 09/02/2018 by @chalarangelo Testing UUIDGeneratorNode - √ UUIDGeneratorNode is a Function - √ Contains dashes in the proper places - √ Only contains hexadecimal digits + ✔ UUIDGeneratorNode is a Function + ✔ Contains dashes in the proper places + ✔ Only contains hexadecimal digits + + Testing all + + ✔ all is a Function + ✔ Returns true for arrays with no falsey values + ✔ Returns false for arrays with 0 + ✔ Returns false for arrays with NaN + ✔ Returns false for arrays with undefined + ✔ Returns false for arrays with null + ✔ Returns false for arrays with empty strings + + Testing allBy + + ✔ allBy is a Function + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing anagrams + + ✔ anagrams is a Function + ✔ Generates all anagrams of a string + ✔ Works for single-letter strings + ✔ Works for empty strings + + Testing any + + ✔ any is a Function + ✔ Returns true for arrays with at least one truthy value + ✔ Returns false for arrays with no truthy values + ✔ Returns false for arrays with no truthy values + + Testing anyBy + + ✔ anyBy is a Function + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing approximatelyEqual + + ✔ approximatelyEqual is a Function + ✔ Works for PI / 2 + ✔ Works for 0.1 + 0.2 === 0.3 + ✔ Works for exactly equal values + ✔ Works for a custom epsilon + + Testing arrayToHtmlList + + ✔ arrayToHtmlList is a Function + + Testing ary + + ✔ ary is a Function + ✔ Discards arguments with index >=n + + Testing atob + + ✔ atob is a Function + ✔ atob("Zm9vYmFy") equals "foobar" + ✔ atob("Z") returns "" + + Testing attempt + + ✔ attempt is a Function + ✔ Returns a value + ✔ Returns an error + + Testing average + + ✔ average is a Function + ✔ average(true) returns 0 + ✔ average(false) returns 1 + ✔ average(9, 1) returns 5 + ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 + ✔ average(1, 2, 3) returns 2 + ✔ average(null) returns 0 + ✔ average(1, 2, 3) returns NaN + ✔ average(String) returns NaN + ✔ average({ a: 123}) returns NaN + ✔ average([undefined, 0, string]) returns NaN + ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing averageBy + + ✔ averageBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing bifurcate + + ✔ bifurcate is a Function + ✔ Splits the collection into two groups + + Testing bifurcateBy + + ✔ bifurcateBy is a Function + ✔ Splits the collection into two groups + + Testing binarySearch + + ✔ binarySearch is a Function + ✔ Finds item in array + ✔ Returns -1 when not found + ✔ Works with empty arrays + ✔ Works for one element arrays + + Testing bind + + ✔ bind is a Function + ✔ Binds to an object context + + Testing bindAll + + ✔ bindAll is a Function + ✔ Binds to an object context + + Testing bindKey + + ✔ bindKey is a Function + ✔ Binds function to an object context + + Testing binomialCoefficient + + ✔ binomialCoefficient is a Function + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns NaN + ✔ Returns NaN + + Testing bottomVisible + + ✔ bottomVisible is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing btoa + + ✔ btoa is a Function + ✔ btoa("foobar") equals "Zm9vYmFy" + + Testing byteSize + + ✔ byteSize is a Function + ✔ Works for a single letter + ✔ Works for a common string + ✔ Works for emoji + + Testing call + + ✔ call is a Function + ✔ Calls function on given object + + Testing capitalize + + ✔ capitalize is a Function + ✔ Capitalizes the first letter of a string + ✔ Capitalizes the first letter of a string + ✔ Works with characters + ✔ Works with single character words + + Testing capitalizeEveryWord + + ✔ capitalizeEveryWord is a Function + ✔ Capitalizes the first letter of every word in a string + ✔ Works with characters + ✔ Works with one word string + + Testing castArray + + ✔ castArray is a Function + ✔ Works for single values + ✔ Works for arrays with one value + ✔ Works for arrays with multiple value + ✔ Works for strings + ✔ Works for objects + + Testing chainAsync + + ✔ chainAsync is a Function + + Testing chunk + + ✔ chunk is a Function + ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] + ✔ chunk([]) returns [] + ✔ chunk(123) returns [] + ✔ chunk({ a: 123}) returns [] + ✔ chunk(string, 2) returns [ st, ri, ng ] + ✔ chunk() throws an error + ✔ chunk(undefined) throws an error + ✔ chunk(null) throws an error + ✔ chunk(This is a string, 2) takes less than 2s to run + + Testing clampNumber + + ✔ clampNumber is a Function + ✔ Clamps num within the inclusive range specified by the boundary values a and b + + Testing cleanObj + + ✔ cleanObj is a Function + ✔ Removes any properties except the ones specified from a JSON object + + Testing cloneRegExp + + ✔ cloneRegExp is a Function + ✔ Clones regular expressions properly + + Testing coalesce + + ✔ coalesce is a Function + ✔ Returns the first non-null/undefined argument + + Testing coalesceFactory + + ✔ coalesceFactory is a Function + ✔ Returns a customized coalesce function + + Testing collatz + + ✔ collatz is a Function + ✔ When n is even, divide by 2 + ✔ When n is odd, times by 3 and add 1 + ✔ Eventually reaches 1 + + Testing collectInto + + ✔ collectInto is a Function + + Testing colorize + + ✔ colorize is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing compact + + ✔ compact is a Function + ✔ Removes falsey values from an array + + Testing compose + + ✔ compose is a Function + ✔ Performs right-to-left function composition + + Testing composeRight + + ✔ composeRight is a Function + ✔ Performs left-to-right function composition + + Testing converge + + ✔ converge is a Function + ✔ Produces the average of the array + ✔ Produces the strange concatenation + + Testing copyToClipboard + + ✔ copyToClipboard is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing countBy + + ✔ countBy is a Function + ✔ Works for functions + ✔ Works for property names + + Testing countOccurrences + + ✔ countOccurrences is a Function + ✔ Counts the occurrences of a value in an array + + Testing countVowels + + ✔ countVowels is a Function + + Testing createElement + + ✔ createElement is a Function + + Testing createEventHub + + ✔ createEventHub is a Function + + Testing currentURL + + ✔ currentURL is a Function + + Testing curry + + ✔ curry is a Function + ✔ curries a Math.pow + ✔ curries a Math.min + + Testing debounce + + ✔ debounce is a Function + + Testing decapitalize + + ✔ decapitalize is a Function + ✔ Works with default parameter + ✔ Works with second parameter set to true + + Testing deepClone + + ✔ deepClone is a Function + ✔ Shallow cloning works + ✔ Deep cloning works + + Testing deepFlatten + + ✔ deepFlatten is a Function + ✔ Deep flattens an array + + Testing defaults + + ✔ defaults is a Function + + Testing defer + + ✔ defer is a Function + + Testing degreesToRads + + ✔ degreesToRads is a Function + ✔ Returns the appropriate value + + Testing delay + + ✔ delay is a Function + + Testing detectDeviceType + + ✔ detectDeviceType is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing difference + + ✔ difference is a Function + ✔ Returns the difference between two arrays + + Testing differenceBy + + ✔ differenceBy is a Function + ✔ Works using a native function and numbers + ✔ Works with arrow function and objects + + Testing differenceWith + + ✔ differenceWith is a Function + ✔ Filters out all values from an array + + Testing digitize + + ✔ digitize is a Function + ✔ Converts a number to an array of digits + + Testing distance + + ✔ distance is a Function + ✔ Calculates the distance between two points + + Testing drop + + ✔ drop is a Function + ✔ Works without the last argument + ✔ Removes appropriate element count as specified + ✔ Empties array given a count greater than length + + Testing dropRight + + ✔ dropRight is a Function + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + + Testing dropRightWhile + + ✔ dropRightWhile is a Function + ✔ Removes elements from the end of an array until the passed function returns true. + + Testing dropWhile + + ✔ dropWhile is a Function + ✔ Removes elements in an array until the passed function returns true. + + Testing elementIsVisibleInViewport + + ✔ elementIsVisibleInViewport is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing elo + + ✔ elo is a Function + ✔ Standard 1v1s + ✔ should be equivalent + ✔ 4 player FFA, all same rank + + Testing equals + + ✔ equals is a Function + ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } + ✔ [1,2,3] is equal to [1,2,3] + ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } + ✔ [1,2,3] is not equal to [1,2,4] + ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + + Testing escapeHTML + + ✔ escapeHTML is a Function + ✔ Escapes a string for use in HTML + + Testing escapeRegExp + + ✔ escapeRegExp is a Function + ✔ Escapes a string to use in a regular expression + + Testing everyNth + + ✔ everyNth is a Function + ✔ Returns every nth element in an array + + Testing extendHex + + ✔ extendHex is a Function + ✔ Extends a 3-digit color code to a 6-digit color code + ✔ Extends a 3-digit color code to a 6-digit color code + + Testing factorial + + ✔ factorial is a Function + ✔ Calculates the factorial of 720 + ✔ Calculates the factorial of 0 + ✔ Calculates the factorial of 1 + ✔ Calculates the factorial of 4 + ✔ Calculates the factorial of 10 + + Testing factors + + ✔ factors is a Function + + Testing fibonacci + + ✔ fibonacci is a Function + ✔ Generates an array, containing the Fibonacci sequence + + Testing fibonacciCountUntilNum + + ✔ fibonacciCountUntilNum is a Function + + Testing fibonacciUntilNum + + ✔ fibonacciUntilNum is a Function + + Testing filterNonUnique + + ✔ filterNonUnique is a Function + ✔ Filters out the non-unique values in an array + + Testing findKey + + ✔ findKey is a Function + ✔ Returns the appropriate key + + Testing findLast + + ✔ findLast is a Function + ✔ Finds last element for which the given function returns true + + Testing findLastIndex + + ✔ findLastIndex is a Function + ✔ Finds last index for which the given function returns true + + Testing findLastKey + + ✔ findLastKey is a Function + ✔ Returns the appropriate key + + Testing flatten + + ✔ flatten is a Function + ✔ Flattens an array + ✔ Flattens an array + + Testing flattenObject + + ✔ flattenObject is a Function + ✔ Flattens an object with the paths for keys + ✔ Works with arrays + + Testing flip + + ✔ flip is a Function + ✔ Flips argument order + + Testing forEachRight + + ✔ forEachRight is a Function + ✔ Iterates over the array in reverse + + Testing forOwn + + ✔ forOwn is a Function + ✔ Iterates over an element's key-value pairs + + Testing forOwnRight + + ✔ forOwnRight is a Function + ✔ Iterates over an element's key-value pairs in reverse + + Testing formatDuration + + ✔ formatDuration is a Function + ✔ Returns the human readable format of the given number of milliseconds + ✔ Returns the human readable format of the given number of milliseconds + + Testing fromCamelCase + + ✔ fromCamelCase is a Function + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + + Testing functionName + + ✔ functionName is a Function + ✔ Works for native functions + ✔ Works for functions + ✔ Works for arrow functions + + Testing functions + + ✔ functions is a Function + ✔ Returns own methods + ✔ Returns own and inherited methods + + Testing gcd + + ✔ gcd is a Function + ✔ Calculates the greatest common divisor between two or more numbers/arrays + ✔ Calculates the greatest common divisor between two or more numbers/arrays + + Testing geometricProgression + + ✔ geometricProgression is a Function + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + + Testing get + + ✔ get is a Function + ✔ Retrieve a property indicated by the selector from an object. + + Testing getColonTimeFromDate + + ✔ getColonTimeFromDate is a Function + + Testing getDaysDiffBetweenDates + + ✔ getDaysDiffBetweenDates is a Function + ✔ Returns the difference in days between two dates + + Testing getMeridiemSuffixOfInteger + + ✔ getMeridiemSuffixOfInteger is a Function + + Testing getScrollPosition + + ✔ getScrollPosition is a Function + + Testing getStyle + + ✔ getStyle is a Function + + Testing getType + + ✔ getType is a Function + ✔ Returns the native type of a value + + Testing getURLParameters + + ✔ getURLParameters is a Function + ✔ Returns an object containing the parameters of the current URL + + Testing groupBy + + ✔ groupBy is a Function + ✔ Groups the elements of an array based on the given function + ✔ Groups the elements of an array based on the given function + + Testing hammingDistance + + ✔ hammingDistance is a Function + ✔ retuns hamming disance between 2 values + + Testing hasClass + + ✔ hasClass is a Function + + Testing hasFlags + + ✔ hasFlags is a Function + + Testing hashBrowser + + ✔ hashBrowser is a Function + + Testing hashNode + + ✔ hashNode is a Function + + Testing head + + ✔ head is a Function + ✔ head({ a: 1234}) returns undefined + ✔ head([1, 2, 3]) returns 1 + ✔ head({ 0: false}) returns false + ✔ head(String) returns S + ✔ head(null) throws an Error + ✔ head(undefined) throws an Error + ✔ head() throws an Error + ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing hexToRGB + + ✔ hexToRGB is a Function + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + + Testing hide + + ✔ hide is a Function + + Testing howManyTimes + + ✔ howManyTimes is a Function + + Testing httpDelete + + ✔ httpDelete is a Function + + Testing httpGet + + ✔ httpGet is a Function + + Testing httpPost + + ✔ httpPost is a Function + + Testing httpPut + + ✔ httpPut is a Function + + Testing httpsRedirect + + ✔ httpsRedirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing inRange + + ✔ inRange is a Function + ✔ The given number falls within the given range + ✔ The given number falls within the given range + ✔ The given number does not falls within the given range + ✔ The given number does not falls within the given range + + Testing indexOfAll + + ✔ indexOfAll is a Function + ✔ Returns all indices of val in an array + ✔ Returns all indices of val in an array + + Testing initial + + ✔ initial is a Function + ✔ Returns all the elements of an array except the last one + + Testing initialize2DArray + + ✔ initialize2DArray is a Function + ✔ Initializes a 2D array of given width and height and value + + Testing initializeArrayWithRange + + ✔ initializeArrayWithRange is a Function + ✔ Initializes an array containing the numbers in the specified range + + Testing initializeArrayWithRangeRight + + ✔ initializeArrayWithRangeRight is a Function + + Testing initializeArrayWithValues + + ✔ initializeArrayWithValues is a Function + ✔ Initializes and fills an array with the specified values + + Testing intersection + + ✔ intersection is a Function + ✔ Returns a list of elements that exist in both arrays + + Testing intersectionBy + + ✔ intersectionBy is a Function + ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + + Testing intersectionWith + + ✔ intersectionWith is a Function + ✔ Returns a list of elements that exist in both arrays, using a provided comparator function + + Testing invertKeyValues + + ✔ invertKeyValues is a Function + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + + Testing is + + ✔ is is a Function + ✔ Works for arrays with data + ✔ Works for empty arrays + ✔ Works for arrays, not objects + ✔ Works for objects + ✔ Works for maps + ✔ Works for regular expressions + ✔ Works for sets + ✔ Works for weak maps + ✔ Works for weak sets + ✔ Works for strings - returns false for primitive + ✔ Works for strings - returns true when using constructor + ✔ Works for numbers - returns false for primitive + ✔ Works for numbers - returns true when using constructor + ✔ Works for booleans - returns false for primitive + ✔ Works for booleans - returns true when using constructor + ✔ Works for functions + + Testing isAbsoluteURL + + ✔ isAbsoluteURL is a Function + ✔ Given string is an absolute URL + ✔ Given string is an absolute URL + ✔ Given string is not an absolute URL + + Testing isArmstrongNumber + + ✔ isArmstrongNumber is a Function + + Testing isArray + + ✔ isArray is a Function + ✔ passed value is an array + ✔ passed value is not an array + + Testing isArrayBuffer + + ✔ isArrayBuffer is a Function + + Testing isArrayLike + + ✔ isArrayLike is a Function + ✔ Returns true for a string + ✔ Returns true for an array + ✔ Returns false for null + + Testing isBoolean + + ✔ isBoolean is a Function + ✔ passed value is not a boolean + ✔ passed value is not a boolean + + Testing isDivisible + + ✔ isDivisible is a Function + ✔ The number 6 is divisible by 3 + + Testing isEmpty + + ✔ isEmpty is a Function + ✔ Returns true for empty Map + ✔ Returns true for empty Set + ✔ Returns true for empty array + ✔ Returns true for empty object + ✔ Returns true for empty string + ✔ Returns false for non-empty array + ✔ Returns false for non-empty object + ✔ Returns false for non-empty string + ✔ Returns true - type is not considered a collection + ✔ Returns true - type is not considered a collection + + Testing isEven + + ✔ isEven is a Function + ✔ 4 is even number + ✔ undefined + + Testing isFunction + + ✔ isFunction is a Function + ✔ passed value is a function + ✔ passed value is not a function + + Testing isLowerCase + + ✔ isLowerCase is a Function + ✔ passed string is a lowercase + ✔ passed string is a lowercase + ✔ passed value is not a lowercase + + Testing isMap + + ✔ isMap is a Function + + Testing isNil + + ✔ isNil is a Function + ✔ Returns true for null + ✔ Returns true for undefined + ✔ Returns false for an empty string + + Testing isNull + + ✔ isNull is a Function + ✔ passed argument is a null + ✔ passed argument is a null + + Testing isNumber + + ✔ isNumber is a Function + ✔ passed argument is a number + ✔ passed argument is not a number + + Testing isObject + + ✔ isObject is a Function + ✔ isObject([1, 2, 3, 4]) is a object + ✔ isObject([]) is a object + ✔ isObject({ a:1 }) is a object + ✔ isObject(true) is not a object + + Testing isObjectLike + + ✔ isObjectLike is a Function + ✔ Returns true for an object + ✔ Returns true for an array + ✔ Returns false for a function + ✔ Returns false for null + + Testing isPlainObject + + ✔ isPlainObject is a Function + ✔ Returns true for a plain object + ✔ Returns false for a Map (example of non-plain object) + + Testing isPrime + + ✔ isPrime is a Function + ✔ passed number is a prime + + Testing isPrimitive + + ✔ isPrimitive is a Function + ✔ isPrimitive(null) is primitive + ✔ isPrimitive(undefined) is primitive + ✔ isPrimitive(string) is primitive + ✔ isPrimitive(true) is primitive + ✔ isPrimitive(50) is primitive + ✔ isPrimitive('Hello') is primitive + ✔ isPrimitive(false) is primitive + ✔ isPrimitive(Symbol()) is primitive + ✔ isPrimitive([1, 2, 3]) is not primitive + ✔ isPrimitive({ a: 123 }) is not primitive + ✔ isPrimitive({ a: 123 }) takes less than 2s to run + + Testing isPromiseLike + + ✔ isPromiseLike is a Function + ✔ Returns true for a promise-like object + ✔ Returns false for null + ✔ Returns false for an empty object + + Testing isRegExp + + ✔ isRegExp is a Function + + Testing isSet + + ✔ isSet is a Function + + Testing isSorted + + ✔ isSorted is a Function + ✔ Array is sorted in ascending order + ✔ Array is sorted in descending order + ✔ Array is not sorted, direction changed in array + + Testing isString + + ✔ isString is a Function + ✔ foo is a string + ✔ "10" is a string + ✔ Empty string is a string + ✔ 10 is not a string + ✔ true is not string + + Testing isSymbol + + ✔ isSymbol is a Function + ✔ Checks if the given argument is a symbol + + Testing isTravisCI + + ✔ isTravisCI is a Function + ✔ Running on Travis, correctly evaluates + + Testing isTypedArray + + ✔ isTypedArray is a Function + + Testing isUndefined + + ✔ isUndefined is a Function + ✔ Returns true for undefined + + Testing isUpperCase + + ✔ isUpperCase is a Function + ✔ ABC is all upper case + ✔ abc is not all upper case + ✔ A3@$ is all uppercase + + Testing isValidJSON + + ✔ isValidJSON is a Function + ✔ {"name":"Adam","age":20} is a valid JSON + ✔ {"name":"Adam",age:"20"} is not a valid JSON + ✔ null is a valid JSON + + Testing isWeakMap + + ✔ isWeakMap is a Function + + Testing isWeakSet + + ✔ isWeakSet is a Function + + Testing join + + ✔ join is a Function + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + + Testing last + + ✔ last is a Function + ✔ last({ a: 1234}) returns undefined + ✔ last([1, 2, 3]) returns 3 + ✔ last({ 0: false}) returns undefined + ✔ last(String) returns g + ✔ last(null) throws an Error + ✔ last(undefined) throws an Error + ✔ last() throws an Error + ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing lcm + + ✔ lcm is a Function + ✔ Returns the least common multiple of two or more numbers. + ✔ Returns the least common multiple of two or more numbers. + + Testing longestItem + + ✔ longestItem is a Function + ✔ Returns the longest object + + Testing lowercaseKeys + + ✔ lowercaseKeys is a Function + ✔ Lowercases object keys + ✔ Does not mutate original object + + Testing luhnCheck + + ✔ luhnCheck is a Function + ✔ validates identification number + ✔ validates identification number + ✔ validates identification number + + Testing mapKeys + + ✔ mapKeys is a Function + ✔ Maps keys + + Testing mapObject + + ✔ mapObject is a Function + ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } + ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } + ✔ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } + + Testing mapValues + + ✔ mapValues is a Function + ✔ Maps values + + Testing mask + + ✔ mask is a Function + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + + Testing matches + + ✔ matches is a Function + ✔ Matches returns true for two similar objects + ✔ Matches returns false for two non-similar objects + + Testing matchesWith + + ✔ matchesWith is a Function + ✔ Returns true for two objects with similar values, based on the provided function + + Testing maxBy + + ✔ maxBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing maxN + + ✔ maxN is a Function + ✔ Returns the n maximum elements from the provided array + ✔ Returns the n maximum elements from the provided array + + Testing median + + ✔ median is a Function + ✔ Returns the median of an array of numbers + ✔ Returns the median of an array of numbers + + Testing memoize + + ✔ memoize is a Function + ✔ Function works properly + ✔ Function works properly + ✔ Cache stores values + + Testing merge + + ✔ merge is a Function + ✔ Merges two objects + + Testing minBy + + ✔ minBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing minN + + ✔ minN is a Function + ✔ Returns the n minimum elements from the provided array + ✔ Returns the n minimum elements from the provided array + + Testing mostPerformant + + ✔ mostPerformant is a Function + + Testing negate + + ✔ negate is a Function + ✔ Negates a predicate function + + Testing none + + ✔ none is a Function + ✔ Returns true for arrays with no truthy values + ✔ Returns false for arrays with at least one truthy value + + Testing noneBy + + ✔ noneBy is a Function + ✔ Returns true with a predicate function + ✔ Returns false with predicate function + + Testing nthArg + + ✔ nthArg is a Function + ✔ Returns the nth argument + ✔ Returns undefined if arguments too few + ✔ Works for negative values + + Testing nthElement + + ✔ nthElement is a Function + ✔ Returns the nth element of an array. + ✔ Returns the nth element of an array. + + Testing objectFromPairs + + ✔ objectFromPairs is a Function + ✔ Creates an object from the given key-value pairs. + + Testing objectToPairs + + ✔ objectToPairs is a Function + ✔ Creates an array of key-value pair arrays from an object. + + Testing observeMutations + + ✔ observeMutations is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing off + + ✔ off is a Function + + Testing omit + + ✔ omit is a Function + ✔ Omits the key-value pairs corresponding to the given keys from an object + + Testing omitBy + + ✔ omitBy is a Function + ✔ Creates an object composed of the properties the given function returns falsey for + + Testing on + + ✔ on is a Function + + Testing onUserInputChange + + ✔ onUserInputChange is a Function + + Testing once + + ✔ once is a Function + + Testing orderBy + + ✔ orderBy is a Function + ✔ Returns a sorted array of objects ordered by properties and orders. + ✔ Returns a sorted array of objects ordered by properties and orders. + + Testing over + + ✔ over is a Function + ✔ Applies given functions over multiple arguments + + Testing overArgs + + ✔ overArgs is a Function + ✔ Invokes the provided function with its arguments transformed + + Testing palindrome + + ✔ palindrome is a Function + ✔ Given string is a palindrome + ✔ Given string is not a palindrome + + Testing parseCookie + + ✔ parseCookie is a Function + ✔ Parses the cookie + + Testing partial + + ✔ partial is a Function + ✔ Prepends arguments + + Testing partialRight + + ✔ partialRight is a Function + ✔ Appends arguments + + Testing partition + + ✔ partition is a Function + ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. + + Testing percentile + + ✔ percentile is a Function + ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + + Testing pick + + ✔ pick is a Function + ✔ Picks the key-value pairs corresponding to the given keys from an object. + + Testing pickBy + + ✔ pickBy is a Function + ✔ Creates an object composed of the properties the given function returns truthy for. + + Testing pipeAsyncFunctions + + ✔ pipeAsyncFunctions is a Function + ✔ Produces the appropriate hash + ✔ pipeAsyncFunctions result should be 15 + + Testing pipeFunctions + + ✔ pipeFunctions is a Function + ✔ Performs left-to-right function composition + + Testing pluralize + + ✔ pluralize is a Function + ✔ Produces the plural of the word + ✔ Produces the singular of the word + ✔ Produces the plural of the word + ✔ Prodices the defined plural of the word + ✔ Works with a dictionary + + Testing powerset + + ✔ powerset is a Function + ✔ Returns the powerset of a given array of numbers. + + Testing prettyBytes + + ✔ prettyBytes is a Function + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + + Testing primes + + ✔ primes is a Function + ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. + + Testing promisify + + ✔ promisify is a Function + ✔ Returns a promise + + Testing pull + + ✔ pull is a Function + ✔ Pulls the specified values + + Testing pullAtIndex + + ✔ pullAtIndex is a Function + ✔ Pulls the given values + ✔ Pulls the given values + + Testing pullAtValue + + ✔ pullAtValue is a Function + ✔ Pulls the specified values + ✔ Pulls the specified values + + Testing pullBy + + ✔ pullBy is a Function + ✔ Pulls the specified values + + Testing quickSort + + ✔ quickSort is a Function + ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] + ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] + ✔ quickSort() throws an error + ✔ quickSort(123) throws an error + ✔ quickSort({ 234: string}) throws an error + ✔ quickSort(null) throws an error + ✔ quickSort(undefined) throws an error + ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + + Testing radsToDegrees + + ✔ radsToDegrees is a Function + ✔ Returns the appropriate value + + Testing randomHexColorCode + + ✔ randomHexColorCode is a Function + ✔ should be equal + + Testing randomIntArrayInRange + + ✔ randomIntArrayInRange is a Function + ✔ The returned array contains only integers + ✔ The returned array has the proper length + ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + + Testing randomIntegerInRange + + ✔ randomIntegerInRange is a Function + ✔ The returned value is an integer + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing randomNumberInRange + + ✔ randomNumberInRange is a Function + ✔ The returned value is a number + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing readFileLines + + ✔ readFileLines is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing rearg + + ✔ rearg is a Function + ✔ Reorders arguments in invoked function + + Testing redirect + + ✔ redirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing reduceSuccessive + + ✔ reduceSuccessive is a Function + ✔ Returns the array of successively reduced values + + Testing reduceWhich + + ✔ reduceWhich is a Function + ✔ Returns the minimum of an array + ✔ Returns the maximum of an array + ✔ Returns the object with the minimum specified value in an array + + Testing reducedFilter + + ✔ reducedFilter is a Function + ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. + + Testing remove + + ✔ remove is a Function + ✔ Removes elements from an array for which the given function returns false + + Testing removeNonASCII + + ✔ removeNonASCII is a Function + ✔ Removes non-ASCII characters + + Testing removeVowels + + ✔ removeVowels is a Function + + Testing reverseString + + ✔ reverseString is a Function + ✔ Reverses a string. + + Testing round + + ✔ round is a Function + ✔ round(1.005, 2) returns 1.01 + ✔ round(123.3423345345345345344, 11) returns 123.34233453453 + ✔ round(3.342, 11) returns 3.342 + ✔ round(1.005) returns 1 + ✔ round([1.005, 2]) returns NaN + ✔ round(string) returns NaN + ✔ round() returns NaN + ✔ round(132, 413, 4134) returns NaN + ✔ round({a: 132}, 413) returns NaN + ✔ round(123.3423345345345345344, 11) takes less than 2s to run + + Testing runAsync + + ✔ runAsync is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing runPromisesInSeries + + ✔ runPromisesInSeries is a Function + + Testing sample + + ✔ sample is a Function + ✔ Returns a random element from the array + ✔ Works for single-element arrays + ✔ Returns undefined for empty array + + Testing sampleSize + + ✔ sampleSize is a Function + ✔ Returns a single element without n specified + ✔ Returns a random sample of specified size from an array + ✔ Returns all elements in an array if n >= length + ✔ Returns an empty array if original array is empty + ✔ Returns an empty array if n = 0 + + Testing scrollToTop + + ✔ scrollToTop is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing sdbm + + ✔ sdbm is a Function + ✔ Hashes the input string into a whole number. + + Testing serializeCookie + + ✔ serializeCookie is a Function + ✔ Serializes the cookie + + Testing setStyle + + ✔ setStyle is a Function + + Testing shallowClone + + ✔ shallowClone is a Function + ✔ Shallow cloning works + ✔ Does not clone deeply + + Testing show + + ✔ show is a Function + + Testing shuffle + + ✔ shuffle is a Function + ✔ Shuffles the array + ✔ New array contains all original elements + ✔ Works for empty arrays + ✔ Works for single-element arrays + + Testing similarity + + ✔ similarity is a Function + ✔ Returns an array of elements that appear in both arrays. + + Testing size + + ✔ size is a Function + ✔ Get size of arrays, objects or strings. + ✔ Get size of arrays, objects or strings. + + Testing sleep + + ✔ sleep is a Function + + Testing solveRPN + + ✔ solveRPN is a Function + + Testing sortCharactersInString + + ✔ sortCharactersInString is a Function + ✔ Alphabetically sorts the characters in a string. + + Testing sortedIndex + + ✔ sortedIndex is a Function + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + + Testing sortedIndexBy + + ✔ sortedIndexBy is a Function + ✔ Returns the lowest index to insert the element without messing up the list order + + Testing sortedLastIndex + + ✔ sortedLastIndex is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing sortedLastIndexBy + + ✔ sortedLastIndexBy is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing speechSynthesis + + ✔ speechSynthesis is a Function + + Testing splitLines + + ✔ splitLines is a Function + ✔ Splits a multiline string into an array of lines. + + Testing spreadOver + + ✔ spreadOver is a Function + ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + + Testing standardDeviation + + ✔ standardDeviation is a Function + ✔ Returns the standard deviation of an array of numbers + ✔ Returns the standard deviation of an array of numbers + + Testing stripHTMLTags + + ✔ stripHTMLTags is a Function + ✔ Removes HTML tags + + Testing sum + + ✔ sum is a Function + ✔ Returns the sum of two or more numbers/arrays. + + Testing sumBy + + ✔ sumBy is a Function + + Testing sumPower + + ✔ sumPower is a Function + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + + Testing symmetricDifference + + ✔ symmetricDifference is a Function + ✔ Returns the symmetric difference between two arrays. + + Testing symmetricDifferenceBy + + ✔ symmetricDifferenceBy is a Function + ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + + Testing symmetricDifferenceWith + + ✔ symmetricDifferenceWith is a Function + ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator + + Testing tail + + ✔ tail is a Function + ✔ Returns tail + ✔ Returns tail + + Testing take + + ✔ take is a Function + ✔ Returns an array with n elements removed from the beginning. + ✔ Returns an array with n elements removed from the beginning. + + Testing takeRight + + ✔ takeRight is a Function + ✔ Returns an array with n elements removed from the end + ✔ Returns an array with n elements removed from the end + + Testing takeRightWhile + + ✔ takeRightWhile is a Function + ✔ Removes elements until the function returns true + + Testing takeWhile + + ✔ takeWhile is a Function + ✔ Removes elements until the function returns true + + Testing throttle + + ✔ throttle is a Function + + Testing timeTaken + + ✔ timeTaken is a Function + + Testing times + + ✔ times is a Function + ✔ Runs a function the specified amount of times + + Testing toCamelCase + + ✔ toCamelCase is a Function + ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName + ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized + ✔ toCamelCase('some-javascript-property') return someJavascriptProperty + ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens + ✔ toCamelCase() throws a error + ✔ toCamelCase([]) throws a error + ✔ toCamelCase({}) throws a error + ✔ toCamelCase(123) throws a error + ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + + Testing toCurrency + + ✔ toCurrency is a Function + ✔ currency: Euro | currencyLangFormat: Local + ✔ currency: US Dollar | currencyLangFormat: English (United States) + ✔ currency: Japanese Yen | currencyLangFormat: Local + + Testing toDecimalMark + + ✔ toDecimalMark is a Function + ✔ convert a float-point arithmetic to the Decimal mark form + + Testing toKebabCase + + ✔ toKebabCase is a Function + ✔ toKebabCase('camelCase') returns camel-case + ✔ toKebabCase('some text') returns some-text + ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens + ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html + ✔ toKebabCase() return undefined + ✔ toKebabCase([]) throws an error + ✔ toKebabCase({}) throws an error + ✔ toKebabCase(123) throws an error + ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toOrdinalSuffix + + ✔ toOrdinalSuffix is a Function + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + + Testing toSafeInteger + + ✔ toSafeInteger is a Function + ✔ Number(toSafeInteger(3.2)) is a number + ✔ Converts a value to a safe integer + ✔ toSafeInteger('4.2') returns 4 + ✔ toSafeInteger(4.6) returns 5 + ✔ toSafeInteger([]) returns 0 + ✔ isNaN(toSafeInteger([1.5, 3124])) is true + ✔ isNaN(toSafeInteger('string')) is true + ✔ isNaN(toSafeInteger({})) is true + ✔ isNaN(toSafeInteger()) is true + ✔ toSafeInteger(Infinity) returns 9007199254740991 + ✔ toSafeInteger(3.2) takes less than 2s to run + + Testing toSnakeCase + + ✔ toSnakeCase is a Function + ✔ toSnakeCase('camelCase') returns camel_case + ✔ toSnakeCase('some text') returns some_text + ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens + ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html + ✔ toSnakeCase() returns undefined + ✔ toSnakeCase([]) throws an error + ✔ toSnakeCase({}) throws an error + ✔ toSnakeCase(123) throws an error + ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toggleClass + + ✔ toggleClass is a Function + + Testing tomorrow + + ✔ tomorrow is a Function + ✔ Returns the correct year + ✔ Returns the correct month + ✔ Returns the correct date + + Testing transform + + ✔ transform is a Function + ✔ Transforms an object + + Testing truncateString + + ✔ truncateString is a Function + ✔ Truncates a "boomerang" up to a specified length. + + Testing truthCheckCollection + + ✔ truthCheckCollection is a Function + ✔ second argument is truthy on all elements of a collection + + Testing unary + + ✔ unary is a Function + ✔ Discards arguments after the first one + + Testing uncurry + + ✔ uncurry is a Function + ✔ Works without a provided value for n + ✔ Works without n = 2 + ✔ Works withoutn = 3 + + Testing unescapeHTML + + ✔ unescapeHTML is a Function + ✔ Unescapes escaped HTML characters. + + Testing unflattenObject + + ✔ unflattenObject is a Function + ✔ Unflattens an object with the paths for keys + + Testing unfold + + ✔ unfold is a Function + ✔ Works with a given function, producing an array + + Testing union + + ✔ union is a Function + ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] + ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] + ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] + ✔ union([], []) returns [] + ✔ union() throws an error + ✔ union(true, str) throws an error + ✔ union(false, true) throws an error + ✔ union(123, {}) throws an error + ✔ union([], {}) throws an error + ✔ union(undefined, null) throws an error + ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + + Testing unionBy + + ✔ unionBy is a Function + ✔ Produces the appropriate results + + Testing unionWith + + ✔ unionWith is a Function + ✔ Produces the appropriate results + + Testing uniqueElements + + ✔ uniqueElements is a Function + ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] + ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] + ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] + ✔ uniqueElements() returns [] + ✔ uniqueElements(null) returns [] + ✔ uniqueElements(undefined) returns [] + ✔ uniqueElements('strt') returns ['s', 't', 'r'] + ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error + ✔ uniqueElements({}) throws an error + ✔ uniqueElements(true) throws an error + ✔ uniqueElements(false) throws an error + ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + + Testing untildify + + ✔ untildify is a Function + ✔ Contains no tildes + ✔ Does not alter the rest of the path + ✔ Does not alter paths without tildes + + Testing unzip + + ✔ unzip is a Function + ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] + ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] + + Testing unzipWith + + ✔ unzipWith is a Function + ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] Testing validateNumber - √ validateNumber is a Function - √ validateNumber(9) returns true - √ validateNumber(234asd.slice(0, 2)) returns true - √ validateNumber(1232) returns true - √ validateNumber(1232 + 13423) returns true - √ validateNumber(1232 * 2342 * 123) returns true - √ validateNumber(1232.23423536) returns true - √ validateNumber(234asd) returns false - √ validateNumber(e234d) returns false - √ validateNumber(false) returns false - √ validateNumber(true) returns false - √ validateNumber(null) returns false - √ validateNumber(123 * asd) returns false + ✔ validateNumber is a Function + ✔ validateNumber(9) returns true + ✔ validateNumber(234asd.slice(0, 2)) returns true + ✔ validateNumber(1232) returns true + ✔ validateNumber(1232 + 13423) returns true + ✔ validateNumber(1232 * 2342 * 123) returns true + ✔ validateNumber(1232.23423536) returns true + ✔ validateNumber(234asd) returns false + ✔ validateNumber(e234d) returns false + ✔ validateNumber(false) returns false + ✔ validateNumber(true) returns false + ✔ validateNumber(null) returns false + ✔ validateNumber(123 * asd) returns false Testing without - √ without is a Function - √ without([2, 1, 2, 3], 1, 2) returns [3] - √ without([]) returns [] - √ without([3, 1, true, '3', true], '3', true) returns [3, 1] - √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - √ without() throws an error - √ without(null) throws an error - √ without(undefined) throws an error - √ without() throws an error - √ without({}) throws an error + ✔ without is a Function + ✔ without([2, 1, 2, 3], 1, 2) returns [3] + ✔ without([]) returns [] + ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] + ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] + ✔ without() throws an error + ✔ without(null) throws an error + ✔ without(undefined) throws an error + ✔ without() throws an error + ✔ without({}) throws an error Testing words - √ words is a Function - √ words('I love javaScript!!') returns [I, love, javaScript] - √ words('python, javaScript & coffee') returns [python, javaScript, coffee] - √ words(I love javaScript!!) returns an array - √ words() throws a error - √ words(null) throws a error - √ words(undefined) throws a error - √ words({}) throws a error - √ words([]) throws a error - √ words(1234) throws a error + ✔ words is a Function + ✔ words('I love javaScript!!') returns [I, love, javaScript] + ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] + ✔ words(I love javaScript!!) returns an array + ✔ words() throws a error + ✔ words(null) throws a error + ✔ words(undefined) throws a error + ✔ words({}) throws a error + ✔ words([]) throws a error + ✔ words(1234) throws a error Testing xProd - √ xProd is a Function - √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + ✔ xProd is a Function + ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] Testing yesNo - √ yesNo is a Function - √ yesNo(Y) returns true - √ yesNo(yes) returns true - √ yesNo(foo, true) returns true - √ yesNo(No) returns false - √ yesNo() returns false - √ yesNo(null) returns false - √ yesNo(undefined) returns false - √ yesNo([123, null]) returns false - √ yesNo([Yes, No]) returns false - √ yesNo({ 2: Yes }) returns false - √ yesNo([Yes, No], true) returns true - √ yesNo({ 2: Yes }, true) returns true + ✔ yesNo is a Function + ✔ yesNo(Y) returns true + ✔ yesNo(yes) returns true + ✔ yesNo(foo, true) returns true + ✔ yesNo(No) returns false + ✔ yesNo() returns false + ✔ yesNo(null) returns false + ✔ yesNo(undefined) returns false + ✔ yesNo([123, null]) returns false + ✔ yesNo([Yes, No]) returns false + ✔ yesNo({ 2: Yes }) returns false + ✔ yesNo([Yes, No], true) returns true + ✔ yesNo({ 2: Yes }, true) returns true Testing zip - √ zip is a Function - √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - √ zip([]) returns [] - √ zip(123) returns [] - √ zip([a, b], [1, 2], [true, false]) returns an Array - √ zip([a], [1, 2], [true, false]) returns an Array - √ zip(null) throws an error - √ zip(undefined) throws an error + ✔ zip is a Function + ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] + ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] + ✔ zip([]) returns [] + ✔ zip(123) returns [] + ✔ zip([a, b], [1, 2], [true, false]) returns an Array + ✔ zip([a], [1, 2], [true, false]) returns an Array + ✔ zip(null) throws an error + ✔ zip(undefined) throws an error Testing zipObject - √ zipObject is a Function - √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - √ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - √ zipObject([a], string) returns { a: s } - √ zipObject() throws an error - √ zipObject([string], null) throws an error - √ zipObject(null, [1]) throws an error - √ zipObject(string) throws an error - √ zipObject(test, string) throws an error + ✔ zipObject is a Function + ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} + ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} + ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } + ✔ zipObject([a], string) returns { a: s } + ✔ zipObject() throws an error + ✔ zipObject([string], null) throws an error + ✔ zipObject(null, [1]) throws an error + ✔ zipObject(string) throws an error + ✔ zipObject(test, string) throws an error Testing zipWith - √ zipWith is a Function - √ Runs the function provided - √ Sends a GET request - √ Sends a GET request - √ Runs the function provided - √ Runs promises in series - √ Sends a POST request - √ Works with multiple promises + ✔ zipWith is a Function + ✔ Sends a GET request + ✔ Sends a POST request + ✔ Runs the function provided + ✔ Runs promises in series + ✔ Works with multiple promises - total: 924 - passing: 924 - duration: 2.5s + total: 948 + passing: 948 + duration: 2.4s From 996b000528b8df5672587dbe53ff65b1d983f1d2 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Thu, 15 Feb 2018 20:32:21 +0000 Subject: [PATCH 28/43] Travis build: 1680 [cron] --- test/testlog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testlog b/test/testlog index a7b7fc01e..3aebd7873 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Wed Feb 14 2018 20:22:28 GMT+0000 (UTC) +Test log for: Thu Feb 15 2018 20:32:12 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1885,15 +1885,15 @@ Test log for: Wed Feb 14 2018 20:22:28 GMT+0000 (UTC) Testing zipWith ✔ zipWith is a Function + ✔ Runs the function provided ✔ Sends a GET request ✔ Sends a POST request - ✔ Runs the function provided ✔ Runs promises in series ✔ Works with multiple promises total: 948 passing: 948 - duration: 2.4s + duration: 2.7s From 0776ed5c4d74a3a71bc460df76a38e5b055dd8f8 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Fri, 16 Feb 2018 14:10:55 +0530 Subject: [PATCH 29/43] fix typo in average test --- test/average/average.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/average/average.test.js b/test/average/average.test.js index dff7df5a7..16a9471c7 100644 --- a/test/average/average.test.js +++ b/test/average/average.test.js @@ -19,6 +19,6 @@ test('Testing average', (t) => { let start = new Date().getTime(); average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631); let end = new Date().getTime(); - t.true((end - start) < 2000, 'head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run'); + t.true((end - start) < 2000, 'average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run'); t.end(); }); \ No newline at end of file From 77031a7e576dd6874b65a8cfe2fe0ea53ac91df0 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Fri, 16 Feb 2018 14:23:11 +0530 Subject: [PATCH 30/43] Update randomHexColorCode.js Add missing semicolon --- test/randomHexColorCode/randomHexColorCode.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js index d604bc77e..7d9946955 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -8,8 +8,8 @@ test('Testing randomHexColorCode', (t) => { //t.deepEqual(randomHexColorCode(args..), 'Expected'); t.equal(randomHexColorCode().length, 7); t.true(randomHexColorCode().startsWith('#'),'The color code starts with "#"'); - t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null) + t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null,'The color code contains only valid hex-digits'); //t.false(randomHexColorCode(args..), 'Expected'); //t.throws(randomHexColorCode(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); From 9a3bd8ffae064f1e4dceed5ea7959ee054afd01c Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 16 Feb 2018 13:43:43 +0200 Subject: [PATCH 31/43] Updated all, any, none Merged them with their by counterparts. --- snippets/all.md | 8 +++-- snippets/allBy.md | 13 -------- snippets/any.md | 8 +++-- snippets/anyBy.md | 13 -------- snippets/none.md | 8 +++-- snippets/noneBy.md | 13 -------- tag_database | 9 ++---- test/all/all.js | 2 +- test/all/all.test.js | 2 ++ test/allBy/allBy.js | 2 -- test/allBy/allBy.test.js | 15 ---------- test/any/any.js | 2 +- test/any/any.test.js | 2 ++ test/anyBy/anyBy.js | 2 -- test/anyBy/anyBy.test.js | 15 ---------- test/mostPerformant/mostPerformant.js | 9 ++++++ test/mostPerformant/mostPerformant.test.js | 14 +++++++++ test/none/none.js | 2 +- test/none/none.test.js | 2 ++ test/noneBy/noneBy.js | 2 -- test/noneBy/noneBy.test.js | 15 ---------- test/testlog | 35 +++++----------------- 22 files changed, 58 insertions(+), 135 deletions(-) delete mode 100644 snippets/allBy.md delete mode 100644 snippets/anyBy.md delete mode 100644 snippets/noneBy.md delete mode 100644 test/allBy/allBy.js delete mode 100644 test/allBy/allBy.test.js delete mode 100644 test/anyBy/anyBy.js delete mode 100644 test/anyBy/anyBy.test.js create mode 100644 test/mostPerformant/mostPerformant.js create mode 100644 test/mostPerformant/mostPerformant.test.js delete mode 100644 test/noneBy/noneBy.js delete mode 100644 test/noneBy/noneBy.test.js diff --git a/snippets/all.md b/snippets/all.md index e9faecd9d..17cadbc9f 100644 --- a/snippets/all.md +++ b/snippets/all.md @@ -1,13 +1,15 @@ ### all -Returns `true` if all elements in a collection are truthy, `false` otherwise. +Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. -Use `Array.every(Boolean)` to test if all elements in the collection are truthy. +Use `Array.every()` to test if all elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const all = arr => arr.every(Boolean); +const all = (arr, fn = Boolean) => arr.every(fn); ``` ```js +all([4, 2, 3], x => x > 1); // true all([1, 2, 3]); // true ``` diff --git a/snippets/allBy.md b/snippets/allBy.md deleted file mode 100644 index 36335714f..000000000 --- a/snippets/allBy.md +++ /dev/null @@ -1,13 +0,0 @@ -### allBy - -Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. - -Use `Array.every()` to test if all elements in the collection return `true` based on `fn`. - -```js -const allBy = (arr, fn) => arr.every(fn); -``` - -```js -allBy([4, 2, 3], x => x > 1); // true -``` diff --git a/snippets/any.md b/snippets/any.md index 09a5afad8..31368cc7a 100644 --- a/snippets/any.md +++ b/snippets/any.md @@ -1,13 +1,15 @@ ### any -Returns `true` if at least one element in a collection is truthy, `false` otherwise. +Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. -Use `Array.some(Boolean)` to test if any elements in the collection are truthy. +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const any = arr => arr.some(Boolean); +const any = (arr, fn = Boolean) => arr.some(fn); ``` ```js +any([0, 1, 2, 0], x => x >= 2); // true any([0, 0, 1, 0]); // true ``` diff --git a/snippets/anyBy.md b/snippets/anyBy.md deleted file mode 100644 index 2345f82bc..000000000 --- a/snippets/anyBy.md +++ /dev/null @@ -1,13 +0,0 @@ -### anyBy - -Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. - -Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. - -```js -const anyBy = (arr, fn) => arr.some(fn); -``` - -```js -anyBy([0, 1, 2, 0], x => x >= 2); // true -``` diff --git a/snippets/none.md b/snippets/none.md index a243b0409..1b9af0c2a 100644 --- a/snippets/none.md +++ b/snippets/none.md @@ -1,13 +1,15 @@ ### none -Returns `true` if no elements in a collection are truthy, `false` otherwise. +Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. -Use `!Array.some(Boolean)` to test if any elements in the collection are truthy. +Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const none = arr => !arr.some(Boolean); +const none = (arr, fn = Boolean) => !arr.some(fn); ``` ```js +none([0, 1, 3, 0], x => x == 2); // true none([0, 0, 0]); // true ``` diff --git a/snippets/noneBy.md b/snippets/noneBy.md deleted file mode 100644 index fa719d2df..000000000 --- a/snippets/noneBy.md +++ /dev/null @@ -1,13 +0,0 @@ -### noneBy - -Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. - -Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. - -```js -const noneBy = (arr, fn) => !arr.some(fn); -``` - -```js -noneBy([0, 1, 3, 0], x => x == 2); // true -``` diff --git a/tag_database b/tag_database index 13f4d7cc9..df3662150 100644 --- a/tag_database +++ b/tag_database @@ -1,8 +1,6 @@ -all:array -allBy:array,function +all:array,function anagrams:string,recursion -any:array -anyBy:array,function +any:array,function approximatelyEqual:math arrayToHtmlList:browser,array ary:adapter,function @@ -164,8 +162,7 @@ minBy:math,array,function minN:array,math mostPerformant:utility,function negate:function -none:array -noneBy:array,function +none:array,function nthArg:utility,function nthElement:array objectFromPairs:object,array diff --git a/test/all/all.js b/test/all/all.js index 1a938d602..6be892a3c 100644 --- a/test/all/all.js +++ b/test/all/all.js @@ -1,2 +1,2 @@ -const all = arr => arr.every(Boolean); +const all = (arr, fn = Boolean) => arr.every(fn); module.exports = all; \ No newline at end of file diff --git a/test/all/all.test.js b/test/all/all.test.js index 5aef8c036..60ac82f4a 100644 --- a/test/all/all.test.js +++ b/test/all/all.test.js @@ -11,6 +11,8 @@ test('Testing all', (t) => { t.false(all([undefined,1]), 'Returns false for arrays with undefined'); t.false(all([null,1]), 'Returns false for arrays with null'); t.false(all(['',1]), 'Returns false for arrays with empty strings'); + t.true(all([4,1,2,3], x => x >= 1), 'Returns true with predicate function'); + t.false(all([0,1], x => x >= 1), 'Returns false with a predicate function'); //t.deepEqual(all(args..), 'Expected'); //t.equal(all(args..), 'Expected'); //t.false(all(args..), 'Expected'); diff --git a/test/allBy/allBy.js b/test/allBy/allBy.js deleted file mode 100644 index d222c885f..000000000 --- a/test/allBy/allBy.js +++ /dev/null @@ -1,2 +0,0 @@ -const allBy = (arr, fn) => arr.every(fn); -module.exports = allBy; \ No newline at end of file diff --git a/test/allBy/allBy.test.js b/test/allBy/allBy.test.js deleted file mode 100644 index 29a018ba1..000000000 --- a/test/allBy/allBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const allBy = require('./allBy.js'); - -test('Testing allBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof allBy === 'function', 'allBy is a Function'); - t.true(allBy([4,1,2,3], x => x >= 1), 'Returns true with predicate function'); - t.false(allBy([0,1], x => x >= 1), 'Returns false with a predicate function'); - //t.deepEqual(allBy(args..), 'Expected'); - //t.equal(allBy(args..), 'Expected'); - //t.false(allBy(args..), 'Expected'); - //t.throws(allBy(args..), 'Expected'); - t.end(); -}); diff --git a/test/any/any.js b/test/any/any.js index 701f7cc85..5004b3309 100644 --- a/test/any/any.js +++ b/test/any/any.js @@ -1,2 +1,2 @@ -const any = arr => arr.some(Boolean); +const any = (arr, fn = Boolean) => arr.some(fn); module.exports = any; \ No newline at end of file diff --git a/test/any/any.test.js b/test/any/any.test.js index d9dd8f3a5..63399b385 100644 --- a/test/any/any.test.js +++ b/test/any/any.test.js @@ -8,6 +8,8 @@ test('Testing any', (t) => { t.true(any([0,1,2,3]), 'Returns true for arrays with at least one truthy value'); t.false(any([0,0]), 'Returns false for arrays with no truthy values'); t.false(any([NaN,0,undefined,null,'']), 'Returns false for arrays with no truthy values'); + t.true(any([4,1,0,3], x => x >= 1), 'Returns true with predicate function'); + t.false(any([0,1], x => x < 0), 'Returns false with a predicate function'); //t.deepEqual(any(args..), 'Expected'); //t.equal(any(args..), 'Expected'); //t.false(any(args..), 'Expected'); diff --git a/test/anyBy/anyBy.js b/test/anyBy/anyBy.js deleted file mode 100644 index a72250185..000000000 --- a/test/anyBy/anyBy.js +++ /dev/null @@ -1,2 +0,0 @@ -const anyBy = (arr, fn) => arr.some(fn); -module.exports = anyBy; \ No newline at end of file diff --git a/test/anyBy/anyBy.test.js b/test/anyBy/anyBy.test.js deleted file mode 100644 index 126690349..000000000 --- a/test/anyBy/anyBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const anyBy = require('./anyBy.js'); - -test('Testing anyBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof anyBy === 'function', 'anyBy is a Function'); - t.true(anyBy([4,1,0,3], x => x >= 1), 'Returns true with predicate function'); - t.false(anyBy([0,1], x => x < 0), 'Returns false with a predicate function'); - //t.deepEqual(anyBy(args..), 'Expected'); - //t.equal(anyBy(args..), 'Expected'); - //t.false(anyBy(args..), 'Expected'); - //t.throws(anyBy(args..), 'Expected'); - t.end(); -}); diff --git a/test/mostPerformant/mostPerformant.js b/test/mostPerformant/mostPerformant.js new file mode 100644 index 000000000..ae084a5cf --- /dev/null +++ b/test/mostPerformant/mostPerformant.js @@ -0,0 +1,9 @@ +const mostPerformant = (fns, iterations = 10000) => { +const times = fns.map(fn => { +const before = performance.now(); +for (let i = 0; i < iterations; i++) fn(); +return performance.now() - before; +}); +return times.indexOf(Math.min(...times)); +}; +module.exports = mostPerformant; \ No newline at end of file diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js new file mode 100644 index 000000000..95a560f91 --- /dev/null +++ b/test/mostPerformant/mostPerformant.test.js @@ -0,0 +1,14 @@ +const test = require('tape'); +const mostPerformant = require('./mostPerformant.js'); + +test('Testing mostPerformant', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof mostPerformant === 'function', 'mostPerformant is a Function'); + t.pass('Tested by @chalarangelo on 16/02/2018'); + //t.deepEqual(mostPerformant(args..), 'Expected'); + //t.equal(mostPerformant(args..), 'Expected'); + //t.false(mostPerformant(args..), 'Expected'); + //t.throws(mostPerformant(args..), 'Expected'); + t.end(); +}); diff --git a/test/none/none.js b/test/none/none.js index 680ac9393..2e81d7d72 100644 --- a/test/none/none.js +++ b/test/none/none.js @@ -1,2 +1,2 @@ -const none = arr => !arr.some(Boolean); +const none = (arr, fn = Boolean) => !arr.some(fn); module.exports = none; \ No newline at end of file diff --git a/test/none/none.test.js b/test/none/none.test.js index 02d1a88a9..af6209d91 100644 --- a/test/none/none.test.js +++ b/test/none/none.test.js @@ -7,6 +7,8 @@ test('Testing none', (t) => { t.true(typeof none === 'function', 'none is a Function'); t.true(none([0,undefined,NaN,null,'']), 'Returns true for arrays with no truthy values'); t.false(none([0,1]), 'Returns false for arrays with at least one truthy value'); + t.true(none([4,1,0,3], x => x < 0), 'Returns true with a predicate function'); + t.false(none([0,1,2], x => x === 1), 'Returns false with predicate function'); //t.deepEqual(none(args..), 'Expected'); //t.equal(none(args..), 'Expected'); //t.false(none(args..), 'Expected'); diff --git a/test/noneBy/noneBy.js b/test/noneBy/noneBy.js deleted file mode 100644 index 21ae86e05..000000000 --- a/test/noneBy/noneBy.js +++ /dev/null @@ -1,2 +0,0 @@ -const noneBy = (arr, fn) => !arr.some(fn); -module.exports = noneBy; \ No newline at end of file diff --git a/test/noneBy/noneBy.test.js b/test/noneBy/noneBy.test.js deleted file mode 100644 index f76aa990e..000000000 --- a/test/noneBy/noneBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const noneBy = require('./noneBy.js'); - -test('Testing noneBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof noneBy === 'function', 'noneBy is a Function'); - t.true(noneBy([4,1,0,3], x => x < 0), 'Returns true with a predicate function'); - t.false(noneBy([0,1,2], x => x === 1), 'Returns false with predicate function'); - //t.deepEqual(noneBy(args..), 'Expected'); - //t.equal(noneBy(args..), 'Expected'); - //t.false(noneBy(args..), 'Expected'); - //t.throws(noneBy(args..), 'Expected'); - t.end(); -}); diff --git a/test/testlog b/test/testlog index 8b77ecac0..6bc0d1ffb 100644 --- a/test/testlog +++ b/test/testlog @@ -1,11 +1,9 @@ -Test log for: Wed Feb 14 2018 11:45:44 GMT+0200 (GTB Standard Time) -Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) +Test log for: Fri Feb 16 2018 13:42:15 GMT+0200 (GTB Standard Time) > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing all √ all is a Function @@ -15,10 +13,6 @@ Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) √ Returns false for arrays with undefined √ Returns false for arrays with null √ Returns false for arrays with empty strings - - Testing allBy - - √ allBy is a Function √ Returns true with predicate function √ Returns false with a predicate function @@ -35,19 +29,8 @@ Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) √ Returns true for arrays with at least one truthy value √ Returns false for arrays with no truthy values √ Returns false for arrays with no truthy values - - Testing anyBy - - √ anyBy is a Function √ Returns true with predicate function √ Returns false with a predicate function - - Testing anagrams - - √ anagrams is a Function - √ Generates all anagrams of a string - √ Works for single-letter strings - √ Works for empty strings Testing approximatelyEqual @@ -1089,6 +1072,10 @@ Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) √ Returns the n minimum elements from the provided array √ Returns the n minimum elements from the provided array + Testing mostPerformant + + √ mostPerformant is a Function + Testing negate √ negate is a Function @@ -1099,10 +1086,6 @@ Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) √ none is a Function √ Returns true for arrays with no truthy values √ Returns false for arrays with at least one truthy value - - Testing noneBy - - √ noneBy is a Function √ Returns true with a predicate function √ Returns false with predicate function @@ -1892,15 +1875,13 @@ Test log for: Wed Feb 14 2018 12:46:59 GMT+0200 (GTB Standard Time) √ zipWith is a Function √ Runs the function provided √ Sends a GET request - √ Sends a GET request - √ Runs the function provided √ Runs promises in series √ Sends a POST request √ Works with multiple promises - total: 924 - passing: 924 - duration: 2.5s + total: 945 + passing: 945 + duration: 4.9s From 4843dd0b44391c5539f89a1bebe88d4b5aa9ef39 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Fri, 16 Feb 2018 11:46:02 +0000 Subject: [PATCH 32/43] Travis build: 1683 --- README.md | 87 +++++++------------------------------------------ docs/index.html | 23 ++++++------- 2 files changed, 22 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 223fd8bbd..6bff27e25 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,7 @@ average(1, 2, 3); View contents * [`all`](#all) -* [`allBy`](#allby) * [`any`](#any) -* [`anyBy`](#anyby) * [`bifurcate`](#bifurcate) * [`bifurcateBy`](#bifurcateby) * [`chunk`](#chunk) @@ -141,7 +139,6 @@ average(1, 2, 3); * [`maxN`](#maxn) * [`minN`](#minn) * [`none`](#none) -* [`noneBy`](#noneby) * [`nthElement`](#nthelement) * [`partition`](#partition) * [`pull`](#pull) @@ -776,41 +773,21 @@ const unary = fn => val => fn(val); ### all -Returns `true` if all elements in a collection are truthy, `false` otherwise. - -Use `Array.every(Boolean)` to test if all elements in the collection are truthy. - -```js -const all = arr => arr.every(Boolean); -``` - -
    -Examples - -```js -all([1, 2, 3]); // true -``` - -
    - -
    [⬆ Back to top](#table-of-contents) - - -### allBy - Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. Use `Array.every()` to test if all elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const allBy = (arr, fn) => arr.every(fn); +const all = (arr, fn = Boolean) => arr.every(fn); ```
    Examples ```js -allBy([4, 2, 3], x => x > 1); // true +all([4, 2, 3], x => x > 1); // true +all([1, 2, 3]); // true ```
    @@ -820,41 +797,21 @@ allBy([4, 2, 3], x => x > 1); // true ### any -Returns `true` if at least one element in a collection is truthy, `false` otherwise. - -Use `Array.some(Boolean)` to test if any elements in the collection are truthy. - -```js -const any = arr => arr.some(Boolean); -``` - -
    -Examples - -```js -any([0, 0, 1, 0]); // true -``` - -
    - -
    [⬆ Back to top](#table-of-contents) - - -### anyBy - Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const anyBy = (arr, fn) => arr.some(fn); +const any = (arr, fn = Boolean) => arr.some(fn); ```
    Examples ```js -anyBy([0, 1, 2, 0], x => x >= 2); // true +any([0, 1, 2, 0], x => x >= 2); // true +any([0, 0, 1, 0]); // true ```
    @@ -1815,41 +1772,21 @@ minN([1, 2, 3], 2); // [1,2] ### none -Returns `true` if no elements in a collection are truthy, `false` otherwise. - -Use `!Array.some(Boolean)` to test if any elements in the collection are truthy. - -```js -const none = arr => !arr.some(Boolean); -``` - -
    -Examples - -```js -none([0, 0, 0]); // true -``` - -
    - -
    [⬆ Back to top](#table-of-contents) - - -### noneBy - Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. Use `Array.some()` to test if any elements in the collection return `true` based on `fn`. +Omit the second argument, `fn`, to use `Boolean` as a default. ```js -const noneBy = (arr, fn) => !arr.some(fn); +const none = (arr, fn = Boolean) => !arr.some(fn); ```
    Examples ```js -noneBy([0, 1, 3, 0], x => x == 2); // true +none([0, 1, 3, 0], x => x == 2); // true +none([0, 0, 0]); // true ```
    diff --git a/docs/index.html b/docs/index.html index e56217194..141de6d37 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -123,14 +123,12 @@ Object.assig
     arrayMax([1, 2, 3]); // 3
     

    unary

    Creates a function that accepts up to one argument, ignoring any additional arguments.

    Call the provided function, fn, with just the first argument given.

    const unary = fn => val => fn(val);
     
    ['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
    -

    Array

    all

    Returns true if all elements in a collection are truthy, false otherwise.

    Use Array.every(Boolean) to test if all elements in the collection are truthy.

    const all = arr => arr.every(Boolean);
    -
    all([1, 2, 3]); // true
    -

    allBy

    Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

    Use Array.every() to test if all elements in the collection return true based on fn.

    const allBy = (arr, fn) => arr.every(fn);
    -
    allBy([4, 2, 3], x => x > 1); // true
    -

    any

    Returns true if at least one element in a collection is truthy, false otherwise.

    Use Array.some(Boolean) to test if any elements in the collection are truthy.

    const any = arr => arr.some(Boolean);
    -
    any([0, 0, 1, 0]); // true
    -

    anyBy

    Returns true if the provided predicate function returns true for at least one element in a collection, false otherwise.

    Use Array.some() to test if any elements in the collection return true based on fn.

    const anyBy = (arr, fn) => arr.some(fn);
    -
    anyBy([0, 1, 2, 0], x => x >= 2); // true
    +

    Array

    all

    Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

    Use Array.every() to test if all elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

    const all = (arr, fn = Boolean) => arr.every(fn);
    +
    all([4, 2, 3], x => x > 1); // true
    +all([1, 2, 3]); // true
    +

    any

    Returns true if the provided predicate function returns true for at least one element in a collection, false otherwise.

    Use Array.some() to test if any elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

    const any = (arr, fn = Boolean) => arr.some(fn);
    +
    any([0, 1, 2, 0], x => x >= 2); // true
    +any([0, 0, 1, 0]); // true
     

    bifurcate

    Splits values into two groups. If an element in filter is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.

    Use Array.reduce() and Array.push() to add elements to groups, based on filter.

    const bifurcate = (arr, filter) =>
       arr.reduce((acc, val, i) => (acc[filter[i] ? 0 : 1].push(val), acc), [[], []]);
     
    bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ]
    @@ -297,10 +295,9 @@ Object.assig
     

    minN

    Returns the n minimum elements from the provided array. If n is greater than or equal to the provided array's length, then return the original array(sorted in ascending order).

    Use Array.sort() combined with the spread operator (...) to create a shallow clone of the array and sort it in ascending order. Use Array.slice() to get the specified number of elements. Omit the second argument, n, to get a one-element array.

    const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n);
     
    minN([1, 2, 3]); // [1]
     minN([1, 2, 3], 2); // [1,2]
    -

    none

    Returns true if no elements in a collection are truthy, false otherwise.

    Use !Array.some(Boolean) to test if any elements in the collection are truthy.

    const none = arr => !arr.some(Boolean);
    -
    none([0, 0, 0]); // true
    -

    noneBy

    Returns true if the provided predicate function returns false for all elements in a collection, false otherwise.

    Use Array.some() to test if any elements in the collection return true based on fn.

    const noneBy = (arr, fn) => !arr.some(fn);
    -
    noneBy([0, 1, 3, 0], x => x == 2); // true
    +

    none

    Returns true if the provided predicate function returns false for all elements in a collection, false otherwise.

    Use Array.some() to test if any elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

    const none = (arr, fn = Boolean) => !arr.some(fn);
    +
    none([0, 1, 3, 0], x => x == 2); // true
    +none([0, 0, 0]); // true
     

    nthElement

    Returns the nth element of an array.

    Use Array.slice() to get an array containing the nth element at the first place. If the index is out of bounds, return []. Omit the second argument, n, to get the first element of the array.

    const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0];
     
    nthElement(['a', 'b', 'c'], 1); // 'b'
     nthElement(['a', 'b', 'b'], -3); // 'a'
    
    From efdb54dac044adc007875e87a3f0af5b21f60c81 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Fri, 16 Feb 2018 14:00:23 +0200
    Subject: [PATCH 33/43] Added remaining tests
    
    ---
     test/arrayToHtmlList/arrayToHtmlList.test.js  |    3 +-
     test/chainAsync/chainAsync.test.js            |   29 +-
     test/createElement/createElement.test.js      |    3 +-
     test/createEventHub/createEventHub.test.js    |    3 +-
     test/currentURL/currentURL.test.js            |    3 +-
     test/debounce/debounce.test.js                |    3 +-
     test/defaults/defaults.test.js                |    3 +-
     test/defer/defer.test.js                      |    3 +-
     test/delay/delay.test.js                      |    9 +-
     .../getScrollPosition.test.js                 |    3 +-
     test/getStyle/getStyle.test.js                |    3 +-
     test/hasFlags/hasFlags.test.js                |    3 +-
     test/hashBrowser/hashBrowser.test.js          |    3 +-
     test/hide/hide.test.js                        |    3 +-
     test/off/off.test.js                          |    3 +-
     test/on/on.test.js                            |    3 +-
     .../onUserInputChange.test.js                 |    3 +-
     test/once/once.test.js                        |    3 +-
     test/setStyle/setStyle.test.js                |    3 +-
     test/show/show.test.js                        |    3 +-
     test/sleep/sleep.test.js                      |    6 +-
     test/testlog                                  | 1944 +++++++++--------
     test/throttle/throttle.test.js                |    3 +-
     test/timeTaken/timeTaken.test.js              |    3 +-
     test/toggleClass/toggleClass.test.js          |    3 +-
     25 files changed, 1068 insertions(+), 983 deletions(-)
    
    diff --git a/test/arrayToHtmlList/arrayToHtmlList.test.js b/test/arrayToHtmlList/arrayToHtmlList.test.js
    index 1f8885778..7cb8f4582 100644
    --- a/test/arrayToHtmlList/arrayToHtmlList.test.js
    +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js
    @@ -5,9 +5,10 @@ test('Testing arrayToHtmlList', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(arrayToHtmlList(args..), 'Expected');
       //t.equal(arrayToHtmlList(args..), 'Expected');
       //t.false(arrayToHtmlList(args..), 'Expected');
       //t.throws(arrayToHtmlList(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js
    index d013df52f..244862417 100644
    --- a/test/chainAsync/chainAsync.test.js
    +++ b/test/chainAsync/chainAsync.test.js
    @@ -5,22 +5,19 @@ test('Testing chainAsync', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof chainAsync === 'function', 'chainAsync is a Function');
    -  //t.deepEqual(chainAsync(args..), 'Expected');
    -  // chainAsync([
    -  //   next => {
    -  //     next();
    -  //   },
    -  //   next => {
    -  //     (() =>{
    -  //       next()
    -  //     })();
    -  //   },
    -  //   next => {
    -  //     t.pass("Calls all functions in an array");
    -  //     next();
    -  //   }
    -  // ]);
    -  //
    +  chainAsync([
    +    next => {
    +      next();
    +    },
    +    next => {
    +      (() =>{
    +        next()
    +      })();
    +    },
    +    next => {
    +      t.pass("Calls all functions in an array");
    +    }
    +  ]);
       // // Ensure we wait for the 2nd assertion to be made
       // t.plan(2);
     
    diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js
    index f773ea672..6923ec245 100644
    --- a/test/createElement/createElement.test.js
    +++ b/test/createElement/createElement.test.js
    @@ -5,9 +5,10 @@ test('Testing createElement', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof createElement === 'function', 'createElement is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(createElement(args..), 'Expected');
       //t.equal(createElement(args..), 'Expected');
       //t.false(createElement(args..), 'Expected');
       //t.throws(createElement(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js
    index 759c461b3..101d07aef 100644
    --- a/test/createEventHub/createEventHub.test.js
    +++ b/test/createEventHub/createEventHub.test.js
    @@ -5,9 +5,10 @@ test('Testing createEventHub', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof createEventHub === 'function', 'createEventHub is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(createEventHub(args..), 'Expected');
       //t.equal(createEventHub(args..), 'Expected');
       //t.false(createEventHub(args..), 'Expected');
       //t.throws(createEventHub(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js
    index e7dba8ee4..e190ad429 100644
    --- a/test/currentURL/currentURL.test.js
    +++ b/test/currentURL/currentURL.test.js
    @@ -5,9 +5,10 @@ test('Testing currentURL', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof currentURL === 'function', 'currentURL is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(currentURL(args..), 'Expected');
       //t.equal(currentURL(args..), 'Expected');
       //t.false(currentURL(args..), 'Expected');
       //t.throws(currentURL(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/debounce/debounce.test.js b/test/debounce/debounce.test.js
    index f1a35323c..867aac93a 100644
    --- a/test/debounce/debounce.test.js
    +++ b/test/debounce/debounce.test.js
    @@ -5,9 +5,10 @@ test('Testing debounce', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof debounce === 'function', 'debounce is a Function');
    +  debounce(() => {t.pass('Works as expected');}, 250);
       //t.deepEqual(debounce(args..), 'Expected');
       //t.equal(debounce(args..), 'Expected');
       //t.false(debounce(args..), 'Expected');
       //t.throws(debounce(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js
    index ab1afa29e..b3c519f9d 100644
    --- a/test/defaults/defaults.test.js
    +++ b/test/defaults/defaults.test.js
    @@ -5,9 +5,10 @@ test('Testing defaults', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof defaults === 'function', 'defaults is a Function');
    +  t.deepEqual(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }, 'Assigns default values for undefined properties');
       //t.deepEqual(defaults(args..), 'Expected');
       //t.equal(defaults(args..), 'Expected');
       //t.false(defaults(args..), 'Expected');
       //t.throws(defaults(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js
    index faa5731c9..23e125b90 100644
    --- a/test/defer/defer.test.js
    +++ b/test/defer/defer.test.js
    @@ -5,9 +5,10 @@ test('Testing defer', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof defer === 'function', 'defer is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(defer(args..), 'Expected');
       //t.equal(defer(args..), 'Expected');
       //t.false(defer(args..), 'Expected');
       //t.throws(defer(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js
    index 544f8632d..8404b3bcb 100644
    --- a/test/delay/delay.test.js
    +++ b/test/delay/delay.test.js
    @@ -5,9 +5,16 @@ test('Testing delay', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof delay === 'function', 'delay is a Function');
    +  delay(
    +    function(text) {
    +      t.equals(text, 'test', 'Works as expecting, passing arguments properly');
    +    },
    +    1000,
    +    'test'
    +  );
       //t.deepEqual(delay(args..), 'Expected');
       //t.equal(delay(args..), 'Expected');
       //t.false(delay(args..), 'Expected');
       //t.throws(delay(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js
    index ded20c020..9f7fd14d7 100644
    --- a/test/getScrollPosition/getScrollPosition.test.js
    +++ b/test/getScrollPosition/getScrollPosition.test.js
    @@ -5,9 +5,10 @@ test('Testing getScrollPosition', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof getScrollPosition === 'function', 'getScrollPosition is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(getScrollPosition(args..), 'Expected');
       //t.equal(getScrollPosition(args..), 'Expected');
       //t.false(getScrollPosition(args..), 'Expected');
       //t.throws(getScrollPosition(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js
    index 11c2c9244..23bac0147 100644
    --- a/test/getStyle/getStyle.test.js
    +++ b/test/getStyle/getStyle.test.js
    @@ -5,9 +5,10 @@ test('Testing getStyle', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof getStyle === 'function', 'getStyle is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(getStyle(args..), 'Expected');
       //t.equal(getStyle(args..), 'Expected');
       //t.false(getStyle(args..), 'Expected');
       //t.throws(getStyle(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js
    index 0245051be..be0d4c301 100644
    --- a/test/hasFlags/hasFlags.test.js
    +++ b/test/hasFlags/hasFlags.test.js
    @@ -5,9 +5,10 @@ test('Testing hasFlags', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof hasFlags === 'function', 'hasFlags is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(hasFlags(args..), 'Expected');
       //t.equal(hasFlags(args..), 'Expected');
       //t.false(hasFlags(args..), 'Expected');
       //t.throws(hasFlags(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js
    index d01cafc5b..5464dd95d 100644
    --- a/test/hashBrowser/hashBrowser.test.js
    +++ b/test/hashBrowser/hashBrowser.test.js
    @@ -5,9 +5,10 @@ test('Testing hashBrowser', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(hashBrowser(args..), 'Expected');
       //t.equal(hashBrowser(args..), 'Expected');
       //t.false(hashBrowser(args..), 'Expected');
       //t.throws(hashBrowser(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js
    index d93d3fa74..af1971858 100644
    --- a/test/hide/hide.test.js
    +++ b/test/hide/hide.test.js
    @@ -5,9 +5,10 @@ test('Testing hide', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof hide === 'function', 'hide is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(hide(args..), 'Expected');
       //t.equal(hide(args..), 'Expected');
       //t.false(hide(args..), 'Expected');
       //t.throws(hide(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/off/off.test.js b/test/off/off.test.js
    index 030e7797a..8a3eca663 100644
    --- a/test/off/off.test.js
    +++ b/test/off/off.test.js
    @@ -5,9 +5,10 @@ test('Testing off', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof off === 'function', 'off is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(off(args..), 'Expected');
       //t.equal(off(args..), 'Expected');
       //t.false(off(args..), 'Expected');
       //t.throws(off(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/on/on.test.js b/test/on/on.test.js
    index 5bfa58a76..f14e85ad0 100644
    --- a/test/on/on.test.js
    +++ b/test/on/on.test.js
    @@ -5,9 +5,10 @@ test('Testing on', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof on === 'function', 'on is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(on(args..), 'Expected');
       //t.equal(on(args..), 'Expected');
       //t.false(on(args..), 'Expected');
       //t.throws(on(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js
    index c4c181806..bbc726d63 100644
    --- a/test/onUserInputChange/onUserInputChange.test.js
    +++ b/test/onUserInputChange/onUserInputChange.test.js
    @@ -5,9 +5,10 @@ test('Testing onUserInputChange', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof onUserInputChange === 'function', 'onUserInputChange is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(onUserInputChange(args..), 'Expected');
       //t.equal(onUserInputChange(args..), 'Expected');
       //t.false(onUserInputChange(args..), 'Expected');
       //t.throws(onUserInputChange(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/once/once.test.js b/test/once/once.test.js
    index 6d457fe01..89aba3872 100644
    --- a/test/once/once.test.js
    +++ b/test/once/once.test.js
    @@ -5,9 +5,10 @@ test('Testing once', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof once === 'function', 'once is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(once(args..), 'Expected');
       //t.equal(once(args..), 'Expected');
       //t.false(once(args..), 'Expected');
       //t.throws(once(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js
    index 796ab1316..3c8e4aa94 100644
    --- a/test/setStyle/setStyle.test.js
    +++ b/test/setStyle/setStyle.test.js
    @@ -5,9 +5,10 @@ test('Testing setStyle', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof setStyle === 'function', 'setStyle is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(setStyle(args..), 'Expected');
       //t.equal(setStyle(args..), 'Expected');
       //t.false(setStyle(args..), 'Expected');
       //t.throws(setStyle(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/show/show.test.js b/test/show/show.test.js
    index 06cf5e26e..859735338 100644
    --- a/test/show/show.test.js
    +++ b/test/show/show.test.js
    @@ -5,9 +5,10 @@ test('Testing show', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof show === 'function', 'show is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(show(args..), 'Expected');
       //t.equal(show(args..), 'Expected');
       //t.false(show(args..), 'Expected');
       //t.throws(show(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js
    index 8d5388924..57beb16e2 100644
    --- a/test/sleep/sleep.test.js
    +++ b/test/sleep/sleep.test.js
    @@ -5,9 +5,13 @@ test('Testing sleep', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof sleep === 'function', 'sleep is a Function');
    +  async function sleepyWork() {
    +    await sleep(1000);
    +    t.pass('Works as expected');
    +  }
       //t.deepEqual(sleep(args..), 'Expected');
       //t.equal(sleep(args..), 'Expected');
       //t.false(sleep(args..), 'Expected');
       //t.throws(sleep(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/testlog b/test/testlog
    index 0d6347ab4..9af1b19b9 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,6 +1,6 @@
    -Test log for: Fri Feb 16 2018 13:42:15 GMT+0200 (GTB Standard Time)
    +Test log for: Fri Feb 16 2018 14:00:11 GMT+0200 (GTB Standard Time)
     
    -> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code
    +> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
     
     
    @@ -18,10 +18,10 @@ Test log for: Fri Feb 16 2018 13:42:15 GMT+0200 (GTB Standard Time)
     
       Testing anagrams
     
    -    ✔ anagrams is a Function
    -    ✔ Generates all anagrams of a string
    -    ✔ Works for single-letter strings
    -    ✔ Works for empty strings
    +    √ anagrams is a Function
    +    √ Generates all anagrams of a string
    +    √ Works for single-letter strings
    +    √ Works for empty strings
     
       Testing any
     
    @@ -34,1043 +34,1065 @@ Test log for: Fri Feb 16 2018 13:42:15 GMT+0200 (GTB Standard Time)
     
       Testing approximatelyEqual
     
    -    ✔ approximatelyEqual is a Function
    -    ✔ Works for PI / 2
    -    ✔ Works for 0.1 + 0.2 === 0.3
    -    ✔ Works for exactly equal values
    -    ✔ Works for a custom epsilon
    +    √ approximatelyEqual is a Function
    +    √ Works for PI / 2
    +    √ Works for 0.1 + 0.2 === 0.3
    +    √ Works for exactly equal values
    +    √ Works for a custom epsilon
     
       Testing arrayToHtmlList
     
    -    ✔ arrayToHtmlList is a Function
    +    √ arrayToHtmlList is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing ary
     
    -    ✔ ary is a Function
    -    ✔ Discards arguments with index >=n
    +    √ ary is a Function
    +    √ Discards arguments with index >=n
     
       Testing atob
     
    -    ✔ atob is a Function
    -    ✔ atob("Zm9vYmFy") equals "foobar"
    -    ✔ atob("Z") returns ""
    +    √ atob is a Function
    +    √ atob("Zm9vYmFy") equals "foobar"
    +    √ atob("Z") returns ""
     
       Testing attempt
     
    -    ✔ attempt is a Function
    -    ✔ Returns a value
    -    ✔ Returns an error
    +    √ attempt is a Function
    +    √ Returns a value
    +    √ Returns an error
     
       Testing average
     
    -    ✔ average is a Function
    -    ✔ average(true) returns 0
    -    ✔ average(false) returns 1
    -    ✔ average(9, 1) returns 5
    -    ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 
    -    ✔ average(1, 2, 3) returns 2
    -    ✔ average(null) returns 0
    -    ✔ average(1, 2, 3) returns NaN
    -    ✔ average(String) returns NaN
    -    ✔ average({ a: 123}) returns NaN
    -    ✔ average([undefined, 0, string]) returns NaN
    -    ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
    +    √ average is a Function
    +    √ average(true) returns 0
    +    √ average(false) returns 1
    +    √ average(9, 1) returns 5
    +    √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 
    +    √ average(1, 2, 3) returns 2
    +    √ average(null) returns 0
    +    √ average(1, 2, 3) returns NaN
    +    √ average(String) returns NaN
    +    √ average({ a: 123}) returns NaN
    +    √ average([undefined, 0, string]) returns NaN
    +    √ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
     
       Testing averageBy
     
    -    ✔ averageBy is a Function
    -    ✔ Produces the right result with a function
    -    ✔ Produces the right result with a property name
    +    √ averageBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing bifurcate
     
    -    ✔ bifurcate is a Function
    -    ✔ Splits the collection into two groups
    +    √ bifurcate is a Function
    +    √ Splits the collection into two groups
     
       Testing bifurcateBy
     
    -    ✔ bifurcateBy is a Function
    -    ✔ Splits the collection into two groups
    +    √ bifurcateBy is a Function
    +    √ Splits the collection into two groups
     
       Testing binarySearch
     
    -    ✔ binarySearch is a Function
    -    ✔ Finds item in array
    -    ✔ Returns -1 when not found
    -    ✔ Works with empty arrays
    -    ✔ Works for one element arrays
    +    √ binarySearch is a Function
    +    √ Finds item in array
    +    √ Returns -1 when not found
    +    √ Works with empty arrays
    +    √ Works for one element arrays
     
       Testing bind
     
    -    ✔ bind is a Function
    -    ✔ Binds to an object context
    +    √ bind is a Function
    +    √ Binds to an object context
     
       Testing bindAll
     
    -    ✔ bindAll is a Function
    -    ✔ Binds to an object context
    +    √ bindAll is a Function
    +    √ Binds to an object context
     
       Testing bindKey
     
    -    ✔ bindKey is a Function
    -    ✔ Binds function to an object context
    +    √ bindKey is a Function
    +    √ Binds function to an object context
     
       Testing binomialCoefficient
     
    -    ✔ binomialCoefficient is a Function
    -    ✔ Returns the appropriate value
    -    ✔ Returns the appropriate value
    -    ✔ Returns the appropriate value
    -    ✔ Returns NaN
    -    ✔ Returns NaN
    +    √ binomialCoefficient is a Function
    +    √ Returns the appropriate value
    +    √ Returns the appropriate value
    +    √ Returns the appropriate value
    +    √ Returns NaN
    +    √ Returns NaN
     
       Testing bottomVisible
     
    -    ✔ bottomVisible is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ bottomVisible is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing btoa
     
    -    ✔ btoa is a Function
    -    ✔ btoa("foobar") equals "Zm9vYmFy"
    +    √ btoa is a Function
    +    √ btoa("foobar") equals "Zm9vYmFy"
     
       Testing byteSize
     
    -    ✔ byteSize is a Function
    -    ✔ Works for a single letter
    -    ✔ Works for a common string
    -    ✔ Works for emoji
    +    √ byteSize is a Function
    +    √ Works for a single letter
    +    √ Works for a common string
    +    √ Works for emoji
     
       Testing call
     
    -    ✔ call is a Function
    -    ✔ Calls function on given object
    +    √ call is a Function
    +    √ Calls function on given object
     
       Testing capitalize
     
    -    ✔ capitalize is a Function
    -    ✔ Capitalizes the first letter of a string
    -    ✔ Capitalizes the first letter of a string
    -    ✔ Works with characters
    -    ✔ Works with single character words
    +    √ capitalize is a Function
    +    √ Capitalizes the first letter of a string
    +    √ Capitalizes the first letter of a string
    +    √ Works with characters
    +    √ Works with single character words
     
       Testing capitalizeEveryWord
     
    -    ✔ capitalizeEveryWord is a Function
    -    ✔ Capitalizes the first letter of every word in a string
    -    ✔ Works with characters
    -    ✔ Works with one word string
    +    √ capitalizeEveryWord is a Function
    +    √ Capitalizes the first letter of every word in a string
    +    √ Works with characters
    +    √ Works with one word string
     
       Testing castArray
     
    -    ✔ castArray is a Function
    -    ✔ Works for single values
    -    ✔ Works for arrays with one value
    -    ✔ Works for arrays with multiple value
    -    ✔ Works for strings
    -    ✔ Works for objects
    +    √ castArray is a Function
    +    √ Works for single values
    +    √ Works for arrays with one value
    +    √ Works for arrays with multiple value
    +    √ Works for strings
    +    √ Works for objects
     
       Testing chainAsync
     
    -    ✔ chainAsync is a Function
    +    √ chainAsync is a Function
    +    √ Calls all functions in an array
     
       Testing chunk
     
    -    ✔ chunk is a Function
    -    ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] 
    -    ✔ chunk([]) returns []
    -    ✔ chunk(123) returns []
    -    ✔ chunk({ a: 123}) returns []
    -    ✔ chunk(string, 2) returns [ st, ri, ng ]
    -    ✔ chunk() throws an error
    -    ✔ chunk(undefined) throws an error
    -    ✔ chunk(null) throws an error
    -    ✔ chunk(This is a string, 2) takes less than 2s to run
    +    √ chunk is a Function
    +    √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] 
    +    √ chunk([]) returns []
    +    √ chunk(123) returns []
    +    √ chunk({ a: 123}) returns []
    +    √ chunk(string, 2) returns [ st, ri, ng ]
    +    √ chunk() throws an error
    +    √ chunk(undefined) throws an error
    +    √ chunk(null) throws an error
    +    √ chunk(This is a string, 2) takes less than 2s to run
     
       Testing clampNumber
     
    -    ✔ clampNumber is a Function
    -    ✔ Clamps num within the inclusive range specified by the boundary values a and b
    +    √ clampNumber is a Function
    +    √ Clamps num within the inclusive range specified by the boundary values a and b
     
       Testing cleanObj
     
    -    ✔ cleanObj is a Function
    -    ✔ Removes any properties except the ones specified from a JSON object
    +    √ cleanObj is a Function
    +    √ Removes any properties except the ones specified from a JSON object
     
       Testing cloneRegExp
     
    -    ✔ cloneRegExp is a Function
    -    ✔ Clones regular expressions properly
    +    √ cloneRegExp is a Function
    +    √ Clones regular expressions properly
     
       Testing coalesce
     
    -    ✔ coalesce is a Function
    -    ✔ Returns the first non-null/undefined argument
    +    √ coalesce is a Function
    +    √ Returns the first non-null/undefined argument
     
       Testing coalesceFactory
     
    -    ✔ coalesceFactory is a Function
    -    ✔ Returns a customized coalesce function
    +    √ coalesceFactory is a Function
    +    √ Returns a customized coalesce function
     
       Testing collatz
     
    -    ✔ collatz is a Function
    -    ✔ When n is even, divide by 2
    -    ✔ When n is odd, times by 3 and add 1
    -    ✔ Eventually reaches 1
    +    √ collatz is a Function
    +    √ When n is even, divide by 2
    +    √ When n is odd, times by 3 and add 1
    +    √ Eventually reaches 1
     
       Testing collectInto
     
    -    ✔ collectInto is a Function
    +    √ collectInto is a Function
     
       Testing colorize
     
    -    ✔ colorize is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ colorize is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing compact
     
    -    ✔ compact is a Function
    -    ✔ Removes falsey values from an array
    +    √ compact is a Function
    +    √ Removes falsey values from an array
     
       Testing compose
     
    -    ✔ compose is a Function
    -    ✔ Performs right-to-left function composition
    +    √ compose is a Function
    +    √ Performs right-to-left function composition
     
       Testing composeRight
     
    -    ✔ composeRight is a Function
    -    ✔ Performs left-to-right function composition
    +    √ composeRight is a Function
    +    √ Performs left-to-right function composition
     
       Testing converge
     
    -    ✔ converge is a Function
    -    ✔ Produces the average of the array
    -    ✔ Produces the strange concatenation
    +    √ converge is a Function
    +    √ Produces the average of the array
    +    √ Produces the strange concatenation
     
       Testing copyToClipboard
     
    -    ✔ copyToClipboard is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ copyToClipboard is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing countBy
     
    -    ✔ countBy is a Function
    -    ✔ Works for functions
    -    ✔ Works for property names
    +    √ countBy is a Function
    +    √ Works for functions
    +    √ Works for property names
     
       Testing countOccurrences
     
    -    ✔ countOccurrences is a Function
    -    ✔ Counts the occurrences of a value in an array
    +    √ countOccurrences is a Function
    +    √ Counts the occurrences of a value in an array
     
       Testing countVowels
     
    -    ✔ countVowels is a Function
    +    √ countVowels is a Function
     
       Testing createElement
     
    -    ✔ createElement is a Function
    +    √ createElement is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing createEventHub
     
    -    ✔ createEventHub is a Function
    +    √ createEventHub is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing currentURL
     
    -    ✔ currentURL is a Function
    +    √ currentURL is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing curry
     
    -    ✔ curry is a Function
    -    ✔ curries a Math.pow
    -    ✔ curries a Math.min
    +    √ curry is a Function
    +    √ curries a Math.pow
    +    √ curries a Math.min
     
       Testing debounce
     
    -    ✔ debounce is a Function
    +    √ debounce is a Function
     
       Testing decapitalize
     
    -    ✔ decapitalize is a Function
    -    ✔ Works with default parameter
    -    ✔ Works with second parameter set to true
    +    √ decapitalize is a Function
    +    √ Works with default parameter
    +    √ Works with second parameter set to true
     
       Testing deepClone
     
    -    ✔ deepClone is a Function
    -    ✔ Shallow cloning works
    -    ✔ Deep cloning works
    +    √ deepClone is a Function
    +    √ Shallow cloning works
    +    √ Deep cloning works
     
       Testing deepFlatten
     
    -    ✔ deepFlatten is a Function
    -    ✔ Deep flattens an array
    +    √ deepFlatten is a Function
    +    √ Deep flattens an array
     
       Testing defaults
     
    -    ✔ defaults is a Function
    +    √ defaults is a Function
    +    √ Assigns default values for undefined properties
     
       Testing defer
     
    -    ✔ defer is a Function
    +    √ defer is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing degreesToRads
     
    -    ✔ degreesToRads is a Function
    -    ✔ Returns the appropriate value
    +    √ degreesToRads is a Function
    +    √ Returns the appropriate value
     
       Testing delay
     
    -    ✔ delay is a Function
    +    √ delay is a Function
     
       Testing detectDeviceType
     
    -    ✔ detectDeviceType is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ detectDeviceType is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing difference
     
    -    ✔ difference is a Function
    -    ✔ Returns the difference between two arrays
    +    √ difference is a Function
    +    √ Returns the difference between two arrays
     
       Testing differenceBy
     
    -    ✔ differenceBy is a Function
    -    ✔ Works using a native function and numbers
    -    ✔ Works with arrow function and objects
    +    √ differenceBy is a Function
    +    √ Works using a native function and numbers
    +    √ Works with arrow function and objects
     
       Testing differenceWith
     
    -    ✔ differenceWith is a Function
    -    ✔ Filters out all values from an array
    +    √ differenceWith is a Function
    +    √ Filters out all values from an array
     
       Testing digitize
     
    -    ✔ digitize is a Function
    -    ✔ Converts a number to an array of digits
    +    √ digitize is a Function
    +    √ Converts a number to an array of digits
     
       Testing distance
     
    -    ✔ distance is a Function
    -    ✔ Calculates the distance between two points
    +    √ distance is a Function
    +    √ Calculates the distance between two points
     
       Testing drop
     
    -    ✔ drop is a Function
    -    ✔ Works without the last argument
    -    ✔ Removes appropriate element count as specified
    -    ✔ Empties array given a count greater than length
    +    √ drop is a Function
    +    √ Works without the last argument
    +    √ Removes appropriate element count as specified
    +    √ Empties array given a count greater than length
     
       Testing dropRight
     
    -    ✔ dropRight is a Function
    -    ✔ Returns a new array with n elements removed from the right
    -    ✔ Returns a new array with n elements removed from the right
    -    ✔ Returns a new array with n elements removed from the right
    +    √ dropRight is a Function
    +    √ Returns a new array with n elements removed from the right
    +    √ Returns a new array with n elements removed from the right
    +    √ Returns a new array with n elements removed from the right
     
       Testing dropRightWhile
     
    -    ✔ dropRightWhile is a Function
    -    ✔ Removes elements from the end of an array until the passed function returns true.
    +    √ dropRightWhile is a Function
    +    √ Removes elements from the end of an array until the passed function returns true.
     
       Testing dropWhile
     
    -    ✔ dropWhile is a Function
    -    ✔ Removes elements in an array until the passed function returns true.
    +    √ dropWhile is a Function
    +    √ Removes elements in an array until the passed function returns true.
     
       Testing elementIsVisibleInViewport
     
    -    ✔ elementIsVisibleInViewport is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ elementIsVisibleInViewport is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing elo
     
    -    ✔ elo is a Function
    -    ✔ Standard 1v1s
    -    ✔ should be equivalent
    -    ✔ 4 player FFA, all same rank
    +    √ elo is a Function
    +    √ Standard 1v1s
    +    √ should be equivalent
    +    √ 4 player FFA, all same rank
     
       Testing equals
     
    -    ✔ equals is a Function
    -    ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' }
    -    ✔ [1,2,3] is equal to [1,2,3]
    -    ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] }
    -    ✔ [1,2,3] is not equal to [1,2,4]
    -    ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match.
    +    √ equals is a Function
    +    √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' }
    +    √ [1,2,3] is equal to [1,2,3]
    +    √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] }
    +    √ [1,2,3] is not equal to [1,2,4]
    +    √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match.
     
       Testing escapeHTML
     
    -    ✔ escapeHTML is a Function
    -    ✔ Escapes a string for use in HTML
    +    √ escapeHTML is a Function
    +    √ Escapes a string for use in HTML
     
       Testing escapeRegExp
     
    -    ✔ escapeRegExp is a Function
    -    ✔ Escapes a string to use in a regular expression
    +    √ escapeRegExp is a Function
    +    √ Escapes a string to use in a regular expression
     
       Testing everyNth
     
    -    ✔ everyNth is a Function
    -    ✔ Returns every nth element in an array
    +    √ everyNth is a Function
    +    √ Returns every nth element in an array
     
       Testing extendHex
     
    -    ✔ extendHex is a Function
    -    ✔ Extends a 3-digit color code to a 6-digit color code
    -    ✔ Extends a 3-digit color code to a 6-digit color code
    +    √ extendHex is a Function
    +    √ Extends a 3-digit color code to a 6-digit color code
    +    √ Extends a 3-digit color code to a 6-digit color code
     
       Testing factorial
     
    -    ✔ factorial is a Function
    -    ✔ Calculates the factorial of 720
    -    ✔ Calculates the factorial of 0
    -    ✔ Calculates the factorial of 1
    -    ✔ Calculates the factorial of 4
    -    ✔ Calculates the factorial of 10
    +    √ factorial is a Function
    +    √ Calculates the factorial of 720
    +    √ Calculates the factorial of 0
    +    √ Calculates the factorial of 1
    +    √ Calculates the factorial of 4
    +    √ Calculates the factorial of 10
     
       Testing factors
     
    -    ✔ factors is a Function
    +    √ factors is a Function
     
       Testing fibonacci
     
    -    ✔ fibonacci is a Function
    -    ✔ Generates an array, containing the Fibonacci sequence
    +    √ fibonacci is a Function
    +    √ Generates an array, containing the Fibonacci sequence
     
       Testing fibonacciCountUntilNum
     
    -    ✔ fibonacciCountUntilNum is a Function
    +    √ fibonacciCountUntilNum is a Function
     
       Testing fibonacciUntilNum
     
    -    ✔ fibonacciUntilNum is a Function
    +    √ fibonacciUntilNum is a Function
     
       Testing filterNonUnique
     
    -    ✔ filterNonUnique is a Function
    -    ✔ Filters out the non-unique values in an array
    +    √ filterNonUnique is a Function
    +    √ Filters out the non-unique values in an array
     
       Testing findKey
     
    -    ✔ findKey is a Function
    -    ✔ Returns the appropriate key
    +    √ findKey is a Function
    +    √ Returns the appropriate key
     
       Testing findLast
     
    -    ✔ findLast is a Function
    -    ✔ Finds last element for which the given function returns true
    +    √ findLast is a Function
    +    √ Finds last element for which the given function returns true
     
       Testing findLastIndex
     
    -    ✔ findLastIndex is a Function
    -    ✔ Finds last index for which the given function returns true
    +    √ findLastIndex is a Function
    +    √ Finds last index for which the given function returns true
     
       Testing findLastKey
     
    -    ✔ findLastKey is a Function
    -    ✔ Returns the appropriate key
    +    √ findLastKey is a Function
    +    √ Returns the appropriate key
     
       Testing flatten
     
    -    ✔ flatten is a Function
    -    ✔ Flattens an array
    -    ✔ Flattens an array
    +    √ flatten is a Function
    +    √ Flattens an array
    +    √ Flattens an array
     
       Testing flattenObject
     
    -    ✔ flattenObject is a Function
    -    ✔ Flattens an object with the paths for keys
    -    ✔ Works with arrays
    +    √ flattenObject is a Function
    +    √ Flattens an object with the paths for keys
    +    √ Works with arrays
     
       Testing flip
     
    -    ✔ flip is a Function
    -    ✔ Flips argument order
    +    √ flip is a Function
    +    √ Flips argument order
     
       Testing forEachRight
     
    -    ✔ forEachRight is a Function
    -    ✔ Iterates over the array in reverse
    -
    -  Testing forOwn
    -
    -    ✔ forOwn is a Function
    -    ✔ Iterates over an element's key-value pairs
    -
    -  Testing forOwnRight
    -
    -    ✔ forOwnRight is a Function
    -    ✔ Iterates over an element's key-value pairs in reverse
    +    √ forEachRight is a Function
    +    √ Iterates over the array in reverse
     
       Testing formatDuration
     
    -    ✔ formatDuration is a Function
    -    ✔ Returns the human readable format of the given number of milliseconds
    -    ✔ Returns the human readable format of the given number of milliseconds
    +    √ formatDuration is a Function
    +    √ Returns the human readable format of the given number of milliseconds
    +    √ Returns the human readable format of the given number of milliseconds
    +
    +  Testing forOwn
    +
    +    √ forOwn is a Function
    +    √ Iterates over an element's key-value pairs
    +
    +  Testing forOwnRight
    +
    +    √ forOwnRight is a Function
    +    √ Iterates over an element's key-value pairs in reverse
     
       Testing fromCamelCase
     
    -    ✔ fromCamelCase is a Function
    -    ✔ Converts a string from camelcase
    -    ✔ Converts a string from camelcase
    -    ✔ Converts a string from camelcase
    +    √ fromCamelCase is a Function
    +    √ Converts a string from camelcase
    +    √ Converts a string from camelcase
    +    √ Converts a string from camelcase
     
       Testing functionName
     
    -    ✔ functionName is a Function
    -    ✔ Works for native functions
    -    ✔ Works for functions
    -    ✔ Works for arrow functions
    +    √ functionName is a Function
    +    √ Works for native functions
    +    √ Works for functions
    +    √ Works for arrow functions
     
       Testing functions
     
    -    ✔ functions is a Function
    -    ✔ Returns own methods
    -    ✔ Returns own and inherited methods
    +    √ functions is a Function
    +    √ Returns own methods
    +    √ Returns own and inherited methods
     
       Testing gcd
     
    -    ✔ gcd is a Function
    -    ✔ Calculates the greatest common divisor between two or more numbers/arrays
    -    ✔ Calculates the greatest common divisor between two or more numbers/arrays
    +    √ gcd is a Function
    +    √ Calculates the greatest common divisor between two or more numbers/arrays
    +    √ Calculates the greatest common divisor between two or more numbers/arrays
     
       Testing geometricProgression
     
    -    ✔ geometricProgression is a Function
    -    ✔ Initializes an array containing the numbers in the specified range
    -    ✔ Initializes an array containing the numbers in the specified range
    -    ✔ Initializes an array containing the numbers in the specified range
    +    √ geometricProgression is a Function
    +    √ Initializes an array containing the numbers in the specified range
    +    √ Initializes an array containing the numbers in the specified range
    +    √ Initializes an array containing the numbers in the specified range
     
       Testing get
     
    -    ✔ get is a Function
    -    ✔ Retrieve a property indicated by the selector from an object.
    +    √ get is a Function
    +    √ Retrieve a property indicated by the selector from an object.
     
       Testing getColonTimeFromDate
     
    -    ✔ getColonTimeFromDate is a Function
    +    √ getColonTimeFromDate is a Function
     
       Testing getDaysDiffBetweenDates
     
    -    ✔ getDaysDiffBetweenDates is a Function
    -    ✔ Returns the difference in days between two dates
    +    √ getDaysDiffBetweenDates is a Function
    +    √ Returns the difference in days between two dates
     
       Testing getMeridiemSuffixOfInteger
     
    -    ✔ getMeridiemSuffixOfInteger is a Function
    +    √ getMeridiemSuffixOfInteger is a Function
     
       Testing getScrollPosition
     
    -    ✔ getScrollPosition is a Function
    +    √ getScrollPosition is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing getStyle
     
    -    ✔ getStyle is a Function
    +    √ getStyle is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing getType
     
    -    ✔ getType is a Function
    -    ✔ Returns the native type of a value
    +    √ getType is a Function
    +    √ Returns the native type of a value
     
       Testing getURLParameters
     
    -    ✔ getURLParameters is a Function
    -    ✔ Returns an object containing the parameters of the current URL
    +    √ getURLParameters is a Function
    +    √ Returns an object containing the parameters of the current URL
     
       Testing groupBy
     
    -    ✔ groupBy is a Function
    -    ✔ Groups the elements of an array based on the given function
    -    ✔ Groups the elements of an array based on the given function
    +    √ groupBy is a Function
    +    √ Groups the elements of an array based on the given function
    +    √ Groups the elements of an array based on the given function
     
       Testing hammingDistance
     
    -    ✔ hammingDistance is a Function
    -    ✔ retuns hamming disance between 2 values
    +    √ hammingDistance is a Function
    +    √ retuns hamming disance between 2 values
     
       Testing hasClass
     
    -    ✔ hasClass is a Function
    +    √ hasClass is a Function
     
       Testing hasFlags
     
    -    ✔ hasFlags is a Function
    +    √ hasFlags is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing hashBrowser
     
    -    ✔ hashBrowser is a Function
    +    √ hashBrowser is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing hashNode
     
    -    ✔ hashNode is a Function
    +    √ hashNode is a Function
     
       Testing head
     
    -    ✔ head is a Function
    -    ✔ head({ a: 1234}) returns undefined
    -    ✔ head([1, 2, 3]) returns 1
    -    ✔ head({ 0: false}) returns false
    -    ✔ head(String) returns S
    -    ✔ head(null) throws an Error
    -    ✔ head(undefined) throws an Error
    -    ✔ head() throws an Error
    -    ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
    +    √ head is a Function
    +    √ head({ a: 1234}) returns undefined
    +    √ head([1, 2, 3]) returns 1
    +    √ head({ 0: false}) returns false
    +    √ head(String) returns S
    +    √ head(null) throws an Error
    +    √ head(undefined) throws an Error
    +    √ head() throws an Error
    +    √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
     
       Testing hexToRGB
     
    -    ✔ hexToRGB is a Function
    -    ✔ Converts a color code to a rgb() or rgba() string
    -    ✔ Converts a color code to a rgb() or rgba() string
    -    ✔ Converts a color code to a rgb() or rgba() string
    +    √ hexToRGB is a Function
    +    √ Converts a color code to a rgb() or rgba() string
    +    √ Converts a color code to a rgb() or rgba() string
    +    √ Converts a color code to a rgb() or rgba() string
     
       Testing hide
     
    -    ✔ hide is a Function
    +    √ hide is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing howManyTimes
     
    -    ✔ howManyTimes is a Function
    +    √ howManyTimes is a Function
     
       Testing httpDelete
     
    -    ✔ httpDelete is a Function
    +    √ httpDelete is a Function
     
       Testing httpGet
     
    -    ✔ httpGet is a Function
    +    √ httpGet is a Function
     
       Testing httpPost
     
    -    ✔ httpPost is a Function
    +    √ httpPost is a Function
     
       Testing httpPut
     
    -    ✔ httpPut is a Function
    +    √ httpPut is a Function
     
       Testing httpsRedirect
     
    -    ✔ httpsRedirect is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    -
    -  Testing inRange
    -
    -    ✔ inRange is a Function
    -    ✔ The given number falls within the given range
    -    ✔ The given number falls within the given range
    -    ✔ The given number does not falls within the given range
    -    ✔ The given number does not falls within the given range
    +    √ httpsRedirect is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing indexOfAll
     
    -    ✔ indexOfAll is a Function
    -    ✔ Returns all indices of val in an array
    -    ✔ Returns all indices of val in an array
    +    √ indexOfAll is a Function
    +    √ Returns all indices of val in an array
    +    √ Returns all indices of val in an array
     
       Testing initial
     
    -    ✔ initial is a Function
    -    ✔ Returns all the elements of an array except the last one
    +    √ initial is a Function
    +    √ Returns all the elements of an array except the last one
     
       Testing initialize2DArray
     
    -    ✔ initialize2DArray is a Function
    -    ✔ Initializes a 2D array of given width and height and value
    +    √ initialize2DArray is a Function
    +    √ Initializes a 2D array of given width and height and value
     
       Testing initializeArrayWithRange
     
    -    ✔ initializeArrayWithRange is a Function
    -    ✔ Initializes an array containing the numbers in the specified range
    +    √ initializeArrayWithRange is a Function
    +    √ Initializes an array containing the numbers in the specified range
     
       Testing initializeArrayWithRangeRight
     
    -    ✔ initializeArrayWithRangeRight is a Function
    +    √ initializeArrayWithRangeRight is a Function
     
       Testing initializeArrayWithValues
     
    -    ✔ initializeArrayWithValues is a Function
    -    ✔ Initializes and fills an array with the specified values
    +    √ initializeArrayWithValues is a Function
    +    √ Initializes and fills an array with the specified values
    +
    +  Testing inRange
    +
    +    √ inRange is a Function
    +    √ The given number falls within the given range
    +    √ The given number falls within the given range
    +    √ The given number does not falls within the given range
    +    √ The given number does not falls within the given range
     
       Testing intersection
     
    -    ✔ intersection is a Function
    -    ✔ Returns a list of elements that exist in both arrays
    +    √ intersection is a Function
    +    √ Returns a list of elements that exist in both arrays
     
       Testing intersectionBy
     
    -    ✔ intersectionBy is a Function
    -    ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both
    +    √ intersectionBy is a Function
    +    √ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both
     
       Testing intersectionWith
     
    -    ✔ intersectionWith is a Function
    -    ✔ Returns a list of elements that exist in both arrays, using a provided comparator function
    +    √ intersectionWith is a Function
    +    √ Returns a list of elements that exist in both arrays, using a provided comparator function
     
       Testing invertKeyValues
     
    -    ✔ invertKeyValues is a Function
    -    ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }
    -    ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] }
    +    √ invertKeyValues is a Function
    +    √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }
    +    √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] }
     
       Testing is
     
    -    ✔ is is a Function
    -    ✔ Works for arrays with data
    -    ✔ Works for empty arrays
    -    ✔ Works for arrays, not objects
    -    ✔ Works for objects
    -    ✔ Works for maps
    -    ✔ Works for regular expressions
    -    ✔ Works for sets
    -    ✔ Works for weak maps
    -    ✔ Works for weak sets
    -    ✔ Works for strings - returns false for primitive
    -    ✔ Works for strings - returns true when using constructor
    -    ✔ Works for numbers - returns false for primitive
    -    ✔ Works for numbers - returns true when using constructor
    -    ✔ Works for booleans - returns false for primitive
    -    ✔ Works for booleans - returns true when using constructor
    -    ✔ Works for functions
    +    √ is is a Function
    +    √ Works for arrays with data
    +    √ Works for empty arrays
    +    √ Works for arrays, not objects
    +    √ Works for objects
    +    √ Works for maps
    +    √ Works for regular expressions
    +    √ Works for sets
    +    √ Works for weak maps
    +    √ Works for weak sets
    +    √ Works for strings - returns false for primitive
    +    √ Works for strings - returns true when using constructor
    +    √ Works for numbers - returns false for primitive
    +    √ Works for numbers - returns true when using constructor
    +    √ Works for booleans - returns false for primitive
    +    √ Works for booleans - returns true when using constructor
    +    √ Works for functions
     
       Testing isAbsoluteURL
     
    -    ✔ isAbsoluteURL is a Function
    -    ✔ Given string is an absolute URL
    -    ✔ Given string is an absolute URL
    -    ✔ Given string is not an absolute URL
    +    √ isAbsoluteURL is a Function
    +    √ Given string is an absolute URL
    +    √ Given string is an absolute URL
    +    √ Given string is not an absolute URL
     
       Testing isArmstrongNumber
     
    -    ✔ isArmstrongNumber is a Function
    +    √ isArmstrongNumber is a Function
     
       Testing isArray
     
    -    ✔ isArray is a Function
    -    ✔ passed value is an array
    -    ✔ passed value is not an array
    +    √ isArray is a Function
    +    √ passed value is an array
    +    √ passed value is not an array
     
       Testing isArrayBuffer
     
    -    ✔ isArrayBuffer is a Function
    +    √ isArrayBuffer is a Function
     
       Testing isArrayLike
     
    -    ✔ isArrayLike is a Function
    -    ✔ Returns true for a string
    -    ✔ Returns true for an array
    -    ✔ Returns false for null
    +    √ isArrayLike is a Function
    +    √ Returns true for a string
    +    √ Returns true for an array
    +    √ Returns false for null
     
       Testing isBoolean
     
    -    ✔ isBoolean is a Function
    -    ✔ passed value is not a boolean
    -    ✔ passed value is not a boolean
    +    √ isBoolean is a Function
    +    √ passed value is not a boolean
    +    √ passed value is not a boolean
     
       Testing isDivisible
     
    -    ✔ isDivisible is a Function
    -    ✔ The number 6 is divisible by 3
    +    √ isDivisible is a Function
    +    √ The number 6 is divisible by 3
     
       Testing isEmpty
     
    -    ✔ isEmpty is a Function
    -    ✔ Returns true for empty Map
    -    ✔ Returns true for empty Set
    -    ✔ Returns true for empty array
    -    ✔ Returns true for empty object
    -    ✔ Returns true for empty string
    -    ✔ Returns false for non-empty array
    -    ✔ Returns false for non-empty object
    -    ✔ Returns false for non-empty string
    -    ✔ Returns true - type is not considered a collection
    -    ✔ Returns true - type is not considered a collection
    +    √ isEmpty is a Function
    +    √ Returns true for empty Map
    +    √ Returns true for empty Set
    +    √ Returns true for empty array
    +    √ Returns true for empty object
    +    √ Returns true for empty string
    +    √ Returns false for non-empty array
    +    √ Returns false for non-empty object
    +    √ Returns false for non-empty string
    +    √ Returns true - type is not considered a collection
    +    √ Returns true - type is not considered a collection
     
       Testing isEven
     
    -    ✔ isEven is a Function
    -    ✔ 4 is even number
    -    ✔ undefined
    +    √ isEven is a Function
    +    √ 4 is even number
    +    √ undefined
     
       Testing isFunction
     
    -    ✔ isFunction is a Function
    -    ✔ passed value is a function
    -    ✔ passed value is not a function
    +    √ isFunction is a Function
    +    √ passed value is a function
    +    √ passed value is not a function
     
       Testing isLowerCase
     
    -    ✔ isLowerCase is a Function
    -    ✔ passed string is a lowercase
    -    ✔ passed string is a lowercase
    -    ✔ passed value is not a lowercase
    +    √ isLowerCase is a Function
    +    √ passed string is a lowercase
    +    √ passed string is a lowercase
    +    √ passed value is not a lowercase
     
       Testing isMap
     
    -    ✔ isMap is a Function
    +    √ isMap is a Function
     
       Testing isNil
     
    -    ✔ isNil is a Function
    -    ✔ Returns true for null
    -    ✔ Returns true for undefined
    -    ✔ Returns false for an empty string
    +    √ isNil is a Function
    +    √ Returns true for null
    +    √ Returns true for undefined
    +    √ Returns false for an empty string
     
       Testing isNull
     
    -    ✔ isNull is a Function
    -    ✔ passed argument is a null
    -    ✔ passed argument is a null
    +    √ isNull is a Function
    +    √ passed argument is a null
    +    √ passed argument is a null
     
       Testing isNumber
     
    -    ✔ isNumber is a Function
    -    ✔ passed argument is a number
    -    ✔ passed argument is not a number
    +    √ isNumber is a Function
    +    √ passed argument is a number
    +    √ passed argument is not a number
     
       Testing isObject
     
    -    ✔ isObject is a Function
    -    ✔ isObject([1, 2, 3, 4]) is a object
    -    ✔ isObject([]) is a object
    -    ✔ isObject({ a:1 }) is a object
    -    ✔ isObject(true) is not a object
    +    √ isObject is a Function
    +    √ isObject([1, 2, 3, 4]) is a object
    +    √ isObject([]) is a object
    +    √ isObject({ a:1 }) is a object
    +    √ isObject(true) is not a object
     
       Testing isObjectLike
     
    -    ✔ isObjectLike is a Function
    -    ✔ Returns true for an object
    -    ✔ Returns true for an array
    -    ✔ Returns false for a function
    -    ✔ Returns false for null
    +    √ isObjectLike is a Function
    +    √ Returns true for an object
    +    √ Returns true for an array
    +    √ Returns false for a function
    +    √ Returns false for null
     
       Testing isPlainObject
     
    -    ✔ isPlainObject is a Function
    -    ✔ Returns true for a plain object
    -    ✔ Returns false for a Map (example of non-plain object)
    +    √ isPlainObject is a Function
    +    √ Returns true for a plain object
    +    √ Returns false for a Map (example of non-plain object)
     
       Testing isPrime
     
    -    ✔ isPrime is a Function
    -    ✔ passed number is a prime
    +    √ isPrime is a Function
    +    √ passed number is a prime
     
       Testing isPrimitive
     
    -    ✔ isPrimitive is a Function
    -    ✔ isPrimitive(null) is primitive
    -    ✔ isPrimitive(undefined) is primitive
    -    ✔ isPrimitive(string) is primitive
    -    ✔ isPrimitive(true) is primitive
    -    ✔ isPrimitive(50) is primitive
    -    ✔ isPrimitive('Hello') is primitive
    -    ✔ isPrimitive(false) is primitive
    -    ✔ isPrimitive(Symbol()) is primitive
    -    ✔ isPrimitive([1, 2, 3]) is not primitive
    -    ✔ isPrimitive({ a: 123 }) is not primitive
    -    ✔ isPrimitive({ a: 123 }) takes less than 2s to run
    +    √ isPrimitive is a Function
    +    √ isPrimitive(null) is primitive
    +    √ isPrimitive(undefined) is primitive
    +    √ isPrimitive(string) is primitive
    +    √ isPrimitive(true) is primitive
    +    √ isPrimitive(50) is primitive
    +    √ isPrimitive('Hello') is primitive
    +    √ isPrimitive(false) is primitive
    +    √ isPrimitive(Symbol()) is primitive
    +    √ isPrimitive([1, 2, 3]) is not primitive
    +    √ isPrimitive({ a: 123 }) is not primitive
    +    √ isPrimitive({ a: 123 }) takes less than 2s to run
     
       Testing isPromiseLike
     
    -    ✔ isPromiseLike is a Function
    -    ✔ Returns true for a promise-like object
    -    ✔ Returns false for null
    -    ✔ Returns false for an empty object
    +    √ isPromiseLike is a Function
    +    √ Returns true for a promise-like object
    +    √ Returns false for null
    +    √ Returns false for an empty object
     
       Testing isRegExp
     
    -    ✔ isRegExp is a Function
    +    √ isRegExp is a Function
     
       Testing isSet
     
    -    ✔ isSet is a Function
    +    √ isSet is a Function
     
       Testing isSorted
     
    -    ✔ isSorted is a Function
    -    ✔ Array is sorted in ascending order
    -    ✔ Array is sorted in descending order
    -    ✔ Array is not sorted, direction changed in array
    +    √ isSorted is a Function
    +    √ Array is sorted in ascending order
    +    √ Array is sorted in descending order
    +    √ Array is not sorted, direction changed in array
     
       Testing isString
     
    -    ✔ isString is a Function
    -    ✔ foo is a string
    -    ✔ "10" is a string
    -    ✔ Empty string is a string
    -    ✔ 10 is not a string
    -    ✔ true is not string
    +    √ isString is a Function
    +    √ foo is a string
    +    √ "10" is a string
    +    √ Empty string is a string
    +    √ 10 is not a string
    +    √ true is not string
     
       Testing isSymbol
     
    -    ✔ isSymbol is a Function
    -    ✔ Checks if the given argument is a symbol
    +    √ isSymbol is a Function
    +    √ Checks if the given argument is a symbol
     
       Testing isTravisCI
     
    -    ✔ isTravisCI is a Function
    -    ✔ Running on Travis, correctly evaluates
    +    √ isTravisCI is a Function
    +    √ Not running on Travis, correctly evaluates
     
       Testing isTypedArray
     
    -    ✔ isTypedArray is a Function
    +    √ isTypedArray is a Function
     
       Testing isUndefined
     
    -    ✔ isUndefined is a Function
    -    ✔ Returns true for undefined
    +    √ isUndefined is a Function
    +    √ Returns true for undefined
     
       Testing isUpperCase
     
    -    ✔ isUpperCase is a Function
    -    ✔ ABC is all upper case
    -    ✔ abc is not all upper case
    -    ✔ A3@$ is all uppercase
    +    √ isUpperCase is a Function
    +    √ ABC is all upper case
    +    √ abc is not all upper case
    +    √ A3@$ is all uppercase
     
       Testing isValidJSON
     
    -    ✔ isValidJSON is a Function
    -    ✔ {"name":"Adam","age":20} is a valid JSON
    -    ✔ {"name":"Adam",age:"20"} is not a valid JSON
    -    ✔ null is a valid JSON
    +    √ isValidJSON is a Function
    +    √ {"name":"Adam","age":20} is a valid JSON
    +    √ {"name":"Adam",age:"20"} is not a valid JSON
    +    √ null is a valid JSON
     
       Testing isWeakMap
     
    -    ✔ isWeakMap is a Function
    +    √ isWeakMap is a Function
     
       Testing isWeakSet
     
    -    ✔ isWeakSet is a Function
    +    √ isWeakSet is a Function
     
       Testing join
     
    -    ✔ join is a Function
    -    ✔ Joins all elements of an array into a string and returns this string
    -    ✔ Joins all elements of an array into a string and returns this string
    -    ✔ Joins all elements of an array into a string and returns this string
    +    √ join is a Function
    +    √ Joins all elements of an array into a string and returns this string
    +    √ Joins all elements of an array into a string and returns this string
    +    √ Joins all elements of an array into a string and returns this string
    +
    +  Testing JSONToDate
    +
    +    √ JSONToDate is a Function
    +
    +  Testing JSONToFile
    +
    +    √ JSONToFile is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing last
     
    -    ✔ last is a Function
    -    ✔ last({ a: 1234}) returns undefined
    -    ✔ last([1, 2, 3]) returns 3
    -    ✔ last({ 0: false}) returns undefined
    -    ✔ last(String) returns g
    -    ✔ last(null) throws an Error
    -    ✔ last(undefined) throws an Error
    -    ✔ last() throws an Error
    -    ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
    +    √ last is a Function
    +    √ last({ a: 1234}) returns undefined
    +    √ last([1, 2, 3]) returns 3
    +    √ last({ 0: false}) returns undefined
    +    √ last(String) returns g
    +    √ last(null) throws an Error
    +    √ last(undefined) throws an Error
    +    √ last() throws an Error
    +    √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
     
       Testing lcm
     
    -    ✔ lcm is a Function
    -    ✔ Returns the least common multiple of two or more numbers.
    -    ✔ Returns the least common multiple of two or more numbers.
    +    √ lcm is a Function
    +    √ Returns the least common multiple of two or more numbers.
    +    √ Returns the least common multiple of two or more numbers.
     
       Testing longestItem
     
    -    ✔ longestItem is a Function
    -    ✔ Returns the longest object
    +    √ longestItem is a Function
    +    √ Returns the longest object
     
       Testing lowercaseKeys
     
    -    ✔ lowercaseKeys is a Function
    -    ✔ Lowercases object keys
    -    ✔ Does not mutate original object
    +    √ lowercaseKeys is a Function
    +    √ Lowercases object keys
    +    √ Does not mutate original object
     
       Testing luhnCheck
     
    -    ✔ luhnCheck is a Function
    -    ✔ validates identification number
    -    ✔ validates identification number
    -    ✔ validates identification number
    +    √ luhnCheck is a Function
    +    √ validates identification number
    +    √ validates identification number
    +    √ validates identification number
     
       Testing mapKeys
     
    -    ✔ mapKeys is a Function
    -    ✔ Maps keys
    +    √ mapKeys is a Function
    +    √ Maps keys
     
       Testing mapObject
     
    -    ✔ mapObject is a Function
    -    ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 }
    -    ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 }
    -    ✔ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 }
    +    √ mapObject is a Function
    +    √ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 }
    +    √ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 }
    +    √ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 }
     
       Testing mapValues
     
    -    ✔ mapValues is a Function
    -    ✔ Maps values
    +    √ mapValues is a Function
    +    √ Maps values
     
       Testing mask
     
    -    ✔ mask is a Function
    -    ✔ Replaces all but the last num of characters with the specified mask character
    -    ✔ Replaces all but the last num of characters with the specified mask character
    -    ✔ Replaces all but the last num of characters with the specified mask character
    +    √ mask is a Function
    +    √ Replaces all but the last num of characters with the specified mask character
    +    √ Replaces all but the last num of characters with the specified mask character
    +    √ Replaces all but the last num of characters with the specified mask character
     
       Testing matches
     
    -    ✔ matches is a Function
    -    ✔ Matches returns true for two similar objects
    -    ✔ Matches returns false for two non-similar objects
    +    √ matches is a Function
    +    √ Matches returns true for two similar objects
    +    √ Matches returns false for two non-similar objects
     
       Testing matchesWith
     
    -    ✔ matchesWith is a Function
    -    ✔ Returns true for two objects with similar values, based on the provided function
    +    √ matchesWith is a Function
    +    √ Returns true for two objects with similar values, based on the provided function
     
       Testing maxBy
     
    -    ✔ maxBy is a Function
    -    ✔ Produces the right result with a function
    -    ✔ Produces the right result with a property name
    +    √ maxBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing maxN
     
    -    ✔ maxN is a Function
    -    ✔ Returns the n maximum elements from the provided array
    -    ✔ Returns the n maximum elements from the provided array
    +    √ maxN is a Function
    +    √ Returns the n maximum elements from the provided array
    +    √ Returns the n maximum elements from the provided array
     
       Testing median
     
    -    ✔ median is a Function
    -    ✔ Returns the median of an array of numbers
    -    ✔ Returns the median of an array of numbers
    +    √ median is a Function
    +    √ Returns the median of an array of numbers
    +    √ Returns the median of an array of numbers
     
       Testing memoize
     
    -    ✔ memoize is a Function
    -    ✔ Function works properly
    -    ✔ Function works properly
    -    ✔ Cache stores values
    +    √ memoize is a Function
    +    √ Function works properly
    +    √ Function works properly
    +    √ Cache stores values
     
       Testing merge
     
    -    ✔ merge is a Function
    -    ✔ Merges two objects
    +    √ merge is a Function
    +    √ Merges two objects
     
       Testing minBy
     
    -    ✔ minBy is a Function
    -    ✔ Produces the right result with a function
    -    ✔ Produces the right result with a property name
    +    √ minBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing minN
     
    -    ✔ minN is a Function
    -    ✔ Returns the n minimum elements from the provided array
    -    ✔ Returns the n minimum elements from the provided array
    +    √ minN is a Function
    +    √ Returns the n minimum elements from the provided array
    +    √ Returns the n minimum elements from the provided array
     
       Testing mostPerformant
     
         √ mostPerformant is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing negate
     
    -    ✔ negate is a Function
    -    ✔ Negates a predicate function
    +    √ negate is a Function
    +    √ Negates a predicate function
     
       Testing none
     
    @@ -1082,775 +1104,809 @@ Test log for: Fri Feb 16 2018 13:42:15 GMT+0200 (GTB Standard Time)
     
       Testing nthArg
     
    -    ✔ nthArg is a Function
    -    ✔ Returns the nth argument
    -    ✔ Returns undefined if arguments too few
    -    ✔ Works for negative values
    +    √ nthArg is a Function
    +    √ Returns the nth argument
    +    √ Returns undefined if arguments too few
    +    √ Works for negative values
     
       Testing nthElement
     
    -    ✔ nthElement is a Function
    -    ✔ Returns the nth element of an array.
    -    ✔ Returns the nth element of an array.
    +    √ nthElement is a Function
    +    √ Returns the nth element of an array.
    +    √ Returns the nth element of an array.
     
       Testing objectFromPairs
     
    -    ✔ objectFromPairs is a Function
    -    ✔ Creates an object from the given key-value pairs.
    +    √ objectFromPairs is a Function
    +    √ Creates an object from the given key-value pairs.
     
       Testing objectToPairs
     
    -    ✔ objectToPairs is a Function
    -    ✔ Creates an array of key-value pair arrays from an object.
    +    √ objectToPairs is a Function
    +    √ Creates an array of key-value pair arrays from an object.
     
       Testing observeMutations
     
    -    ✔ observeMutations is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ observeMutations is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing off
     
    -    ✔ off is a Function
    +    √ off is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing omit
     
    -    ✔ omit is a Function
    -    ✔ Omits the key-value pairs corresponding to the given keys from an object
    +    √ omit is a Function
    +    √ Omits the key-value pairs corresponding to the given keys from an object
     
       Testing omitBy
     
    -    ✔ omitBy is a Function
    -    ✔ Creates an object composed of the properties the given function returns falsey for
    +    √ omitBy is a Function
    +    √ Creates an object composed of the properties the given function returns falsey for
     
       Testing on
     
    -    ✔ on is a Function
    -
    -  Testing onUserInputChange
    -
    -    ✔ onUserInputChange is a Function
    +    √ on is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing once
     
    -    ✔ once is a Function
    +    √ once is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
    +
    +  Testing onUserInputChange
    +
    +    √ onUserInputChange is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing orderBy
     
    -    ✔ orderBy is a Function
    -    ✔ Returns a sorted array of objects ordered by properties and orders.
    -    ✔ Returns a sorted array of objects ordered by properties and orders.
    +    √ orderBy is a Function
    +    √ Returns a sorted array of objects ordered by properties and orders.
    +    √ Returns a sorted array of objects ordered by properties and orders.
     
       Testing over
     
    -    ✔ over is a Function
    -    ✔ Applies given functions over multiple arguments
    +    √ over is a Function
    +    √ Applies given functions over multiple arguments
     
       Testing overArgs
     
    -    ✔ overArgs is a Function
    -    ✔ Invokes the provided function with its arguments transformed
    +    √ overArgs is a Function
    +    √ Invokes the provided function with its arguments transformed
     
       Testing palindrome
     
    -    ✔ palindrome is a Function
    -    ✔ Given string is a palindrome
    -    ✔ Given string is not a palindrome
    +    √ palindrome is a Function
    +    √ Given string is a palindrome
    +    √ Given string is not a palindrome
     
       Testing parseCookie
     
    -    ✔ parseCookie is a Function
    -    ✔ Parses the cookie
    +    √ parseCookie is a Function
    +    √ Parses the cookie
     
       Testing partial
     
    -    ✔ partial is a Function
    -    ✔ Prepends arguments
    +    √ partial is a Function
    +    √ Prepends arguments
     
       Testing partialRight
     
    -    ✔ partialRight is a Function
    -    ✔ Appends arguments
    +    √ partialRight is a Function
    +    √ Appends arguments
     
       Testing partition
     
    -    ✔ partition is a Function
    -    ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element.
    +    √ partition is a Function
    +    √ Groups the elements into two arrays, depending on the provided function's truthiness for each element.
     
       Testing percentile
     
    -    ✔ percentile is a Function
    -    ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.
    +    √ percentile is a Function
    +    √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.
     
       Testing pick
     
    -    ✔ pick is a Function
    -    ✔ Picks the key-value pairs corresponding to the given keys from an object.
    +    √ pick is a Function
    +    √ Picks the key-value pairs corresponding to the given keys from an object.
     
       Testing pickBy
     
    -    ✔ pickBy is a Function
    -    ✔ Creates an object composed of the properties the given function returns truthy for.
    +    √ pickBy is a Function
    +    √ Creates an object composed of the properties the given function returns truthy for.
     
       Testing pipeAsyncFunctions
     
    -    ✔ pipeAsyncFunctions is a Function
    -    ✔ Produces the appropriate hash
    -    ✔ pipeAsyncFunctions result should be 15
    +    √ pipeAsyncFunctions is a Function
    +    √ Produces the appropriate hash
    +    √ pipeAsyncFunctions result should be 15
     
       Testing pipeFunctions
     
    -    ✔ pipeFunctions is a Function
    -    ✔ Performs left-to-right function composition
    +    √ pipeFunctions is a Function
    +    √ Performs left-to-right function composition
     
       Testing pluralize
     
    -    ✔ pluralize is a Function
    -    ✔ Produces the plural of the word
    -    ✔ Produces the singular of the word
    -    ✔ Produces the plural of the word
    -    ✔ Prodices the defined plural of the word
    -    ✔ Works with a dictionary
    +    √ pluralize is a Function
    +    √ Produces the plural of the word
    +    √ Produces the singular of the word
    +    √ Produces the plural of the word
    +    √ Prodices the defined plural of the word
    +    √ Works with a dictionary
     
       Testing powerset
     
    -    ✔ powerset is a Function
    -    ✔ Returns the powerset of a given array of numbers.
    +    √ powerset is a Function
    +    √ Returns the powerset of a given array of numbers.
     
       Testing prettyBytes
     
    -    ✔ prettyBytes is a Function
    -    ✔ Converts a number in bytes to a human-readable string.
    -    ✔ Converts a number in bytes to a human-readable string.
    -    ✔ Converts a number in bytes to a human-readable string.
    +    √ prettyBytes is a Function
    +    √ Converts a number in bytes to a human-readable string.
    +    √ Converts a number in bytes to a human-readable string.
    +    √ Converts a number in bytes to a human-readable string.
     
       Testing primes
     
    -    ✔ primes is a Function
    -    ✔ Generates primes up to a given number, using the Sieve of Eratosthenes.
    +    √ primes is a Function
    +    √ Generates primes up to a given number, using the Sieve of Eratosthenes.
     
       Testing promisify
     
    -    ✔ promisify is a Function
    -    ✔ Returns a promise
    +    √ promisify is a Function
    +    √ Returns a promise
     
       Testing pull
     
    -    ✔ pull is a Function
    -    ✔ Pulls the specified values
    +    √ pull is a Function
    +    √ Pulls the specified values
     
       Testing pullAtIndex
     
    -    ✔ pullAtIndex is a Function
    -    ✔ Pulls the given values
    -    ✔ Pulls the given values
    +    √ pullAtIndex is a Function
    +    √ Pulls the given values
    +    √ Pulls the given values
     
       Testing pullAtValue
     
    -    ✔ pullAtValue is a Function
    -    ✔ Pulls the specified values
    -    ✔ Pulls the specified values
    +    √ pullAtValue is a Function
    +    √ Pulls the specified values
    +    √ Pulls the specified values
     
       Testing pullBy
     
    -    ✔ pullBy is a Function
    -    ✔ Pulls the specified values
    +    √ pullBy is a Function
    +    √ Pulls the specified values
     
       Testing quickSort
     
    -    ✔ quickSort is a Function
    -    ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]
    -    ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0]
    -    ✔ quickSort() throws an error
    -    ✔ quickSort(123) throws an error
    -    ✔ quickSort({ 234: string}) throws an error
    -    ✔ quickSort(null) throws an error
    -    ✔ quickSort(undefined) throws an error
    -    ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run
    +    √ quickSort is a Function
    +    √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]
    +    √ quickSort([-1, 0, -2]) returns [-2, -1, 0]
    +    √ quickSort() throws an error
    +    √ quickSort(123) throws an error
    +    √ quickSort({ 234: string}) throws an error
    +    √ quickSort(null) throws an error
    +    √ quickSort(undefined) throws an error
    +    √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run
     
       Testing radsToDegrees
     
    -    ✔ radsToDegrees is a Function
    -    ✔ Returns the appropriate value
    +    √ radsToDegrees is a Function
    +    √ Returns the appropriate value
     
       Testing randomHexColorCode
     
    -    ✔ randomHexColorCode is a Function
    -    ✔ should be equal
    +    √ randomHexColorCode is a Function
    +    √ should be equal
    +    √ The color code starts with "#"
    +    √ The color code contains only valid hex-digits
     
       Testing randomIntArrayInRange
     
    -    ✔ randomIntArrayInRange is a Function
    -    ✔ The returned array contains only integers
    -    ✔ The returned array has the proper length
    -    ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive).
    +    √ randomIntArrayInRange is a Function
    +    √ The returned array contains only integers
    +    √ The returned array has the proper length
    +    √ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive).
     
       Testing randomIntegerInRange
     
    -    ✔ randomIntegerInRange is a Function
    -    ✔ The returned value is an integer
    -    ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive).
    +    √ randomIntegerInRange is a Function
    +    √ The returned value is an integer
    +    √ The returned value lies between provided lowerLimit and upperLimit (both inclusive).
     
       Testing randomNumberInRange
     
    -    ✔ randomNumberInRange is a Function
    -    ✔ The returned value is a number
    -    ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive).
    +    √ randomNumberInRange is a Function
    +    √ The returned value is a number
    +    √ The returned value lies between provided lowerLimit and upperLimit (both inclusive).
     
       Testing readFileLines
     
    -    ✔ readFileLines is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ readFileLines is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing rearg
     
    -    ✔ rearg is a Function
    -    ✔ Reorders arguments in invoked function
    +    √ rearg is a Function
    +    √ Reorders arguments in invoked function
     
       Testing redirect
     
    -    ✔ redirect is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    -
    -  Testing reduceSuccessive
    -
    -    ✔ reduceSuccessive is a Function
    -    ✔ Returns the array of successively reduced values
    -
    -  Testing reduceWhich
    -
    -    ✔ reduceWhich is a Function
    -    ✔ Returns the minimum of an array
    -    ✔ Returns the maximum of an array
    -    ✔ Returns the object with the minimum specified value in an array
    +    √ redirect is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing reducedFilter
     
    -    ✔ reducedFilter is a Function
    -    ✔ Filter an array of objects based on a condition while also filtering out unspecified keys.
    +    √ reducedFilter is a Function
    +    √ Filter an array of objects based on a condition while also filtering out unspecified keys.
    +
    +  Testing reduceSuccessive
    +
    +    √ reduceSuccessive is a Function
    +    √ Returns the array of successively reduced values
    +
    +  Testing reduceWhich
    +
    +    √ reduceWhich is a Function
    +    √ Returns the minimum of an array
    +    √ Returns the maximum of an array
    +    √ Returns the object with the minimum specified value in an array
     
       Testing remove
     
    -    ✔ remove is a Function
    -    ✔ Removes elements from an array for which the given function returns false
    +    √ remove is a Function
    +    √ Removes elements from an array for which the given function returns false
     
       Testing removeNonASCII
     
    -    ✔ removeNonASCII is a Function
    -    ✔ Removes non-ASCII characters
    +    √ removeNonASCII is a Function
    +    √ Removes non-ASCII characters
     
       Testing removeVowels
     
    -    ✔ removeVowels is a Function
    +    √ removeVowels is a Function
     
       Testing reverseString
     
    -    ✔ reverseString is a Function
    -    ✔ Reverses a string.
    +    √ reverseString is a Function
    +    √ Reverses a string.
    +
    +  Testing RGBToHex
    +
    +    √ RGBToHex is a Function
    +    √ Converts the values of RGB components to a color code.
     
       Testing round
     
    -    ✔ round is a Function
    -    ✔ round(1.005, 2) returns 1.01
    -    ✔ round(123.3423345345345345344, 11) returns 123.34233453453
    -    ✔ round(3.342, 11) returns 3.342
    -    ✔ round(1.005) returns 1
    -    ✔ round([1.005, 2]) returns NaN
    -    ✔ round(string) returns NaN
    -    ✔ round() returns NaN
    -    ✔ round(132, 413, 4134) returns NaN
    -    ✔ round({a: 132}, 413) returns NaN
    -    ✔ round(123.3423345345345345344, 11) takes less than 2s to run
    +    √ round is a Function
    +    √ round(1.005, 2) returns 1.01
    +    √ round(123.3423345345345345344, 11) returns 123.34233453453
    +    √ round(3.342, 11) returns 3.342
    +    √ round(1.005) returns 1
    +    √ round([1.005, 2]) returns NaN
    +    √ round(string) returns NaN
    +    √ round() returns NaN
    +    √ round(132, 413, 4134) returns NaN
    +    √ round({a: 132}, 413) returns NaN
    +    √ round(123.3423345345345345344, 11) takes less than 2s to run
     
       Testing runAsync
     
    -    ✔ runAsync is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ runAsync is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing runPromisesInSeries
     
    -    ✔ runPromisesInSeries is a Function
    +    √ runPromisesInSeries is a Function
     
       Testing sample
     
    -    ✔ sample is a Function
    -    ✔ Returns a random element from the array
    -    ✔ Works for single-element arrays
    -    ✔ Returns undefined for empty array
    +    √ sample is a Function
    +    √ Returns a random element from the array
    +    √ Works for single-element arrays
    +    √ Returns undefined for empty array
     
       Testing sampleSize
     
    -    ✔ sampleSize is a Function
    -    ✔ Returns a single element without n specified
    -    ✔ Returns a random sample of specified size from an array
    -    ✔ Returns all elements in an array if n >= length
    -    ✔ Returns an empty array if original array is empty
    -    ✔ Returns an empty array if n = 0
    +    √ sampleSize is a Function
    +    √ Returns a single element without n specified
    +    √ Returns a random sample of specified size from an array
    +    √ Returns all elements in an array if n >= length
    +    √ Returns an empty array if original array is empty
    +    √ Returns an empty array if n = 0
     
       Testing scrollToTop
     
    -    ✔ scrollToTop is a Function
    -    ✔ Tested on 09/02/2018 by @chalarangelo
    +    √ scrollToTop is a Function
    +    √ Tested on 09/02/2018 by @chalarangelo
     
       Testing sdbm
     
    -    ✔ sdbm is a Function
    -    ✔ Hashes the input string into a whole number.
    +    √ sdbm is a Function
    +    √ Hashes the input string into a whole number.
     
       Testing serializeCookie
     
    -    ✔ serializeCookie is a Function
    -    ✔ Serializes the cookie
    +    √ serializeCookie is a Function
    +    √ Serializes the cookie
     
       Testing setStyle
     
    -    ✔ setStyle is a Function
    +    √ setStyle is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing shallowClone
     
    -    ✔ shallowClone is a Function
    -    ✔ Shallow cloning works
    -    ✔ Does not clone deeply
    +    √ shallowClone is a Function
    +    √ Shallow cloning works
    +    √ Does not clone deeply
     
       Testing show
     
    -    ✔ show is a Function
    +    √ show is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing shuffle
     
    -    ✔ shuffle is a Function
    -    ✔ Shuffles the array
    -    ✔ New array contains all original elements
    -    ✔ Works for empty arrays
    -    ✔ Works for single-element arrays
    +    √ shuffle is a Function
    +    √ Shuffles the array
    +    √ New array contains all original elements
    +    √ Works for empty arrays
    +    √ Works for single-element arrays
     
       Testing similarity
     
    -    ✔ similarity is a Function
    -    ✔ Returns an array of elements that appear in both arrays.
    +    √ similarity is a Function
    +    √ Returns an array of elements that appear in both arrays.
     
       Testing size
     
    -    ✔ size is a Function
    -    ✔ Get size of arrays, objects or strings.
    -    ✔ Get size of arrays, objects or strings.
    +    √ size is a Function
    +    √ Get size of arrays, objects or strings.
    +    √ Get size of arrays, objects or strings.
     
       Testing sleep
     
    -    ✔ sleep is a Function
    +    √ sleep is a Function
     
       Testing solveRPN
     
    -    ✔ solveRPN is a Function
    +    √ solveRPN is a Function
     
       Testing sortCharactersInString
     
    -    ✔ sortCharactersInString is a Function
    -    ✔ Alphabetically sorts the characters in a string.
    +    √ sortCharactersInString is a Function
    +    √ Alphabetically sorts the characters in a string.
     
       Testing sortedIndex
     
    -    ✔ sortedIndex is a Function
    -    ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order.
    -    ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order.
    +    √ sortedIndex is a Function
    +    √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order.
    +    √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order.
     
       Testing sortedIndexBy
     
    -    ✔ sortedIndexBy is a Function
    -    ✔ Returns the lowest index to insert the element without messing up the list order
    +    √ sortedIndexBy is a Function
    +    √ Returns the lowest index to insert the element without messing up the list order
     
       Testing sortedLastIndex
     
    -    ✔ sortedLastIndex is a Function
    -    ✔ Returns the highest index to insert the element without messing up the list order
    +    √ sortedLastIndex is a Function
    +    √ Returns the highest index to insert the element without messing up the list order
     
       Testing sortedLastIndexBy
     
    -    ✔ sortedLastIndexBy is a Function
    -    ✔ Returns the highest index to insert the element without messing up the list order
    +    √ sortedLastIndexBy is a Function
    +    √ Returns the highest index to insert the element without messing up the list order
     
       Testing speechSynthesis
     
    -    ✔ speechSynthesis is a Function
    +    √ speechSynthesis is a Function
     
       Testing splitLines
     
    -    ✔ splitLines is a Function
    -    ✔ Splits a multiline string into an array of lines.
    +    √ splitLines is a Function
    +    √ Splits a multiline string into an array of lines.
     
       Testing spreadOver
     
    -    ✔ spreadOver is a Function
    -    ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.
    +    √ spreadOver is a Function
    +    √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.
     
       Testing standardDeviation
     
    -    ✔ standardDeviation is a Function
    -    ✔ Returns the standard deviation of an array of numbers
    -    ✔ Returns the standard deviation of an array of numbers
    +    √ standardDeviation is a Function
    +    √ Returns the standard deviation of an array of numbers
    +    √ Returns the standard deviation of an array of numbers
     
       Testing stripHTMLTags
     
    -    ✔ stripHTMLTags is a Function
    -    ✔ Removes HTML tags
    +    √ stripHTMLTags is a Function
    +    √ Removes HTML tags
     
       Testing sum
     
    -    ✔ sum is a Function
    -    ✔ Returns the sum of two or more numbers/arrays.
    +    √ sum is a Function
    +    √ Returns the sum of two or more numbers/arrays.
     
       Testing sumBy
     
    -    ✔ sumBy is a Function
    +    √ sumBy is a Function
     
       Testing sumPower
     
    -    ✔ sumPower is a Function
    -    ✔ Returns the sum of the powers of all the numbers from start to end
    -    ✔ Returns the sum of the powers of all the numbers from start to end
    -    ✔ Returns the sum of the powers of all the numbers from start to end
    +    √ sumPower is a Function
    +    √ Returns the sum of the powers of all the numbers from start to end
    +    √ Returns the sum of the powers of all the numbers from start to end
    +    √ Returns the sum of the powers of all the numbers from start to end
     
       Testing symmetricDifference
     
    -    ✔ symmetricDifference is a Function
    -    ✔ Returns the symmetric difference between two arrays.
    +    √ symmetricDifference is a Function
    +    √ Returns the symmetric difference between two arrays.
     
       Testing symmetricDifferenceBy
     
    -    ✔ symmetricDifferenceBy is a Function
    -    ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both
    +    √ symmetricDifferenceBy is a Function
    +    √ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both
     
       Testing symmetricDifferenceWith
     
    -    ✔ symmetricDifferenceWith is a Function
    -    ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator
    +    √ symmetricDifferenceWith is a Function
    +    √ Returns the symmetric difference between two arrays, using a provided function as a comparator
     
       Testing tail
     
    -    ✔ tail is a Function
    -    ✔ Returns tail
    -    ✔ Returns tail
    +    √ tail is a Function
    +    √ Returns tail
    +    √ Returns tail
     
       Testing take
     
    -    ✔ take is a Function
    -    ✔ Returns an array with n elements removed from the beginning.
    -    ✔ Returns an array with n elements removed from the beginning.
    +    √ take is a Function
    +    √ Returns an array with n elements removed from the beginning.
    +    √ Returns an array with n elements removed from the beginning.
     
       Testing takeRight
     
    -    ✔ takeRight is a Function
    -    ✔ Returns an array with n elements removed from the end
    -    ✔ Returns an array with n elements removed from the end
    +    √ takeRight is a Function
    +    √ Returns an array with n elements removed from the end
    +    √ Returns an array with n elements removed from the end
     
       Testing takeRightWhile
     
    -    ✔ takeRightWhile is a Function
    -    ✔ Removes elements until the function returns true
    +    √ takeRightWhile is a Function
    +    √ Removes elements until the function returns true
     
       Testing takeWhile
     
    -    ✔ takeWhile is a Function
    -    ✔ Removes elements until the function returns true
    +    √ takeWhile is a Function
    +    √ Removes elements until the function returns true
     
       Testing throttle
     
    -    ✔ throttle is a Function
    -
    -  Testing timeTaken
    -
    -    ✔ timeTaken is a Function
    +    √ throttle is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing times
     
    -    ✔ times is a Function
    -    ✔ Runs a function the specified amount of times
    +    √ times is a Function
    +    √ Runs a function the specified amount of times
    +
    +  Testing timeTaken
    +
    +    √ timeTaken is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
     
       Testing toCamelCase
     
    -    ✔ toCamelCase is a Function
    -    ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName
    -    ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized
    -    ✔ toCamelCase('some-javascript-property') return someJavascriptProperty
    -    ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens
    -    ✔ toCamelCase() throws a error
    -    ✔ toCamelCase([]) throws a error
    -    ✔ toCamelCase({}) throws a error
    -    ✔ toCamelCase(123) throws a error
    -    ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run
    +    √ toCamelCase is a Function
    +    √ toCamelCase('some_database_field_name') returns someDatabaseFieldName
    +    √ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized
    +    √ toCamelCase('some-javascript-property') return someJavascriptProperty
    +    √ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens
    +    √ toCamelCase() throws a error
    +    √ toCamelCase([]) throws a error
    +    √ toCamelCase({}) throws a error
    +    √ toCamelCase(123) throws a error
    +    √ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run
     
       Testing toCurrency
     
    -    ✔ toCurrency is a Function
    -    ✔ currency: Euro | currencyLangFormat: Local
    -    ✔ currency: US Dollar | currencyLangFormat: English (United States)
    -    ✔ currency: Japanese Yen | currencyLangFormat: Local
    +    √ toCurrency is a Function
    +    √ currency: Euro | currencyLangFormat: Local
    +    √ currency: US Dollar | currencyLangFormat: English (United States)
    +    √ currency: Japanese Yen | currencyLangFormat: Local
     
       Testing toDecimalMark
     
    -    ✔ toDecimalMark is a Function
    -    ✔ convert a float-point arithmetic to the Decimal mark form
    -
    -  Testing toKebabCase
    -
    -    ✔ toKebabCase is a Function
    -    ✔ toKebabCase('camelCase') returns camel-case
    -    ✔ toKebabCase('some text') returns some-text
    -    ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens
    -    ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html
    -    ✔ toKebabCase() return undefined
    -    ✔ toKebabCase([]) throws an error
    -    ✔ toKebabCase({}) throws an error
    -    ✔ toKebabCase(123) throws an error
    -    ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run
    -
    -  Testing toOrdinalSuffix
    -
    -    ✔ toOrdinalSuffix is a Function
    -    ✔ Adds an ordinal suffix to a number
    -    ✔ Adds an ordinal suffix to a number
    -    ✔ Adds an ordinal suffix to a number
    -    ✔ Adds an ordinal suffix to a number
    -
    -  Testing toSafeInteger
    -
    -    ✔ toSafeInteger is a Function
    -    ✔ Number(toSafeInteger(3.2)) is a number
    -    ✔ Converts a value to a safe integer
    -    ✔ toSafeInteger('4.2') returns 4
    -    ✔ toSafeInteger(4.6) returns 5
    -    ✔ toSafeInteger([]) returns 0
    -    ✔ isNaN(toSafeInteger([1.5, 3124])) is true
    -    ✔ isNaN(toSafeInteger('string')) is true
    -    ✔ isNaN(toSafeInteger({})) is true
    -    ✔ isNaN(toSafeInteger()) is true
    -    ✔ toSafeInteger(Infinity) returns 9007199254740991
    -    ✔ toSafeInteger(3.2) takes less than 2s to run
    -
    -  Testing toSnakeCase
    -
    -    ✔ toSnakeCase is a Function
    -    ✔ toSnakeCase('camelCase') returns camel_case
    -    ✔ toSnakeCase('some text') returns some_text
    -    ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens
    -    ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html
    -    ✔ toSnakeCase() returns undefined
    -    ✔ toSnakeCase([]) throws an error
    -    ✔ toSnakeCase({}) throws an error
    -    ✔ toSnakeCase(123) throws an error
    -    ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run
    +    √ toDecimalMark is a Function
    +    √ convert a float-point arithmetic to the Decimal mark form
     
       Testing toggleClass
     
    -    ✔ toggleClass is a Function
    +    √ toggleClass is a Function
    +    √ Tested by @chalarangelo on 16/02/2018
    +
    +  Testing toKebabCase
    +
    +    √ toKebabCase is a Function
    +    √ toKebabCase('camelCase') returns camel-case
    +    √ toKebabCase('some text') returns some-text
    +    √ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens
    +    √ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html
    +    √ toKebabCase() return undefined
    +    √ toKebabCase([]) throws an error
    +    √ toKebabCase({}) throws an error
    +    √ toKebabCase(123) throws an error
    +    √ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run
     
       Testing tomorrow
     
    -    ✔ tomorrow is a Function
    -    ✔ Returns the correct year
    -    ✔ Returns the correct month
    -    ✔ Returns the correct date
    +    √ tomorrow is a Function
    +    √ Returns the correct year
    +    √ Returns the correct month
    +    √ Returns the correct date
    +
    +  Testing toOrdinalSuffix
    +
    +    √ toOrdinalSuffix is a Function
    +    √ Adds an ordinal suffix to a number
    +    √ Adds an ordinal suffix to a number
    +    √ Adds an ordinal suffix to a number
    +    √ Adds an ordinal suffix to a number
    +
    +  Testing toSafeInteger
    +
    +    √ toSafeInteger is a Function
    +    √ Number(toSafeInteger(3.2)) is a number
    +    √ Converts a value to a safe integer
    +    √ toSafeInteger('4.2') returns 4
    +    √ toSafeInteger(4.6) returns 5
    +    √ toSafeInteger([]) returns 0
    +    √ isNaN(toSafeInteger([1.5, 3124])) is true
    +    √ isNaN(toSafeInteger('string')) is true
    +    √ isNaN(toSafeInteger({})) is true
    +    √ isNaN(toSafeInteger()) is true
    +    √ toSafeInteger(Infinity) returns 9007199254740991
    +    √ toSafeInteger(3.2) takes less than 2s to run
    +
    +  Testing toSnakeCase
    +
    +    √ toSnakeCase is a Function
    +    √ toSnakeCase('camelCase') returns camel_case
    +    √ toSnakeCase('some text') returns some_text
    +    √ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens
    +    √ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html
    +    √ toSnakeCase() returns undefined
    +    √ toSnakeCase([]) throws an error
    +    √ toSnakeCase({}) throws an error
    +    √ toSnakeCase(123) throws an error
    +    √ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run
     
       Testing transform
     
    -    ✔ transform is a Function
    -    ✔ Transforms an object
    +    √ transform is a Function
    +    √ Transforms an object
     
       Testing truncateString
     
    -    ✔ truncateString is a Function
    -    ✔ Truncates a "boomerang" up to a specified length.
    +    √ truncateString is a Function
    +    √ Truncates a "boomerang" up to a specified length.
     
       Testing truthCheckCollection
     
    -    ✔ truthCheckCollection is a Function
    -    ✔ second argument is truthy on all elements of a collection
    +    √ truthCheckCollection is a Function
    +    √ second argument is truthy on all elements of a collection
     
       Testing unary
     
    -    ✔ unary is a Function
    -    ✔ Discards arguments after the first one
    +    √ unary is a Function
    +    √ Discards arguments after the first one
     
       Testing uncurry
     
    -    ✔ uncurry is a Function
    -    ✔ Works without a provided value for n
    -    ✔ Works without n = 2
    -    ✔ Works withoutn = 3
    +    √ uncurry is a Function
    +    √ Works without a provided value for n
    +    √ Works without n = 2
    +    √ Works withoutn = 3
     
       Testing unescapeHTML
     
    -    ✔ unescapeHTML is a Function
    -    ✔ Unescapes escaped HTML characters.
    +    √ unescapeHTML is a Function
    +    √ Unescapes escaped HTML characters.
     
       Testing unflattenObject
     
    -    ✔ unflattenObject is a Function
    -    ✔ Unflattens an object with the paths for keys
    +    √ unflattenObject is a Function
    +    √ Unflattens an object with the paths for keys
     
       Testing unfold
     
    -    ✔ unfold is a Function
    -    ✔ Works with a given function, producing an array
    +    √ unfold is a Function
    +    √ Works with a given function, producing an array
     
       Testing union
     
    -    ✔ union is a Function
    -    ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]
    -    ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]
    -    ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]
    -    ✔ union([], []) returns []
    -    ✔ union() throws an error
    -    ✔ union(true, str) throws an error
    -    ✔ union(false, true) throws an error
    -    ✔ union(123, {}) throws an error
    -    ✔ union([], {}) throws an error
    -    ✔ union(undefined, null) throws an error
    -    ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run
    +    √ union is a Function
    +    √ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]
    +    √ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]
    +    √ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]
    +    √ union([], []) returns []
    +    √ union() throws an error
    +    √ union(true, str) throws an error
    +    √ union(false, true) throws an error
    +    √ union(123, {}) throws an error
    +    √ union([], {}) throws an error
    +    √ union(undefined, null) throws an error
    +    √ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run
     
       Testing unionBy
     
    -    ✔ unionBy is a Function
    -    ✔ Produces the appropriate results
    +    √ unionBy is a Function
    +    √ Produces the appropriate results
     
       Testing unionWith
     
    -    ✔ unionWith is a Function
    -    ✔ Produces the appropriate results
    +    √ unionWith is a Function
    +    √ Produces the appropriate results
     
       Testing uniqueElements
     
    -    ✔ uniqueElements is a Function
    -    ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]
    -    ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53]
    -    ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']
    -    ✔ uniqueElements() returns []
    -    ✔ uniqueElements(null) returns []
    -    ✔ uniqueElements(undefined) returns []
    -    ✔ uniqueElements('strt') returns ['s', 't', 'r']
    -    ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error
    -    ✔ uniqueElements({}) throws an error
    -    ✔ uniqueElements(true) throws an error
    -    ✔ uniqueElements(false) throws an error
    -    ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run
    +    √ uniqueElements is a Function
    +    √ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]
    +    √ uniqueElements([1, 23, 53]) returns [1, 23, 53]
    +    √ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']
    +    √ uniqueElements() returns []
    +    √ uniqueElements(null) returns []
    +    √ uniqueElements(undefined) returns []
    +    √ uniqueElements('strt') returns ['s', 't', 'r']
    +    √ uniqueElements(1, 1, 2543, 534, 5) throws an error
    +    √ uniqueElements({}) throws an error
    +    √ uniqueElements(true) throws an error
    +    √ uniqueElements(false) throws an error
    +    √ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run
     
       Testing untildify
     
    -    ✔ untildify is a Function
    -    ✔ Contains no tildes
    -    ✔ Does not alter the rest of the path
    -    ✔ Does not alter paths without tildes
    +    √ untildify is a Function
    +    √ Contains no tildes
    +    √ Does not alter the rest of the path
    +    √ Does not alter paths without tildes
     
       Testing unzip
     
    -    ✔ unzip is a Function
    -    ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]
    -    ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]
    +    √ unzip is a Function
    +    √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]
    +    √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]
     
       Testing unzipWith
     
    -    ✔ unzipWith is a Function
    -    ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]
    +    √ unzipWith is a Function
    +    √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]
    +
    +  Testing URLJoin
    +
    +    √ URLJoin is a Function
    +    √ Returns proper URL
    +    √ Returns proper URL
    +
    +  Testing UUIDGeneratorBrowser
    +
    +    √ UUIDGeneratorBrowser is a Function
    +    √ Tested 09/02/2018 by @chalarangelo
    +
    +  Testing UUIDGeneratorNode
    +
    +    √ UUIDGeneratorNode is a Function
    +    √ Contains dashes in the proper places
    +    √ Only contains hexadecimal digits
     
       Testing validateNumber
     
    -    ✔ validateNumber is a Function
    -    ✔ validateNumber(9) returns true
    -    ✔ validateNumber(234asd.slice(0, 2)) returns true
    -    ✔ validateNumber(1232) returns true
    -    ✔ validateNumber(1232 + 13423) returns true
    -    ✔ validateNumber(1232 * 2342 * 123) returns true
    -    ✔ validateNumber(1232.23423536) returns true
    -    ✔ validateNumber(234asd) returns false
    -    ✔ validateNumber(e234d) returns false
    -    ✔ validateNumber(false) returns false
    -    ✔ validateNumber(true) returns false
    -    ✔ validateNumber(null) returns false
    -    ✔ validateNumber(123 * asd) returns false
    +    √ validateNumber is a Function
    +    √ validateNumber(9) returns true
    +    √ validateNumber(234asd.slice(0, 2)) returns true
    +    √ validateNumber(1232) returns true
    +    √ validateNumber(1232 + 13423) returns true
    +    √ validateNumber(1232 * 2342 * 123) returns true
    +    √ validateNumber(1232.23423536) returns true
    +    √ validateNumber(234asd) returns false
    +    √ validateNumber(e234d) returns false
    +    √ validateNumber(false) returns false
    +    √ validateNumber(true) returns false
    +    √ validateNumber(null) returns false
    +    √ validateNumber(123 * asd) returns false
     
       Testing without
     
    -    ✔ without is a Function
    -    ✔ without([2, 1, 2, 3], 1, 2) returns [3]
    -    ✔ without([]) returns []
    -    ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1]
    -    ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']
    -    ✔ without() throws an error
    -    ✔ without(null) throws an error
    -    ✔ without(undefined) throws an error
    -    ✔ without() throws an error
    -    ✔ without({}) throws an error
    +    √ without is a Function
    +    √ without([2, 1, 2, 3], 1, 2) returns [3]
    +    √ without([]) returns []
    +    √ without([3, 1, true, '3', true], '3', true) returns [3, 1]
    +    √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']
    +    √ without() throws an error
    +    √ without(null) throws an error
    +    √ without(undefined) throws an error
    +    √ without() throws an error
    +    √ without({}) throws an error
     
       Testing words
     
    -    ✔ words is a Function
    -    ✔ words('I love javaScript!!') returns [I, love, javaScript]
    -    ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee]
    -    ✔ words(I love javaScript!!) returns an array
    -    ✔ words() throws a error
    -    ✔ words(null) throws a error
    -    ✔ words(undefined) throws a error
    -    ✔ words({}) throws a error
    -    ✔ words([]) throws a error
    -    ✔ words(1234) throws a error
    +    √ words is a Function
    +    √ words('I love javaScript!!') returns [I, love, javaScript]
    +    √ words('python, javaScript & coffee') returns [python, javaScript, coffee]
    +    √ words(I love javaScript!!) returns an array
    +    √ words() throws a error
    +    √ words(null) throws a error
    +    √ words(undefined) throws a error
    +    √ words({}) throws a error
    +    √ words([]) throws a error
    +    √ words(1234) throws a error
     
       Testing xProd
     
    -    ✔ xProd is a Function
    -    ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
    +    √ xProd is a Function
    +    √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
     
       Testing yesNo
     
    -    ✔ yesNo is a Function
    -    ✔ yesNo(Y) returns true
    -    ✔ yesNo(yes) returns true
    -    ✔ yesNo(foo, true) returns true
    -    ✔ yesNo(No) returns false
    -    ✔ yesNo() returns false
    -    ✔ yesNo(null) returns false
    -    ✔ yesNo(undefined) returns false
    -    ✔ yesNo([123, null]) returns false
    -    ✔ yesNo([Yes, No]) returns false
    -    ✔ yesNo({ 2: Yes }) returns false
    -    ✔ yesNo([Yes, No], true) returns true
    -    ✔ yesNo({ 2: Yes }, true) returns true
    +    √ yesNo is a Function
    +    √ yesNo(Y) returns true
    +    √ yesNo(yes) returns true
    +    √ yesNo(foo, true) returns true
    +    √ yesNo(No) returns false
    +    √ yesNo() returns false
    +    √ yesNo(null) returns false
    +    √ yesNo(undefined) returns false
    +    √ yesNo([123, null]) returns false
    +    √ yesNo([Yes, No]) returns false
    +    √ yesNo({ 2: Yes }) returns false
    +    √ yesNo([Yes, No], true) returns true
    +    √ yesNo({ 2: Yes }, true) returns true
     
       Testing zip
     
    -    ✔ zip is a Function
    -    ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]
    -    ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]
    -    ✔ zip([]) returns []
    -    ✔ zip(123) returns []
    -    ✔ zip([a, b], [1, 2], [true, false]) returns an Array
    -    ✔ zip([a], [1, 2], [true, false]) returns an Array
    -    ✔ zip(null) throws an error
    -    ✔ zip(undefined) throws an error
    +    √ zip is a Function
    +    √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]
    +    √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]
    +    √ zip([]) returns []
    +    √ zip(123) returns []
    +    √ zip([a, b], [1, 2], [true, false]) returns an Array
    +    √ zip([a], [1, 2], [true, false]) returns an Array
    +    √ zip(null) throws an error
    +    √ zip(undefined) throws an error
     
       Testing zipObject
     
    -    ✔ zipObject is a Function
    -    ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}
    -    ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}
    -    ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r }
    -    ✔ zipObject([a], string) returns { a: s }
    -    ✔ zipObject() throws an error
    -    ✔ zipObject([string], null) throws an error
    -    ✔ zipObject(null, [1]) throws an error
    -    ✔ zipObject(string) throws an error
    -    ✔ zipObject(test, string) throws an error
    +    √ zipObject is a Function
    +    √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}
    +    √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}
    +    √ zipObject([a, b, c], string) returns { a: s, b: t, c: r }
    +    √ zipObject([a], string) returns { a: s }
    +    √ zipObject() throws an error
    +    √ zipObject([string], null) throws an error
    +    √ zipObject(null, [1]) throws an error
    +    √ zipObject(string) throws an error
    +    √ zipObject(test, string) throws an error
     
       Testing zipWith
     
         √ zipWith is a Function
    -    √ Runs the function provided
         √ Sends a GET request
    +    √ Runs the function provided
         √ Runs promises in series
         √ Sends a POST request
    +    √ Works as expecting, passing arguments properly
         √ Works with multiple promises
     
     
    -  total:     945
    -  passing:   945
    -  duration:  4.9s
    +  total:     970
    +  passing:   970
    +  duration:  2.4s
     
     
    diff --git a/test/throttle/throttle.test.js b/test/throttle/throttle.test.js
    index 4de75afdb..fcd88a603 100644
    --- a/test/throttle/throttle.test.js
    +++ b/test/throttle/throttle.test.js
    @@ -5,9 +5,10 @@ test('Testing throttle', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof throttle === 'function', 'throttle is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(throttle(args..), 'Expected');
       //t.equal(throttle(args..), 'Expected');
       //t.false(throttle(args..), 'Expected');
       //t.throws(throttle(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js
    index 45d8aa0eb..fd72e9d13 100644
    --- a/test/timeTaken/timeTaken.test.js
    +++ b/test/timeTaken/timeTaken.test.js
    @@ -5,9 +5,10 @@ test('Testing timeTaken', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof timeTaken === 'function', 'timeTaken is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(timeTaken(args..), 'Expected');
       //t.equal(timeTaken(args..), 'Expected');
       //t.false(timeTaken(args..), 'Expected');
       //t.throws(timeTaken(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js
    index f7424a31d..f0bbe14d6 100644
    --- a/test/toggleClass/toggleClass.test.js
    +++ b/test/toggleClass/toggleClass.test.js
    @@ -5,9 +5,10 @@ test('Testing toggleClass', (t) => {
       //For more information on all the methods supported by tape
       //Please go to https://github.com/substack/tape
       t.true(typeof toggleClass === 'function', 'toggleClass is a Function');
    +  t.pass('Tested by @chalarangelo on 16/02/2018');
       //t.deepEqual(toggleClass(args..), 'Expected');
       //t.equal(toggleClass(args..), 'Expected');
       //t.false(toggleClass(args..), 'Expected');
       //t.throws(toggleClass(args..), 'Expected');
       t.end();
    -});
    \ No newline at end of file
    +});
    
    From 7ed6ab1a5d2d3379451be5cdff1aaf9b4dbcd619 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Fri, 16 Feb 2018 14:05:10 +0200
    Subject: [PATCH 34/43] Codacy code quality improvements
    
    ---
     test/chainAsync/chainAsync.test.js | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js
    index 244862417..a1e6edd06 100644
    --- a/test/chainAsync/chainAsync.test.js
    +++ b/test/chainAsync/chainAsync.test.js
    @@ -10,8 +10,8 @@ test('Testing chainAsync', (t) => {
           next();
         },
         next => {
    -      (() =>{
    -        next()
    +      (() => {
    +        next();
           })();
         },
         next => {
    
    From 36f4c70d31467273be363d6eba7c27e9a6e20dd7 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Fri, 16 Feb 2018 14:06:18 +0200
    Subject: [PATCH 35/43] Ready to release package
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 094ca7ffd..4dd3113d2 100644
    --- a/package.json
    +++ b/package.json
    @@ -19,7 +19,7 @@
       },
       "name": "30-seconds-of-code",
       "description": "A collection of useful JavaScript snippets.",
    -  "version": "0.0.1",
    +  "version": "0.0.2",
       "main": "dist/_30s.js",
       "module": "dist/_30s.esm.js",
       "scripts": {
    
    From c3f35d7a6bd8b92ce245a1cdc9362f0907919a6c Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Fri, 16 Feb 2018 12:11:03 +0000
    Subject: [PATCH 36/43] Travis build: 1688 [custom]
    
    ---
     dist/_30s.es5.js     |   17 +-
     dist/_30s.es5.min.js |    2 +-
     dist/_30s.esm.js     |   14 +-
     dist/_30s.js         |   14 +-
     dist/_30s.min.js     |    2 +-
     test/testlog         | 3722 +++++++++++++++++++++---------------------
     6 files changed, 1875 insertions(+), 1896 deletions(-)
    
    diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js
    index 74d832712..0f49c793d 100644
    --- a/dist/_30s.es5.js
    +++ b/dist/_30s.es5.js
    @@ -35,10 +35,7 @@ var UUIDGeneratorNode = function UUIDGeneratorNode() {
     };
     
     var all = function all(arr) {
    -  return arr.every(Boolean);
    -};
    -
    -var allBy = function allBy(arr, fn) {
    +  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Boolean;
       return arr.every(fn);
     };
     
    @@ -52,10 +49,7 @@ var anagrams = function anagrams(str) {
     };
     
     var any = function any(arr) {
    -  return arr.some(Boolean);
    -};
    -
    -var anyBy = function anyBy(arr, fn) {
    +  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Boolean;
       return arr.some(fn);
     };
     
    @@ -1364,10 +1358,7 @@ var negate = function negate(func) {
     };
     
     var none = function none(arr) {
    -  return !arr.some(Boolean);
    -};
    -
    -var noneBy = function noneBy(arr, fn) {
    +  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Boolean;
       return !arr.some(fn);
     };
     
    @@ -2481,7 +2472,7 @@ var zipWith = function zipWith() {
       }) : result;
     };
     
    -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, all: all, allBy: allBy, anagrams: anagrams, any: any, anyBy: anyBy, approximatelyEqual: approximatelyEqual, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bifurcate: bifurcate, bifurcateBy: bifurcateBy, bind: bind, bindAll: bindAll, bindKey: bindKey, binomialCoefficient: binomialCoefficient, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, degreesToRads: degreesToRads, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, mostPerformant: mostPerformant, negate: negate, none: none, noneBy: noneBy, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, radsToDegrees: radsToDegrees, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, uncurry: uncurry, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith };
    +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, all: all, anagrams: anagrams, any: any, approximatelyEqual: approximatelyEqual, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bifurcate: bifurcate, bifurcateBy: bifurcateBy, bind: bind, bindAll: bindAll, bindKey: bindKey, binomialCoefficient: binomialCoefficient, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, degreesToRads: degreesToRads, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, mostPerformant: mostPerformant, negate: negate, none: none, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, radsToDegrees: radsToDegrees, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, uncurry: uncurry, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith };
     
     return imports;
     
    diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js
    index f671c25cc..d024faabc 100644
    --- a/dist/_30s.es5.min.js
    +++ b/dist/_30s.es5.min.js
    @@ -1 +1 @@
    -(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e._30s=t()})(this,function(){'use strict';function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^$.randomBytes(1)[0]&15>>e/4).toString(16)})},all:function(e){return e.every(Boolean)},allBy:function(e,t){return e.every(t)},anagrams:function e(t){return 2>=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},any:function(e){return e.some(Boolean)},anyBy:function(e,t){return e.some(t)},approximatelyEqual:function(e,t){var n=2'})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;lt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:P(e/8.64e7),hour:P(e/3.6e6)%24,minute:P(e/6e4)%60,second:P(e/1e3)%60,millisecond:P(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=re(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':ie(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sG(e))return e+(r?' ':'')+i[0];var l=F(P(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/U(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=P(z(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,C(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return function(e){return function(t){return t.reduce(function(e,t){return e(t)},e)}}(e)(r.slice(0,t))}},unescapeHTML:function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(w(e),w(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(L(e),L(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(B(e),B(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(T(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,O(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,O(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^$.randomBytes(1)[0]&15>>e/4).toString(16)})},all:function(e){var t=1=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},any:function(e){var t=1'})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;lt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:P(e/8.64e7),hour:P(e/3.6e6)%24,minute:P(e/6e4)%60,second:P(e/1e3)%60,millisecond:P(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=re(s,2),h=c[0],i=c[1];if(h===e.length-1)return n;if(0<(i-e[h+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':ie(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sG(e))return e+(r?' ':'')+i[0];var l=F(P(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/U(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=P(z(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,C(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return function(e){return function(t){return t.reduce(function(e,t){return e(t)},e)}}(e)(r.slice(0,t))}},unescapeHTML:function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(w(e),w(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(L(e),L(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(T(e),T(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(B(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,O(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,O(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1
         (c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
       );
     
    -const all = arr => arr.every(Boolean);
    -
    -const allBy = (arr, fn) => arr.every(fn);
    +const all = (arr, fn = Boolean) => arr.every(fn);
     
     const anagrams = str => {
       if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
    @@ -40,9 +38,7 @@ const anagrams = str => {
         );
     };
     
    -const any = arr => arr.some(Boolean);
    -
    -const anyBy = (arr, fn) => arr.some(fn);
    +const any = (arr, fn = Boolean) => arr.some(fn);
     
     const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
     
    @@ -792,9 +788,7 @@ const mostPerformant = (fns, iterations = 10000) => {
     
     const negate = func => (...args) => !func(...args);
     
    -const none = arr => !arr.some(Boolean);
    -
    -const noneBy = (arr, fn) => !arr.some(fn);
    +const none = (arr, fn = Boolean) => !arr.some(fn);
     
     const nthArg = n => (...args) => args.slice(n)[0];
     
    @@ -1423,6 +1417,6 @@ const zipWith = (...arrays) => {
       return fn ? result.map(arr => fn(...arr)) : result;
     };
     
    -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
    +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
     
     export default imports;
    diff --git a/dist/_30s.js b/dist/_30s.js
    index 6237d7389..a4607f33b 100644
    --- a/dist/_30s.js
    +++ b/dist/_30s.js
    @@ -31,9 +31,7 @@ const UUIDGeneratorNode = () =>
         (c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
       );
     
    -const all = arr => arr.every(Boolean);
    -
    -const allBy = (arr, fn) => arr.every(fn);
    +const all = (arr, fn = Boolean) => arr.every(fn);
     
     const anagrams = str => {
       if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
    @@ -46,9 +44,7 @@ const anagrams = str => {
         );
     };
     
    -const any = arr => arr.some(Boolean);
    -
    -const anyBy = (arr, fn) => arr.some(fn);
    +const any = (arr, fn = Boolean) => arr.some(fn);
     
     const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
     
    @@ -798,9 +794,7 @@ const mostPerformant = (fns, iterations = 10000) => {
     
     const negate = func => (...args) => !func(...args);
     
    -const none = arr => !arr.some(Boolean);
    -
    -const noneBy = (arr, fn) => !arr.some(fn);
    +const none = (arr, fn = Boolean) => !arr.some(fn);
     
     const nthArg = n => (...args) => args.slice(n)[0];
     
    @@ -1429,7 +1423,7 @@ const zipWith = (...arrays) => {
       return fn ? result.map(arr => fn(...arr)) : result;
     };
     
    -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
    +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
     
     return imports;
     
    diff --git a/dist/_30s.min.js b/dist/_30s.min.js
    index 98745c13f..4be49ced6 100644
    --- a/dist/_30s.min.js
    +++ b/dist/_30s.min.js
    @@ -1 +1 @@
    -(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.sqrt,b=Math.log,c=Math.floor,d=Math.PI,e=Math.min,g=Math.max,h=Math.ceil,i=Math.round,j=Math.abs;const k='undefined'!=typeof require&&require('fs'),l='undefined'!=typeof require&&require('crypto'),m=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(m(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),n=(a,b=a.length,...c)=>b<=c.length?a(...c):n.bind(null,a,b,...c),o=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?o(a[c]):a[c]),b},p=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?p(a):a)),q=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>r(c[a],d[a]))},s=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*s(a-1),t=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?t(a,b-1):a),[]),u=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,u(a[d],e+d)):c[e+d]=a[d],c},{}),v=(...a)=>{const c=(a,b)=>b?v(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},w='undefined'!=typeof require&&require('crypto'),x='undefined'!=typeof require&&require('fs'),y=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0k.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^l.randomBytes(1)[0]&15>>a/4).toString(16)),all:(a)=>a.every(Boolean),allBy:(a,b)=>a.every(b),anagrams:m,any:(a)=>a.some(Boolean),anyBy:(a,b)=>a.some(b),approximatelyEqual:(a,b,c=1e-3)=>j(a-b)a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bifurcate:(a,b)=>a.reduce((a,c,d)=>(a[b[d]?0:1].push(c),a),[[],[]]),bifurcateBy:(a,b)=>a.reduce((a,c,d)=>(a[b(c,d)?0:1].push(c),a),[[],[]]),bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},binomialCoefficient:(a,b)=>{var c=Number.isNaN;if(c(a)||c(b))return NaN;if(0>b||b>a)return 0;if(0===b||b===a)return 1;if(1===b||b===a-1)return a;a-bdocument.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:n,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:o,deepFlatten:p,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),degreesToRads:(a)=>a*d/180,delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:s,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:t,flattenObject:u,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:c(a/8.64e7),hour:c(a/3.6e6)%24,minute:c(a/6e4)%60,second:c(a/1e3)%60,millisecond:c(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:v,geometricProgression:(a,d=1,e=2)=>Array.from({length:c(b(a/d)/b(e))+1}).map((a,b)=>d*e**b),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(w.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(b)=>{const d=c(a(b));for(var e=2;e<=d;e++)if(0==b%e)return!1;return 2<=b},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=c(a.length/2),d=[...a].sort((c,a)=>c-a);return 0==a.length%2?(d[b-1]+d[b])/2:d[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),mostPerformant:(a,b=1e4)=>{const c=a.map((a)=>{const c=performance.now();for(let c=0;c(...b)=>!a(...b),none:(a)=>!a.some(Boolean),noneBy:(a,b)=>!a.some(b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,d=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>j(a))return a+(d?' ':'')+g[0];const h=e(c(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(d?' ':'')+g[h]},primes:(b)=>{let d=Array.from({length:b-1}).map((a,b)=>b+2),e=c(a(b)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>d=d.filter((b)=>0!=b%a||b===a)),d},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},radsToDegrees:(a)=>180*a/d,randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,d=1)=>Array.from({length:d},()=>c(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>c(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>x.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(a,b=0)=>+`${i(`${a}e${b}`)}e-${b}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[c(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let d=a.length;d;){const b=c(Math.random()*d--);[a[d],a[b]]=[a[b],a[d]]}return a.slice(0,b)},scrollToTop:y,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const d=c(Math.random()*b--);[a[b],a[d]]=[a[d],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(b,c=!1)=>{const d=b.reduce((a,b)=>a+b,0)/b.length;return a(b.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(b.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(a)=>i(g(e(a,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),uncurry:(a,b=1)=>(...c)=>{if(b>c.length)throw new RangeError('Arguments too few!');return((a)=>(b)=>b.reduce((a,b)=>a(b),a))(a)(c.slice(0,b))},unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); +(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.sqrt,b=Math.log,c=Math.floor,d=Math.PI,e=Math.min,g=Math.max,h=Math.ceil,i=Math.round,j=Math.abs;const k='undefined'!=typeof require&&require('fs'),l='undefined'!=typeof require&&require('crypto'),m=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(m(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),n=(a,b=a.length,...c)=>b<=c.length?a(...c):n.bind(null,a,b,...c),o=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?o(a[c]):a[c]),b},p=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?p(a):a)),q=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>r(c[a],d[a]))},s=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*s(a-1),t=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?t(a,b-1):a),[]),u=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,u(a[d],e+d)):c[e+d]=a[d],c},{}),v=(...a)=>{const c=(a,b)=>b?v(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},w='undefined'!=typeof require&&require('crypto'),x='undefined'!=typeof require&&require('fs'),y=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0k.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^l.randomBytes(1)[0]&15>>a/4).toString(16)),all:(a,b=Boolean)=>a.every(b),anagrams:m,any:(a,b=Boolean)=>a.some(b),approximatelyEqual:(a,b,c=1e-3)=>j(a-b)a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bifurcate:(a,b)=>a.reduce((a,c,d)=>(a[b[d]?0:1].push(c),a),[[],[]]),bifurcateBy:(a,b)=>a.reduce((a,c,d)=>(a[b(c,d)?0:1].push(c),a),[[],[]]),bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},binomialCoefficient:(a,b)=>{var c=Number.isNaN;if(c(a)||c(b))return NaN;if(0>b||b>a)return 0;if(0===b||b===a)return 1;if(1===b||b===a-1)return a;a-bdocument.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:n,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:o,deepFlatten:p,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),degreesToRads:(a)=>a*d/180,delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:s,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:t,flattenObject:u,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:c(a/8.64e7),hour:c(a/3.6e6)%24,minute:c(a/6e4)%60,second:c(a/1e3)%60,millisecond:c(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:v,geometricProgression:(a,d=1,e=2)=>Array.from({length:c(b(a/d)/b(e))+1}).map((a,b)=>d*e**b),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(w.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(b)=>{const d=c(a(b));for(var e=2;e<=d;e++)if(0==b%e)return!1;return 2<=b},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=c(a.length/2),d=[...a].sort((c,a)=>c-a);return 0==a.length%2?(d[b-1]+d[b])/2:d[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),mostPerformant:(a,b=1e4)=>{const c=a.map((a)=>{const c=performance.now();for(let c=0;c(...b)=>!a(...b),none:(a,b=Boolean)=>!a.some(b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,d=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>j(a))return a+(d?' ':'')+g[0];const h=e(c(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(d?' ':'')+g[h]},primes:(b)=>{let d=Array.from({length:b-1}).map((a,b)=>b+2),e=c(a(b)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>d=d.filter((b)=>0!=b%a||b===a)),d},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},radsToDegrees:(a)=>180*a/d,randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,d=1)=>Array.from({length:d},()=>c(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>c(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>x.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(a,b=0)=>+`${i(`${a}e${b}`)}e-${b}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[c(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let d=a.length;d;){const b=c(Math.random()*d--);[a[d],a[b]]=[a[b],a[d]]}return a.slice(0,b)},scrollToTop:y,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const d=c(Math.random()*b--);[a[b],a[d]]=[a[d],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(b,c=!1)=>{const d=b.reduce((a,b)=>a+b,0)/b.length;return a(b.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(b.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(a)=>i(g(e(a,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),uncurry:(a,b=1)=>(...c)=>{if(b>c.length)throw new RangeError('Arguments too few!');return((a)=>(b)=>b.reduce((a,b)=>a(b),a))(a)(c.slice(0,b))},unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); diff --git a/test/testlog b/test/testlog index 9af1b19b9..af38eea74 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1912 +1,1912 @@ -Test log for: Fri Feb 16 2018 14:00:11 GMT+0200 (GTB Standard Time) +Test log for: Fri Feb 16 2018 12:10:48 GMT+0000 (UTC) -> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code +> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing all - - √ all is a Function - √ Returns true for arrays with no falsey values - √ Returns false for arrays with 0 - √ Returns false for arrays with NaN - √ Returns false for arrays with undefined - √ Returns false for arrays with null - √ Returns false for arrays with empty strings - √ Returns true with predicate function - √ Returns false with a predicate function - - Testing anagrams - - √ anagrams is a Function - √ Generates all anagrams of a string - √ Works for single-letter strings - √ Works for empty strings - - Testing any - - √ any is a Function - √ Returns true for arrays with at least one truthy value - √ Returns false for arrays with no truthy values - √ Returns false for arrays with no truthy values - √ Returns true with predicate function - √ Returns false with a predicate function - - Testing approximatelyEqual - - √ approximatelyEqual is a Function - √ Works for PI / 2 - √ Works for 0.1 + 0.2 === 0.3 - √ Works for exactly equal values - √ Works for a custom epsilon - - Testing arrayToHtmlList - - √ arrayToHtmlList is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing ary - - √ ary is a Function - √ Discards arguments with index >=n - - Testing atob - - √ atob is a Function - √ atob("Zm9vYmFy") equals "foobar" - √ atob("Z") returns "" - - Testing attempt - - √ attempt is a Function - √ Returns a value - √ Returns an error - - Testing average - - √ average is a Function - √ average(true) returns 0 - √ average(false) returns 1 - √ average(9, 1) returns 5 - √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - √ average(1, 2, 3) returns 2 - √ average(null) returns 0 - √ average(1, 2, 3) returns NaN - √ average(String) returns NaN - √ average({ a: 123}) returns NaN - √ average([undefined, 0, string]) returns NaN - √ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing averageBy - - √ averageBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing bifurcate - - √ bifurcate is a Function - √ Splits the collection into two groups - - Testing bifurcateBy - - √ bifurcateBy is a Function - √ Splits the collection into two groups - - Testing binarySearch - - √ binarySearch is a Function - √ Finds item in array - √ Returns -1 when not found - √ Works with empty arrays - √ Works for one element arrays - - Testing bind - - √ bind is a Function - √ Binds to an object context - - Testing bindAll - - √ bindAll is a Function - √ Binds to an object context - - Testing bindKey - - √ bindKey is a Function - √ Binds function to an object context - - Testing binomialCoefficient - - √ binomialCoefficient is a Function - √ Returns the appropriate value - √ Returns the appropriate value - √ Returns the appropriate value - √ Returns NaN - √ Returns NaN - - Testing bottomVisible - - √ bottomVisible is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing btoa - - √ btoa is a Function - √ btoa("foobar") equals "Zm9vYmFy" - - Testing byteSize - - √ byteSize is a Function - √ Works for a single letter - √ Works for a common string - √ Works for emoji - - Testing call - - √ call is a Function - √ Calls function on given object - - Testing capitalize - - √ capitalize is a Function - √ Capitalizes the first letter of a string - √ Capitalizes the first letter of a string - √ Works with characters - √ Works with single character words - - Testing capitalizeEveryWord - - √ capitalizeEveryWord is a Function - √ Capitalizes the first letter of every word in a string - √ Works with characters - √ Works with one word string - - Testing castArray - - √ castArray is a Function - √ Works for single values - √ Works for arrays with one value - √ Works for arrays with multiple value - √ Works for strings - √ Works for objects - - Testing chainAsync - - √ chainAsync is a Function - √ Calls all functions in an array - - Testing chunk - - √ chunk is a Function - √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - √ chunk([]) returns [] - √ chunk(123) returns [] - √ chunk({ a: 123}) returns [] - √ chunk(string, 2) returns [ st, ri, ng ] - √ chunk() throws an error - √ chunk(undefined) throws an error - √ chunk(null) throws an error - √ chunk(This is a string, 2) takes less than 2s to run - - Testing clampNumber - - √ clampNumber is a Function - √ Clamps num within the inclusive range specified by the boundary values a and b - - Testing cleanObj - - √ cleanObj is a Function - √ Removes any properties except the ones specified from a JSON object - - Testing cloneRegExp - - √ cloneRegExp is a Function - √ Clones regular expressions properly - - Testing coalesce - - √ coalesce is a Function - √ Returns the first non-null/undefined argument - - Testing coalesceFactory - - √ coalesceFactory is a Function - √ Returns a customized coalesce function - - Testing collatz - - √ collatz is a Function - √ When n is even, divide by 2 - √ When n is odd, times by 3 and add 1 - √ Eventually reaches 1 - - Testing collectInto - - √ collectInto is a Function - - Testing colorize - - √ colorize is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing compact - - √ compact is a Function - √ Removes falsey values from an array - - Testing compose - - √ compose is a Function - √ Performs right-to-left function composition - - Testing composeRight - - √ composeRight is a Function - √ Performs left-to-right function composition - - Testing converge - - √ converge is a Function - √ Produces the average of the array - √ Produces the strange concatenation - - Testing copyToClipboard - - √ copyToClipboard is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing countBy - - √ countBy is a Function - √ Works for functions - √ Works for property names - - Testing countOccurrences - - √ countOccurrences is a Function - √ Counts the occurrences of a value in an array - - Testing countVowels - - √ countVowels is a Function - - Testing createElement - - √ createElement is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing createEventHub - - √ createEventHub is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing currentURL - - √ currentURL is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing curry - - √ curry is a Function - √ curries a Math.pow - √ curries a Math.min - - Testing debounce - - √ debounce is a Function - - Testing decapitalize - - √ decapitalize is a Function - √ Works with default parameter - √ Works with second parameter set to true - - Testing deepClone - - √ deepClone is a Function - √ Shallow cloning works - √ Deep cloning works - - Testing deepFlatten - - √ deepFlatten is a Function - √ Deep flattens an array - - Testing defaults - - √ defaults is a Function - √ Assigns default values for undefined properties - - Testing defer - - √ defer is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing degreesToRads - - √ degreesToRads is a Function - √ Returns the appropriate value - - Testing delay - - √ delay is a Function - - Testing detectDeviceType - - √ detectDeviceType is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing difference - - √ difference is a Function - √ Returns the difference between two arrays - - Testing differenceBy - - √ differenceBy is a Function - √ Works using a native function and numbers - √ Works with arrow function and objects - - Testing differenceWith - - √ differenceWith is a Function - √ Filters out all values from an array - - Testing digitize - - √ digitize is a Function - √ Converts a number to an array of digits - - Testing distance - - √ distance is a Function - √ Calculates the distance between two points - - Testing drop - - √ drop is a Function - √ Works without the last argument - √ Removes appropriate element count as specified - √ Empties array given a count greater than length - - Testing dropRight - - √ dropRight is a Function - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - - Testing dropRightWhile - - √ dropRightWhile is a Function - √ Removes elements from the end of an array until the passed function returns true. - - Testing dropWhile - - √ dropWhile is a Function - √ Removes elements in an array until the passed function returns true. - - Testing elementIsVisibleInViewport - - √ elementIsVisibleInViewport is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing elo - - √ elo is a Function - √ Standard 1v1s - √ should be equivalent - √ 4 player FFA, all same rank - - Testing equals - - √ equals is a Function - √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - √ [1,2,3] is equal to [1,2,3] - √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - √ [1,2,3] is not equal to [1,2,4] - √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. - - Testing escapeHTML - - √ escapeHTML is a Function - √ Escapes a string for use in HTML - - Testing escapeRegExp - - √ escapeRegExp is a Function - √ Escapes a string to use in a regular expression - - Testing everyNth - - √ everyNth is a Function - √ Returns every nth element in an array - - Testing extendHex - - √ extendHex is a Function - √ Extends a 3-digit color code to a 6-digit color code - √ Extends a 3-digit color code to a 6-digit color code - - Testing factorial - - √ factorial is a Function - √ Calculates the factorial of 720 - √ Calculates the factorial of 0 - √ Calculates the factorial of 1 - √ Calculates the factorial of 4 - √ Calculates the factorial of 10 - - Testing factors - - √ factors is a Function - - Testing fibonacci - - √ fibonacci is a Function - √ Generates an array, containing the Fibonacci sequence - - Testing fibonacciCountUntilNum - - √ fibonacciCountUntilNum is a Function - - Testing fibonacciUntilNum - - √ fibonacciUntilNum is a Function - - Testing filterNonUnique - - √ filterNonUnique is a Function - √ Filters out the non-unique values in an array - - Testing findKey - - √ findKey is a Function - √ Returns the appropriate key - - Testing findLast - - √ findLast is a Function - √ Finds last element for which the given function returns true - - Testing findLastIndex - - √ findLastIndex is a Function - √ Finds last index for which the given function returns true - - Testing findLastKey - - √ findLastKey is a Function - √ Returns the appropriate key - - Testing flatten - - √ flatten is a Function - √ Flattens an array - √ Flattens an array - - Testing flattenObject - - √ flattenObject is a Function - √ Flattens an object with the paths for keys - √ Works with arrays - - Testing flip - - √ flip is a Function - √ Flips argument order - - Testing forEachRight - - √ forEachRight is a Function - √ Iterates over the array in reverse - - Testing formatDuration - - √ formatDuration is a Function - √ Returns the human readable format of the given number of milliseconds - √ Returns the human readable format of the given number of milliseconds - - Testing forOwn - - √ forOwn is a Function - √ Iterates over an element's key-value pairs - - Testing forOwnRight - - √ forOwnRight is a Function - √ Iterates over an element's key-value pairs in reverse - - Testing fromCamelCase - - √ fromCamelCase is a Function - √ Converts a string from camelcase - √ Converts a string from camelcase - √ Converts a string from camelcase - - Testing functionName - - √ functionName is a Function - √ Works for native functions - √ Works for functions - √ Works for arrow functions - - Testing functions - - √ functions is a Function - √ Returns own methods - √ Returns own and inherited methods - - Testing gcd - - √ gcd is a Function - √ Calculates the greatest common divisor between two or more numbers/arrays - √ Calculates the greatest common divisor between two or more numbers/arrays - - Testing geometricProgression - - √ geometricProgression is a Function - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - - Testing get - - √ get is a Function - √ Retrieve a property indicated by the selector from an object. - - Testing getColonTimeFromDate - - √ getColonTimeFromDate is a Function - - Testing getDaysDiffBetweenDates - - √ getDaysDiffBetweenDates is a Function - √ Returns the difference in days between two dates - - Testing getMeridiemSuffixOfInteger - - √ getMeridiemSuffixOfInteger is a Function - - Testing getScrollPosition - - √ getScrollPosition is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing getStyle - - √ getStyle is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing getType - - √ getType is a Function - √ Returns the native type of a value - - Testing getURLParameters - - √ getURLParameters is a Function - √ Returns an object containing the parameters of the current URL - - Testing groupBy - - √ groupBy is a Function - √ Groups the elements of an array based on the given function - √ Groups the elements of an array based on the given function - - Testing hammingDistance - - √ hammingDistance is a Function - √ retuns hamming disance between 2 values - - Testing hasClass - - √ hasClass is a Function - - Testing hasFlags - - √ hasFlags is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing hashBrowser - - √ hashBrowser is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing hashNode - - √ hashNode is a Function - - Testing head - - √ head is a Function - √ head({ a: 1234}) returns undefined - √ head([1, 2, 3]) returns 1 - √ head({ 0: false}) returns false - √ head(String) returns S - √ head(null) throws an Error - √ head(undefined) throws an Error - √ head() throws an Error - √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing hexToRGB - - √ hexToRGB is a Function - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - - Testing hide - - √ hide is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing howManyTimes - - √ howManyTimes is a Function - - Testing httpDelete - - √ httpDelete is a Function - - Testing httpGet - - √ httpGet is a Function - - Testing httpPost - - √ httpPost is a Function - - Testing httpPut - - √ httpPut is a Function - - Testing httpsRedirect - - √ httpsRedirect is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing indexOfAll - - √ indexOfAll is a Function - √ Returns all indices of val in an array - √ Returns all indices of val in an array - - Testing initial - - √ initial is a Function - √ Returns all the elements of an array except the last one - - Testing initialize2DArray - - √ initialize2DArray is a Function - √ Initializes a 2D array of given width and height and value - - Testing initializeArrayWithRange - - √ initializeArrayWithRange is a Function - √ Initializes an array containing the numbers in the specified range - - Testing initializeArrayWithRangeRight - - √ initializeArrayWithRangeRight is a Function - - Testing initializeArrayWithValues - - √ initializeArrayWithValues is a Function - √ Initializes and fills an array with the specified values - - Testing inRange - - √ inRange is a Function - √ The given number falls within the given range - √ The given number falls within the given range - √ The given number does not falls within the given range - √ The given number does not falls within the given range - - Testing intersection - - √ intersection is a Function - √ Returns a list of elements that exist in both arrays - - Testing intersectionBy - - √ intersectionBy is a Function - √ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both - - Testing intersectionWith - - √ intersectionWith is a Function - √ Returns a list of elements that exist in both arrays, using a provided comparator function - - Testing invertKeyValues - - √ invertKeyValues is a Function - √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } - - Testing is - - √ is is a Function - √ Works for arrays with data - √ Works for empty arrays - √ Works for arrays, not objects - √ Works for objects - √ Works for maps - √ Works for regular expressions - √ Works for sets - √ Works for weak maps - √ Works for weak sets - √ Works for strings - returns false for primitive - √ Works for strings - returns true when using constructor - √ Works for numbers - returns false for primitive - √ Works for numbers - returns true when using constructor - √ Works for booleans - returns false for primitive - √ Works for booleans - returns true when using constructor - √ Works for functions - - Testing isAbsoluteURL - - √ isAbsoluteURL is a Function - √ Given string is an absolute URL - √ Given string is an absolute URL - √ Given string is not an absolute URL - - Testing isArmstrongNumber - - √ isArmstrongNumber is a Function - - Testing isArray - - √ isArray is a Function - √ passed value is an array - √ passed value is not an array - - Testing isArrayBuffer - - √ isArrayBuffer is a Function - - Testing isArrayLike - - √ isArrayLike is a Function - √ Returns true for a string - √ Returns true for an array - √ Returns false for null - - Testing isBoolean - - √ isBoolean is a Function - √ passed value is not a boolean - √ passed value is not a boolean - - Testing isDivisible - - √ isDivisible is a Function - √ The number 6 is divisible by 3 - - Testing isEmpty - - √ isEmpty is a Function - √ Returns true for empty Map - √ Returns true for empty Set - √ Returns true for empty array - √ Returns true for empty object - √ Returns true for empty string - √ Returns false for non-empty array - √ Returns false for non-empty object - √ Returns false for non-empty string - √ Returns true - type is not considered a collection - √ Returns true - type is not considered a collection - - Testing isEven - - √ isEven is a Function - √ 4 is even number - √ undefined - - Testing isFunction - - √ isFunction is a Function - √ passed value is a function - √ passed value is not a function - - Testing isLowerCase - - √ isLowerCase is a Function - √ passed string is a lowercase - √ passed string is a lowercase - √ passed value is not a lowercase - - Testing isMap - - √ isMap is a Function - - Testing isNil - - √ isNil is a Function - √ Returns true for null - √ Returns true for undefined - √ Returns false for an empty string - - Testing isNull - - √ isNull is a Function - √ passed argument is a null - √ passed argument is a null - - Testing isNumber - - √ isNumber is a Function - √ passed argument is a number - √ passed argument is not a number - - Testing isObject - - √ isObject is a Function - √ isObject([1, 2, 3, 4]) is a object - √ isObject([]) is a object - √ isObject({ a:1 }) is a object - √ isObject(true) is not a object - - Testing isObjectLike - - √ isObjectLike is a Function - √ Returns true for an object - √ Returns true for an array - √ Returns false for a function - √ Returns false for null - - Testing isPlainObject - - √ isPlainObject is a Function - √ Returns true for a plain object - √ Returns false for a Map (example of non-plain object) - - Testing isPrime - - √ isPrime is a Function - √ passed number is a prime - - Testing isPrimitive - - √ isPrimitive is a Function - √ isPrimitive(null) is primitive - √ isPrimitive(undefined) is primitive - √ isPrimitive(string) is primitive - √ isPrimitive(true) is primitive - √ isPrimitive(50) is primitive - √ isPrimitive('Hello') is primitive - √ isPrimitive(false) is primitive - √ isPrimitive(Symbol()) is primitive - √ isPrimitive([1, 2, 3]) is not primitive - √ isPrimitive({ a: 123 }) is not primitive - √ isPrimitive({ a: 123 }) takes less than 2s to run - - Testing isPromiseLike - - √ isPromiseLike is a Function - √ Returns true for a promise-like object - √ Returns false for null - √ Returns false for an empty object - - Testing isRegExp - - √ isRegExp is a Function - - Testing isSet - - √ isSet is a Function - - Testing isSorted - - √ isSorted is a Function - √ Array is sorted in ascending order - √ Array is sorted in descending order - √ Array is not sorted, direction changed in array - - Testing isString - - √ isString is a Function - √ foo is a string - √ "10" is a string - √ Empty string is a string - √ 10 is not a string - √ true is not string - - Testing isSymbol - - √ isSymbol is a Function - √ Checks if the given argument is a symbol - - Testing isTravisCI - - √ isTravisCI is a Function - √ Not running on Travis, correctly evaluates - - Testing isTypedArray - - √ isTypedArray is a Function - - Testing isUndefined - - √ isUndefined is a Function - √ Returns true for undefined - - Testing isUpperCase - - √ isUpperCase is a Function - √ ABC is all upper case - √ abc is not all upper case - √ A3@$ is all uppercase - - Testing isValidJSON - - √ isValidJSON is a Function - √ {"name":"Adam","age":20} is a valid JSON - √ {"name":"Adam",age:"20"} is not a valid JSON - √ null is a valid JSON - - Testing isWeakMap - - √ isWeakMap is a Function - - Testing isWeakSet - - √ isWeakSet is a Function - - Testing join - - √ join is a Function - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - Testing JSONToDate - √ JSONToDate is a Function + ✔ JSONToDate is a Function Testing JSONToFile - √ JSONToFile is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing last - - √ last is a Function - √ last({ a: 1234}) returns undefined - √ last([1, 2, 3]) returns 3 - √ last({ 0: false}) returns undefined - √ last(String) returns g - √ last(null) throws an Error - √ last(undefined) throws an Error - √ last() throws an Error - √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing lcm - - √ lcm is a Function - √ Returns the least common multiple of two or more numbers. - √ Returns the least common multiple of two or more numbers. - - Testing longestItem - - √ longestItem is a Function - √ Returns the longest object - - Testing lowercaseKeys - - √ lowercaseKeys is a Function - √ Lowercases object keys - √ Does not mutate original object - - Testing luhnCheck - - √ luhnCheck is a Function - √ validates identification number - √ validates identification number - √ validates identification number - - Testing mapKeys - - √ mapKeys is a Function - √ Maps keys - - Testing mapObject - - √ mapObject is a Function - √ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - √ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } - √ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } - - Testing mapValues - - √ mapValues is a Function - √ Maps values - - Testing mask - - √ mask is a Function - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - - Testing matches - - √ matches is a Function - √ Matches returns true for two similar objects - √ Matches returns false for two non-similar objects - - Testing matchesWith - - √ matchesWith is a Function - √ Returns true for two objects with similar values, based on the provided function - - Testing maxBy - - √ maxBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing maxN - - √ maxN is a Function - √ Returns the n maximum elements from the provided array - √ Returns the n maximum elements from the provided array - - Testing median - - √ median is a Function - √ Returns the median of an array of numbers - √ Returns the median of an array of numbers - - Testing memoize - - √ memoize is a Function - √ Function works properly - √ Function works properly - √ Cache stores values - - Testing merge - - √ merge is a Function - √ Merges two objects - - Testing minBy - - √ minBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing minN - - √ minN is a Function - √ Returns the n minimum elements from the provided array - √ Returns the n minimum elements from the provided array - - Testing mostPerformant - - √ mostPerformant is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing negate - - √ negate is a Function - √ Negates a predicate function - - Testing none - - √ none is a Function - √ Returns true for arrays with no truthy values - √ Returns false for arrays with at least one truthy value - √ Returns true with a predicate function - √ Returns false with predicate function - - Testing nthArg - - √ nthArg is a Function - √ Returns the nth argument - √ Returns undefined if arguments too few - √ Works for negative values - - Testing nthElement - - √ nthElement is a Function - √ Returns the nth element of an array. - √ Returns the nth element of an array. - - Testing objectFromPairs - - √ objectFromPairs is a Function - √ Creates an object from the given key-value pairs. - - Testing objectToPairs - - √ objectToPairs is a Function - √ Creates an array of key-value pair arrays from an object. - - Testing observeMutations - - √ observeMutations is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing off - - √ off is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing omit - - √ omit is a Function - √ Omits the key-value pairs corresponding to the given keys from an object - - Testing omitBy - - √ omitBy is a Function - √ Creates an object composed of the properties the given function returns falsey for - - Testing on - - √ on is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing once - - √ once is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing onUserInputChange - - √ onUserInputChange is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing orderBy - - √ orderBy is a Function - √ Returns a sorted array of objects ordered by properties and orders. - √ Returns a sorted array of objects ordered by properties and orders. - - Testing over - - √ over is a Function - √ Applies given functions over multiple arguments - - Testing overArgs - - √ overArgs is a Function - √ Invokes the provided function with its arguments transformed - - Testing palindrome - - √ palindrome is a Function - √ Given string is a palindrome - √ Given string is not a palindrome - - Testing parseCookie - - √ parseCookie is a Function - √ Parses the cookie - - Testing partial - - √ partial is a Function - √ Prepends arguments - - Testing partialRight - - √ partialRight is a Function - √ Appends arguments - - Testing partition - - √ partition is a Function - √ Groups the elements into two arrays, depending on the provided function's truthiness for each element. - - Testing percentile - - √ percentile is a Function - √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. - - Testing pick - - √ pick is a Function - √ Picks the key-value pairs corresponding to the given keys from an object. - - Testing pickBy - - √ pickBy is a Function - √ Creates an object composed of the properties the given function returns truthy for. - - Testing pipeAsyncFunctions - - √ pipeAsyncFunctions is a Function - √ Produces the appropriate hash - √ pipeAsyncFunctions result should be 15 - - Testing pipeFunctions - - √ pipeFunctions is a Function - √ Performs left-to-right function composition - - Testing pluralize - - √ pluralize is a Function - √ Produces the plural of the word - √ Produces the singular of the word - √ Produces the plural of the word - √ Prodices the defined plural of the word - √ Works with a dictionary - - Testing powerset - - √ powerset is a Function - √ Returns the powerset of a given array of numbers. - - Testing prettyBytes - - √ prettyBytes is a Function - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - - Testing primes - - √ primes is a Function - √ Generates primes up to a given number, using the Sieve of Eratosthenes. - - Testing promisify - - √ promisify is a Function - √ Returns a promise - - Testing pull - - √ pull is a Function - √ Pulls the specified values - - Testing pullAtIndex - - √ pullAtIndex is a Function - √ Pulls the given values - √ Pulls the given values - - Testing pullAtValue - - √ pullAtValue is a Function - √ Pulls the specified values - √ Pulls the specified values - - Testing pullBy - - √ pullBy is a Function - √ Pulls the specified values - - Testing quickSort - - √ quickSort is a Function - √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - √ quickSort([-1, 0, -2]) returns [-2, -1, 0] - √ quickSort() throws an error - √ quickSort(123) throws an error - √ quickSort({ 234: string}) throws an error - √ quickSort(null) throws an error - √ quickSort(undefined) throws an error - √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run - - Testing radsToDegrees - - √ radsToDegrees is a Function - √ Returns the appropriate value - - Testing randomHexColorCode - - √ randomHexColorCode is a Function - √ should be equal - √ The color code starts with "#" - √ The color code contains only valid hex-digits - - Testing randomIntArrayInRange - - √ randomIntArrayInRange is a Function - √ The returned array contains only integers - √ The returned array has the proper length - √ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). - - Testing randomIntegerInRange - - √ randomIntegerInRange is a Function - √ The returned value is an integer - √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing randomNumberInRange - - √ randomNumberInRange is a Function - √ The returned value is a number - √ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing readFileLines - - √ readFileLines is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing rearg - - √ rearg is a Function - √ Reorders arguments in invoked function - - Testing redirect - - √ redirect is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing reducedFilter - - √ reducedFilter is a Function - √ Filter an array of objects based on a condition while also filtering out unspecified keys. - - Testing reduceSuccessive - - √ reduceSuccessive is a Function - √ Returns the array of successively reduced values - - Testing reduceWhich - - √ reduceWhich is a Function - √ Returns the minimum of an array - √ Returns the maximum of an array - √ Returns the object with the minimum specified value in an array - - Testing remove - - √ remove is a Function - √ Removes elements from an array for which the given function returns false - - Testing removeNonASCII - - √ removeNonASCII is a Function - √ Removes non-ASCII characters - - Testing removeVowels - - √ removeVowels is a Function - - Testing reverseString - - √ reverseString is a Function - √ Reverses a string. + ✔ JSONToFile is a Function + ✔ Tested on 09/02/2018 by @chalarangelo Testing RGBToHex - √ RGBToHex is a Function - √ Converts the values of RGB components to a color code. - - Testing round - - √ round is a Function - √ round(1.005, 2) returns 1.01 - √ round(123.3423345345345345344, 11) returns 123.34233453453 - √ round(3.342, 11) returns 3.342 - √ round(1.005) returns 1 - √ round([1.005, 2]) returns NaN - √ round(string) returns NaN - √ round() returns NaN - √ round(132, 413, 4134) returns NaN - √ round({a: 132}, 413) returns NaN - √ round(123.3423345345345345344, 11) takes less than 2s to run - - Testing runAsync - - √ runAsync is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing runPromisesInSeries - - √ runPromisesInSeries is a Function - - Testing sample - - √ sample is a Function - √ Returns a random element from the array - √ Works for single-element arrays - √ Returns undefined for empty array - - Testing sampleSize - - √ sampleSize is a Function - √ Returns a single element without n specified - √ Returns a random sample of specified size from an array - √ Returns all elements in an array if n >= length - √ Returns an empty array if original array is empty - √ Returns an empty array if n = 0 - - Testing scrollToTop - - √ scrollToTop is a Function - √ Tested on 09/02/2018 by @chalarangelo - - Testing sdbm - - √ sdbm is a Function - √ Hashes the input string into a whole number. - - Testing serializeCookie - - √ serializeCookie is a Function - √ Serializes the cookie - - Testing setStyle - - √ setStyle is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing shallowClone - - √ shallowClone is a Function - √ Shallow cloning works - √ Does not clone deeply - - Testing show - - √ show is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing shuffle - - √ shuffle is a Function - √ Shuffles the array - √ New array contains all original elements - √ Works for empty arrays - √ Works for single-element arrays - - Testing similarity - - √ similarity is a Function - √ Returns an array of elements that appear in both arrays. - - Testing size - - √ size is a Function - √ Get size of arrays, objects or strings. - √ Get size of arrays, objects or strings. - - Testing sleep - - √ sleep is a Function - - Testing solveRPN - - √ solveRPN is a Function - - Testing sortCharactersInString - - √ sortCharactersInString is a Function - √ Alphabetically sorts the characters in a string. - - Testing sortedIndex - - √ sortedIndex is a Function - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - - Testing sortedIndexBy - - √ sortedIndexBy is a Function - √ Returns the lowest index to insert the element without messing up the list order - - Testing sortedLastIndex - - √ sortedLastIndex is a Function - √ Returns the highest index to insert the element without messing up the list order - - Testing sortedLastIndexBy - - √ sortedLastIndexBy is a Function - √ Returns the highest index to insert the element without messing up the list order - - Testing speechSynthesis - - √ speechSynthesis is a Function - - Testing splitLines - - √ splitLines is a Function - √ Splits a multiline string into an array of lines. - - Testing spreadOver - - √ spreadOver is a Function - √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. - - Testing standardDeviation - - √ standardDeviation is a Function - √ Returns the standard deviation of an array of numbers - √ Returns the standard deviation of an array of numbers - - Testing stripHTMLTags - - √ stripHTMLTags is a Function - √ Removes HTML tags - - Testing sum - - √ sum is a Function - √ Returns the sum of two or more numbers/arrays. - - Testing sumBy - - √ sumBy is a Function - - Testing sumPower - - √ sumPower is a Function - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - - Testing symmetricDifference - - √ symmetricDifference is a Function - √ Returns the symmetric difference between two arrays. - - Testing symmetricDifferenceBy - - √ symmetricDifferenceBy is a Function - √ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both - - Testing symmetricDifferenceWith - - √ symmetricDifferenceWith is a Function - √ Returns the symmetric difference between two arrays, using a provided function as a comparator - - Testing tail - - √ tail is a Function - √ Returns tail - √ Returns tail - - Testing take - - √ take is a Function - √ Returns an array with n elements removed from the beginning. - √ Returns an array with n elements removed from the beginning. - - Testing takeRight - - √ takeRight is a Function - √ Returns an array with n elements removed from the end - √ Returns an array with n elements removed from the end - - Testing takeRightWhile - - √ takeRightWhile is a Function - √ Removes elements until the function returns true - - Testing takeWhile - - √ takeWhile is a Function - √ Removes elements until the function returns true - - Testing throttle - - √ throttle is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing times - - √ times is a Function - √ Runs a function the specified amount of times - - Testing timeTaken - - √ timeTaken is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing toCamelCase - - √ toCamelCase is a Function - √ toCamelCase('some_database_field_name') returns someDatabaseFieldName - √ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - √ toCamelCase('some-javascript-property') return someJavascriptProperty - √ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - √ toCamelCase() throws a error - √ toCamelCase([]) throws a error - √ toCamelCase({}) throws a error - √ toCamelCase(123) throws a error - √ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run - - Testing toCurrency - - √ toCurrency is a Function - √ currency: Euro | currencyLangFormat: Local - √ currency: US Dollar | currencyLangFormat: English (United States) - √ currency: Japanese Yen | currencyLangFormat: Local - - Testing toDecimalMark - - √ toDecimalMark is a Function - √ convert a float-point arithmetic to the Decimal mark form - - Testing toggleClass - - √ toggleClass is a Function - √ Tested by @chalarangelo on 16/02/2018 - - Testing toKebabCase - - √ toKebabCase is a Function - √ toKebabCase('camelCase') returns camel-case - √ toKebabCase('some text') returns some-text - √ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - √ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - √ toKebabCase() return undefined - √ toKebabCase([]) throws an error - √ toKebabCase({}) throws an error - √ toKebabCase(123) throws an error - √ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing tomorrow - - √ tomorrow is a Function - √ Returns the correct year - √ Returns the correct month - √ Returns the correct date - - Testing toOrdinalSuffix - - √ toOrdinalSuffix is a Function - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - - Testing toSafeInteger - - √ toSafeInteger is a Function - √ Number(toSafeInteger(3.2)) is a number - √ Converts a value to a safe integer - √ toSafeInteger('4.2') returns 4 - √ toSafeInteger(4.6) returns 5 - √ toSafeInteger([]) returns 0 - √ isNaN(toSafeInteger([1.5, 3124])) is true - √ isNaN(toSafeInteger('string')) is true - √ isNaN(toSafeInteger({})) is true - √ isNaN(toSafeInteger()) is true - √ toSafeInteger(Infinity) returns 9007199254740991 - √ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - √ toSnakeCase is a Function - √ toSnakeCase('camelCase') returns camel_case - √ toSnakeCase('some text') returns some_text - √ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - √ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - √ toSnakeCase() returns undefined - √ toSnakeCase([]) throws an error - √ toSnakeCase({}) throws an error - √ toSnakeCase(123) throws an error - √ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing transform - - √ transform is a Function - √ Transforms an object - - Testing truncateString - - √ truncateString is a Function - √ Truncates a "boomerang" up to a specified length. - - Testing truthCheckCollection - - √ truthCheckCollection is a Function - √ second argument is truthy on all elements of a collection - - Testing unary - - √ unary is a Function - √ Discards arguments after the first one - - Testing uncurry - - √ uncurry is a Function - √ Works without a provided value for n - √ Works without n = 2 - √ Works withoutn = 3 - - Testing unescapeHTML - - √ unescapeHTML is a Function - √ Unescapes escaped HTML characters. - - Testing unflattenObject - - √ unflattenObject is a Function - √ Unflattens an object with the paths for keys - - Testing unfold - - √ unfold is a Function - √ Works with a given function, producing an array - - Testing union - - √ union is a Function - √ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - √ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - √ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - √ union([], []) returns [] - √ union() throws an error - √ union(true, str) throws an error - √ union(false, true) throws an error - √ union(123, {}) throws an error - √ union([], {}) throws an error - √ union(undefined, null) throws an error - √ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run - - Testing unionBy - - √ unionBy is a Function - √ Produces the appropriate results - - Testing unionWith - - √ unionWith is a Function - √ Produces the appropriate results - - Testing uniqueElements - - √ uniqueElements is a Function - √ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - √ uniqueElements([1, 23, 53]) returns [1, 23, 53] - √ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - √ uniqueElements() returns [] - √ uniqueElements(null) returns [] - √ uniqueElements(undefined) returns [] - √ uniqueElements('strt') returns ['s', 't', 'r'] - √ uniqueElements(1, 1, 2543, 534, 5) throws an error - √ uniqueElements({}) throws an error - √ uniqueElements(true) throws an error - √ uniqueElements(false) throws an error - √ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run - - Testing untildify - - √ untildify is a Function - √ Contains no tildes - √ Does not alter the rest of the path - √ Does not alter paths without tildes - - Testing unzip - - √ unzip is a Function - √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] - - Testing unzipWith - - √ unzipWith is a Function - √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + ✔ RGBToHex is a Function + ✔ Converts the values of RGB components to a color code. Testing URLJoin - √ URLJoin is a Function - √ Returns proper URL - √ Returns proper URL + ✔ URLJoin is a Function + ✔ Returns proper URL + ✔ Returns proper URL Testing UUIDGeneratorBrowser - √ UUIDGeneratorBrowser is a Function - √ Tested 09/02/2018 by @chalarangelo + ✔ UUIDGeneratorBrowser is a Function + ✔ Tested 09/02/2018 by @chalarangelo Testing UUIDGeneratorNode - √ UUIDGeneratorNode is a Function - √ Contains dashes in the proper places - √ Only contains hexadecimal digits + ✔ UUIDGeneratorNode is a Function + ✔ Contains dashes in the proper places + ✔ Only contains hexadecimal digits + + Testing all + + ✔ all is a Function + ✔ Returns true for arrays with no falsey values + ✔ Returns false for arrays with 0 + ✔ Returns false for arrays with NaN + ✔ Returns false for arrays with undefined + ✔ Returns false for arrays with null + ✔ Returns false for arrays with empty strings + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing anagrams + + ✔ anagrams is a Function + ✔ Generates all anagrams of a string + ✔ Works for single-letter strings + ✔ Works for empty strings + + Testing any + + ✔ any is a Function + ✔ Returns true for arrays with at least one truthy value + ✔ Returns false for arrays with no truthy values + ✔ Returns false for arrays with no truthy values + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing approximatelyEqual + + ✔ approximatelyEqual is a Function + ✔ Works for PI / 2 + ✔ Works for 0.1 + 0.2 === 0.3 + ✔ Works for exactly equal values + ✔ Works for a custom epsilon + + Testing arrayToHtmlList + + ✔ arrayToHtmlList is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing ary + + ✔ ary is a Function + ✔ Discards arguments with index >=n + + Testing atob + + ✔ atob is a Function + ✔ atob("Zm9vYmFy") equals "foobar" + ✔ atob("Z") returns "" + + Testing attempt + + ✔ attempt is a Function + ✔ Returns a value + ✔ Returns an error + + Testing average + + ✔ average is a Function + ✔ average(true) returns 0 + ✔ average(false) returns 1 + ✔ average(9, 1) returns 5 + ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 + ✔ average(1, 2, 3) returns 2 + ✔ average(null) returns 0 + ✔ average(1, 2, 3) returns NaN + ✔ average(String) returns NaN + ✔ average({ a: 123}) returns NaN + ✔ average([undefined, 0, string]) returns NaN + ✔ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing averageBy + + ✔ averageBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing bifurcate + + ✔ bifurcate is a Function + ✔ Splits the collection into two groups + + Testing bifurcateBy + + ✔ bifurcateBy is a Function + ✔ Splits the collection into two groups + + Testing binarySearch + + ✔ binarySearch is a Function + ✔ Finds item in array + ✔ Returns -1 when not found + ✔ Works with empty arrays + ✔ Works for one element arrays + + Testing bind + + ✔ bind is a Function + ✔ Binds to an object context + + Testing bindAll + + ✔ bindAll is a Function + ✔ Binds to an object context + + Testing bindKey + + ✔ bindKey is a Function + ✔ Binds function to an object context + + Testing binomialCoefficient + + ✔ binomialCoefficient is a Function + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns NaN + ✔ Returns NaN + + Testing bottomVisible + + ✔ bottomVisible is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing btoa + + ✔ btoa is a Function + ✔ btoa("foobar") equals "Zm9vYmFy" + + Testing byteSize + + ✔ byteSize is a Function + ✔ Works for a single letter + ✔ Works for a common string + ✔ Works for emoji + + Testing call + + ✔ call is a Function + ✔ Calls function on given object + + Testing capitalize + + ✔ capitalize is a Function + ✔ Capitalizes the first letter of a string + ✔ Capitalizes the first letter of a string + ✔ Works with characters + ✔ Works with single character words + + Testing capitalizeEveryWord + + ✔ capitalizeEveryWord is a Function + ✔ Capitalizes the first letter of every word in a string + ✔ Works with characters + ✔ Works with one word string + + Testing castArray + + ✔ castArray is a Function + ✔ Works for single values + ✔ Works for arrays with one value + ✔ Works for arrays with multiple value + ✔ Works for strings + ✔ Works for objects + + Testing chainAsync + + ✔ chainAsync is a Function + ✔ Calls all functions in an array + + Testing chunk + + ✔ chunk is a Function + ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] + ✔ chunk([]) returns [] + ✔ chunk(123) returns [] + ✔ chunk({ a: 123}) returns [] + ✔ chunk(string, 2) returns [ st, ri, ng ] + ✔ chunk() throws an error + ✔ chunk(undefined) throws an error + ✔ chunk(null) throws an error + ✔ chunk(This is a string, 2) takes less than 2s to run + + Testing clampNumber + + ✔ clampNumber is a Function + ✔ Clamps num within the inclusive range specified by the boundary values a and b + + Testing cleanObj + + ✔ cleanObj is a Function + ✔ Removes any properties except the ones specified from a JSON object + + Testing cloneRegExp + + ✔ cloneRegExp is a Function + ✔ Clones regular expressions properly + + Testing coalesce + + ✔ coalesce is a Function + ✔ Returns the first non-null/undefined argument + + Testing coalesceFactory + + ✔ coalesceFactory is a Function + ✔ Returns a customized coalesce function + + Testing collatz + + ✔ collatz is a Function + ✔ When n is even, divide by 2 + ✔ When n is odd, times by 3 and add 1 + ✔ Eventually reaches 1 + + Testing collectInto + + ✔ collectInto is a Function + + Testing colorize + + ✔ colorize is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing compact + + ✔ compact is a Function + ✔ Removes falsey values from an array + + Testing compose + + ✔ compose is a Function + ✔ Performs right-to-left function composition + + Testing composeRight + + ✔ composeRight is a Function + ✔ Performs left-to-right function composition + + Testing converge + + ✔ converge is a Function + ✔ Produces the average of the array + ✔ Produces the strange concatenation + + Testing copyToClipboard + + ✔ copyToClipboard is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing countBy + + ✔ countBy is a Function + ✔ Works for functions + ✔ Works for property names + + Testing countOccurrences + + ✔ countOccurrences is a Function + ✔ Counts the occurrences of a value in an array + + Testing countVowels + + ✔ countVowels is a Function + + Testing createElement + + ✔ createElement is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing createEventHub + + ✔ createEventHub is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing currentURL + + ✔ currentURL is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing curry + + ✔ curry is a Function + ✔ curries a Math.pow + ✔ curries a Math.min + + Testing debounce + + ✔ debounce is a Function + + Testing decapitalize + + ✔ decapitalize is a Function + ✔ Works with default parameter + ✔ Works with second parameter set to true + + Testing deepClone + + ✔ deepClone is a Function + ✔ Shallow cloning works + ✔ Deep cloning works + + Testing deepFlatten + + ✔ deepFlatten is a Function + ✔ Deep flattens an array + + Testing defaults + + ✔ defaults is a Function + ✔ Assigns default values for undefined properties + + Testing defer + + ✔ defer is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing degreesToRads + + ✔ degreesToRads is a Function + ✔ Returns the appropriate value + + Testing delay + + ✔ delay is a Function + + Testing detectDeviceType + + ✔ detectDeviceType is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing difference + + ✔ difference is a Function + ✔ Returns the difference between two arrays + + Testing differenceBy + + ✔ differenceBy is a Function + ✔ Works using a native function and numbers + ✔ Works with arrow function and objects + + Testing differenceWith + + ✔ differenceWith is a Function + ✔ Filters out all values from an array + + Testing digitize + + ✔ digitize is a Function + ✔ Converts a number to an array of digits + + Testing distance + + ✔ distance is a Function + ✔ Calculates the distance between two points + + Testing drop + + ✔ drop is a Function + ✔ Works without the last argument + ✔ Removes appropriate element count as specified + ✔ Empties array given a count greater than length + + Testing dropRight + + ✔ dropRight is a Function + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + + Testing dropRightWhile + + ✔ dropRightWhile is a Function + ✔ Removes elements from the end of an array until the passed function returns true. + + Testing dropWhile + + ✔ dropWhile is a Function + ✔ Removes elements in an array until the passed function returns true. + + Testing elementIsVisibleInViewport + + ✔ elementIsVisibleInViewport is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing elo + + ✔ elo is a Function + ✔ Standard 1v1s + ✔ should be equivalent + ✔ 4 player FFA, all same rank + + Testing equals + + ✔ equals is a Function + ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } + ✔ [1,2,3] is equal to [1,2,3] + ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } + ✔ [1,2,3] is not equal to [1,2,4] + ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + + Testing escapeHTML + + ✔ escapeHTML is a Function + ✔ Escapes a string for use in HTML + + Testing escapeRegExp + + ✔ escapeRegExp is a Function + ✔ Escapes a string to use in a regular expression + + Testing everyNth + + ✔ everyNth is a Function + ✔ Returns every nth element in an array + + Testing extendHex + + ✔ extendHex is a Function + ✔ Extends a 3-digit color code to a 6-digit color code + ✔ Extends a 3-digit color code to a 6-digit color code + + Testing factorial + + ✔ factorial is a Function + ✔ Calculates the factorial of 720 + ✔ Calculates the factorial of 0 + ✔ Calculates the factorial of 1 + ✔ Calculates the factorial of 4 + ✔ Calculates the factorial of 10 + + Testing factors + + ✔ factors is a Function + + Testing fibonacci + + ✔ fibonacci is a Function + ✔ Generates an array, containing the Fibonacci sequence + + Testing fibonacciCountUntilNum + + ✔ fibonacciCountUntilNum is a Function + + Testing fibonacciUntilNum + + ✔ fibonacciUntilNum is a Function + + Testing filterNonUnique + + ✔ filterNonUnique is a Function + ✔ Filters out the non-unique values in an array + + Testing findKey + + ✔ findKey is a Function + ✔ Returns the appropriate key + + Testing findLast + + ✔ findLast is a Function + ✔ Finds last element for which the given function returns true + + Testing findLastIndex + + ✔ findLastIndex is a Function + ✔ Finds last index for which the given function returns true + + Testing findLastKey + + ✔ findLastKey is a Function + ✔ Returns the appropriate key + + Testing flatten + + ✔ flatten is a Function + ✔ Flattens an array + ✔ Flattens an array + + Testing flattenObject + + ✔ flattenObject is a Function + ✔ Flattens an object with the paths for keys + ✔ Works with arrays + + Testing flip + + ✔ flip is a Function + ✔ Flips argument order + + Testing forEachRight + + ✔ forEachRight is a Function + ✔ Iterates over the array in reverse + + Testing forOwn + + ✔ forOwn is a Function + ✔ Iterates over an element's key-value pairs + + Testing forOwnRight + + ✔ forOwnRight is a Function + ✔ Iterates over an element's key-value pairs in reverse + + Testing formatDuration + + ✔ formatDuration is a Function + ✔ Returns the human readable format of the given number of milliseconds + ✔ Returns the human readable format of the given number of milliseconds + + Testing fromCamelCase + + ✔ fromCamelCase is a Function + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + + Testing functionName + + ✔ functionName is a Function + ✔ Works for native functions + ✔ Works for functions + ✔ Works for arrow functions + + Testing functions + + ✔ functions is a Function + ✔ Returns own methods + ✔ Returns own and inherited methods + + Testing gcd + + ✔ gcd is a Function + ✔ Calculates the greatest common divisor between two or more numbers/arrays + ✔ Calculates the greatest common divisor between two or more numbers/arrays + + Testing geometricProgression + + ✔ geometricProgression is a Function + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + + Testing get + + ✔ get is a Function + ✔ Retrieve a property indicated by the selector from an object. + + Testing getColonTimeFromDate + + ✔ getColonTimeFromDate is a Function + + Testing getDaysDiffBetweenDates + + ✔ getDaysDiffBetweenDates is a Function + ✔ Returns the difference in days between two dates + + Testing getMeridiemSuffixOfInteger + + ✔ getMeridiemSuffixOfInteger is a Function + + Testing getScrollPosition + + ✔ getScrollPosition is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing getStyle + + ✔ getStyle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing getType + + ✔ getType is a Function + ✔ Returns the native type of a value + + Testing getURLParameters + + ✔ getURLParameters is a Function + ✔ Returns an object containing the parameters of the current URL + + Testing groupBy + + ✔ groupBy is a Function + ✔ Groups the elements of an array based on the given function + ✔ Groups the elements of an array based on the given function + + Testing hammingDistance + + ✔ hammingDistance is a Function + ✔ retuns hamming disance between 2 values + + Testing hasClass + + ✔ hasClass is a Function + + Testing hasFlags + + ✔ hasFlags is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing hashBrowser + + ✔ hashBrowser is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing hashNode + + ✔ hashNode is a Function + + Testing head + + ✔ head is a Function + ✔ head({ a: 1234}) returns undefined + ✔ head([1, 2, 3]) returns 1 + ✔ head({ 0: false}) returns false + ✔ head(String) returns S + ✔ head(null) throws an Error + ✔ head(undefined) throws an Error + ✔ head() throws an Error + ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing hexToRGB + + ✔ hexToRGB is a Function + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + + Testing hide + + ✔ hide is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing howManyTimes + + ✔ howManyTimes is a Function + + Testing httpDelete + + ✔ httpDelete is a Function + + Testing httpGet + + ✔ httpGet is a Function + + Testing httpPost + + ✔ httpPost is a Function + + Testing httpPut + + ✔ httpPut is a Function + + Testing httpsRedirect + + ✔ httpsRedirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing inRange + + ✔ inRange is a Function + ✔ The given number falls within the given range + ✔ The given number falls within the given range + ✔ The given number does not falls within the given range + ✔ The given number does not falls within the given range + + Testing indexOfAll + + ✔ indexOfAll is a Function + ✔ Returns all indices of val in an array + ✔ Returns all indices of val in an array + + Testing initial + + ✔ initial is a Function + ✔ Returns all the elements of an array except the last one + + Testing initialize2DArray + + ✔ initialize2DArray is a Function + ✔ Initializes a 2D array of given width and height and value + + Testing initializeArrayWithRange + + ✔ initializeArrayWithRange is a Function + ✔ Initializes an array containing the numbers in the specified range + + Testing initializeArrayWithRangeRight + + ✔ initializeArrayWithRangeRight is a Function + + Testing initializeArrayWithValues + + ✔ initializeArrayWithValues is a Function + ✔ Initializes and fills an array with the specified values + + Testing intersection + + ✔ intersection is a Function + ✔ Returns a list of elements that exist in both arrays + + Testing intersectionBy + + ✔ intersectionBy is a Function + ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + + Testing intersectionWith + + ✔ intersectionWith is a Function + ✔ Returns a list of elements that exist in both arrays, using a provided comparator function + + Testing invertKeyValues + + ✔ invertKeyValues is a Function + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + + Testing is + + ✔ is is a Function + ✔ Works for arrays with data + ✔ Works for empty arrays + ✔ Works for arrays, not objects + ✔ Works for objects + ✔ Works for maps + ✔ Works for regular expressions + ✔ Works for sets + ✔ Works for weak maps + ✔ Works for weak sets + ✔ Works for strings - returns false for primitive + ✔ Works for strings - returns true when using constructor + ✔ Works for numbers - returns false for primitive + ✔ Works for numbers - returns true when using constructor + ✔ Works for booleans - returns false for primitive + ✔ Works for booleans - returns true when using constructor + ✔ Works for functions + + Testing isAbsoluteURL + + ✔ isAbsoluteURL is a Function + ✔ Given string is an absolute URL + ✔ Given string is an absolute URL + ✔ Given string is not an absolute URL + + Testing isArmstrongNumber + + ✔ isArmstrongNumber is a Function + + Testing isArray + + ✔ isArray is a Function + ✔ passed value is an array + ✔ passed value is not an array + + Testing isArrayBuffer + + ✔ isArrayBuffer is a Function + + Testing isArrayLike + + ✔ isArrayLike is a Function + ✔ Returns true for a string + ✔ Returns true for an array + ✔ Returns false for null + + Testing isBoolean + + ✔ isBoolean is a Function + ✔ passed value is not a boolean + ✔ passed value is not a boolean + + Testing isDivisible + + ✔ isDivisible is a Function + ✔ The number 6 is divisible by 3 + + Testing isEmpty + + ✔ isEmpty is a Function + ✔ Returns true for empty Map + ✔ Returns true for empty Set + ✔ Returns true for empty array + ✔ Returns true for empty object + ✔ Returns true for empty string + ✔ Returns false for non-empty array + ✔ Returns false for non-empty object + ✔ Returns false for non-empty string + ✔ Returns true - type is not considered a collection + ✔ Returns true - type is not considered a collection + + Testing isEven + + ✔ isEven is a Function + ✔ 4 is even number + ✔ undefined + + Testing isFunction + + ✔ isFunction is a Function + ✔ passed value is a function + ✔ passed value is not a function + + Testing isLowerCase + + ✔ isLowerCase is a Function + ✔ passed string is a lowercase + ✔ passed string is a lowercase + ✔ passed value is not a lowercase + + Testing isMap + + ✔ isMap is a Function + + Testing isNil + + ✔ isNil is a Function + ✔ Returns true for null + ✔ Returns true for undefined + ✔ Returns false for an empty string + + Testing isNull + + ✔ isNull is a Function + ✔ passed argument is a null + ✔ passed argument is a null + + Testing isNumber + + ✔ isNumber is a Function + ✔ passed argument is a number + ✔ passed argument is not a number + + Testing isObject + + ✔ isObject is a Function + ✔ isObject([1, 2, 3, 4]) is a object + ✔ isObject([]) is a object + ✔ isObject({ a:1 }) is a object + ✔ isObject(true) is not a object + + Testing isObjectLike + + ✔ isObjectLike is a Function + ✔ Returns true for an object + ✔ Returns true for an array + ✔ Returns false for a function + ✔ Returns false for null + + Testing isPlainObject + + ✔ isPlainObject is a Function + ✔ Returns true for a plain object + ✔ Returns false for a Map (example of non-plain object) + + Testing isPrime + + ✔ isPrime is a Function + ✔ passed number is a prime + + Testing isPrimitive + + ✔ isPrimitive is a Function + ✔ isPrimitive(null) is primitive + ✔ isPrimitive(undefined) is primitive + ✔ isPrimitive(string) is primitive + ✔ isPrimitive(true) is primitive + ✔ isPrimitive(50) is primitive + ✔ isPrimitive('Hello') is primitive + ✔ isPrimitive(false) is primitive + ✔ isPrimitive(Symbol()) is primitive + ✔ isPrimitive([1, 2, 3]) is not primitive + ✔ isPrimitive({ a: 123 }) is not primitive + ✔ isPrimitive({ a: 123 }) takes less than 2s to run + + Testing isPromiseLike + + ✔ isPromiseLike is a Function + ✔ Returns true for a promise-like object + ✔ Returns false for null + ✔ Returns false for an empty object + + Testing isRegExp + + ✔ isRegExp is a Function + + Testing isSet + + ✔ isSet is a Function + + Testing isSorted + + ✔ isSorted is a Function + ✔ Array is sorted in ascending order + ✔ Array is sorted in descending order + ✔ Array is not sorted, direction changed in array + + Testing isString + + ✔ isString is a Function + ✔ foo is a string + ✔ "10" is a string + ✔ Empty string is a string + ✔ 10 is not a string + ✔ true is not string + + Testing isSymbol + + ✔ isSymbol is a Function + ✔ Checks if the given argument is a symbol + + Testing isTravisCI + + ✔ isTravisCI is a Function + ✔ Running on Travis, correctly evaluates + + Testing isTypedArray + + ✔ isTypedArray is a Function + + Testing isUndefined + + ✔ isUndefined is a Function + ✔ Returns true for undefined + + Testing isUpperCase + + ✔ isUpperCase is a Function + ✔ ABC is all upper case + ✔ abc is not all upper case + ✔ A3@$ is all uppercase + + Testing isValidJSON + + ✔ isValidJSON is a Function + ✔ {"name":"Adam","age":20} is a valid JSON + ✔ {"name":"Adam",age:"20"} is not a valid JSON + ✔ null is a valid JSON + + Testing isWeakMap + + ✔ isWeakMap is a Function + + Testing isWeakSet + + ✔ isWeakSet is a Function + + Testing join + + ✔ join is a Function + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + + Testing last + + ✔ last is a Function + ✔ last({ a: 1234}) returns undefined + ✔ last([1, 2, 3]) returns 3 + ✔ last({ 0: false}) returns undefined + ✔ last(String) returns g + ✔ last(null) throws an Error + ✔ last(undefined) throws an Error + ✔ last() throws an Error + ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing lcm + + ✔ lcm is a Function + ✔ Returns the least common multiple of two or more numbers. + ✔ Returns the least common multiple of two or more numbers. + + Testing longestItem + + ✔ longestItem is a Function + ✔ Returns the longest object + + Testing lowercaseKeys + + ✔ lowercaseKeys is a Function + ✔ Lowercases object keys + ✔ Does not mutate original object + + Testing luhnCheck + + ✔ luhnCheck is a Function + ✔ validates identification number + ✔ validates identification number + ✔ validates identification number + + Testing mapKeys + + ✔ mapKeys is a Function + ✔ Maps keys + + Testing mapObject + + ✔ mapObject is a Function + ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } + ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } + ✔ mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } + + Testing mapValues + + ✔ mapValues is a Function + ✔ Maps values + + Testing mask + + ✔ mask is a Function + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + + Testing matches + + ✔ matches is a Function + ✔ Matches returns true for two similar objects + ✔ Matches returns false for two non-similar objects + + Testing matchesWith + + ✔ matchesWith is a Function + ✔ Returns true for two objects with similar values, based on the provided function + + Testing maxBy + + ✔ maxBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing maxN + + ✔ maxN is a Function + ✔ Returns the n maximum elements from the provided array + ✔ Returns the n maximum elements from the provided array + + Testing median + + ✔ median is a Function + ✔ Returns the median of an array of numbers + ✔ Returns the median of an array of numbers + + Testing memoize + + ✔ memoize is a Function + ✔ Function works properly + ✔ Function works properly + ✔ Cache stores values + + Testing merge + + ✔ merge is a Function + ✔ Merges two objects + + Testing minBy + + ✔ minBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing minN + + ✔ minN is a Function + ✔ Returns the n minimum elements from the provided array + ✔ Returns the n minimum elements from the provided array + + Testing mostPerformant + + ✔ mostPerformant is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing negate + + ✔ negate is a Function + ✔ Negates a predicate function + + Testing none + + ✔ none is a Function + ✔ Returns true for arrays with no truthy values + ✔ Returns false for arrays with at least one truthy value + ✔ Returns true with a predicate function + ✔ Returns false with predicate function + + Testing nthArg + + ✔ nthArg is a Function + ✔ Returns the nth argument + ✔ Returns undefined if arguments too few + ✔ Works for negative values + + Testing nthElement + + ✔ nthElement is a Function + ✔ Returns the nth element of an array. + ✔ Returns the nth element of an array. + + Testing objectFromPairs + + ✔ objectFromPairs is a Function + ✔ Creates an object from the given key-value pairs. + + Testing objectToPairs + + ✔ objectToPairs is a Function + ✔ Creates an array of key-value pair arrays from an object. + + Testing observeMutations + + ✔ observeMutations is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing off + + ✔ off is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing omit + + ✔ omit is a Function + ✔ Omits the key-value pairs corresponding to the given keys from an object + + Testing omitBy + + ✔ omitBy is a Function + ✔ Creates an object composed of the properties the given function returns falsey for + + Testing on + + ✔ on is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing onUserInputChange + + ✔ onUserInputChange is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing once + + ✔ once is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing orderBy + + ✔ orderBy is a Function + ✔ Returns a sorted array of objects ordered by properties and orders. + ✔ Returns a sorted array of objects ordered by properties and orders. + + Testing over + + ✔ over is a Function + ✔ Applies given functions over multiple arguments + + Testing overArgs + + ✔ overArgs is a Function + ✔ Invokes the provided function with its arguments transformed + + Testing palindrome + + ✔ palindrome is a Function + ✔ Given string is a palindrome + ✔ Given string is not a palindrome + + Testing parseCookie + + ✔ parseCookie is a Function + ✔ Parses the cookie + + Testing partial + + ✔ partial is a Function + ✔ Prepends arguments + + Testing partialRight + + ✔ partialRight is a Function + ✔ Appends arguments + + Testing partition + + ✔ partition is a Function + ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. + + Testing percentile + + ✔ percentile is a Function + ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + + Testing pick + + ✔ pick is a Function + ✔ Picks the key-value pairs corresponding to the given keys from an object. + + Testing pickBy + + ✔ pickBy is a Function + ✔ Creates an object composed of the properties the given function returns truthy for. + + Testing pipeAsyncFunctions + + ✔ pipeAsyncFunctions is a Function + ✔ Produces the appropriate hash + ✔ pipeAsyncFunctions result should be 15 + + Testing pipeFunctions + + ✔ pipeFunctions is a Function + ✔ Performs left-to-right function composition + + Testing pluralize + + ✔ pluralize is a Function + ✔ Produces the plural of the word + ✔ Produces the singular of the word + ✔ Produces the plural of the word + ✔ Prodices the defined plural of the word + ✔ Works with a dictionary + + Testing powerset + + ✔ powerset is a Function + ✔ Returns the powerset of a given array of numbers. + + Testing prettyBytes + + ✔ prettyBytes is a Function + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + + Testing primes + + ✔ primes is a Function + ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. + + Testing promisify + + ✔ promisify is a Function + ✔ Returns a promise + + Testing pull + + ✔ pull is a Function + ✔ Pulls the specified values + + Testing pullAtIndex + + ✔ pullAtIndex is a Function + ✔ Pulls the given values + ✔ Pulls the given values + + Testing pullAtValue + + ✔ pullAtValue is a Function + ✔ Pulls the specified values + ✔ Pulls the specified values + + Testing pullBy + + ✔ pullBy is a Function + ✔ Pulls the specified values + + Testing quickSort + + ✔ quickSort is a Function + ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] + ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] + ✔ quickSort() throws an error + ✔ quickSort(123) throws an error + ✔ quickSort({ 234: string}) throws an error + ✔ quickSort(null) throws an error + ✔ quickSort(undefined) throws an error + ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + + Testing radsToDegrees + + ✔ radsToDegrees is a Function + ✔ Returns the appropriate value + + Testing randomHexColorCode + + ✔ randomHexColorCode is a Function + ✔ should be equal + ✔ The color code starts with "#" + ✔ The color code contains only valid hex-digits + + Testing randomIntArrayInRange + + ✔ randomIntArrayInRange is a Function + ✔ The returned array contains only integers + ✔ The returned array has the proper length + ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + + Testing randomIntegerInRange + + ✔ randomIntegerInRange is a Function + ✔ The returned value is an integer + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing randomNumberInRange + + ✔ randomNumberInRange is a Function + ✔ The returned value is a number + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing readFileLines + + ✔ readFileLines is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing rearg + + ✔ rearg is a Function + ✔ Reorders arguments in invoked function + + Testing redirect + + ✔ redirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing reduceSuccessive + + ✔ reduceSuccessive is a Function + ✔ Returns the array of successively reduced values + + Testing reduceWhich + + ✔ reduceWhich is a Function + ✔ Returns the minimum of an array + ✔ Returns the maximum of an array + ✔ Returns the object with the minimum specified value in an array + + Testing reducedFilter + + ✔ reducedFilter is a Function + ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. + + Testing remove + + ✔ remove is a Function + ✔ Removes elements from an array for which the given function returns false + + Testing removeNonASCII + + ✔ removeNonASCII is a Function + ✔ Removes non-ASCII characters + + Testing removeVowels + + ✔ removeVowels is a Function + + Testing reverseString + + ✔ reverseString is a Function + ✔ Reverses a string. + + Testing round + + ✔ round is a Function + ✔ round(1.005, 2) returns 1.01 + ✔ round(123.3423345345345345344, 11) returns 123.34233453453 + ✔ round(3.342, 11) returns 3.342 + ✔ round(1.005) returns 1 + ✔ round([1.005, 2]) returns NaN + ✔ round(string) returns NaN + ✔ round() returns NaN + ✔ round(132, 413, 4134) returns NaN + ✔ round({a: 132}, 413) returns NaN + ✔ round(123.3423345345345345344, 11) takes less than 2s to run + + Testing runAsync + + ✔ runAsync is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing runPromisesInSeries + + ✔ runPromisesInSeries is a Function + + Testing sample + + ✔ sample is a Function + ✔ Returns a random element from the array + ✔ Works for single-element arrays + ✔ Returns undefined for empty array + + Testing sampleSize + + ✔ sampleSize is a Function + ✔ Returns a single element without n specified + ✔ Returns a random sample of specified size from an array + ✔ Returns all elements in an array if n >= length + ✔ Returns an empty array if original array is empty + ✔ Returns an empty array if n = 0 + + Testing scrollToTop + + ✔ scrollToTop is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing sdbm + + ✔ sdbm is a Function + ✔ Hashes the input string into a whole number. + + Testing serializeCookie + + ✔ serializeCookie is a Function + ✔ Serializes the cookie + + Testing setStyle + + ✔ setStyle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing shallowClone + + ✔ shallowClone is a Function + ✔ Shallow cloning works + ✔ Does not clone deeply + + Testing show + + ✔ show is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing shuffle + + ✔ shuffle is a Function + ✔ Shuffles the array + ✔ New array contains all original elements + ✔ Works for empty arrays + ✔ Works for single-element arrays + + Testing similarity + + ✔ similarity is a Function + ✔ Returns an array of elements that appear in both arrays. + + Testing size + + ✔ size is a Function + ✔ Get size of arrays, objects or strings. + ✔ Get size of arrays, objects or strings. + + Testing sleep + + ✔ sleep is a Function + + Testing solveRPN + + ✔ solveRPN is a Function + + Testing sortCharactersInString + + ✔ sortCharactersInString is a Function + ✔ Alphabetically sorts the characters in a string. + + Testing sortedIndex + + ✔ sortedIndex is a Function + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + + Testing sortedIndexBy + + ✔ sortedIndexBy is a Function + ✔ Returns the lowest index to insert the element without messing up the list order + + Testing sortedLastIndex + + ✔ sortedLastIndex is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing sortedLastIndexBy + + ✔ sortedLastIndexBy is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing speechSynthesis + + ✔ speechSynthesis is a Function + + Testing splitLines + + ✔ splitLines is a Function + ✔ Splits a multiline string into an array of lines. + + Testing spreadOver + + ✔ spreadOver is a Function + ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + + Testing standardDeviation + + ✔ standardDeviation is a Function + ✔ Returns the standard deviation of an array of numbers + ✔ Returns the standard deviation of an array of numbers + + Testing stripHTMLTags + + ✔ stripHTMLTags is a Function + ✔ Removes HTML tags + + Testing sum + + ✔ sum is a Function + ✔ Returns the sum of two or more numbers/arrays. + + Testing sumBy + + ✔ sumBy is a Function + + Testing sumPower + + ✔ sumPower is a Function + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + + Testing symmetricDifference + + ✔ symmetricDifference is a Function + ✔ Returns the symmetric difference between two arrays. + + Testing symmetricDifferenceBy + + ✔ symmetricDifferenceBy is a Function + ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + + Testing symmetricDifferenceWith + + ✔ symmetricDifferenceWith is a Function + ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator + + Testing tail + + ✔ tail is a Function + ✔ Returns tail + ✔ Returns tail + + Testing take + + ✔ take is a Function + ✔ Returns an array with n elements removed from the beginning. + ✔ Returns an array with n elements removed from the beginning. + + Testing takeRight + + ✔ takeRight is a Function + ✔ Returns an array with n elements removed from the end + ✔ Returns an array with n elements removed from the end + + Testing takeRightWhile + + ✔ takeRightWhile is a Function + ✔ Removes elements until the function returns true + + Testing takeWhile + + ✔ takeWhile is a Function + ✔ Removes elements until the function returns true + + Testing throttle + + ✔ throttle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing timeTaken + + ✔ timeTaken is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing times + + ✔ times is a Function + ✔ Runs a function the specified amount of times + + Testing toCamelCase + + ✔ toCamelCase is a Function + ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName + ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized + ✔ toCamelCase('some-javascript-property') return someJavascriptProperty + ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens + ✔ toCamelCase() throws a error + ✔ toCamelCase([]) throws a error + ✔ toCamelCase({}) throws a error + ✔ toCamelCase(123) throws a error + ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + + Testing toCurrency + + ✔ toCurrency is a Function + ✔ currency: Euro | currencyLangFormat: Local + ✔ currency: US Dollar | currencyLangFormat: English (United States) + ✔ currency: Japanese Yen | currencyLangFormat: Local + + Testing toDecimalMark + + ✔ toDecimalMark is a Function + ✔ convert a float-point arithmetic to the Decimal mark form + + Testing toKebabCase + + ✔ toKebabCase is a Function + ✔ toKebabCase('camelCase') returns camel-case + ✔ toKebabCase('some text') returns some-text + ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens + ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html + ✔ toKebabCase() return undefined + ✔ toKebabCase([]) throws an error + ✔ toKebabCase({}) throws an error + ✔ toKebabCase(123) throws an error + ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toOrdinalSuffix + + ✔ toOrdinalSuffix is a Function + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + + Testing toSafeInteger + + ✔ toSafeInteger is a Function + ✔ Number(toSafeInteger(3.2)) is a number + ✔ Converts a value to a safe integer + ✔ toSafeInteger('4.2') returns 4 + ✔ toSafeInteger(4.6) returns 5 + ✔ toSafeInteger([]) returns 0 + ✔ isNaN(toSafeInteger([1.5, 3124])) is true + ✔ isNaN(toSafeInteger('string')) is true + ✔ isNaN(toSafeInteger({})) is true + ✔ isNaN(toSafeInteger()) is true + ✔ toSafeInteger(Infinity) returns 9007199254740991 + ✔ toSafeInteger(3.2) takes less than 2s to run + + Testing toSnakeCase + + ✔ toSnakeCase is a Function + ✔ toSnakeCase('camelCase') returns camel_case + ✔ toSnakeCase('some text') returns some_text + ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens + ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html + ✔ toSnakeCase() returns undefined + ✔ toSnakeCase([]) throws an error + ✔ toSnakeCase({}) throws an error + ✔ toSnakeCase(123) throws an error + ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toggleClass + + ✔ toggleClass is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing tomorrow + + ✔ tomorrow is a Function + ✔ Returns the correct year + ✔ Returns the correct month + ✔ Returns the correct date + + Testing transform + + ✔ transform is a Function + ✔ Transforms an object + + Testing truncateString + + ✔ truncateString is a Function + ✔ Truncates a "boomerang" up to a specified length. + + Testing truthCheckCollection + + ✔ truthCheckCollection is a Function + ✔ second argument is truthy on all elements of a collection + + Testing unary + + ✔ unary is a Function + ✔ Discards arguments after the first one + + Testing uncurry + + ✔ uncurry is a Function + ✔ Works without a provided value for n + ✔ Works without n = 2 + ✔ Works withoutn = 3 + + Testing unescapeHTML + + ✔ unescapeHTML is a Function + ✔ Unescapes escaped HTML characters. + + Testing unflattenObject + + ✔ unflattenObject is a Function + ✔ Unflattens an object with the paths for keys + + Testing unfold + + ✔ unfold is a Function + ✔ Works with a given function, producing an array + + Testing union + + ✔ union is a Function + ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] + ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] + ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] + ✔ union([], []) returns [] + ✔ union() throws an error + ✔ union(true, str) throws an error + ✔ union(false, true) throws an error + ✔ union(123, {}) throws an error + ✔ union([], {}) throws an error + ✔ union(undefined, null) throws an error + ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + + Testing unionBy + + ✔ unionBy is a Function + ✔ Produces the appropriate results + + Testing unionWith + + ✔ unionWith is a Function + ✔ Produces the appropriate results + + Testing uniqueElements + + ✔ uniqueElements is a Function + ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] + ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] + ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] + ✔ uniqueElements() returns [] + ✔ uniqueElements(null) returns [] + ✔ uniqueElements(undefined) returns [] + ✔ uniqueElements('strt') returns ['s', 't', 'r'] + ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error + ✔ uniqueElements({}) throws an error + ✔ uniqueElements(true) throws an error + ✔ uniqueElements(false) throws an error + ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + + Testing untildify + + ✔ untildify is a Function + ✔ Contains no tildes + ✔ Does not alter the rest of the path + ✔ Does not alter paths without tildes + + Testing unzip + + ✔ unzip is a Function + ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] + ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] + + Testing unzipWith + + ✔ unzipWith is a Function + ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] Testing validateNumber - √ validateNumber is a Function - √ validateNumber(9) returns true - √ validateNumber(234asd.slice(0, 2)) returns true - √ validateNumber(1232) returns true - √ validateNumber(1232 + 13423) returns true - √ validateNumber(1232 * 2342 * 123) returns true - √ validateNumber(1232.23423536) returns true - √ validateNumber(234asd) returns false - √ validateNumber(e234d) returns false - √ validateNumber(false) returns false - √ validateNumber(true) returns false - √ validateNumber(null) returns false - √ validateNumber(123 * asd) returns false + ✔ validateNumber is a Function + ✔ validateNumber(9) returns true + ✔ validateNumber(234asd.slice(0, 2)) returns true + ✔ validateNumber(1232) returns true + ✔ validateNumber(1232 + 13423) returns true + ✔ validateNumber(1232 * 2342 * 123) returns true + ✔ validateNumber(1232.23423536) returns true + ✔ validateNumber(234asd) returns false + ✔ validateNumber(e234d) returns false + ✔ validateNumber(false) returns false + ✔ validateNumber(true) returns false + ✔ validateNumber(null) returns false + ✔ validateNumber(123 * asd) returns false Testing without - √ without is a Function - √ without([2, 1, 2, 3], 1, 2) returns [3] - √ without([]) returns [] - √ without([3, 1, true, '3', true], '3', true) returns [3, 1] - √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - √ without() throws an error - √ without(null) throws an error - √ without(undefined) throws an error - √ without() throws an error - √ without({}) throws an error + ✔ without is a Function + ✔ without([2, 1, 2, 3], 1, 2) returns [3] + ✔ without([]) returns [] + ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] + ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] + ✔ without() throws an error + ✔ without(null) throws an error + ✔ without(undefined) throws an error + ✔ without() throws an error + ✔ without({}) throws an error Testing words - √ words is a Function - √ words('I love javaScript!!') returns [I, love, javaScript] - √ words('python, javaScript & coffee') returns [python, javaScript, coffee] - √ words(I love javaScript!!) returns an array - √ words() throws a error - √ words(null) throws a error - √ words(undefined) throws a error - √ words({}) throws a error - √ words([]) throws a error - √ words(1234) throws a error + ✔ words is a Function + ✔ words('I love javaScript!!') returns [I, love, javaScript] + ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] + ✔ words(I love javaScript!!) returns an array + ✔ words() throws a error + ✔ words(null) throws a error + ✔ words(undefined) throws a error + ✔ words({}) throws a error + ✔ words([]) throws a error + ✔ words(1234) throws a error Testing xProd - √ xProd is a Function - √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + ✔ xProd is a Function + ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] Testing yesNo - √ yesNo is a Function - √ yesNo(Y) returns true - √ yesNo(yes) returns true - √ yesNo(foo, true) returns true - √ yesNo(No) returns false - √ yesNo() returns false - √ yesNo(null) returns false - √ yesNo(undefined) returns false - √ yesNo([123, null]) returns false - √ yesNo([Yes, No]) returns false - √ yesNo({ 2: Yes }) returns false - √ yesNo([Yes, No], true) returns true - √ yesNo({ 2: Yes }, true) returns true + ✔ yesNo is a Function + ✔ yesNo(Y) returns true + ✔ yesNo(yes) returns true + ✔ yesNo(foo, true) returns true + ✔ yesNo(No) returns false + ✔ yesNo() returns false + ✔ yesNo(null) returns false + ✔ yesNo(undefined) returns false + ✔ yesNo([123, null]) returns false + ✔ yesNo([Yes, No]) returns false + ✔ yesNo({ 2: Yes }) returns false + ✔ yesNo([Yes, No], true) returns true + ✔ yesNo({ 2: Yes }, true) returns true Testing zip - √ zip is a Function - √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - √ zip([]) returns [] - √ zip(123) returns [] - √ zip([a, b], [1, 2], [true, false]) returns an Array - √ zip([a], [1, 2], [true, false]) returns an Array - √ zip(null) throws an error - √ zip(undefined) throws an error + ✔ zip is a Function + ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] + ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] + ✔ zip([]) returns [] + ✔ zip(123) returns [] + ✔ zip([a, b], [1, 2], [true, false]) returns an Array + ✔ zip([a], [1, 2], [true, false]) returns an Array + ✔ zip(null) throws an error + ✔ zip(undefined) throws an error Testing zipObject - √ zipObject is a Function - √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - √ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - √ zipObject([a], string) returns { a: s } - √ zipObject() throws an error - √ zipObject([string], null) throws an error - √ zipObject(null, [1]) throws an error - √ zipObject(string) throws an error - √ zipObject(test, string) throws an error + ✔ zipObject is a Function + ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} + ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} + ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } + ✔ zipObject([a], string) returns { a: s } + ✔ zipObject() throws an error + ✔ zipObject([string], null) throws an error + ✔ zipObject(null, [1]) throws an error + ✔ zipObject(string) throws an error + ✔ zipObject(test, string) throws an error Testing zipWith - √ zipWith is a Function - √ Sends a GET request - √ Runs the function provided - √ Runs promises in series - √ Sends a POST request - √ Works as expecting, passing arguments properly - √ Works with multiple promises + ✔ zipWith is a Function + ✔ Runs the function provided + ✔ Sends a GET request + ✔ Sends a POST request + ✔ Works as expecting, passing arguments properly + ✔ Runs promises in series + ✔ Works with multiple promises total: 970 passing: 970 - duration: 2.4s + duration: 3.1s From 9ef26a92497fade101445d9f2e3e08b49abd3b1a Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 16 Feb 2018 14:11:52 +0200 Subject: [PATCH 37/43] Add .npmignore --- .npmignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..e92f3bf08 --- /dev/null +++ b/.npmignore @@ -0,0 +1,18 @@ +snippet-template.md +tag_database +travis.log +CONTRIBUTING.md +COLLABORATING.md +CODE_OF_CONDUCT.md +.travis.yml +.mdlrc.style.rb +.mdlrc +.codeclimate.yml +test/* +static-parts/* +snippets_archive/* +scripts/* +locale/* +docs/* +.travis/* +.github/* From d2cd57f07f655ff09480f53d0f9f8b12ded50791 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Fri, 16 Feb 2018 20:24:04 +0000 Subject: [PATCH 38/43] Travis build: 1692 [cron] --- test/testlog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/testlog b/test/testlog index af38eea74..d46eb18bd 100644 --- a/test/testlog +++ b/test/testlog @@ -1,6 +1,6 @@ -Test log for: Fri Feb 16 2018 12:10:48 GMT+0000 (UTC) +Test log for: Fri Feb 16 2018 20:23:57 GMT+0000 (UTC) -> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code +> 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1897,16 +1897,16 @@ Test log for: Fri Feb 16 2018 12:10:48 GMT+0000 (UTC) Testing zipWith ✔ zipWith is a Function - ✔ Runs the function provided ✔ Sends a GET request + ✔ Runs the function provided ✔ Sends a POST request - ✔ Works as expecting, passing arguments properly ✔ Runs promises in series + ✔ Works as expecting, passing arguments properly ✔ Works with multiple promises total: 970 passing: 970 - duration: 3.1s + duration: 2.5s From 18fa8b615f9ecde038a0ffd2a4311619438a4d80 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sat, 17 Feb 2018 20:23:56 +0000 Subject: [PATCH 39/43] Travis build: 1694 [cron] --- test/testlog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testlog b/test/testlog index d46eb18bd..be21ddc72 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Fri Feb 16 2018 20:23:57 GMT+0000 (UTC) +Test log for: Sat Feb 17 2018 20:23:50 GMT+0000 (UTC) > 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1898,8 +1898,8 @@ Test log for: Fri Feb 16 2018 20:23:57 GMT+0000 (UTC) ✔ zipWith is a Function ✔ Sends a GET request - ✔ Runs the function provided ✔ Sends a POST request + ✔ Runs the function provided ✔ Runs promises in series ✔ Works as expecting, passing arguments properly ✔ Works with multiple promises @@ -1907,6 +1907,6 @@ Test log for: Fri Feb 16 2018 20:23:57 GMT+0000 (UTC) total: 970 passing: 970 - duration: 2.5s + duration: 2.4s From 7872590ac2d3db80e70aec839461ee170bc7a004 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 18 Feb 2018 19:41:43 +0200 Subject: [PATCH 40/43] Update stableSort.md --- snippets/stableSort.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/snippets/stableSort.md b/snippets/stableSort.md index b14535e73..5a37fb1d6 100644 --- a/snippets/stableSort.md +++ b/snippets/stableSort.md @@ -1,9 +1,11 @@ ### stableSort -Performs stable sort. Useful in Chrome and NodeJS. +Performs stable sorting of an array, preserving the initial indexes of items when their values are the same. +Does not mutate the original array, but returns a new array instead. -Use `Array.map()` to pair each element of the input array with its corresponding index. Then use `Array.sort()` and a user provided `compare()` function. If the items are equal, sort them by their initial index in the input array. Lastly use `Array.map()` to convert back to the initial array items. -Returns new array without modifying the initial one. +Use `Array.map()` to pair each element of the input array with its corresponding index. +Use `Array.sort()` and a `compare` function to sort the list, preserving their initial order if the items compared are equal. +Use `Array.map()` to convert back to the initial array items. ```js const stableSort = (arr, compare) => @@ -16,5 +18,4 @@ const stableSort = (arr, compare) => ```js const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const stable = stableSort(arr, () => 0); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -const unstable = [...arr].sort(() => 0); // [5, 0, 2, 3, 4, 1, 6, 7, 8, 9, 10] (in Chrome/NodeJS) ``` From 7378c9c481cd60ccbdc2660215991168e7cc1010 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 18 Feb 2018 19:45:24 +0200 Subject: [PATCH 41/43] Update stableSort.test.js --- test/stableSort/stableSort.test.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index 28dcbb057..e8cf95496 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -10,12 +10,8 @@ test('Testing stableSort', (t) => { //t.false(stableSort(args..), 'Expected'); //t.throws(stableSort(args..), 'Expected'); - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const compare = () => 0; - // stable - t.deepEqual(stableSort(arr, compare), arr); - // unstable - t.notDeepEqual([...arr].sort(compare), arr); - + t.deepEqual(stableSort(arr, compare), arr, 'Array is properly sorted'); t.end(); -}); \ No newline at end of file +}); From 719be051ce3667bfce3c347af57d8e7c83e80d00 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sun, 18 Feb 2018 17:47:02 +0000 Subject: [PATCH 42/43] Travis build: 1696 --- README.md | 31 +++++++++++++++++++++++++++++++ docs/index.html | 9 ++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bff27e25..bddfc47cd 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ average(1, 2, 3); * [`sortedIndexBy`](#sortedindexby) * [`sortedLastIndex`](#sortedlastindex) * [`sortedLastIndexBy`](#sortedlastindexby) +* [`stableSort`](#stablesort-) * [`symmetricDifference`](#symmetricdifference) * [`symmetricDifferenceBy`](#symmetricdifferenceby) * [`symmetricDifferenceWith`](#symmetricdifferencewith) @@ -2328,6 +2329,36 @@ sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x); // 1
    [⬆ Back to top](#table-of-contents) +### stableSort ![advanced](/advanced.svg) + +Performs stable sorting of an array, preserving the initial indexes of items when their values are the same. +Does not mutate the original array, but returns a new array instead. + +Use `Array.map()` to pair each element of the input array with its corresponding index. +Use `Array.sort()` and a `compare` function to sort the list, preserving their initial order if the items compared are equal. +Use `Array.map()` to convert back to the initial array items. + +```js +const stableSort = (arr, compare) => + arr + .map((item, index) => ({ item, index })) + .sort((a, b) => compare(a.item, b.item) || a.index - b.index) + .map(({ item }) => item); +``` + +
    +Examples + +```js +const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const stable = stableSort(arr, () => 0); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### symmetricDifference Returns the symmetric difference between two arrays. diff --git a/docs/index.html b/docs/index.html index 141de6d37..d8b48804d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -448,6 +448,13 @@ Object.assig
       return index === -1 ? 0 : arr.length - index;
     };
     
    sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x); // 1
    +

    stableSortadvanced

    Performs stable sorting of an array, preserving the initial indexes of items when their values are the same. Does not mutate the original array, but returns a new array instead.

    Use Array.map() to pair each element of the input array with its corresponding index. Use Array.sort() and a compare function to sort the list, preserving their initial order if the items compared are equal. Use Array.map() to convert back to the initial array items.

    const stableSort = (arr, compare) =>
    +  arr
    +    .map((item, index) => ({ item, index }))
    +    .sort((a, b) => compare(a.item, b.item) || a.index - b.index)
    +    .map(({ item }) => item);
    +
    const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    +const stable = stableSort(arr, () => 0); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     

    symmetricDifference

    Returns the symmetric difference between two arrays.

    Create a Set from each array, then use Array.filter() on each of them to only keep values not contained in the other.

    const symmetricDifference = (a, b) => {
       const sA = new Set(a),
         sB = new Set(b);
    
    From dead0ac1cad4d950237b4822927b72667c82ab16 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Sun, 18 Feb 2018 20:24:49 +0000
    Subject: [PATCH 43/43] Travis build: 1698 [cron]
    
    ---
     dist/_30s.es5.js     | 13 ++++++++++++-
     dist/_30s.es5.min.js |  2 +-
     dist/_30s.esm.js     |  8 +++++++-
     dist/_30s.js         |  8 +++++++-
     dist/_30s.min.js     |  2 +-
     test/testlog         | 11 ++++++++---
     6 files changed, 36 insertions(+), 8 deletions(-)
    
    diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js
    index 0f49c793d..0bc6ed0a8 100644
    --- a/dist/_30s.es5.js
    +++ b/dist/_30s.es5.js
    @@ -2003,6 +2003,17 @@ var spreadOver = function spreadOver(fn) {
       };
     };
     
    +var stableSort = function stableSort(arr, compare) {
    +  return arr.map(function (item, index) {
    +    return { item: item, index: index };
    +  }).sort(function (a, b) {
    +    return compare(a.item, b.item) || a.index - b.index;
    +  }).map(function (_ref) {
    +    var item = _ref.item;
    +    return item;
    +  });
    +};
    +
     var standardDeviation = function standardDeviation(arr) {
       var usePopulation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
     
    @@ -2472,7 +2483,7 @@ var zipWith = function zipWith() {
       }) : result;
     };
     
    -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, all: all, anagrams: anagrams, any: any, approximatelyEqual: approximatelyEqual, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bifurcate: bifurcate, bifurcateBy: bifurcateBy, bind: bind, bindAll: bindAll, bindKey: bindKey, binomialCoefficient: binomialCoefficient, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, degreesToRads: degreesToRads, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, mostPerformant: mostPerformant, negate: negate, none: none, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, radsToDegrees: radsToDegrees, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, uncurry: uncurry, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith };
    +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, all: all, anagrams: anagrams, any: any, approximatelyEqual: approximatelyEqual, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, attempt: attempt, average: average, averageBy: averageBy, bifurcate: bifurcate, bifurcateBy: bifurcateBy, bind: bind, bindAll: bindAll, bindKey: bindKey, binomialCoefficient: binomialCoefficient, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, converge: converge, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, debounce: debounce, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, degreesToRads: degreesToRads, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flattenObject: flattenObject, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getColonTimeFromDate: getColonTimeFromDate, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getMeridiemSuffixOfInteger: getMeridiemSuffixOfInteger, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, mostPerformant: mostPerformant, negate: negate, none: none, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, overArgs: overArgs, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeAsyncFunctions: pipeAsyncFunctions, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, radsToDegrees: radsToDegrees, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, rearg: rearg, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, stableSort: stableSort, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, throttle: throttle, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toCurrency: toCurrency, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, uncurry: uncurry, unescapeHTML: unescapeHTML, unflattenObject: unflattenObject, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith };
     
     return imports;
     
    diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js
    index d024faabc..8121c7fea 100644
    --- a/dist/_30s.es5.min.js
    +++ b/dist/_30s.es5.min.js
    @@ -1 +1 @@
    -(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e._30s=t()})(this,function(){'use strict';function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^$.randomBytes(1)[0]&15>>e/4).toString(16)})},all:function(e){var t=1=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},any:function(e){var t=1'})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;lt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:P(e/8.64e7),hour:P(e/3.6e6)%24,minute:P(e/6e4)%60,second:P(e/1e3)%60,millisecond:P(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=re(s,2),h=c[0],i=c[1];if(h===e.length-1)return n;if(0<(i-e[h+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':ie(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sG(e))return e+(r?' ':'')+i[0];var l=F(P(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/U(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=P(z(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,C(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return function(e){return function(t){return t.reduce(function(e,t){return e(t)},e)}}(e)(r.slice(0,t))}},unescapeHTML:function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(w(e),w(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(L(e),L(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(T(e),T(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(B(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,O(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,O(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^$.randomBytes(1)[0]&15>>e/4).toString(16)})},all:function(e){var t=1=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},any:function(e){var t=1'})},ary:function(t,r){return function(){for(var n=arguments.length,i=Array(n),l=0;lt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:P(e/8.64e7),hour:P(e/3.6e6)%24,minute:P(e/6e4)%60,second:P(e/1e3)%60,millisecond:P(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1e?e%12+'am':e%12+'pm'},getScrollPosition:function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=re(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':ie(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1i-n&&(t='mouse',e(t),document.removeEventListener('mousemove',r)),n=i};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',r))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;ic?1:sG(e))return e+(r?' ':'')+i[0];var l=F(P(Math.log10(0>e?-e:e)/3),i.length-1),o=+((0>e?-e:e)/U(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(r?' ':'')+i[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=P(z(e)),r=Array.from({length:n-1}).map(function(e,t){return t+2});return r.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),r=0;re[e.length-1],r=e.findIndex(function(e){return n?t>=e:t<=e});return-1===r?e.length:r},sortedIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.findIndex(function(e){return r?i>=n(e):i<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],r=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===r?0:e.length-r-1},sortedLastIndexBy:function(e,t,n){var r=n(e[0])>n(e[e.length-1]),i=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return r?i<=e[1]:i>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,C(t))}},stableSort:function(e,t){return e.map(function(e,t){return{item:e,index:t}}).sort(function(e,n){return t(e.item,n.item)||e.index-n.index}).map(function(e){var t=e.item;return t})},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,o),i=Date.now())},t-(Date.now()-i))):(e.apply(l,o),i=Date.now(),n=!0)}},timeTaken:function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},times:function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return function(e){return function(t){return t.reduce(function(e,t){return e(t)},e)}}(e)(r.slice(0,t))}},unescapeHTML:function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},unflattenObject:function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'+e+'":':'"'+e+'":{'}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},unfold:function(e,t){for(var n=[],r=[null,t];r=e(r[1]);)n.push(r[0]);return n},union:function(e,t){return Array.from(new Set([].concat(w(e),w(t))))},unionBy:function(e,t,n){var r=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(L(e),L(t.filter(function(e){return!r.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(T(e),T(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(B(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,R(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:H.apply(Math,O(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,O(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1 str.split(/\r?\n/);
     
     const spreadOver = fn => argsArr => fn(...argsArr);
     
    +const stableSort = (arr, compare) =>
    +  arr
    +    .map((item, index) => ({ item, index }))
    +    .sort((a, b) => compare(a.item, b.item) || a.index - b.index)
    +    .map(({ item }) => item);
    +
     const standardDeviation = (arr, usePopulation = false) => {
       const mean = arr.reduce((acc, val) => acc + val, 0) / arr.length;
       return Math.sqrt(
    @@ -1417,6 +1423,6 @@ const zipWith = (...arrays) => {
       return fn ? result.map(arr => fn(...arr)) : result;
     };
     
    -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
    +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,stableSort,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
     
     export default imports;
    diff --git a/dist/_30s.js b/dist/_30s.js
    index a4607f33b..b57412c38 100644
    --- a/dist/_30s.js
    +++ b/dist/_30s.js
    @@ -1166,6 +1166,12 @@ const splitLines = str => str.split(/\r?\n/);
     
     const spreadOver = fn => argsArr => fn(...argsArr);
     
    +const stableSort = (arr, compare) =>
    +  arr
    +    .map((item, index) => ({ item, index }))
    +    .sort((a, b) => compare(a.item, b.item) || a.index - b.index)
    +    .map(({ item }) => item);
    +
     const standardDeviation = (arr, usePopulation = false) => {
       const mean = arr.reduce((acc, val) => acc + val, 0) / arr.length;
       return Math.sqrt(
    @@ -1423,7 +1429,7 @@ const zipWith = (...arrays) => {
       return fn ? result.map(arr => fn(...arr)) : result;
     };
     
    -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
    +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,stableSort,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
     
     return imports;
     
    diff --git a/dist/_30s.min.js b/dist/_30s.min.js
    index 4be49ced6..acdc95069 100644
    --- a/dist/_30s.min.js
    +++ b/dist/_30s.min.js
    @@ -1 +1 @@
    -(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.sqrt,b=Math.log,c=Math.floor,d=Math.PI,e=Math.min,g=Math.max,h=Math.ceil,i=Math.round,j=Math.abs;const k='undefined'!=typeof require&&require('fs'),l='undefined'!=typeof require&&require('crypto'),m=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(m(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),n=(a,b=a.length,...c)=>b<=c.length?a(...c):n.bind(null,a,b,...c),o=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?o(a[c]):a[c]),b},p=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?p(a):a)),q=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>r(c[a],d[a]))},s=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*s(a-1),t=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?t(a,b-1):a),[]),u=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,u(a[d],e+d)):c[e+d]=a[d],c},{}),v=(...a)=>{const c=(a,b)=>b?v(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},w='undefined'!=typeof require&&require('crypto'),x='undefined'!=typeof require&&require('fs'),y=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0k.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^l.randomBytes(1)[0]&15>>a/4).toString(16)),all:(a,b=Boolean)=>a.every(b),anagrams:m,any:(a,b=Boolean)=>a.some(b),approximatelyEqual:(a,b,c=1e-3)=>j(a-b)a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bifurcate:(a,b)=>a.reduce((a,c,d)=>(a[b[d]?0:1].push(c),a),[[],[]]),bifurcateBy:(a,b)=>a.reduce((a,c,d)=>(a[b(c,d)?0:1].push(c),a),[[],[]]),bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},binomialCoefficient:(a,b)=>{var c=Number.isNaN;if(c(a)||c(b))return NaN;if(0>b||b>a)return 0;if(0===b||b===a)return 1;if(1===b||b===a-1)return a;a-bdocument.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:n,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:o,deepFlatten:p,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),degreesToRads:(a)=>a*d/180,delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:s,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:t,flattenObject:u,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:c(a/8.64e7),hour:c(a/3.6e6)%24,minute:c(a/6e4)%60,second:c(a/1e3)%60,millisecond:c(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:v,geometricProgression:(a,d=1,e=2)=>Array.from({length:c(b(a/d)/b(e))+1}).map((a,b)=>d*e**b),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(w.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(b)=>{const d=c(a(b));for(var e=2;e<=d;e++)if(0==b%e)return!1;return 2<=b},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=c(a.length/2),d=[...a].sort((c,a)=>c-a);return 0==a.length%2?(d[b-1]+d[b])/2:d[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),mostPerformant:(a,b=1e4)=>{const c=a.map((a)=>{const c=performance.now();for(let c=0;c(...b)=>!a(...b),none:(a,b=Boolean)=>!a.some(b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,d=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>j(a))return a+(d?' ':'')+g[0];const h=e(c(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(d?' ':'')+g[h]},primes:(b)=>{let d=Array.from({length:b-1}).map((a,b)=>b+2),e=c(a(b)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>d=d.filter((b)=>0!=b%a||b===a)),d},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},radsToDegrees:(a)=>180*a/d,randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,d=1)=>Array.from({length:d},()=>c(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>c(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>x.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(a,b=0)=>+`${i(`${a}e${b}`)}e-${b}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[c(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let d=a.length;d;){const b=c(Math.random()*d--);[a[d],a[b]]=[a[b],a[d]]}return a.slice(0,b)},scrollToTop:y,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const d=c(Math.random()*b--);[a[b],a[d]]=[a[d],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(b,c=!1)=>{const d=b.reduce((a,b)=>a+b,0)/b.length;return a(b.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(b.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(a)=>i(g(e(a,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),uncurry:(a,b=1)=>(...c)=>{if(b>c.length)throw new RangeError('Arguments too few!');return((a)=>(b)=>b.reduce((a,b)=>a(b),a))(a)(c.slice(0,b))},unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); +(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.sqrt,b=Math.log,c=Math.floor,d=Math.PI,e=Math.min,g=Math.max,h=Math.ceil,i=Math.round,j=Math.abs;const k='undefined'!=typeof require&&require('fs'),l='undefined'!=typeof require&&require('crypto'),m=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(m(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),n=(a,b=a.length,...c)=>b<=c.length?a(...c):n.bind(null,a,b,...c),o=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?o(a[c]):a[c]),b},p=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?p(a):a)),q=([...c],d=32,e)=>{const[g,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),h=(c,h)=>(e||c)+d*(h-b(h?g:a,h?a:g));if(2===c.length)return[h(g,1),h(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>r(c[a],d[a]))},s=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*s(a-1),t=(a,b=1)=>1===b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?t(a,b-1):a),[]),u=(a,b='')=>Object.keys(a).reduce((c,d)=>{const e=b.length?b+'.':'';return'object'==typeof a[d]?Object.assign(c,u(a[d],e+d)):c[e+d]=a[d],c},{}),v=(...a)=>{const c=(a,b)=>b?v(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},w='undefined'!=typeof require&&require('crypto'),x='undefined'!=typeof require&&require('fs'),y=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0k.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^l.randomBytes(1)[0]&15>>a/4).toString(16)),all:(a,b=Boolean)=>a.every(b),anagrams:m,any:(a,b=Boolean)=>a.some(b),approximatelyEqual:(a,b,c=1e-3)=>j(a-b)a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),attempt:(a,...b)=>{try{return a(b)}catch(a){return a instanceof Error?a:new Error(a)}},average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bifurcate:(a,b)=>a.reduce((a,c,d)=>(a[b[d]?0:1].push(c),a),[[],[]]),bifurcateBy:(a,b)=>a.reduce((a,c,d)=>(a[b(c,d)?0:1].push(c),a),[[],[]]),bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>(f=a[b],a[b]=function(){return f.apply(a)})),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},binomialCoefficient:(a,b)=>{var c=Number.isNaN;if(c(a)||c(b))return NaN;if(0>b||b>a)return 0;if(0===b||b===a)return 1;if(1===b||b===a-1)return a;a-bdocument.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:h(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>g(e(c,g(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),converge:(a,b)=>(...c)=>a(...b.map((a)=>a.apply(null,c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:n,debounce:(a,b=0)=>{let c;return function(...d){clearTimeout(c),c=setTimeout(()=>a.apply(this,d),b)}},decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:o,deepFlatten:p,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),degreesToRads:(a)=>a*d/180,delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:g}=a.getBoundingClientRect(),{innerHeight:h,innerWidth:i}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:s,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:t,flattenObject:u,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:c(a/8.64e7),hour:c(a/3.6e6)%24,minute:c(a/6e4)%60,second:c(a/1e3)%60,millisecond:c(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:v,geometricProgression:(a,d=1,e=2)=>Array.from({length:c(b(a/d)/b(e))+1}).map((a,b)=>d*e**b),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getColonTimeFromDate:(a)=>a.toTimeString().slice(0,8),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getMeridiemSuffixOfInteger:(a)=>0===a||24===a?'12am':12===a?'12pm':12>a?a%12+'am':a%12+'pm',getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(w.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:h((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(b)=>{const d=c(a(b));for(var e=2;e<=d;e++)if(0==b%e)return!1;return 2<=b},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,g)=>g===a.length-2?d+e+c:g===a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>g(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=c(a.length/2),d=[...a].sort((c,a)=>c-a);return 0==a.length%2?(d[b-1]+d[b])/2:d[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),mostPerformant:(a,b=1e4)=>{const c=a.map((a)=>{const c=performance.now();for(let c=0;c(...b)=>!a(...b),none:(a,b=Boolean)=>!a.some(b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,g)=>{if(0===b){const[h,i]=d&&'desc'===d[g]?[a[c],e[c]]:[e[c],a[c]];b=h>i?1:h(...b)=>a.map((a)=>a.apply(null,b)),overArgs:(a,b)=>(...c)=>a(...c.map((a,c)=>b[c](a))),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeAsyncFunctions:(...a)=>(b)=>a.reduce((a,b)=>a.then(b),Promise.resolve(b)),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,d=!0)=>{const g=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>j(a))return a+(d?' ':'')+g[0];const h=e(c(Math.log10(0>a?-a:a)/3),g.length-1),i=+((0>a?-a:a)/1e3**h).toPrecision(b);return(0>a?'-':'')+i+(d?' ':'')+g[h]},primes:(b)=>{let d=Array.from({length:b-1}).map((a,b)=>b+2),e=c(a(b)),g=Array.from({length:e-1}).map((a,b)=>b+2);return g.forEach((a)=>d=d.filter((b)=>0!=b%a||b===a)),d},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),g=a.filter((a)=>!e.includes(d(a)));a.length=0,g.forEach((b)=>a.push(b))},radsToDegrees:(a)=>180*a/d,randomHexColorCode:()=>{let a=(1e6*(1048575*Math.random())).toString(16);return'#'+a.slice(0,6)},randomIntArrayInRange:(a,b,d=1)=>Array.from({length:d},()=>c(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>c(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>x.readFileSync(a).toString('UTF8').split('\n'),rearg:(a,b)=>(...c)=>a(...c.reduce((a,c,d)=>(a[b.indexOf(d)]=c,a),Array.from({length:b.length}))),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(a,b=0)=>+`${i(`${a}e${b}`)}e-${b}`,runAsync:(a)=>{const b=new Worker(URL.createObjectURL(new Blob([`postMessage((${a})());`]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,c)=>{b.onmessage=({data:c})=>{a(c),b.terminate()},b.onerror=(a)=>{c(a),b.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[c(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let d=a.length;d;){const b=c(Math.random()*d--);[a[d],a[b]]=[a[b],a[d]]}return a.slice(0,b)},scrollToTop:y,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const d=c(Math.random()*b--);[a[b],a[d]]=[a[d],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===g?a.length:g},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),g=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===g?0:a.length-g},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),stableSort:(a,c)=>a.map((a,b)=>({item:a,index:b})).sort((d,a)=>c(d.item,a.item)||d.index-a.index).map(({item:a})=>a),standardDeviation:(b,c=!1)=>{const d=b.reduce((a,b)=>a+b,0)/b.length;return a(b.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(b.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},throttle:(a,b)=>{let c,d,e;return function(){const g=this,h=arguments;c?(clearTimeout(d),d=setTimeout(function(){Date.now()-e>=b&&(a.apply(g,h),e=Date.now())},b-(Date.now()-e))):(a.apply(g,h),e=Date.now(),c=!0)}},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toCurrency:(a,b,c=void 0)=>Intl.NumberFormat(c,{style:'currency',currency:b}).format(a),toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(a)=>i(g(e(a,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),uncurry:(a,b=1)=>(...c)=>{if(b>c.length)throw new RangeError('Arguments too few!');return((a)=>(b)=>b.reduce((a,b)=>a(b),a))(a)(c.slice(0,b))},unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unflattenObject:(a)=>Object.keys(a).reduce((b,c)=>{if(-1!==c.indexOf('.')){const d=c.split('.');Object.assign(b,JSON.parse('{'+d.map((a,b)=>b===d.length-1?`"${a}":`:`"${a}":{`).join('')+a[c]+'}'.repeat(d.length)))}else b[c]=a[c];return b},{}),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:g(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=g(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); diff --git a/test/testlog b/test/testlog index be21ddc72..ff2d022e4 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sat Feb 17 2018 20:23:50 GMT+0000 (UTC) +Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC) > 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1534,6 +1534,11 @@ Test log for: Sat Feb 17 2018 20:23:50 GMT+0000 (UTC) ✔ spreadOver is a Function ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + Testing stableSort + + ✔ stableSort is a Function + ✔ Array is properly sorted + Testing standardDeviation ✔ standardDeviation is a Function @@ -1905,8 +1910,8 @@ Test log for: Sat Feb 17 2018 20:23:50 GMT+0000 (UTC) ✔ Works with multiple promises - total: 970 - passing: 970 + total: 972 + passing: 972 duration: 2.4s