From c6b1c65f14ff62f929a345238c99d4ab71ccaf82 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 12:58:58 +0200 Subject: [PATCH 01/74] Add splitLines --- snippets/splitLines.md | 13 +++++++++++++ tag_database | 1 + 2 files changed, 14 insertions(+) create mode 100644 snippets/splitLines.md diff --git a/snippets/splitLines.md b/snippets/splitLines.md new file mode 100644 index 000000000..536e7e1fd --- /dev/null +++ b/snippets/splitLines.md @@ -0,0 +1,13 @@ +### splitLines + +Splits a multiline string into an array of lines. + +Use `String.split()` and a regular expression to match line breaks and create an array. + +```js +const splitLines = str => str.split(/\r?\n/); +``` + +```js +splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , ''] +``` diff --git a/tag_database b/tag_database index 5f4e45246..6994bf49c 100644 --- a/tag_database +++ b/tag_database @@ -121,6 +121,7 @@ similarity:array sleep:function sortCharactersInString:string speechSynthesis:media +splitLines:string spreadOver:adapter standardDeviation:math symmetricDifference:array From 83ab89fe1c64ab39cdcc4a4c128e3b9c4a2a4661 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 13:28:18 +0200 Subject: [PATCH 02/74] Add lowercaseKeys --- snippets/lowercaseKeys.md | 18 ++++++++++++++++++ tag_database | 1 + 2 files changed, 19 insertions(+) create mode 100644 snippets/lowercaseKeys.md diff --git a/snippets/lowercaseKeys.md b/snippets/lowercaseKeys.md new file mode 100644 index 000000000..7612e42bc --- /dev/null +++ b/snippets/lowercaseKeys.md @@ -0,0 +1,18 @@ +### lowercaseKeys + +Creates a new object from the specified object, where all the keys are in lowercase. + +Use `Object.keys()` and `Array.reduce()` to create a new object from the specified object. +Convert each key in the original object to lowercase, using `String.toLowerCase()`. + +```js +const lowercaseKeys = obj => + Object.keys(obj).reduce((acc,key) => {acc[key.toLowerCase()] = obj[key]; return acc;},{}); +``` + +```js +let myObj = {Name: 'Adam', sUrnAME: 'Smith'}; +let myObjLower = lowercaseKeys(myObj); +console.log(myObj); // {Name: 'Adam', sUrnAME: 'Smith'}; +console.log(myObjLower); // {name: 'Adam', surname: 'Smith'}; +``` diff --git a/tag_database b/tag_database index 8a579166f..30e6dad09 100644 --- a/tag_database +++ b/tag_database @@ -78,6 +78,7 @@ JSONToDate:date JSONToFile:node last:array lcm:math +lowercaseKeys:object mapObject:array median:math negate:logic From 7d5515c47563348a3dfeef69fa18116973b24ff8 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 14:16:40 +0200 Subject: [PATCH 03/74] Add escape/unescape string --- snippets/escapeString.md | 14 ++++++++++++++ snippets/unescapeString.md | 14 ++++++++++++++ tag_database | 10 ++++++---- 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 snippets/escapeString.md create mode 100644 snippets/unescapeString.md diff --git a/snippets/escapeString.md b/snippets/escapeString.md new file mode 100644 index 000000000..a1bf2fc7f --- /dev/null +++ b/snippets/escapeString.md @@ -0,0 +1,14 @@ +### escapeString + +Escapes a string for use in HTML. + +Use a chain of `String.replace()` calls combined with regular expressions to replace special characters with the proper symbols. + +```js +const escapeString = str => + str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>'); +``` + +```js +escapeString('Me & you'); // '<a href="#">Me & you</a>' +``` diff --git a/snippets/unescapeString.md b/snippets/unescapeString.md new file mode 100644 index 000000000..5e6e14a01 --- /dev/null +++ b/snippets/unescapeString.md @@ -0,0 +1,14 @@ +### unescapeString + +Unescapes a string from HTML. + +Use a chain of `String.replace()` calls combined with regular expressions to replace special characters with the proper symbols. + +```js +const unescapeString = str => + str.replace(/>/g, '>').replace(/</g, '<').replace(/'/g, '\'').replace(/"/g, '"').replace(/&/g, '&'); +``` + +```js +unescapeString('<a href="#">Me & you</a>'); // 'Me & you' +``` diff --git a/tag_database b/tag_database index 5c3a9153b..e8874cf82 100644 --- a/tag_database +++ b/tag_database @@ -1,6 +1,6 @@ anagrams:string arrayToHtmlList:browser -average:uncategorized +average:math bottomVisible:browser call:adapter capitalize:string @@ -30,6 +30,7 @@ dropElements:array dropRight:array elementIsVisibleInViewport:browser escapeRegExp:string +escapeString:string everyNth:array extendHex:utility factorial:math @@ -76,9 +77,9 @@ JSONToFile:node last:array lcm:math mapObject:array -max:uncategorized +max:math median:math -min:uncategorized +min:math negate:logic nthElement:array objectFromPairs:object @@ -120,7 +121,7 @@ sortCharactersInString:string speechSynthesis:media spreadOver:adapter standardDeviation:math -sum:uncategorized +sum:math symmetricDifference:array tail:array take:array @@ -136,6 +137,7 @@ toOrdinalSuffix:utility toSnakeCase:string truncateString:string truthCheckCollection:object +unescapeString:string union:array UUIDGeneratorBrowser:browser UUIDGeneratorNode:node From 4712d56ff370d57ebf5eae7c0b9a1e3e38869bf7 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:30:55 +0000 Subject: [PATCH 04/74] Travis build: 540 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index ab1608e3d..066eb0df3 100644 --- a/README.md +++ b/README.md @@ -2692,6 +2692,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 4068be7a2..04dd2b420 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1244,6 +1244,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index a2188fd48..37b235214 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -34,6 +34,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 483d9b1f78d92a6a3648af01a93424d0f6107734 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:32:29 +0000 Subject: [PATCH 05/74] Travis build: 541 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 066eb0df3..22ed83bdb 100644 --- a/README.md +++ b/README.md @@ -2693,6 +2693,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 04dd2b420..956610134 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1245,6 +1245,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 37b235214..6481b2565 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -35,6 +35,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From a55404f761fb865618e08ea12dffb13637361434 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 14:32:56 +0200 Subject: [PATCH 06/74] Update build-script.js --- scripts/build-script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-script.js b/scripts/build-script.js index 61d1c693b..f8cf3ca8a 100644 --- a/scripts/build-script.js +++ b/scripts/build-script.js @@ -79,7 +79,7 @@ try { for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)){ let data = snippets[taggedSnippet[0]+'.md']; data = data.slice(0,data.lastIndexOf('```js')) + '
\nExamples\n\n' + data.slice(data.lastIndexOf('```js'),data.lastIndexOf('```')) + data.slice(data.lastIndexOf('```')) + '\n
\n'; - output += `\n${data+'\n\n[⬆ Back to top](#table-of-contents)\n\n'}`; + output += `\n${data+'\n
[⬆ Back to top](#table-of-contents)\n\n'}`; } } } From 3ce2342d3a00f58f919e25253459dd2a08994da1 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:34:23 +0000 Subject: [PATCH 07/74] Travis build: 543 --- README.md | 439 ++++++++++++++++-------------------------------- docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 149 insertions(+), 292 deletions(-) diff --git a/README.md b/README.md index 22ed83bdb..366a3cffe 100644 --- a/README.md +++ b/README.md @@ -282,8 +282,7 @@ Promise.resolve([1, 2, 3]) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### collectInto @@ -309,8 +308,7 @@ Pall(p1, p2, p3).then(console.log); - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### flip @@ -338,8 +336,7 @@ Object.assign(b, a); // == b - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### pipeFunctions @@ -365,8 +362,7 @@ multiplyAndAdd5(5, 2); // 15 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### promisify @@ -395,8 +391,7 @@ delay(2000).then(() => console.log('Hi!')); // // Promise resolves after 2s - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### spreadOver @@ -420,8 +415,7 @@ arrayMax([1, 2, 4]); // 4 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Array @@ -449,8 +443,7 @@ chunk([1, 2, 3, 4, 5], 2); // [[1,2],[3,4],[5]] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### compact @@ -472,8 +465,7 @@ compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]); // [ 1, 2, 3, 'a' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### countOccurrences @@ -495,8 +487,7 @@ countOccurrences([1, 1, 2, 1, 2, 3], 1); // 3 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### deepFlatten @@ -520,8 +511,7 @@ deepFlatten([1, [2], [[3], 4], 5]); // [1,2,3,4,5] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### difference @@ -546,8 +536,7 @@ difference([1, 2, 3], [1, 2, 4]); // [3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### differenceWith @@ -569,8 +558,7 @@ differenceWith([1, 1.2, 1.5, 3], [1.9, 3], (a, b) => Math.round(a) == Math.round - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### distinctValuesOfArray @@ -592,8 +580,7 @@ distinctValuesOfArray([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### dropElements @@ -619,8 +606,7 @@ dropElements([1, 2, 3, 4], n => n >= 3); // [3,4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### dropRight @@ -644,8 +630,7 @@ dropRight([1, 2, 3], 42); // [] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### everyNth @@ -667,8 +652,7 @@ everyNth([1, 2, 3, 4, 5, 6], 2); // [ 2, 4, 6 ] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### filterNonUnique @@ -690,8 +674,7 @@ filterNonUnique([1, 2, 2, 3, 4, 4, 5]); // [1,3,5] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### flatten @@ -713,8 +696,7 @@ flatten([1, [2], 3, 4]); // [1,2,3,4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### flattenDepth @@ -742,8 +724,7 @@ flattenDepth([1, [2], 3, 4]); // [1,2,3,4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### groupBy @@ -771,8 +752,7 @@ groupBy(['one', 'two', 'three'], 'length'); // {3: ['one', 'two'], 5: ['three']} - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### head @@ -794,8 +774,7 @@ head([1, 2, 3]); // 1 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### initial @@ -817,8 +796,7 @@ initial([1, 2, 3]); // [1,2] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### initialize2DArray @@ -843,8 +821,7 @@ initialize2DArray(2, 2, 0); // [[0,0], [0,0]] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### initializeArrayWithRange @@ -869,8 +846,7 @@ initializeArrayWithRange(7, 3); // [3,4,5,6,7] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### initializeArrayWithValues @@ -893,8 +869,7 @@ initializeArrayWithValues(5, 2); // [2,2,2,2,2] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### intersection @@ -919,8 +894,7 @@ intersection([1, 2, 3], [4, 3, 2]); // [2,3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### last @@ -942,8 +916,7 @@ last([1, 2, 3]); // 3 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### mapObject @@ -969,8 +942,7 @@ squareIt([1, 2, 3]); // { 1: 1, 2: 4, 3: 9 } - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### nthElement @@ -995,8 +967,7 @@ nthElement(['a', 'b', 'b'], -3); // 'a' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### pick @@ -1019,8 +990,7 @@ pick({ a: 1, b: '2', c: 3 }, ['a', 'c']); // { 'a': 1, 'c': 3 } - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### pull @@ -1056,8 +1026,7 @@ console.log(myArray2); // [ 'b', 'b' ] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### pullAtIndex @@ -1093,8 +1062,7 @@ console.log(pulled); // [ 'b', 'd' ] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### pullAtValue @@ -1128,8 +1096,7 @@ console.log(pulled); // [ 'b', 'd' ] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### quickSort @@ -1161,8 +1128,7 @@ quickSort([4, 1, 3, 2], true); // [4,3,2,1] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### remove @@ -1191,8 +1157,7 @@ remove([1, 2, 3, 4], n => n % 2 == 0); // [2, 4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### sample @@ -1215,8 +1180,7 @@ sample([3, 7, 9, 11]); // 9 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### shuffle @@ -1247,8 +1211,7 @@ console.log(foo); // [1,2,3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### similarity @@ -1270,8 +1233,7 @@ similarity([1, 2, 3], [1, 2, 4]); // [1,2] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### symmetricDifference @@ -1297,8 +1259,7 @@ symmetricDifference([1, 2, 3], [1, 2, 4]); // [3,4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### tail @@ -1321,8 +1282,7 @@ tail([1]); // [1] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### take @@ -1345,8 +1305,7 @@ take([1, 2, 3], 0); // [] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### takeRight @@ -1369,8 +1328,7 @@ takeRight([1, 2, 3]); // [3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### union @@ -1392,8 +1350,7 @@ union([1, 2, 3], [4, 3, 2]); // [1,2,3,4] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### without @@ -1417,8 +1374,7 @@ without([2, 1, 2, 3], 1, 2); // [3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### zip @@ -1448,8 +1404,7 @@ zip(['a'], [1, 2], [true, false]); // [['a', 1, true], [undefined, 2, false]] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### zipObject @@ -1473,8 +1428,7 @@ zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2} - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Browser @@ -1498,8 +1452,7 @@ arrayToHtmlList(['item 1', 'item 2'], 'myListID'); - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### bottomVisible @@ -1523,8 +1476,7 @@ bottomVisible(); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### currentURL @@ -1546,8 +1498,7 @@ currentURL(); // 'https://google.com' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### detectDeviceType @@ -1573,8 +1524,7 @@ detectDeviceType(); // "Desktop" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### elementIsVisibleInViewport @@ -1608,8 +1558,7 @@ elementIsVisibleInViewport(el, true); // true // (partially visible) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### getScrollPosition @@ -1635,8 +1584,7 @@ getScrollPosition(); // {x: 0, y: 200} - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### getStyle @@ -1658,8 +1606,7 @@ getStyle(document.querySelector('p'), 'font-size'); // '16px' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### getURLParameters @@ -1685,8 +1632,7 @@ getURLParameters('http://url.com/page?name=Adam&surname=Smith'); // {name: 'Adam - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### hasClass @@ -1708,8 +1654,7 @@ hasClass(document.querySelector('p.special'), 'special'); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### hide @@ -1731,8 +1676,7 @@ hide(document.querySelectorAll('img')); // Hides all elements on the page - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### httpsRedirect @@ -1752,8 +1696,7 @@ const httpsRedirect = () => { - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### redirect @@ -1777,8 +1720,7 @@ redirect('https://google.com'); - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### scrollToTop @@ -1807,8 +1749,7 @@ scrollToTop(); - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### setStyle @@ -1830,8 +1771,7 @@ setStyle(document.querySelector('p'), 'font-size', '20px'); // The first

ele - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### show @@ -1853,8 +1793,7 @@ show(document.querySelectorAll('img')); // Shows all elements on the page - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toggleClass @@ -1876,8 +1815,7 @@ toggleClass(document.querySelector('p.special'), 'special'); // The paragraph wi - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### UUIDGeneratorBrowser @@ -1902,8 +1840,7 @@ UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Date @@ -1927,8 +1864,7 @@ getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### JSONToDate @@ -1953,8 +1889,7 @@ JSONToDate(/Date(1489525200000)/); // "14/3/2017" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toEnglishDate @@ -1984,8 +1919,7 @@ toEnglishDate('09/21/2010'); // '21/09/2010' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### tomorrow @@ -2006,8 +1940,7 @@ tomorrow(); // 2017-12-27 (if current date is 2017-12-26) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Function @@ -2046,8 +1979,7 @@ chainAsync([ - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### compose @@ -2073,8 +2005,7 @@ multiplyAndAdd5(5, 2); // 15 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### curry @@ -2101,8 +2032,7 @@ curry(Math.min, 3)(10)(50)(2); // 2 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### functionName @@ -2124,8 +2054,7 @@ functionName(Math.max); // max (logged in debug channel of console) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### runPromisesInSeries @@ -2148,8 +2077,7 @@ runPromisesInSeries([() => delay(1000), () => delay(2000)]); // //executes each - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### sleep @@ -2175,8 +2103,7 @@ async function sleepyWork() { - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Logic @@ -2200,8 +2127,7 @@ negate(isOdd)(1); // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Math @@ -2224,8 +2150,7 @@ average([1, 2, 3]); // 2 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### clampNumber @@ -2250,8 +2175,7 @@ clampNumber(3, 2, 4); // 3 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### collatz @@ -2274,8 +2198,7 @@ collatz(5); // 16 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### digitize @@ -2298,8 +2221,7 @@ digitize(123); // [1, 2, 3] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### distance @@ -2321,8 +2243,7 @@ distance(1, 1, 2, 3); // 2.23606797749979 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### factorial @@ -2352,8 +2273,7 @@ factorial(6); // 720 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### fibonacci @@ -2380,8 +2300,7 @@ fibonacci(6); // 720 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### fibonacciCountUntilNum @@ -2404,8 +2323,7 @@ fibonacciCountUntilNum(10); // 7 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### fibonacciUntilNum @@ -2435,8 +2353,7 @@ fibonacciCountUntilNum(10); // 7 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### gcd @@ -2464,8 +2381,7 @@ gcd(8, 36); // 4 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### hammingDistance @@ -2488,8 +2404,7 @@ hammingDistance(2, 3); // 1 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### inRange @@ -2518,8 +2433,7 @@ inrange(3, 2); // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isArmstrongNumber @@ -2546,8 +2460,7 @@ isArmstrongNumber(56); // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isDivisible @@ -2569,8 +2482,7 @@ isDivisible(6, 3); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isEven @@ -2593,8 +2505,7 @@ isEven(3); // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isPrime @@ -2622,8 +2533,7 @@ isPrime(12); // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### lcm @@ -2652,8 +2562,7 @@ lcm([1, 3, 4], 5); // 60 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### max @@ -2694,6 +2603,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); @@ -2708,8 +2618,7 @@ max([10, 1, 5]); // 10 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### median @@ -2737,8 +2646,7 @@ median([0, 10, -2, 7]); // 3.5 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### min @@ -2760,8 +2668,7 @@ min([10, 1, 5]); // 1 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### palindrome @@ -2793,8 +2700,7 @@ palindrome('taco cat'); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### percentile @@ -2817,8 +2723,7 @@ percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6); // 55 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### powerset @@ -2840,8 +2745,7 @@ powerset([1, 2]); // [[], [1], [2], [2,1]] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### primes @@ -2869,8 +2773,7 @@ primes(10); // [2,3,5,7] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### randomIntegerInRange @@ -2892,8 +2795,7 @@ randomIntegerInRange(0, 5); // 2 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### randomNumberInRange @@ -2915,8 +2817,7 @@ randomNumberInRange(2, 10); // 6.0211363285087005 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### round @@ -2939,8 +2840,7 @@ round(1.005, 2); // 1.01 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### standardDeviation @@ -2973,8 +2873,7 @@ standardDeviation([10, 2, 38, 23, 38, 23, 21], true); // 12.29899614287479 (popu - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### sum @@ -2996,8 +2895,7 @@ sum([1, 2, 3, 4]); // 10 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Media @@ -3027,8 +2925,7 @@ speechSynthesis('Hello, World'); // // plays the message - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Node @@ -3053,8 +2950,7 @@ JSONToFile({ test: 'is passed' }, 'testJsonFile'); // writes the object to 'test - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### readFileLines @@ -3092,8 +2988,7 @@ console.log(arr); // ['line1', 'line2', 'line3'] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### UUIDGeneratorNode @@ -3119,8 +3014,7 @@ UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Object @@ -3154,8 +3048,7 @@ cleanObj(testObj, ['a'], 'children'); // { a: 1, children : { a: 1}} - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### objectFromPairs @@ -3177,8 +3070,7 @@ objectFromPairs([['a', 1], ['b', 2]]); // {a: 1, b: 2} - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### objectToPairs @@ -3200,8 +3092,7 @@ objectToPairs({ a: 1, b: 2 }); // [['a',1],['b',2]]) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### orderBy @@ -3240,8 +3131,7 @@ orderBy(users, ['name', 'age']); // [{name: 'barney', age: 34}, {name: 'barney', - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### select @@ -3265,8 +3155,7 @@ select(obj, 'selector.to.val'); // 'val to select' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### shallowClone @@ -3290,8 +3179,7 @@ a === b; // false - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### truthCheckCollection @@ -3313,8 +3201,7 @@ truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## String @@ -3349,8 +3236,7 @@ anagrams('abc'); // ['abc','acb','bac','bca','cab','cba'] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### Capitalize @@ -3375,8 +3261,7 @@ capitalize('fooBar', true); // 'Foobar' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### capitalizeEveryWord @@ -3398,8 +3283,7 @@ capitalizeEveryWord('hello world!'); // 'Hello World!' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### countVowels @@ -3422,8 +3306,7 @@ countVowels('gym'); // 0 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### escapeRegExp @@ -3445,8 +3328,7 @@ escapeRegExp('(test)'); // \\(test\\) - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### fromCamelCase @@ -3475,8 +3357,7 @@ fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### repeatString @@ -3501,8 +3382,7 @@ repeatString('abc'); // 'abcabc' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### reverseString @@ -3529,8 +3409,7 @@ reverseString('foobar'); // 'raboof' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### sortCharactersInString @@ -3556,8 +3435,7 @@ sortCharactersInString('cabbage'); // 'aabbceg' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toCamelCase @@ -3591,8 +3469,7 @@ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); // 'someMi - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toKebabCase @@ -3624,8 +3501,7 @@ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSo - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toSnakeCase @@ -3659,8 +3535,7 @@ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSo - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### truncateString @@ -3684,8 +3559,7 @@ truncateString('boomerang', 7); // 'boom...' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### words @@ -3709,8 +3583,7 @@ words('python, javaScript & coffee'); // ["python", "javaScript", "coffee"] - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Utility @@ -3733,8 +3606,7 @@ coalesce(null, undefined, '', NaN, 'Waldo'); // "" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### coalesceFactory @@ -3757,8 +3629,7 @@ customCoalesce(undefined, null, NaN, '', 'Waldo'); // "Waldo" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### extendHex @@ -3787,8 +3658,7 @@ extendHex('05a'); // '#0055aa' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### getType @@ -3811,8 +3681,7 @@ getType(new Set([1, 2, 3])); // "set" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### hexToRGB @@ -3854,8 +3723,7 @@ hexToRGB('#fff'); // 'rgb(255, 255, 255)' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isArray @@ -3878,8 +3746,7 @@ isArray([1]); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isBoolean @@ -3902,8 +3769,7 @@ isBoolean(false); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isFunction @@ -3926,8 +3792,7 @@ isFunction(x => x); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isNumber @@ -3949,8 +3814,7 @@ isNumber(1); // true ``` - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isString @@ -3973,8 +3837,7 @@ isString('10'); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### isSymbol @@ -3997,8 +3860,7 @@ isSymbol(Symbol('x')); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### randomHexColorCode @@ -4025,8 +3887,7 @@ randomHexColorCode(); // "#4144c6" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### RGBToHex @@ -4048,8 +3909,7 @@ RGBToHex(255, 165, 1); // 'ffa501' - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### sbdm @@ -4079,8 +3939,7 @@ console.log(sdbm('age')); // 808122783 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### timeTaken @@ -4108,8 +3967,7 @@ timeTaken(() => Math.pow(2, 10)); // 1024 - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toDecimalMark @@ -4129,8 +3987,7 @@ toDecimalMark(12305030388.9087); // "12,305,030,388.9087" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### toOrdinalSuffix @@ -4163,8 +4020,7 @@ toOrdinalSuffix('123'); // "123rd" - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ### validateNumber @@ -4188,8 +4044,7 @@ validateNumber('10'); // true - -[⬆ Back to top](#table-of-contents) +
[⬆ Back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index 956610134..d30ecfb77 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1246,6 +1246,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 6481b2565..121b4956a 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -36,6 +36,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 0afd2178764e8c9a0f48d532a50d1bd1f8210b7b Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:35:44 +0000 Subject: [PATCH 08/74] Travis build: 545 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 366a3cffe..2f131cd54 100644 --- a/README.md +++ b/README.md @@ -2604,6 +2604,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index d30ecfb77..332363464 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1247,6 +1247,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 121b4956a..0f705109c 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -37,6 +37,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From d96ab75effe9a91ce67fcffb8a5664449199bec2 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:37:08 +0000 Subject: [PATCH 09/74] Travis build: 546 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 2f131cd54..6c0aebb86 100644 --- a/README.md +++ b/README.md @@ -2605,6 +2605,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 332363464..df086191a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1248,6 +1248,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 0f705109c..fc588dbbf 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -38,6 +38,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 846a37c05799b84967d96795b9002f8989dfd611 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:38:45 +0000 Subject: [PATCH 10/74] Travis build: 548 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 6c0aebb86..571fe3ad3 100644 --- a/README.md +++ b/README.md @@ -2606,6 +2606,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index df086191a..7aac36b7d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1249,6 +1249,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index fc588dbbf..1430c59b3 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -39,6 +39,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 5b63d0b20a5be858815dbc4a8e3d293c095e2b2e Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:40:29 +0000 Subject: [PATCH 11/74] Travis build: 550 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 571fe3ad3..cacc20a02 100644 --- a/README.md +++ b/README.md @@ -2607,6 +2607,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 7aac36b7d..79ab4d7a1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1250,6 +1250,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 1430c59b3..fab169188 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -40,6 +40,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 004fbb0e296318e859507347761fceb88727b2ec Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:42:38 +0000 Subject: [PATCH 12/74] Travis build: 551 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index cacc20a02..12cc43033 100644 --- a/README.md +++ b/README.md @@ -2608,6 +2608,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 79ab4d7a1..21b72c2fb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1251,6 +1251,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index fab169188..493b56044 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -41,6 +41,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 43827283d3eb78d4af6ba405eafb61afd0034266 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:44:03 +0000 Subject: [PATCH 13/74] Travis build: 552 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 12cc43033..07b319f29 100644 --- a/README.md +++ b/README.md @@ -2609,6 +2609,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 21b72c2fb..6b9e568f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1252,6 +1252,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 493b56044..1d120682a 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -42,6 +42,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From ab1a5d8687f8c81c9b40f8e7e201ec08aebad23c Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:45:47 +0000 Subject: [PATCH 14/74] Travis build: 553 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 07b319f29..7a9b3710f 100644 --- a/README.md +++ b/README.md @@ -2610,6 +2610,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 6b9e568f9..96b59c008 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1253,6 +1253,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 1d120682a..deab49958 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -43,6 +43,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 2bbc7de8b067f117017f23d282eee7ea28a91f93 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:47:49 +0000 Subject: [PATCH 15/74] Travis build: 554 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 7a9b3710f..019f87b84 100644 --- a/README.md +++ b/README.md @@ -2611,6 +2611,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 96b59c008..13cc9e599 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1254,6 +1254,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index deab49958..dc9fdca0c 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -44,6 +44,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From b1d3962f474f72802aab8ec326b7094168df6f5d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:49:11 +0000 Subject: [PATCH 16/74] Travis build: 555 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 019f87b84..9209e5373 100644 --- a/README.md +++ b/README.md @@ -2612,6 +2612,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 13cc9e599..bc7f53f83 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1255,6 +1255,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index dc9fdca0c..aaf49a05e 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -45,6 +45,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 1de23e85b389f99dda379c6cd490ee8131755995 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:50:30 +0000 Subject: [PATCH 17/74] Travis build: 556 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 9209e5373..962e19a99 100644 --- a/README.md +++ b/README.md @@ -2613,6 +2613,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index bc7f53f83..773c6db53 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1256,6 +1256,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index aaf49a05e..d9028f08f 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -46,6 +46,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From b84f7f3bc5fef5e03fa8cad23d7a3a629e0b254d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:53:14 +0000 Subject: [PATCH 18/74] Travis build: 557 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 962e19a99..b9b6590a3 100644 --- a/README.md +++ b/README.md @@ -2614,6 +2614,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 773c6db53..c15d38bbb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1257,6 +1257,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index d9028f08f..37ea0f131 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -47,6 +47,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From c70012a17c4397aba1022f6e6f4fe88b3c409299 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:55:10 +0000 Subject: [PATCH 19/74] Travis build: 559 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index b9b6590a3..ab9dd9119 100644 --- a/README.md +++ b/README.md @@ -2615,6 +2615,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index c15d38bbb..e9eba81a5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1258,6 +1258,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 37ea0f131..4a9c598e7 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -48,6 +48,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 533f4f8967f68cc6277483a5c6a638b91d4f36fb Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:56:33 +0000 Subject: [PATCH 20/74] Travis build: 560 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index ab9dd9119..67d013d73 100644 --- a/README.md +++ b/README.md @@ -2616,6 +2616,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index e9eba81a5..f2cbb949c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1259,6 +1259,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 4a9c598e7..4cf62dc65 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -49,6 +49,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 723cefaabbd31efdd2d861d7de21d47f21a5fbab Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 12:57:56 +0000 Subject: [PATCH 21/74] Travis build: 562 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 67d013d73..d5643b471 100644 --- a/README.md +++ b/README.md @@ -2617,6 +2617,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index f2cbb949c..cf89a0d90 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1260,6 +1260,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 4cf62dc65..1b2ea58c4 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -50,6 +50,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From ba26cc348e1954c105676b167006ee5e9604731d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:00:01 +0000 Subject: [PATCH 22/74] Travis build: 563 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index d5643b471..e8159d7a8 100644 --- a/README.md +++ b/README.md @@ -2618,6 +2618,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index cf89a0d90..444543529 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1261,6 +1261,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 1b2ea58c4..eb5e76d0d 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -51,6 +51,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 617f19d5522ee5aa386c9d63762775356519cb3d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:01:26 +0000 Subject: [PATCH 23/74] Travis build: 566 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index e8159d7a8..68e33da96 100644 --- a/README.md +++ b/README.md @@ -2619,6 +2619,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index 444543529..c36cf03e6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1262,6 +1262,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index eb5e76d0d..91d5bb44c 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -52,6 +52,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From 542f30a0edb842cc3a2efb206677d4688154b45e Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:03:10 +0000 Subject: [PATCH 24/74] Travis build: 567 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 68e33da96..f4b8d1642 100644 --- a/README.md +++ b/README.md @@ -2620,6 +2620,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/docs/index.html b/docs/index.html index c36cf03e6..646106e90 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1263,6 +1263,7 @@ lcm([1, 3, 4], 5); // 60 + const max = (...arr) => Math.max(...[].concat(...arr); diff --git a/snippets/max.md b/snippets/max.md index 91d5bb44c..c2293755d 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -53,6 +53,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va + const max = (...arr) => Math.max(...[].concat(...arr); From d3d2307b2797f5c903067c790567e34bd7058d70 Mon Sep 17 00:00:00 2001 From: atomiks Date: Sat, 30 Dec 2017 00:03:47 +1100 Subject: [PATCH 25/74] Rename to escapeHTML, use a dictionary instead --- snippets/escapeString.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/snippets/escapeString.md b/snippets/escapeString.md index a1bf2fc7f..7ca23af6d 100644 --- a/snippets/escapeString.md +++ b/snippets/escapeString.md @@ -1,14 +1,19 @@ -### escapeString +### escapeHTML Escapes a string for use in HTML. -Use a chain of `String.replace()` calls combined with regular expressions to replace special characters with the proper symbols. +Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object). ```js -const escapeString = str => - str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>'); +const escapeHTML = str => str.replace(/[&<>'"]/g, tag => ({ + '&': '&', + '<': '<', + '>': '>', + '\'': ''', + '"': '"' + })[tag] || tag); ``` ```js -escapeString('Me & you'); // '<a href="#">Me & you</a>' +escapeHTML('Me & you'); // '<a href="#">Me & you</a>' ``` From 8867ae4d590dd9c5a39cf72c6c861e190ed4f581 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 15:04:51 +0200 Subject: [PATCH 26/74] Fixed a problem with a snippet --- snippets/max.md | 50 ------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/snippets/max.md b/snippets/max.md index c2293755d..c90c6d655 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -6,56 +6,6 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va ```js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const max = (...arr) => Math.max(...[].concat(...arr); ``` From 4d92da1c4ca32bff70ff4183d4ad72c21b856d33 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:06:32 +0000 Subject: [PATCH 27/74] Travis build: 574 --- README.md | 72 ++++++++++++++++--------------------------------- docs/index.html | 57 ++++++--------------------------------- snippets/max.md | 1 + 3 files changed, 32 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index f4b8d1642..ab1b54665 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,7 @@ * [`repeatString`](#repeatstring) * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) +* [`splitLines`](#splitlines) * [`toCamelCase`](#tocamelcase) * [`toKebabCase`](#tokebabcase) * [`toSnakeCase`](#tosnakecase) @@ -2574,55 +2575,6 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va ```js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const max = (...arr) => Math.max(...[].concat(...arr); ``` @@ -3455,6 +3407,28 @@ sortCharactersInString('cabbage'); // 'aabbceg'
[⬆ Back to top](#table-of-contents) +### splitLines + +Splits a multiline string into an array of lines. + +Use `String.split()` and a regular expression to match line breaks and create an array. + +```js +const splitLines = str => str.split(/\r?\n/); +``` + +

+Examples + +```js +splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , ''] +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### toCamelCase Converts a string to camelcase. diff --git a/docs/index.html b/docs/index.html index 646106e90..907f4d132 100644 --- a/docs/index.html +++ b/docs/index.html @@ -242,6 +242,7 @@ repeatString reverseString sortCharactersInString +splitLines toCamelCase toKebabCase toSnakeCase @@ -1217,55 +1218,6 @@ lcm([1, 3, 4], 5); // 60

Use Math.max() combined with the spread operator (...) to get the maximum value in the array.


 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
@@ -1620,6 +1572,13 @@ Combine characters to get a string using join('').

sortCharactersInString('cabbage'); // 'aabbceg'
 
+

splitLines

+

Splits a multiline string into an array of lines.

+

Use String.split() and a regular expression to match line breaks and create an array.

+
const splitLines = str => str.split(/\r?\n/);
+
+
splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
+

toCamelCase

Converts a string to camelcase.

Break the string into words and combine them capitalizing the first letter of each word. diff --git a/snippets/max.md b/snippets/max.md index c90c6d655..7c09c9725 100644 --- a/snippets/max.md +++ b/snippets/max.md @@ -6,6 +6,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va ```js + const max = (...arr) => Math.max(...[].concat(...arr); ``` From c52cd0a4d506eaacd3229535cf6e2d7bd1614d80 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:07:55 +0000 Subject: [PATCH 28/74] Travis build: 575 --- README.md | 1 + docs/index.html | 1 + snippets/max.md | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index ab1b54665..905f97f64 100644 --- a/README.md +++ b/README.md @@ -2575,6 +2575,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va ```js + const max = (...arr) => Math.max(...[].concat(...arr); ``` diff --git a/docs/index.html b/docs/index.html index 907f4d132..dea19e0e9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1218,6 +1218,7 @@ lcm([1, 3, 4], 5); // 60

Use Math.max() combined with the spread operator (...) to get the maximum value in the array.


 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
diff --git a/snippets/max.md b/snippets/max.md
index 7c09c9725..b2d9ba2a7 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -7,6 +7,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 ```js
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From 5bd000c1a748f53e42a8b475f50a320e4c073305 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:08:16 +1100
Subject: [PATCH 29/74] Update unescapeString.md

---
 snippets/unescapeString.md | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/snippets/unescapeString.md b/snippets/unescapeString.md
index 5e6e14a01..8408fc744 100644
--- a/snippets/unescapeString.md
+++ b/snippets/unescapeString.md
@@ -1,14 +1,17 @@
-### unescapeString
+### unescapeHTML
 
-Unescapes a string from HTML.
+Unescapes escaped HTML characters.
 
-Use a chain of `String.replace()` calls combined with regular expressions to replace special characters with the proper symbols.
+Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).
 
 ```js
-const unescapeString = str =>
-  str.replace(/>/g, '>').replace(/</g, '<').replace(/'/g, '\'').replace(/"/g, '"').replace(/&/g, '&');
-```
-
+const escapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
+    '&': '&',
+    '<': '<',
+    '>': '>',
+    ''': '\'',
+    '"': '"'
+  })[tag] || tag);```
 ```js
-unescapeString('<a href="#">Me & you</a>'); // 'Me & you'
+unescapeHTML('<a href="#">Me & you</a>'); // 'Me & you'
 ```

From 8433f0e445afd1bf6ccb726ebe68dbd47c8c7e38 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:08:55 +1100
Subject: [PATCH 30/74] Update unescapeString.md

---
 snippets/unescapeString.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/snippets/unescapeString.md b/snippets/unescapeString.md
index 8408fc744..add33a861 100644
--- a/snippets/unescapeString.md
+++ b/snippets/unescapeString.md
@@ -5,7 +5,7 @@ Unescapes escaped HTML characters.
 Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).
 
 ```js
-const escapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
+const unescapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
     '&': '&',
     '<': '<',
     '>': '>',

From 05f5e3c9c921cc3a606720fa17d5a5a1a1bfe8db Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:09:10 +1100
Subject: [PATCH 31/74] Rename unescapeString.md to unescapeHTML.md

---
 snippets/{unescapeString.md => unescapeHTML.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename snippets/{unescapeString.md => unescapeHTML.md} (100%)

diff --git a/snippets/unescapeString.md b/snippets/unescapeHTML.md
similarity index 100%
rename from snippets/unescapeString.md
rename to snippets/unescapeHTML.md

From b3cdb19f57851c39e4146a1a4f54ce608cf457a3 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:09:10 +0000
Subject: [PATCH 32/74] Travis build: 576

---
 README.md       | 1 +
 docs/index.html | 1 +
 snippets/max.md | 1 +
 3 files changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 905f97f64..032e61129 100644
--- a/README.md
+++ b/README.md
@@ -2576,6 +2576,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 
diff --git a/docs/index.html b/docs/index.html
index dea19e0e9..b4168e8cf 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1219,6 +1219,7 @@ lcm([1, 3, 4], 5); // 60
 

 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
diff --git a/snippets/max.md b/snippets/max.md
index b2d9ba2a7..0fe2586b7 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -8,6 +8,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From 3f568671dd3aa2d00973e1928e3f48eed01aa3a6 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:09:21 +1100
Subject: [PATCH 33/74] Rename escapeString.md to escapeHTML.md

---
 snippets/{escapeString.md => escapeHTML.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename snippets/{escapeString.md => escapeHTML.md} (100%)

diff --git a/snippets/escapeString.md b/snippets/escapeHTML.md
similarity index 100%
rename from snippets/escapeString.md
rename to snippets/escapeHTML.md

From 3c5d387a21f40877f88250138a720f461967dd9c Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:09:49 +1100
Subject: [PATCH 34/74] Update tag_database

---
 tag_database | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tag_database b/tag_database
index e8874cf82..95318406d 100644
--- a/tag_database
+++ b/tag_database
@@ -30,7 +30,7 @@ dropElements:array
 dropRight:array
 elementIsVisibleInViewport:browser
 escapeRegExp:string
-escapeString:string
+escapeHTML:string
 everyNth:array
 extendHex:utility
 factorial:math
@@ -137,7 +137,7 @@ toOrdinalSuffix:utility
 toSnakeCase:string
 truncateString:string
 truthCheckCollection:object
-unescapeString:string
+unescapeHTML:string
 union:array
 UUIDGeneratorBrowser:browser
 UUIDGeneratorNode:node

From 93bf15bdaf270a1204f519272c4faa93713073af Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:10:38 +0000
Subject: [PATCH 35/74] Travis build: 582

---
 README.md       | 1 +
 docs/index.html | 1 +
 snippets/max.md | 1 +
 3 files changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 032e61129..5ac9636ec 100644
--- a/README.md
+++ b/README.md
@@ -2577,6 +2577,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 
diff --git a/docs/index.html b/docs/index.html
index b4168e8cf..b747f7bc9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1220,6 +1220,7 @@ lcm([1, 3, 4], 5); // 60
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
diff --git a/snippets/max.md b/snippets/max.md
index 0fe2586b7..7ba4ad2f1 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -9,6 +9,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From 407bb497534746ff162f8e266b62b8f164da12c5 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Fri, 29 Dec 2017 15:11:27 +0200
Subject: [PATCH 36/74] Fix max snippet

---
 snippets/max.md | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/snippets/max.md b/snippets/max.md
index 7ba4ad2f1..9f6bde286 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -5,11 +5,6 @@ Returns the maximum value out of two or more numbers/arrays.
 Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
 
 ```js
-
-
-
-
-
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From 225ccb94337dd334286efc569b117c1838792818 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:11:28 +0000
Subject: [PATCH 37/74] Travis build: 588

---
 README.md       | 1 +
 docs/index.html | 1 +
 snippets/max.md | 1 +
 3 files changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 905f97f64..032e61129 100644
--- a/README.md
+++ b/README.md
@@ -2576,6 +2576,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 
diff --git a/docs/index.html b/docs/index.html
index dea19e0e9..b4168e8cf 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1219,6 +1219,7 @@ lcm([1, 3, 4], 5); // 60
 

 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
diff --git a/snippets/max.md b/snippets/max.md
index b2d9ba2a7..0fe2586b7 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -8,6 +8,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From dcc9b508b327a3608480a24b0e077ea42fa0dcba Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 00:13:15 +1100
Subject: [PATCH 38/74] Update unescapeHTML.md

---
 snippets/unescapeHTML.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/snippets/unescapeHTML.md b/snippets/unescapeHTML.md
index add33a861..3325e1400 100644
--- a/snippets/unescapeHTML.md
+++ b/snippets/unescapeHTML.md
@@ -5,7 +5,7 @@ Unescapes escaped HTML characters.
 Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).
 
 ```js
-const unescapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
+const unescapeHTML = str => str.replace(/&|<|>|'|"/g, tag => ({
     '&': '&',
     '<': '<',
     '>': '>',

From f492b1ad919de8127a81887dfce311e3822cf9e3 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:13:29 +0000
Subject: [PATCH 39/74] Travis build: 592

---
 README.md       | 3 ---
 docs/index.html | 3 ---
 snippets/max.md | 1 +
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 0ca93513d..5ac9636ec 100644
--- a/README.md
+++ b/README.md
@@ -2577,10 +2577,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
-<<<<<<< HEAD
 
-=======
->>>>>>> master
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 
diff --git a/docs/index.html b/docs/index.html
index e3b5151f4..b747f7bc9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1220,10 +1220,7 @@ lcm([1, 3, 4], 5); // 60
 
 
 
-<<<<<<< HEAD
 
-=======
->>>>>>> master
 const max = (...arr) => Math.max(...[].concat(...arr);
 
max([10, 1, 5]); // 10
diff --git a/snippets/max.md b/snippets/max.md
index 0fe2586b7..7ba4ad2f1 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -9,6 +9,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
 
 
 
+
 const max = (...arr) => Math.max(...[].concat(...arr);
 ```
 

From cf2fd804b8adca5783ac89ba762964e8c7a4f91c Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Fri, 29 Dec 2017 15:15:40 +0200
Subject: [PATCH 40/74] Fixed max for good

---
 snippets/max.md | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/snippets/max.md b/snippets/max.md
index 7ba4ad2f1..4d6fe2826 100644
--- a/snippets/max.md
+++ b/snippets/max.md
@@ -5,12 +5,7 @@ Returns the maximum value out of two or more numbers/arrays.
 Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
 
 ```js
-
-
-
-
-
-const max = (...arr) => Math.max(...[].concat(...arr);
+const max = (...arr) => Math.max(...[].concat(...arr));
 ```
 
 ```js

From 7438846e36574949cc853d3b403e7e9cf6f26f62 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:17:10 +0000
Subject: [PATCH 41/74] Travis build: 598

---
 README.md       | 7 +------
 docs/index.html | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 5ac9636ec..d350e2006 100644
--- a/README.md
+++ b/README.md
@@ -2573,12 +2573,7 @@ Returns the maximum value out of two or more numbers/arrays.
 Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
 
 ```js
-
-
-
-
-
-const max = (...arr) => Math.max(...[].concat(...arr);
+const max = (...arr) => Math.max(...[].concat(...arr));
 ```
 
 
diff --git a/docs/index.html b/docs/index.html index b747f7bc9..cda31a86a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1216,12 +1216,7 @@ lcm([1, 3, 4], 5); // 60

max

Returns the maximum value out of two or more numbers/arrays.

Use Math.max() combined with the spread operator (...) to get the maximum value in the array.

-

-
-
-
-
-const max = (...arr) => Math.max(...[].concat(...arr);
+
const max = (...arr) => Math.max(...[].concat(...arr));
 
max([10, 1, 5]); // 10
 
From 18d4fcf3f80c77ca781374687d1f6c9e3f7de0ca Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:22:58 +0000 Subject: [PATCH 42/74] Travis build: 600 --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++ docs/index.html | 38 +++++++++++++++++++++++ snippets/escapeHTML.md | 19 +++++++----- snippets/unescapeHTML.md | 20 +++++++----- tag_database | 2 +- 5 files changed, 131 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d350e2006..f3127ec90 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,7 @@ * [`capitalize`](#capitalize) * [`capitalizeEveryWord`](#capitalizeeveryword) * [`countVowels`](#countvowels) +* [`escapeHTML`](#escapehtml) * [`escapeRegExp`](#escaperegexp) * [`fromCamelCase`](#fromcamelcase) * [`repeatString`](#repeatstring) @@ -226,6 +227,7 @@ * [`toKebabCase`](#tokebabcase) * [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) +* [`unescapeHTML`](#unescapehtml) * [`words`](#words) @@ -3276,6 +3278,39 @@ countVowels('gym'); // 0
[⬆ Back to top](#table-of-contents) +### escapeHTML + +Escapes a string for use in HTML. + +Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object). + +```js +const escapeHTML = str => + str.replace( + /[&<>'"]/g, + tag => + ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag] || tag) + ); +``` + +
+Examples + +```js +escapeHTML('Me & you'); // '<a href="#">Me & you</a>' +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### escapeRegExp Escapes a string to use in a regular expression. @@ -3551,6 +3586,38 @@ truncateString('boomerang', 7); // 'boom...'
[⬆ Back to top](#table-of-contents) +### unescapeHTML + +Unescapes escaped HTML characters. + +Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). + +```js +const unescapeHTML = str => + str.replace( + /&|<|>|'|"/g, + tag => + ({ + '&': '&', + '<': '<', + '>': '>', + ''': "'", + '"': '"' + }[tag] || tag) + ); +``` +
+Examples + +```js +unescapeHTML('<a href="#">Me & you</a>'); // 'Me & you' +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### words Converts a given string into an array of words. diff --git a/docs/index.html b/docs/index.html index cda31a86a..bb72b7b1f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -237,6 +237,7 @@ capitalize capitalizeEveryWord countVowels +escapeHTML escapeRegExp fromCamelCase repeatString @@ -247,6 +248,7 @@ toKebabCase toSnakeCase truncateString +unescapeHTML words

Utility @@ -1516,6 +1518,24 @@ capitalize('fooBar', true); // 'Foobar'
countVowels('foobar'); // 3
 countVowels('gym'); // 0
 
+


escapeHTML

+

Escapes a string for use in HTML.

+

Use String.replace() with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object).

+
const escapeHTML = str =>
+  str.replace(
+    /[&<>'"]/g,
+    tag =>
+      ({
+        '&': '&amp;',
+        '<': '&lt;',
+        '>': '&gt;',
+        "'": '&#39;',
+        '"': '&quot;'
+      }[tag] || tag)
+  );
+
+
escapeHTML('<a href="#">Me & you</a>'); // '&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'
+

escapeRegExp

Escapes a string to use in a regular expression.

Use replace() to escape special characters.

@@ -1641,6 +1661,24 @@ Return the string truncated to the desired length, with ... appende
truncateString('boomerang', 7); // 'boom...'
 
+

unescapeHTML

+

Unescapes escaped HTML characters.

+

Use String.replace() with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).

+
const unescapeHTML = str =>
+  str.replace(
+    /&amp;|&lt;|&gt;|&#39;|&quot;/g,
+    tag =>
+      ({
+        '&amp;': '&',
+        '&lt;': '<',
+        '&gt;': '>',
+        '&#39;': "'",
+        '&quot;': '"'
+      }[tag] || tag)
+  );
+
+
unescapeHTML('&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'); // '<a href="#">Me & you</a>'
+

words

Converts a given string into an array of words.

Use String.split() with a supplied pattern (defaults to non-alpha as a regex) to convert to an array of strings. Use Array.filter() to remove any empty strings. diff --git a/snippets/escapeHTML.md b/snippets/escapeHTML.md index 7ca23af6d..2db4cf0c0 100644 --- a/snippets/escapeHTML.md +++ b/snippets/escapeHTML.md @@ -5,13 +5,18 @@ Escapes a string for use in HTML. Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object). ```js -const escapeHTML = str => str.replace(/[&<>'"]/g, tag => ({ - '&': '&', - '<': '<', - '>': '>', - '\'': ''', - '"': '"' - })[tag] || tag); +const escapeHTML = str => + str.replace( + /[&<>'"]/g, + tag => + ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag] || tag) + ); ``` ```js diff --git a/snippets/unescapeHTML.md b/snippets/unescapeHTML.md index 3325e1400..d3d43b827 100644 --- a/snippets/unescapeHTML.md +++ b/snippets/unescapeHTML.md @@ -5,13 +5,19 @@ Unescapes escaped HTML characters. Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). ```js -const unescapeHTML = str => str.replace(/&|<|>|'|"/g, tag => ({ - '&': '&', - '<': '<', - '>': '>', - ''': '\'', - '"': '"' - })[tag] || tag);``` +const unescapeHTML = str => + str.replace( + /&|<|>|'|"/g, + tag => + ({ + '&': '&', + '<': '<', + '>': '>', + ''': "'", + '"': '"' + }[tag] || tag) + ); +``` ```js unescapeHTML('<a href="#">Me & you</a>'); // 'Me & you' ``` diff --git a/tag_database b/tag_database index 604d1d876..d0a06ba0d 100644 --- a/tag_database +++ b/tag_database @@ -29,8 +29,8 @@ distinctValuesOfArray:array dropElements:array dropRight:array elementIsVisibleInViewport:browser -escapeRegExp:string escapeHTML:string +escapeRegExp:string everyNth:array extendHex:utility factorial:math From 0a19f0867d2761f68b9ec41652b277c08698f513 Mon Sep 17 00:00:00 2001 From: atomiks Date: Sat, 30 Dec 2017 00:25:24 +1100 Subject: [PATCH 43/74] Update unescapeHTML.md --- snippets/unescapeHTML.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/unescapeHTML.md b/snippets/unescapeHTML.md index d3d43b827..8c1ebe960 100644 --- a/snippets/unescapeHTML.md +++ b/snippets/unescapeHTML.md @@ -2,7 +2,7 @@ Unescapes escaped HTML characters. -Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). +Use `String.replace()` with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). ```js const unescapeHTML = str => From 998a3f741a03323943b2cd28a5fe5433c3b98b50 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 13:26:58 +0000 Subject: [PATCH 44/74] Travis build: 602 --- README.md | 2 +- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f3127ec90..c2fb8b122 100644 --- a/README.md +++ b/README.md @@ -3590,7 +3590,7 @@ truncateString('boomerang', 7); // 'boom...' Unescapes escaped HTML characters. -Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). +Use `String.replace()` with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). ```js const unescapeHTML = str => diff --git a/docs/index.html b/docs/index.html index bb72b7b1f..400939957 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1663,7 +1663,7 @@ Return the string truncated to the desired length, with ... appende


unescapeHTML

Unescapes escaped HTML characters.

-

Use String.replace() with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).

+

Use String.replace() with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).

const unescapeHTML = str =>
   str.replace(
     /&amp;|&lt;|&gt;|&#39;|&quot;/g,

From 2addc37b5b0ed8c90d61f9e630d1bd2b077fc56a Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Fri, 29 Dec 2017 15:33:04 +0200
Subject: [PATCH 45/74] Update lowercaseKeys.md

---
 snippets/lowercaseKeys.md | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/snippets/lowercaseKeys.md b/snippets/lowercaseKeys.md
index 7612e42bc..6d4f63edf 100644
--- a/snippets/lowercaseKeys.md
+++ b/snippets/lowercaseKeys.md
@@ -11,8 +11,6 @@ const lowercaseKeys = obj =>
 ```
 
 ```js
-let myObj = {Name: 'Adam', sUrnAME: 'Smith'};
-let myObjLower = lowercaseKeys(myObj);
-console.log(myObj); // {Name: 'Adam', sUrnAME: 'Smith'};
-console.log(myObjLower); // {name: 'Adam', surname: 'Smith'};
+const myObj = {Name: 'Adam', sUrnAME: 'Smith'};
+const myObjLower = lowercaseKeys(myObj); // {name: 'Adam', surname: 'Smith'};
 ```

From bb90b770fef6c5cef180c1b289f7580bff308719 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 13:39:10 +0000
Subject: [PATCH 46/74] Travis build: 606

---
 README.md                 | 29 +++++++++++++++++++++++++++++
 docs/index.html           | 14 ++++++++++++++
 snippets/lowercaseKeys.md |  7 +++++--
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index c2fb8b122..9b5bca310 100644
--- a/README.md
+++ b/README.md
@@ -198,6 +198,7 @@
 View contents
 
 * [`cleanObj`](#cleanobj)
+* [`lowercaseKeys`](#lowercasekeys)
 * [`objectFromPairs`](#objectfrompairs)
 * [`objectToPairs`](#objecttopairs)
 * [`orderBy`](#orderby)
@@ -3020,6 +3021,34 @@ cleanObj(testObj, ['a'], 'children'); // { a: 1, children : { a: 1}}
 
[⬆ Back to top](#table-of-contents) +### lowercaseKeys + +Creates a new object from the specified object, where all the keys are in lowercase. + +Use `Object.keys()` and `Array.reduce()` to create a new object from the specified object. +Convert each key in the original object to lowercase, using `String.toLowerCase()`. + +```js +const lowercaseKeys = obj => + Object.keys(obj).reduce((acc, key) => { + acc[key.toLowerCase()] = obj[key]; + return acc; + }, {}); +``` + +
+Examples + +```js +const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; +const myObjLower = lowercaseKeys(myObj); // {name: 'Adam', surname: 'Smith'}; +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### objectFromPairs Creates an object from the given key-value pairs. diff --git a/docs/index.html b/docs/index.html index 400939957..021fc8dd3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -225,6 +225,7 @@

Object

cleanObj +lowercaseKeys objectFromPairs objectToPairs orderBy @@ -1410,6 +1411,19 @@ Also if you give it a special key (childIndicator) it will search d
const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } };
 cleanObj(testObj, ['a'], 'children'); // { a: 1, children : { a: 1}}
 
+

lowercaseKeys

+

Creates a new object from the specified object, where all the keys are in lowercase.

+

Use Object.keys() and Array.reduce() to create a new object from the specified object. +Convert each key in the original object to lowercase, using String.toLowerCase().

+
const lowercaseKeys = obj =>
+  Object.keys(obj).reduce((acc, key) => {
+    acc[key.toLowerCase()] = obj[key];
+    return acc;
+  }, {});
+
+
const myObj = { Name: 'Adam', sUrnAME: 'Smith' };
+const myObjLower = lowercaseKeys(myObj); // {name: 'Adam', surname: 'Smith'};
+

objectFromPairs

Creates an object from the given key-value pairs.

Use Array.reduce() to create and combine key-value pairs.

diff --git a/snippets/lowercaseKeys.md b/snippets/lowercaseKeys.md index 6d4f63edf..d86f4ec2b 100644 --- a/snippets/lowercaseKeys.md +++ b/snippets/lowercaseKeys.md @@ -7,10 +7,13 @@ Convert each key in the original object to lowercase, using `String.toLowerCase( ```js const lowercaseKeys = obj => - Object.keys(obj).reduce((acc,key) => {acc[key.toLowerCase()] = obj[key]; return acc;},{}); + Object.keys(obj).reduce((acc, key) => { + acc[key.toLowerCase()] = obj[key]; + return acc; + }, {}); ``` ```js -const myObj = {Name: 'Adam', sUrnAME: 'Smith'}; +const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; const myObjLower = lowercaseKeys(myObj); // {name: 'Adam', surname: 'Smith'}; ``` From e9d94847def7c9c605754277023b9a3b84c74822 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 16:05:07 +0200 Subject: [PATCH 47/74] Clean up package.json --- package-lock.json | 1503 +-------------------------------------------- package.json | 14 +- 2 files changed, 9 insertions(+), 1508 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6bccea648..ae673a3a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,15 +9,6 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, - "accepts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", - "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", - "requires": { - "mime-types": "2.1.17", - "negotiator": "0.6.1" - } - }, "acorn": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", @@ -57,51 +48,11 @@ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "requires": { - "string-width": "2.1.1" - } - }, "ansi-escapes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" }, - "ansi-regex": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=" - }, - "ansi-styles": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", - "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=" - }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "requires": { - "micromatch": "2.3.11", - "normalize-path": "2.1.1" - } - }, - "apache-crypt": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.1.tgz", - "integrity": "sha1-1vxyqm0n2ZyVqU/RiNcx7v/6Zjw=", - "requires": { - "unix-crypt-td-js": "1.0.0" - } - }, - "apache-md5": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.2.tgz", - "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=" - }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -124,19 +75,6 @@ "sprintf-js": "1.0.3" } }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "requires": { - "arr-flatten": "1.1.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", @@ -155,11 +93,6 @@ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" - }, "array.prototype.find": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.0.4.tgz", @@ -189,11 +122,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" - }, "async-foreach": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", @@ -274,19 +202,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "basic-auth": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", - "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", - "requires": { - "safe-buffer": "5.1.1" - } - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" - }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", @@ -296,16 +211,6 @@ "tweetnacl": "0.14.5" } }, - "bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" - }, - "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" - }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -322,53 +227,6 @@ "hoek": "2.16.3" } }, - "boxen": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.2.2.tgz", - "integrity": "sha1-Px1AMsMP/qnUsCwyLq8up0HcvOU=", - "requires": { - "ansi-align": "2.0.0", - "camelcase": "4.1.0", - "chalk": "2.3.0", - "cli-boxes": "1.0.0", - "string-width": "2.1.1", - "term-size": "1.2.0", - "widest-line": "1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" - }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "requires": { - "has-flag": "2.0.0" - } - } - } - }, "brace-expansion": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", @@ -378,16 +236,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" - } - }, "builder": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/builder/-/builder-3.2.3.tgz", @@ -486,11 +334,6 @@ "upper-case": "1.1.3" } }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" - }, "camelcase-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", @@ -507,11 +350,6 @@ } } }, - "capture-stack-trace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" - }, "caseless": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", @@ -521,7 +359,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", @@ -532,7 +369,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true, "requires": { "color-convert": "1.9.1" } @@ -540,35 +376,18 @@ "has-flag": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" }, "supports-color": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, "requires": { "has-flag": "2.0.0" } } } }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "requires": { - "anymatch": "1.3.2", - "async-each": "1.0.1", - "glob-parent": "2.0.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" - } - }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", @@ -589,11 +408,6 @@ } } }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" - }, "cli-cursor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", @@ -681,11 +495,6 @@ "delayed-stream": "1.0.0" } }, - "commander": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz", - "integrity": "sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0=" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -701,66 +510,6 @@ "typedarray": "0.0.6" } }, - "concurrently": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-3.5.1.tgz", - "integrity": "sha512-689HrwGw8Rbk1xtV9C4dY6TPJAvIYZbRbnKSAtfJ7tHqICFGoZ0PCWYjxfmerRyxBG0o3sbG3pe7N8vqPwIHuQ==", - "requires": { - "chalk": "0.5.1", - "commander": "2.6.0", - "date-fns": "1.29.0", - "lodash": "4.17.4", - "rx": "2.3.24", - "spawn-command": "0.0.2-1", - "supports-color": "3.2.3", - "tree-kill": "1.2.0" - }, - "dependencies": { - "chalk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", - "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", - "requires": { - "ansi-styles": "1.1.0", - "escape-string-regexp": "1.0.5", - "has-ansi": "0.1.0", - "strip-ansi": "0.3.0", - "supports-color": "0.2.0" - }, - "dependencies": { - "supports-color": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", - "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=" - } - } - } - } - }, - "configstore": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", - "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", - "requires": { - "dot-prop": "4.2.0", - "graceful-fs": "4.1.11", - "make-dir": "1.1.0", - "unique-string": "1.0.0", - "write-file-atomic": "2.3.0", - "xdg-basedir": "3.0.0" - } - }, - "connect": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.5.1.tgz", - "integrity": "sha1-bTDXpjx/FwhXprOqazY9lz3KWI4=", - "requires": { - "debug": "2.2.0", - "finalhandler": "0.5.1", - "parseurl": "1.3.2", - "utils-merge": "1.0.0" - } - }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -776,24 +525,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "requires": { - "capture-stack-trace": "1.0.0" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "4.1.1", - "shebang-command": "1.2.0", - "which": "1.3.0" - } - }, "cryptiles": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", @@ -802,11 +533,6 @@ "boom": "2.10.1" } }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -838,11 +564,6 @@ } } }, - "date-fns": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", - "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==" - }, "debug": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", @@ -864,13 +585,7 @@ "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true - }, - "deep-extend": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, "deep-is": { "version": "0.1.3", @@ -889,8 +604,7 @@ "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" }, "deglob": { "version": "2.1.0", @@ -936,16 +650,6 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, "doctrine": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", @@ -954,24 +658,6 @@ "esutils": "2.0.2" } }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "requires": { - "is-obj": "1.0.1" - } - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -981,16 +667,6 @@ "jsbn": "0.1.1" } }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" - }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -1058,11 +734,6 @@ "event-emitter": "0.3.5" } }, - "es6-promise": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", - "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=" - }, "es6-set": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", @@ -1095,11 +766,6 @@ "es6-symbol": "3.1.1" } }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1373,11 +1039,6 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, "event-emitter": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", @@ -1387,68 +1048,16 @@ "es5-ext": "0.10.37" } }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", - "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" - } - }, "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=" }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "requires": { - "fill-range": "2.2.3" - } - }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "requires": { - "is-extglob": "1.0.0" - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -1459,14 +1068,6 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, - "faye-websocket": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", - "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", - "requires": { - "websocket-driver": "0.7.0" - } - }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -1485,35 +1086,6 @@ "object-assign": "4.1.1" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" - }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "finalhandler": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.5.1.tgz", - "integrity": "sha1-LEANjUUwk1vCMlScX6OF7Afeb80=", - "requires": { - "debug": "2.2.0", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "statuses": "1.3.1", - "unpipe": "1.0.0" - } - }, "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -1543,24 +1115,10 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", - "dev": true, "requires": { "is-function": "1.0.1" } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "requires": { - "for-in": "1.0.2" - } - }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -1581,16 +1139,6 @@ "mime-types": "2.1.17" } }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" - }, "fs-extra": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", @@ -1701,11 +1249,6 @@ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=" }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1734,31 +1277,6 @@ "path-is-absolute": "1.0.1" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "requires": { - "is-glob": "2.0.1" - } - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "requires": { - "ini": "1.3.5" - } - }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", @@ -1794,24 +1312,6 @@ "minimatch": "3.0.4" } }, - "got": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "requires": { - "create-error-class": "3.0.2", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-redirect": "1.0.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "lowercase-keys": "1.0.0", - "safe-buffer": "5.1.1", - "timed-out": "4.0.1", - "unzip-response": "2.0.1", - "url-parse-lax": "1.0.0" - } - }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", @@ -1886,19 +1386,6 @@ "function-bind": "1.1.1" } }, - "has-ansi": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", - "requires": { - "ansi-regex": "0.2.1" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" - }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -1952,33 +1439,6 @@ } } }, - "http-auth": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/http-auth/-/http-auth-3.1.3.tgz", - "integrity": "sha1-lFz63WZSHq+PfISRPTd9exXyTjE=", - "requires": { - "apache-crypt": "1.2.1", - "apache-md5": "1.1.2", - "bcryptjs": "2.4.3", - "uuid": "3.1.0" - } - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.3.1" - } - }, - "http-parser-js": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", - "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=" - }, "http-signature": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", @@ -1994,16 +1454,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==" }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -2036,11 +1486,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, "inquirer": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", @@ -2139,19 +1584,6 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "requires": { - "binary-extensions": "1.11.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", @@ -2170,29 +1602,6 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" - }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", @@ -2209,25 +1618,7 @@ "is-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "requires": { - "is-extglob": "1.0.0" - } - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "requires": { - "global-dirs": "0.1.1", - "is-path-inside": "1.0.1" - } + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" }, "is-my-json-valid": { "version": "2.16.1", @@ -2240,24 +1631,6 @@ "xtend": "4.0.1" } }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "requires": { - "kind-of": "3.2.2" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" - }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -2279,26 +1652,11 @@ "path-is-inside": "1.0.2" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" - }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -2312,16 +1670,6 @@ "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==" }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", @@ -2337,11 +1685,6 @@ "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2352,14 +1695,6 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -2449,22 +1784,6 @@ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=" }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "requires": { - "package-json": "4.0.1" - } - }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -2490,107 +1809,6 @@ "uc.micro": "1.0.3" } }, - "live-server": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.0.tgz", - "integrity": "sha1-RJhkS7+Bpm8Y3Y3/3vYcTBw3TKM=", - "requires": { - "chokidar": "1.7.0", - "colors": "1.1.2", - "connect": "3.5.1", - "cors": "2.8.4", - "event-stream": "3.3.4", - "faye-websocket": "0.11.1", - "http-auth": "3.1.3", - "morgan": "1.9.0", - "object-assign": "4.1.1", - "opn": "5.1.0", - "proxy-middleware": "0.15.0", - "send": "0.16.1", - "serve-index": "1.9.1" - }, - "dependencies": { - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" - }, - "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", - "requires": { - "object-assign": "4.1.1", - "vary": "1.1.2" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", - "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "opn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.1.0.tgz", - "integrity": "sha512-iPNl7SyM8L30Rm1sjGdLLheyHVw5YXVfi3SKWJzBI7efxRwHojfRFjwE/OLM6qp9xJYMgab8WicTU1cPoY+Hpg==", - "requires": { - "is-wsl": "1.1.0" - } - }, - "proxy-middleware": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.15.0.tgz", - "integrity": "sha1-o/3xvvtzD5UZZYcqwvYHTGFHelY=" - }, - "send": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", - "requires": { - "debug": "2.6.9", - "depd": "1.1.1", - "destroy": "1.0.4", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "etag": "1.8.1", - "fresh": "0.5.2", - "http-errors": "1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.3.1" - } - } - } - }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -2630,55 +1848,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" - }, - "lodash._bindcallback": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=" - }, - "lodash._createassigner": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", - "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", - "requires": { - "lodash._bindcallback": "3.0.1", - "lodash._isiterateecall": "3.0.9", - "lodash.restparam": "3.6.1" - } - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" - }, - "lodash.assign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", - "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", - "requires": { - "lodash._baseassign": "3.2.0", - "lodash._createassigner": "3.1.1", - "lodash.keys": "3.1.2" - } - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -2689,45 +1858,11 @@ "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=" }, - "lodash.defaults": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", - "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=", - "requires": { - "lodash.assign": "3.2.0", - "lodash.restparam": "3.6.1" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, "lodash.mergewith": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz", "integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU=" }, - "lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" - }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", @@ -2742,11 +1877,6 @@ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" }, - "lowercase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" - }, "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", @@ -2756,24 +1886,11 @@ "yallist": "2.1.2" } }, - "make-dir": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", - "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", - "requires": { - "pify": "3.0.0" - } - }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" - }, "markdown-it": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.0.tgz", @@ -2808,31 +1925,6 @@ "trim-newlines": "1.0.0" } }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, "mime-db": { "version": "1.30.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", @@ -2874,33 +1966,6 @@ } } }, - "morgan": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", - "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", - "requires": { - "basic-auth": "2.0.0", - "debug": "2.6.9", - "depd": "1.1.1", - "on-finished": "2.3.0", - "on-headers": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, "ms": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", @@ -2929,11 +1994,6 @@ "xml-char-classes": "1.0.0" } }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", @@ -3067,46 +2127,6 @@ } } }, - "nodemon": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.12.1.tgz", - "integrity": "sha1-mWpW3EnZ8Wu/G3ik3gjxNjSzh40=", - "requires": { - "chokidar": "1.7.0", - "debug": "2.6.9", - "es6-promise": "3.3.1", - "ignore-by-default": "1.0.1", - "lodash.defaults": "3.1.2", - "minimatch": "3.0.4", - "ps-tree": "1.1.0", - "touch": "3.1.0", - "undefsafe": "0.0.3", - "update-notifier": "2.3.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "requires": { - "abbrev": "1.1.1" - } - }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -3118,22 +2138,6 @@ "validate-npm-package-license": "3.0.1" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "2.0.1" - } - }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -3163,8 +2167,7 @@ "object-inspect": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.3.0.tgz", - "integrity": "sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg==", - "dev": true + "integrity": "sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg==" }, "object-keys": { "version": "1.0.11", @@ -3181,28 +2184,6 @@ "object-keys": "1.0.11" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3256,11 +2237,6 @@ "os-tmpdir": "1.0.2" } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, "p-limit": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", @@ -3274,17 +2250,6 @@ "p-limit": "1.1.0" } }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "requires": { - "got": "6.7.1", - "registry-auth-token": "3.3.1", - "registry-url": "3.1.0", - "semver": "5.4.1" - } - }, "param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", @@ -3293,17 +2258,6 @@ "no-case": "2.3.2" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -3312,11 +2266,6 @@ "error-ex": "1.3.1" } }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" - }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -3335,11 +2284,6 @@ "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -3362,19 +2306,6 @@ } } }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "requires": { - "through": "2.3.8" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", @@ -3443,16 +2374,6 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" - }, "prettier": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.9.2.tgz", @@ -3468,14 +2389,6 @@ "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" }, - "ps-tree": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", - "requires": { - "event-stream": "3.3.4" - } - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -3491,59 +2404,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=" }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "rc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", - "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - } - }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -3604,17 +2464,6 @@ "util-deprecate": "1.0.2" } }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.3", - "set-immediate-shim": "1.0.1" - } - }, "readline2": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", @@ -3652,51 +2501,11 @@ "strip-indent": "1.0.1" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "requires": { - "is-equal-shallow": "0.1.3" - } - }, - "registry-auth-token": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.1.tgz", - "integrity": "sha1-+w0yie4Nmtosu1KvXf5mywcNMAY=", - "requires": { - "rc": "1.2.2", - "safe-buffer": "5.1.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "requires": { - "rc": "1.2.2" - } - }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=" }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, "repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", @@ -3777,7 +2586,6 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", - "dev": true, "requires": { "through": "2.3.8" } @@ -3803,11 +2611,6 @@ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.6.tgz", "integrity": "sha1-KQA8miFj4B4tLfyQV18sbB1hoDk=" }, - "rx": { - "version": "2.3.24", - "resolved": "https://registry.npmjs.org/rx/-/rx-2.3.24.tgz", - "integrity": "sha1-FPlQpCF9fjXapxu8vljv9o6ksrc=" - }, "rx-lite": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", @@ -3860,71 +2663,11 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "requires": { - "semver": "5.4.1" - } - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "requires": { - "accepts": "1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "1.0.3", - "http-errors": "1.6.2", - "mime-types": "2.1.17", - "parseurl": "1.3.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", @@ -3961,11 +2704,6 @@ "amdefine": "1.0.1" } }, - "spawn-command": { - "version": "0.0.2-1", - "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", - "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=" - }, "spdx-correct": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", @@ -3984,14 +2722,6 @@ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "requires": { - "through": "2.3.8" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -4030,11 +2760,6 @@ "pkg-conf": "2.0.0" } }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" - }, "stdout-stream": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz", @@ -4043,14 +2768,6 @@ "readable-stream": "2.3.3" } }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "requires": { - "duplexer": "0.1.1" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -4079,7 +2796,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", - "dev": true, "requires": { "define-properties": "1.1.2", "es-abstract": "1.10.0", @@ -4099,24 +2815,11 @@ "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" }, - "strip-ansi": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", - "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", - "requires": { - "ansi-regex": "0.2.1" - } - }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -4137,14 +2840,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "requires": { - "has-flag": "1.0.0" - } - }, "table": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", @@ -4212,7 +2907,6 @@ "version": "4.8.0", "resolved": "https://registry.npmjs.org/tape/-/tape-4.8.0.tgz", "integrity": "sha512-TWILfEnvO7I8mFe35d98F6T5fbLaEtbFTG/lxWvid8qDfFTxt19EBijWmB4j3+Hoh5TfHE2faWs73ua+EphuBA==", - "dev": true, "requires": { "deep-equal": "1.0.1", "defined": "1.0.0", @@ -4233,7 +2927,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", - "dev": true, "requires": { "path-parse": "1.0.5" } @@ -4250,14 +2943,6 @@ "inherits": "2.0.3" } }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "requires": { - "execa": "0.7.0" - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4268,19 +2953,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" - }, - "touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", - "requires": { - "nopt": "1.0.10" - } - }, "tough-cookie": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", @@ -4371,106 +3043,21 @@ } } }, - "undefsafe": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", - "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=" - }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "requires": { - "crypto-random-string": "1.0.0" - } - }, "universalify": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" }, - "unix-crypt-td-js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz", - "integrity": "sha1-HAgkFQSBvHoB1J6Y8exmjYJBLzs=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=" - }, - "update-notifier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz", - "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=", - "requires": { - "boxen": "1.2.2", - "chalk": "2.3.0", - "configstore": "3.1.1", - "import-lazy": "2.1.0", - "is-installed-globally": "0.1.0", - "is-npm": "1.0.0", - "latest-version": "3.1.0", - "semver-diff": "2.1.0", - "xdg-basedir": "3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" - }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "requires": { - "has-flag": "2.0.0" - } - } - } - }, "upper-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "requires": { - "prepend-http": "1.0.4" - } - }, "user-home": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", @@ -4484,11 +3071,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" - }, "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", @@ -4503,11 +3085,6 @@ "spdx-expression-parse": "1.0.4" } }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -4530,20 +3107,6 @@ "resolved": "https://registry.npmjs.org/webber/-/webber-0.0.1.tgz", "integrity": "sha1-u1Nt4g0OmS6Noj7KM/5O3/LEZHY=" }, - "websocket-driver": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", - "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", - "requires": { - "http-parser-js": "0.4.9", - "websocket-extensions": "0.1.3" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" - }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", @@ -4598,47 +3161,6 @@ } } }, - "widest-line": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-1.0.0.tgz", - "integrity": "sha1-DAnIXCqUaD0Nfq+O4JfVZL8OEFw=", - "requires": { - "string-width": "1.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "1.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - } - } - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -4699,21 +3221,6 @@ "mkdirp": "0.5.1" } }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" - }, "xml-char-classes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/xml-char-classes/-/xml-char-classes-1.0.0.tgz", diff --git a/package.json b/package.json index 64639634a..be144571d 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,27 @@ { "dependencies": { "builder": "^3.2.3", - "concurrently": "^3.5.1", "fs-extra": "^4.0.2", "html-minifier": "^3.5.7", - "live-server": "^1.2.0", "markdown-it": "^8.4.0", "node-sass": "^4.7.2", - "nodemon": "^1.12.1", "prettier": "^1.9.2", "semistandard": "^11.0.0", "tagger": "^0.1.2", - "webber": "0.0.1" + "webber": "0.0.1", + "chalk": "^2.3.0", + "tape": "^4.8.0" }, "name": "30-seconds-of-code", "description": "A collection of useful Javascript snippets.", "version": "1.0.0", "main": "index.js", - "devDependencies": { - "chalk": "^2.3.0", - "tape": "^4.8.0" - }, "scripts": { "builder": "node ./scripts/build-script.js", "linter": "node ./scripts/lint-script.js", "tagger": "node ./scripts/tag-script.js", "webber": "node ./scripts/web-script.js", - "tdd": "node ./scripts/tdd-script.js", - "start": "concurrently --kill-others \"nodemon -e js,md -i README.md -x \\\"npm run build-list\\\"\" \"live-server ./build\"" + "tdd": "node ./scripts/tdd-script.js" }, "repository": { "type": "git", From 0fccbbf246f5a0fcaabe422de17d07b97587e3fa Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 14:07:07 +0000 Subject: [PATCH 48/74] Travis build: 608 --- package-lock.json | 78 +-- package.json | 6 +- yarn.lock | 1201 +-------------------------------------------- 3 files changed, 68 insertions(+), 1217 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae673a3a9..9efd6e66c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,16 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -249,16 +259,6 @@ "tree-kill": "1.2.0" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -271,39 +271,10 @@ "supports-color": "2.0.0" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "2.1.1" - } - }, "lodash": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1.1.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" } } }, @@ -1386,6 +1357,14 @@ "function-bind": "1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -2127,6 +2106,14 @@ } } }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.1.1" + } + }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -2815,6 +2802,14 @@ "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -2840,6 +2835,11 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, "table": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", diff --git a/package.json b/package.json index be144571d..fdd74b6f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "dependencies": { "builder": "^3.2.3", + "chalk": "^2.3.0", "fs-extra": "^4.0.2", "html-minifier": "^3.5.7", "markdown-it": "^8.4.0", @@ -8,9 +9,8 @@ "prettier": "^1.9.2", "semistandard": "^11.0.0", "tagger": "^0.1.2", - "webber": "0.0.1", - "chalk": "^2.3.0", - "tape": "^4.8.0" + "tape": "^4.8.0", + "webber": "0.0.1" }, "name": "30-seconds-of-code", "description": "A collection of useful Javascript snippets.", diff --git a/yarn.lock b/yarn.lock index cff314490..cafba9830 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,13 +6,6 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" -accepts@~1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f" - dependencies: - mime-types "~2.1.16" - negotiator "0.6.1" - acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -31,7 +24,7 @@ ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0, ajv@^4.9.1: +ajv@^4.7.0: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: @@ -51,20 +44,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" - dependencies: - string-width "^2.0.0" - ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -73,10 +56,6 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -87,23 +66,6 @@ ansi-styles@^3.1.0: dependencies: color-convert "^1.9.0" -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -apache-crypt@^1.1.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/apache-crypt/-/apache-crypt-1.2.1.tgz#d6fc72aa6d27d99c95a94fd188d731eefffa663c" - dependencies: - unix-crypt-td-js "^1.0.0" - -apache-md5@^1.0.6: - version "1.1.2" - resolved "https://registry.yarnpkg.com/apache-md5/-/apache-md5-1.1.2.tgz#ee49736b639b4f108b6e9e626c6da99306b41692" - aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -121,16 +83,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -145,10 +97,6 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - array.prototype.find@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" @@ -172,10 +120,6 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" @@ -212,30 +156,12 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" -basic-auth@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.0.tgz#015db3f353e02e56377755f962742e8981e7bbba" - dependencies: - safe-buffer "5.1.1" - -batch@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" dependencies: tweetnacl "^0.14.3" -bcryptjs@^2.3.0: - version "2.4.3" - resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb" - -binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -260,18 +186,6 @@ boom@5.x.x: dependencies: hoek "4.x.x" -boxen@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.2.2.tgz#3f1d4032c30ffea9d4b02c322eaf2ea741dcbce5" - dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^2.0.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^1.2.0" - widest-line "^1.0.0" - brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" @@ -279,14 +193,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - builder@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/builder/-/builder-3.2.3.tgz#33b239fa62d2432802164eb72e5f49639b0ae115" @@ -334,14 +240,6 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - -capture-stack-trace@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" - caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" @@ -350,16 +248,6 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -chalk@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" - dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" - chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -370,7 +258,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.1, chalk@^2.3.0: +chalk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -378,21 +266,6 @@ chalk@^2.0.1, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" -chokidar@^1.6.0, chokidar@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" @@ -403,10 +276,6 @@ clean-css@4.1.x: dependencies: source-map "0.5.x" -cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -443,10 +312,6 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -colors@latest: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -457,10 +322,6 @@ commander@2.12.x, commander@^2.9.0, commander@~2.12.1: version "2.12.2" resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" -commander@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -473,39 +334,6 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -concurrently@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.1.tgz#ee8b60018bbe86b02df13e5249453c6ececd2521" - dependencies: - chalk "0.5.1" - commander "2.6.0" - date-fns "^1.23.0" - lodash "^4.5.1" - rx "2.3.24" - spawn-command "^0.0.2-1" - supports-color "^3.2.3" - tree-kill "^1.1.0" - -configstore@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.1.tgz#094ee662ab83fad9917678de114faaea8fcdca90" - dependencies: - dot-prop "^4.1.0" - graceful-fs "^4.1.2" - make-dir "^1.0.0" - unique-string "^1.0.0" - write-file-atomic "^2.0.0" - xdg-basedir "^3.0.0" - -connect@3.5.x: - version "3.5.1" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.5.1.tgz#6d30d7a63c7f170857a6b3aa6b363d973dca588e" - dependencies: - debug "~2.2.0" - finalhandler "0.5.1" - parseurl "~1.3.1" - utils-merge "1.0.0" - console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -518,19 +346,6 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cors@latest: - version "2.8.4" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.4.tgz#2bd381f2eb201020105cd50ea59da63090694686" - dependencies: - object-assign "^4" - vary "^1" - -create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - dependencies: - capture-stack-trace "^1.0.0" - cross-spawn@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" @@ -538,14 +353,6 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -558,10 +365,6 @@ cryptiles@3.x.x: dependencies: boom "5.x.x" -crypto-random-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -580,26 +383,16 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -date-fns@^1.23.0: - version "1.29.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" - debug-log@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.6.8: +debug@^2.1.1, debug@^2.2.0, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -608,10 +401,6 @@ deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" -deep-extend@~0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -658,18 +447,6 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -depd@1.1.1, depd@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - doctrine@1.5.0, doctrine@^1.2.2: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -683,34 +460,12 @@ doctrine@^2.0.0: dependencies: esutils "^2.0.2" -dot-prop@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - dependencies: - is-obj "^1.0.0" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: jsbn "~0.1.0" -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -encodeurl@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" - entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" @@ -765,10 +520,6 @@ es6-map@^0.1.3: es6-symbol "~3.1.1" event-emitter "~0.3.5" -es6-promise@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" - es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" @@ -795,11 +546,7 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - -escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -954,10 +701,6 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -965,56 +708,14 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -event-stream@latest, event-stream@~3.3.0: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -1031,12 +732,6 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -faye-websocket@0.11.x: - version "0.11.1" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.1.tgz#f0efe18c4f56e4f40afc7e06c719fd5ee6188f38" - dependencies: - websocket-driver ">=0.5.1" - figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -1051,30 +746,6 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^1.1.3" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -finalhandler@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.5.1.tgz#2c400d8d4530935bc232549c5fa385ec07de6fcd" - dependencies: - debug "~2.2.0" - escape-html "~1.0.3" - on-finished "~2.3.0" - statuses "~1.3.1" - unpipe "~1.0.0" - find-root@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -1107,16 +778,6 @@ for-each@~0.3.2: dependencies: is-function "~1.0.0" -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -1141,14 +802,6 @@ form-data@~2.3.1: combined-stream "^1.0.5" mime-types "^2.1.12" -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - fs-extra@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b" @@ -1161,22 +814,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" - dependencies: - nan "^2.3.0" - node-pre-gyp "^0.6.39" - -fstream-ignore@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" - dependencies: - fstream "^1.0.0" - inherits "2" - minimatch "^3.0.0" - -fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: +fstream@^1.0.0, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: @@ -1230,29 +868,12 @@ get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -1274,12 +895,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.1.1, glob@~7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" - dependencies: - ini "^1.3.4" - globals@^9.14.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -1303,30 +918,10 @@ globule@^1.0.0: lodash "~4.17.4" minimatch "~3.0.2" -got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -har-schema@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -1340,13 +935,6 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" -har-validator@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" - dependencies: - ajv "^4.9.1" - har-schema "^1.0.5" - har-validator@~5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" @@ -1354,22 +942,12 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - dependencies: - ansi-regex "^0.2.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" dependencies: ansi-regex "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" @@ -1384,7 +962,7 @@ has@^1.0.1, has@~1.0.1: dependencies: function-bind "^1.0.2" -hawk@3.1.3, hawk@~3.1.3: +hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" dependencies: @@ -1431,28 +1009,6 @@ html-minifier@^3.5.7: relateurl "0.2.x" uglify-js "3.2.x" -http-auth@3.1.x: - version "3.1.3" - resolved "https://registry.yarnpkg.com/http-auth/-/http-auth-3.1.3.tgz#945cfadd66521eaf8f7c84913d377d7b15f24e31" - dependencies: - apache-crypt "^1.1.2" - apache-md5 "^1.0.6" - bcryptjs "^2.3.0" - uuid "^3.0.0" - -http-errors@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" - dependencies: - depd "1.1.1" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" - -http-parser-js@>=0.4.0: - version "0.4.9" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.4.9.tgz#ea1a04fb64adff0242e9974f297dd4c3cad271e1" - http-signature@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" @@ -1469,18 +1025,10 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" -import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -1502,14 +1050,10 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@^1.3.4, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - inquirer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" @@ -1540,16 +1084,6 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -1564,24 +1098,6 @@ is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -1602,19 +1118,6 @@ is-function@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - -is-installed-globally@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" - dependencies: - global-dirs "^0.1.0" - is-path-inside "^1.0.0" - is-my-json-valid@^2.10.0: version "2.16.1" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz#5a846777e2c2620d1e69104e5d3a03b1f6088f11" @@ -1633,26 +1136,6 @@ is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -1669,22 +1152,10 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" @@ -1695,14 +1166,6 @@ is-resolvable@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.1.tgz#acca1cd36dbe44b974b924321555a70ba03b1cf4" -is-retry-allowed@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - -is-stream@^1.0.0, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - is-symbol@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" @@ -1715,11 +1178,7 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1727,12 +1186,6 @@ isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -1801,24 +1254,6 @@ jsx-ast-utils@^1.3.4: version "1.4.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" - dependencies: - package-json "^4.0.0" - lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" @@ -1838,24 +1273,6 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" -live-server@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/live-server/-/live-server-1.2.0.tgz#4498644bbf81a66f18dd8dffdef61c4c1c374ca3" - dependencies: - chokidar "^1.6.0" - colors latest - connect "3.5.x" - cors latest - event-stream latest - faye-websocket "0.11.x" - http-auth "3.1.x" - morgan "^1.6.1" - object-assign latest - opn latest - proxy-middleware latest - send latest - serve-index "^1.7.2" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -1882,45 +1299,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._bindcallback@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - -lodash._createassigner@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11" - dependencies: - lodash._bindcallback "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash.restparam "^3.0.0" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash.assign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.2.0.tgz#3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa" - dependencies: - lodash._baseassign "^3.0.0" - lodash._createassigner "^3.0.0" - lodash.keys "^3.0.0" - lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" @@ -1933,42 +1311,15 @@ lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" -lodash.defaults@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-3.1.2.tgz#c7308b18dbf8bc9372d701a73493c61192bd2e2c" - dependencies: - lodash.assign "^3.0.0" - lodash.restparam "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.mergewith@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - lodash@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.3.0, lodash@^4.5.1, lodash@~4.17.4: +lodash@^4.0.0, lodash@^4.3.0, lodash@~4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -1983,10 +1334,6 @@ lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" -lowercase-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" - lru-cache@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" @@ -1994,20 +1341,10 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -make-dir@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" - dependencies: - pify "^3.0.0" - map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - markdown-it@^8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.0.tgz#e2400881bf171f7018ed1bd9da441dac8af6306d" @@ -2037,39 +1374,17 @@ meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - mime-db@~1.30.0: version "1.30.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" -mime-types@^2.1.12, mime-types@~2.1.16, mime-types@~2.1.17, mime-types@~2.1.7: +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: version "2.1.17" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" dependencies: mime-db "~1.30.0" -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2079,7 +1394,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0, minimist@~1.2.0: +minimist@^1.1.0, minimist@^1.1.3, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2089,20 +1404,6 @@ minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0, minimist@~1.2.0: dependencies: minimist "0.0.8" -morgan@^1.6.1: - version "1.9.0" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.9.0.tgz#d01fa6c65859b76fcf31b3cb53a3821a311d8051" - dependencies: - basic-auth "~2.0.0" - debug "2.6.9" - depd "~1.1.1" - on-finished "~2.3.0" - on-headers "~1.0.1" - -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -2111,7 +1412,7 @@ mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" -nan@^2.3.0, nan@^2.3.2: +nan@^2.3.2: version "2.8.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" @@ -2125,10 +1426,6 @@ ncname@1.0.x: dependencies: xml-char-classes "^1.0.0" -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - no-case@^2.2.0: version "2.3.2" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" @@ -2153,22 +1450,6 @@ node-gyp@^3.3.1: tar "^2.0.0" which "1" -node-pre-gyp@^0.6.39: - version "0.6.39" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" - dependencies: - detect-libc "^1.0.2" - hawk "3.1.3" - mkdirp "^0.5.1" - nopt "^4.0.1" - npmlog "^4.0.2" - rc "^1.1.7" - request "2.81.0" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^2.2.1" - tar-pack "^3.4.0" - node-sass@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.7.2.tgz#9366778ba1469eb01438a9e8592f4262bcb6794e" @@ -2193,40 +1474,12 @@ node-sass@^4.7.2: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" -nodemon@^1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.12.1.tgz#996a56dc49d9f16bbf1b78a4de08f13634b3878d" - dependencies: - chokidar "^1.7.0" - debug "^2.6.8" - es6-promise "^3.3.1" - ignore-by-default "^1.0.1" - lodash.defaults "^3.1.2" - minimatch "^3.0.4" - ps-tree "^1.1.0" - touch "^3.1.0" - undefsafe "0.0.3" - update-notifier "^2.2.0" - "nopt@2 || 3", nopt@^3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: abbrev "1" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - dependencies: - abbrev "1" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -2236,19 +1489,7 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - dependencies: - path-key "^2.0.0" - -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -2265,7 +1506,7 @@ oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@latest: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2285,24 +1526,7 @@ object.assign@^4.0.4: function-bind "^1.1.0" object-keys "^1.0.10" -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" - -once@^1.3.0, once@^1.3.3: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2312,12 +1536,6 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" -opn@latest: - version "5.1.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519" - dependencies: - is-wsl "^1.1.0" - optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -2343,17 +1561,13 @@ os-tmpdir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@0, osenv@^0.1.4: +osenv@0: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -2364,40 +1578,18 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -package-json@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" - dependencies: - got "^6.7.1" - registry-auth-token "^3.0.1" - registry-url "^3.0.3" - semver "^5.1.0" - param-case@2.1.x: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" dependencies: no-case "^2.2.0" -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" dependencies: error-ex "^1.2.0" -parseurl@~1.3.1, parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2416,10 +1608,6 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -2432,16 +1620,6 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - dependencies: - through "~2.3" - -performance-now@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -2450,10 +1628,6 @@ pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -2499,14 +1673,6 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - prettier@^1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827" @@ -2519,16 +1685,6 @@ progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" -proxy-middleware@latest: - version "0.15.0" - resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" - -ps-tree@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" - dependencies: - event-stream "~3.3.0" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -2541,34 +1697,10 @@ qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" -qs@~6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" - qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -randomatic@^1.1.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: - version "1.2.2" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" - dependencies: - deep-extend "~0.4.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2584,7 +1716,7 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2: +readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.2.2: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -2596,15 +1728,6 @@ readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable string_decoder "~1.0.3" util-deprecate "~1.0.1" -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - readline2@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" @@ -2626,41 +1749,10 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - -registry-auth-token@^3.0.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.1.tgz#fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006" - dependencies: - rc "^1.1.6" - safe-buffer "^5.0.1" - -registry-url@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - dependencies: - rc "^1.0.1" - relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -2694,33 +1786,6 @@ request@2: tunnel-agent "^0.6.0" uuid "^3.1.0" -request@2.81.0: - version "2.81.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~4.2.1" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - performance-now "^0.2.0" - qs "~6.4.0" - safe-buffer "^5.0.1" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "^0.6.0" - uuid "^3.0.0" - request@~2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -2790,7 +1855,7 @@ resumer@~0.0.0: dependencies: through "~2.3.4" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -2810,11 +1875,7 @@ rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" -rx@2.3.24: - version "2.3.24" - resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" - -safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -2849,13 +1910,7 @@ semistandard@^11.0.0: eslint-plugin-standard "~3.0.1" standard-engine "~7.0.0" -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - dependencies: - semver "^5.0.3" - -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0: +"semver@2 || 3 || 4 || 5": version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -2863,58 +1918,10 @@ semver@5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -send@latest: - version "0.16.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" - dependencies: - debug "2.6.9" - depd "~1.1.1" - destroy "~1.0.4" - encodeurl "~1.0.1" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.3.1" - -serve-index@^1.7.2: - version "1.9.1" - resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - dependencies: - accepts "~1.3.4" - batch "0.6.1" - debug "2.6.9" - escape-html "~1.0.3" - http-errors "~1.6.2" - mime-types "~2.1.17" - parseurl "~1.3.2" - set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -setprototypeof@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - shelljs@^0.7.5: version "0.7.8" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" @@ -2923,7 +1930,7 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -2957,10 +1964,6 @@ source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -2975,12 +1978,6 @@ spdx-license-ids@^1.0.2: version "1.2.2" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - dependencies: - through "2" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -3008,26 +2005,12 @@ standard-engine@~7.0.0: minimist "^1.1.0" pkg-conf "^2.0.0" -"statuses@>= 1.3.1 < 2": - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - stdout-stream@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" dependencies: readable-stream "^2.0.1" -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - dependencies: - duplexer "~0.1.1" - string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3061,12 +2044,6 @@ stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - dependencies: - ansi-regex "^0.2.1" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -3089,10 +2066,6 @@ strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" @@ -3103,20 +2076,10 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - dependencies: - has-flag "^1.0.0" - supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" @@ -3156,20 +2119,7 @@ tape@^4.8.0: string.prototype.trim "~1.1.2" through "~2.3.8" -tar-pack@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" - dependencies: - debug "^2.2.0" - fstream "^1.0.10" - fstream-ignore "^1.0.5" - once "^1.3.3" - readable-stream "^2.1.4" - rimraf "^2.5.1" - tar "^2.2.1" - uid-number "^0.0.6" - -tar@^2.0.0, tar@^2.2.1: +tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -3177,37 +2127,21 @@ tar@^2.0.0, tar@^2.2.1: fstream "^1.0.2" inherits "2" -term-size@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" - dependencies: - execa "^0.7.0" - text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -through@2, through@^2.3.6, through@~2.3, through@~2.3.1, through@~2.3.4, through@~2.3.8: +through@^2.3.6, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - -touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - dependencies: - nopt "~1.0.10" - tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" -tree-kill@^1.0.0, tree-kill@^1.1.0: +tree-kill@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" @@ -3256,64 +2190,18 @@ uglify-js@3.2.x: commander "~2.12.1" source-map "~0.6.1" -uid-number@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - -undefsafe@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-0.0.3.tgz#ecca3a03e56b9af17385baac812ac83b994a962f" - uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" -unique-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" - dependencies: - crypto-random-string "^1.0.0" - universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" -unix-crypt-td-js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz#1c0824150481bc7a01d49e98f1ec668d82412f3b" - -unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" - -update-notifier@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.3.0.tgz#4e8827a6bb915140ab093559d7014e3ebb837451" - dependencies: - boxen "^1.2.1" - chalk "^2.0.1" - configstore "^3.0.0" - import-lazy "^2.1.0" - is-installed-globally "^0.1.0" - is-npm "^1.0.0" - latest-version "^3.0.0" - semver-diff "^2.0.0" - xdg-basedir "^3.0.0" - upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - dependencies: - prepend-http "^1.0.1" - user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -3324,10 +2212,6 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -utils-merge@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" - uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" @@ -3339,10 +2223,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -vary@^1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -3355,17 +2235,6 @@ webber@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/webber/-/webber-0.0.1.tgz#bb536de20d0e992e8da23eca33fe4edff2c46476" -websocket-driver@>=0.5.1: - version "0.7.0" - resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.0.tgz#0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb" - dependencies: - http-parser-js ">=0.4.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" - which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" @@ -3382,12 +2251,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2" -widest-line@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" - dependencies: - string-width "^1.0.1" - wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -3403,24 +2266,12 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" dependencies: mkdirp "^0.5.1" -xdg-basedir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" - xml-char-classes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" From 566b0b1d4c21b0dcb32fbd94ab853ade4accc3ad Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 16:09:05 +0200 Subject: [PATCH 49/74] Cleaned up .travis.yml --- .travis.yml | 3 --- package-lock.json | 52 ----------------------------------------------- package.json | 7 ++----- 3 files changed, 2 insertions(+), 60 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8da7b6ea4..1288ecd12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,6 @@ node_js: before_install: - npm install -g semistandard - npm install -g prettier -- npm install webber -- npm install builder -- npm install tagger script: - npm run tagger - npm run linter diff --git a/package-lock.json b/package-lock.json index 9efd6e66c..f06436ab6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -127,11 +127,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, "async-foreach": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", @@ -246,38 +241,6 @@ "concat-map": "0.0.1" } }, - "builder": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/builder/-/builder-3.2.3.tgz", - "integrity": "sha512-DXkZ27RHCw4uCn08SEx7hhgXbtamZOBKa8FEuHjsooyMfNfZXNn7YYqpfWrBNigwX2sMgKYWY8Jupxp6waofSg==", - "requires": { - "async": "1.5.2", - "chalk": "1.1.3", - "js-yaml": "3.10.0", - "lodash": "3.10.1", - "nopt": "3.0.6", - "tree-kill": "1.2.0" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" - } - } - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -2898,11 +2861,6 @@ } } }, - "tagger": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/tagger/-/tagger-0.1.2.tgz", - "integrity": "sha1-K0ZDWgdvEn359ZglN/PX9K5AH/k=" - }, "tape": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/tape/-/tape-4.8.0.tgz", @@ -2961,11 +2919,6 @@ "punycode": "1.4.1" } }, - "tree-kill": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", - "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==" - }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", @@ -3102,11 +3055,6 @@ } } }, - "webber": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/webber/-/webber-0.0.1.tgz", - "integrity": "sha1-u1Nt4g0OmS6Noj7KM/5O3/LEZHY=" - }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", diff --git a/package.json b/package.json index fdd74b6f0..d2c5c6ca8 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,13 @@ { "dependencies": { - "builder": "^3.2.3", - "chalk": "^2.3.0", "fs-extra": "^4.0.2", "html-minifier": "^3.5.7", "markdown-it": "^8.4.0", "node-sass": "^4.7.2", "prettier": "^1.9.2", "semistandard": "^11.0.0", - "tagger": "^0.1.2", - "tape": "^4.8.0", - "webber": "0.0.1" + "chalk": "^2.3.0", + "tape": "^4.8.0" }, "name": "30-seconds-of-code", "description": "A collection of useful Javascript snippets.", From 59ab0e5f87b93314ac1c41841f7e52e6958503c9 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 14:10:10 +0000 Subject: [PATCH 50/74] Travis build: 610 --- yarn.lock | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/yarn.lock b/yarn.lock index cafba9830..b4d7dfd07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,10 +124,6 @@ async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" -async@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -193,17 +189,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -builder@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/builder/-/builder-3.2.3.tgz#33b239fa62d2432802164eb72e5f49639b0ae115" - dependencies: - async "^1.4.2" - chalk "^1.1.1" - js-yaml "^3.4.3" - lodash "^3.10.1" - nopt "^3.0.6" - tree-kill "^1.0.0" - builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1198,7 +1183,7 @@ js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.3, js-yaml@^3.5.1: +js-yaml@^3.5.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -1315,10 +1300,6 @@ lodash.mergewith@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" -lodash@^3.10.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" - lodash@^4.0.0, lodash@^4.3.0, lodash@~4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -1474,7 +1455,7 @@ node-sass@^4.7.2: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" -"nopt@2 || 3", nopt@^3.0.6: +"nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: @@ -2097,10 +2078,6 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -tagger@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/tagger/-/tagger-0.1.2.tgz#2b46435a076f127df9f5982537f3d7f4ae401ff9" - tape@^4.8.0: version "4.8.0" resolved "https://registry.yarnpkg.com/tape/-/tape-4.8.0.tgz#f6a9fec41cc50a1de50fa33603ab580991f6068e" @@ -2141,10 +2118,6 @@ tough-cookie@~2.3.0, tough-cookie@~2.3.3: dependencies: punycode "^1.4.1" -tree-kill@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -2231,10 +2204,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -webber@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/webber/-/webber-0.0.1.tgz#bb536de20d0e992e8da23eca33fe4edff2c46476" - which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" From f8abd322469937da5f2c8a525e9c0abaf11cb7d0 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 29 Dec 2017 16:20:50 +0200 Subject: [PATCH 51/74] Updated webber to properly minify HTML page --- scripts/web-script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/web-script.js b/scripts/web-script.js index dcb2cec3e..1801547fc 100644 --- a/scripts/web-script.js +++ b/scripts/web-script.js @@ -106,7 +106,7 @@ try { // Minify output output = minify(output, { collapseBooleanAttributes: true, - collapseWhitespace: false, + collapseWhitespace: true, decodeEntities: false, minifyCSS: true, minifyJS: true, From 6bbb0d32b6f14b381a79f1f05cebd551f65db414 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 14:21:43 +0000 Subject: [PATCH 52/74] Travis build: 612 --- docs/index.html | 1669 +++++++++-------------------------------------- 1 file changed, 301 insertions(+), 1368 deletions(-) diff --git a/docs/index.html b/docs/index.html index 021fc8dd3..8389e10d5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,22 +1,4 @@ - - - - - - 30 seconds of code - - - - - - - - - - - - - - -
-

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

- -
-
- -
 

Adapter

-

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);
-
-
Promise.resolve([1, 2, 3])
+    }

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

 

Adapter

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);
+
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
 const map = call.bind(null, 'map');
 Promise.resolve([1, 2, 3])
   .then(map(x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
-
-

collectInto

-

Changes a function that accepts an array into a variadic function.

-

Given a function, return a closure that collects all inputs into an array-accepting function.

-
const collectInto = fn => (...args) => fn(args);
-
-
const Pall = collectInto(Promise.all.bind(Promise));
+

collectInto

Changes a function that accepts an array into a variadic function.

Given a function, return a closure that collects all inputs into an array-accepting function.

const collectInto = fn => (...args) => fn(args);
+
const Pall = collectInto(Promise.all.bind(Promise));
 let p1 = Promise.resolve(1);
 let p2 = Promise.resolve(2);
 let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3));
 Pall(p1, p2, p3).then(console.log);
-
-

flip

-

Flip takes a function as an argument, then makes the first argument the last

-

Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.

-
const flip = fn => (...args) => fn(args.pop(), ...args);
-
-
let a = { name: 'John Smith' };
+

flip

Flip takes a function as an argument, then makes the first argument the last

Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.

const flip = fn => (...args) => fn(args.pop(), ...args);
+
let a = { name: 'John Smith' };
 let b = {};
 const mergeFrom = flip(Object.assign);
 let mergePerson = mergeFrom.bind(null, a);
 mergePerson(b); // == b
 b = {};
 Object.assign(b, a); // == b
-
-

pipeFunctions

-

Performs left-to-right function composition.

-

Use Array.reduce() with the spread operator (...) to perform left-to-right function composition. -The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.

-
const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
-
-
const add5 = x => x + 5;
+

pipeFunctions

Performs left-to-right function composition.

Use Array.reduce() with the spread operator (...) to perform left-to-right function composition. The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.

const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
+
const add5 = x => x + 5;
 const multiply = (x, y) => x * y;
 const multiplyAndAdd5 = pipeFunctions(multiply, add5);
 multiplyAndAdd5(5, 2); // 15
-
-

promisify

-

Converts an asynchronous function to return a promise.

-

Use currying to return a function returning a Promise that calls the original function. -Use the ...rest operator to pass in all the parameters.

-

In Node 8+, you can use util.promisify

-
const promisify = func => (...args) =>
+

promisify

Converts an asynchronous function to return a promise.

Use currying to return a function returning a Promise that calls the original function. Use the ...rest operator to pass in all the parameters.

In Node 8+, you can use util.promisify

const promisify = func => (...args) =>
   new Promise((resolve, reject) =>
     func(...args, (err, result) => (err ? reject(err) : resolve(result)))
   );
-
-
const delay = promisify((d, cb) => setTimeout(cb, d));
+
const delay = promisify((d, cb) => setTimeout(cb, d));
 delay(2000).then(() => console.log('Hi!')); // // Promise resolves after 2s
-
-

spreadOver

-

Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.

-

Use closures and the spread operator (...) to map the array of arguments to the inputs of the function.

-
const spreadOver = fn => argsArr => fn(...argsArr);
-
-
const arrayMax = spreadOver(Math.max);
+

spreadOver

Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.

Use closures and the spread operator (...) to map the array of arguments to the inputs of the function.

const spreadOver = fn => argsArr => fn(...argsArr);
+
const arrayMax = spreadOver(Math.max);
 arrayMax([1, 2, 3]); // 3
 arrayMax([1, 2, 4]); // 4
-
-

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

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)
   );
-
-
chunk([1, 2, 3, 4, 5], 2); // [[1,2],[3,4],[5]]
-
-

compact

-

Removes falsey values from an array.

-

Use Array.filter() to filter out falsey values (false, null, 0, "", undefined, and NaN).

-
const compact = arr => arr.filter(Boolean);
-
-
compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]); // [ 1, 2, 3, 'a', 's', 34 ]
-
-

countOccurrences

-

Counts the occurrences of a value in an array.

-

Use Array.reduce() to increment a counter each time you encounter the specific value inside the array.

-
const countOccurrences = (arr, value) => arr.reduce((a, v) => (v === value ? a + 1 : a + 0), 0);
-
-
countOccurrences([1, 1, 2, 1, 2, 3], 1); // 3
-
-

deepFlatten

-

Deep flattens an array.

-

Use recursion. -Use Array.concat() with an empty array ([]) and the spread operator (...) to flatten an array. -Recursively flatten each element that is an array.

-
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
-
-
deepFlatten([1, [2], [[3], 4], 5]); // [1,2,3,4,5]
-
-

difference

-

Returns the difference between two arrays.

-

Create a Set from b, then use Array.filter() on a to only keep values not contained in b.

-
const difference = (a, b) => {
+
chunk([1, 2, 3, 4, 5], 2); // [[1,2],[3,4],[5]]
+

compact

Removes falsey values from an array.

Use Array.filter() to filter out falsey values (false, null, 0, "", undefined, and NaN).

const compact = arr => arr.filter(Boolean);
+
compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]); // [ 1, 2, 3, 'a', 's', 34 ]
+

countOccurrences

Counts the occurrences of a value in an array.

Use Array.reduce() to increment a counter each time you encounter the specific value inside the array.

const countOccurrences = (arr, value) => arr.reduce((a, v) => (v === value ? a + 1 : a + 0), 0);
+
countOccurrences([1, 1, 2, 1, 2, 3], 1); // 3
+

deepFlatten

Deep flattens an array.

Use recursion. Use Array.concat() with an empty array ([]) and the spread operator (...) to flatten an array. Recursively flatten each element that is an array.

const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
+
deepFlatten([1, [2], [[3], 4], 5]); // [1,2,3,4,5]
+

difference

Returns the difference between two arrays.

Create a Set from b, then use Array.filter() on a to only keep values not contained in b.

const difference = (a, b) => {
   const s = new Set(b);
   return a.filter(x => !s.has(x));
 };
-
-
difference([1, 2, 3], [1, 2, 4]); // [3]
-
-

differenceWith

-

Filters out all values from an array for which the comparator function does not return true.

-

Use Array.filter() and Array.find() to find the appropriate values.

-
const differenceWith = (arr, val, comp) => arr.filter(a => !val.find(b => comp(a, b)));
-
-
differenceWith([1, 1.2, 1.5, 3], [1.9, 3], (a, b) => Math.round(a) == Math.round(b)); // [1, 1.2]
-
-

distinctValuesOfArray

-

Returns all the distinct values of an array.

-

Use ES6 Set and the ...rest operator to discard all duplicated values.

-
const distinctValuesOfArray = arr => [...new Set(arr)];
-
-
distinctValuesOfArray([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5]
-
-

dropElements

-

Removes elements in an array until the passed function returns true. Returns the remaining elements in the array.

-

Loop through the array, using Array.slice() to drop the first element of the array until the returned value from the function is true. -Returns the remaining elements.

-
const dropElements = (arr, func) => {
+
difference([1, 2, 3], [1, 2, 4]); // [3]
+

differenceWith

Filters out all values from an array for which the comparator function does not return true.

Use Array.filter() and Array.find() to find the appropriate values.

const differenceWith = (arr, val, comp) => arr.filter(a => !val.find(b => comp(a, b)));
+
differenceWith([1, 1.2, 1.5, 3], [1.9, 3], (a, b) => Math.round(a) == Math.round(b)); // [1, 1.2]
+

distinctValuesOfArray

Returns all the distinct values of an array.

Use ES6 Set and the ...rest operator to discard all duplicated values.

const distinctValuesOfArray = arr => [...new Set(arr)];
+
distinctValuesOfArray([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5]
+

dropElements

Removes elements in an array until the passed function returns true. Returns the remaining elements in the array.

Loop through the array, using Array.slice() to drop the first element of the array until the returned value from the function is true. Returns the remaining elements.

const dropElements = (arr, func) => {
   while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
   return arr;
 };
-
-
dropElements([1, 2, 3, 4], n => n >= 3); // [3,4]
-
-

dropRight

-

Returns a new array with n elements removed from the right.

-

Use Array.slice() to slice the remove the specified number of elements from the right.

-
const dropRight = (arr, n = 1) => arr.slice(0, -n);
-
-
dropRight([1, 2, 3]); // [1,2]
+
dropElements([1, 2, 3, 4], n => n >= 3); // [3,4]
+

dropRight

Returns a new array with n elements removed from the right.

Use Array.slice() to slice the remove the specified number of elements from the right.

const dropRight = (arr, n = 1) => arr.slice(0, -n);
+
dropRight([1, 2, 3]); // [1,2]
 dropRight([1, 2, 3], 2); // [1]
 dropRight([1, 2, 3], 42); // []
-
-

everyNth

-

Returns every nth element in an array.

-

Use Array.filter() to create a new array that contains every nth element of a given array.

-
const everyNth = (arr, nth) => arr.filter((e, i) => i % nth === nth - 1);
-
-
everyNth([1, 2, 3, 4, 5, 6], 2); // [ 2, 4, 6 ]
-
-

filterNonUnique

-

Filters out the non-unique values in an array.

-

Use Array.filter() for an array containing only the unique values.

-
const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i));
-
-
filterNonUnique([1, 2, 2, 3, 4, 4, 5]); // [1,3,5]
-
-

flatten

-

Flattens an array.

-

Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays.

-
const flatten = arr => [].concat(...arr);
-
-
flatten([1, [2], 3, 4]); // [1,2,3,4]
-
-

flattenDepth

-

Flattens an array up to the specified depth.

-

Use recursion, decrementing depth by 1 for each level of depth. -Use Array.reduce() and Array.concat() to merge elements or arrays. -Base case, for depth equal to 1 stops recursion. -Omit the second element, depth to flatten only to a depth of 1 (single flatten).

-
const flattenDepth = (arr, depth = 1) =>
+

everyNth

Returns every nth element in an array.

Use Array.filter() to create a new array that contains every nth element of a given array.

const everyNth = (arr, nth) => arr.filter((e, i) => i % nth === nth - 1);
+
everyNth([1, 2, 3, 4, 5, 6], 2); // [ 2, 4, 6 ]
+

filterNonUnique

Filters out the non-unique values in an array.

Use Array.filter() for an array containing only the unique values.

const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i));
+
filterNonUnique([1, 2, 2, 3, 4, 4, 5]); // [1,3,5]
+

flatten

Flattens an array.

Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays.

const flatten = arr => [].concat(...arr);
+
flatten([1, [2], 3, 4]); // [1,2,3,4]
+

flattenDepth

Flattens an array up to the specified depth.

Use recursion, decrementing depth by 1 for each level of depth. Use Array.reduce() and Array.concat() to merge elements or arrays. Base case, for depth equal to 1 stops recursion. Omit the second element, depth to flatten only to a depth of 1 (single flatten).

const flattenDepth = (arr, depth = 1) =>
   depth != 1
     ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flattenDepth(v, depth - 1) : v), [])
     : arr.reduce((a, v) => a.concat(v), []);
-
-
flattenDepth([1, [2], 3, 4]); // [1,2,3,4]
-
-

groupBy

-

Groups the elements of an array based on the given function.

-

Use Array.map() to map the values of an array to a function or property name. -Use Array.reduce() to create an object, where the keys are produced from the mapped results.

-
const groupBy = (arr, func) =>
+
flattenDepth([1, [2], 3, 4]); // [1,2,3,4]
+

groupBy

Groups the elements of an array based on the given function.

Use Array.map() to map the values of an array to a function or property name. Use Array.reduce() to create an object, where the keys are produced from the mapped results.

const groupBy = (arr, func) =>
   arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
     acc[val] = (acc[val] || []).concat(arr[i]);
     return acc;
   }, {});
-
-
groupBy([6.1, 4.2, 6.3], Math.floor); // {4: [4.2], 6: [6.1, 6.3]}
+
groupBy([6.1, 4.2, 6.3], Math.floor); // {4: [4.2], 6: [6.1, 6.3]}
 groupBy(['one', 'two', 'three'], 'length'); // {3: ['one', 'two'], 5: ['three']}
-
-

-

Returns the head of a list.

-

Use arr[0] to return the first element of the passed array.

-
const head = arr => arr[0];
-
-
head([1, 2, 3]); // 1
-
-

initial

-

Returns all the elements of an array except the last one.

-

Use arr.slice(0,-1) to return all but the last element of the array.

-
const initial = arr => arr.slice(0, -1);
-
-
initial([1, 2, 3]); // [1,2]
-
-

initialize2DArray

-

Initializes a 2D array of given width and height and value.

-

Use Array.map() to generate h rows where each is a new array of size w initialize with value. If the value is not provided, default to null.

-
const initialize2DArray = (w, h, val = null) =>
+

Returns the head of a list.

Use arr[0] to return the first element of the passed array.

const head = arr => arr[0];
+
head([1, 2, 3]); // 1
+

initial

Returns all the elements of an array except the last one.

Use arr.slice(0,-1) to return all but the last element of the array.

const initial = arr => arr.slice(0, -1);
+
initial([1, 2, 3]); // [1,2]
+

initialize2DArray

Initializes a 2D array of given width and height and value.

Use Array.map() to generate h rows where each is a new array of size w initialize with value. If the value is not provided, default to null.

const initialize2DArray = (w, h, val = null) =>
   Array(h)
     .fill()
     .map(() => Array(w).fill(val));
-
-
initialize2DArray(2, 2, 0); // [[0,0], [0,0]]
-
-

initializeArrayWithRange

-

Initializes an array containing the numbers in the specified range where start and end are inclusive.

-

Use Array((end + 1) - start) to create an array of the desired length, Array.map() to fill with the desired values in a range. -You can omit start to use a default value of 0.

-
const initializeArrayWithRange = (end, start = 0) =>
+
initialize2DArray(2, 2, 0); // [[0,0], [0,0]]
+

initializeArrayWithRange

Initializes an array containing the numbers in the specified range where start and end are inclusive.

Use Array((end + 1) - start) to create an array of the desired length, Array.map() to fill with the desired values in a range. You can omit start to use a default value of 0.

const initializeArrayWithRange = (end, start = 0) =>
   Array.from({ length: end + 1 - start }).map((v, i) => i + start);
-
-
initializeArrayWithRange(5); // [0,1,2,3,4,5]
+
initializeArrayWithRange(5); // [0,1,2,3,4,5]
 initializeArrayWithRange(7, 3); // [3,4,5,6,7]
-
-

initializeArrayWithValues

-

Initializes and fills an array with the specified values.

-

Use Array(n) to create an array of the desired length, fill(v) to fill it with the desired values. -You can omit value to use a default value of 0.

-
const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value);
-
-
initializeArrayWithValues(5, 2); // [2,2,2,2,2]
-
-

intersection

-

Returns a list of elements that exist in both arrays.

-

Create a Set from b, then use Array.filter() on a to only keep values contained in b.

-
const intersection = (a, b) => {
+

initializeArrayWithValues

Initializes and fills an array with the specified values.

Use Array(n) to create an array of the desired length, fill(v) to fill it with the desired values. You can omit value to use a default value of 0.

const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value);
+
initializeArrayWithValues(5, 2); // [2,2,2,2,2]
+

intersection

Returns a list of elements that exist in both arrays.

Create a Set from b, then use Array.filter() on a to only keep values contained in b.

const intersection = (a, b) => {
   const s = new Set(b);
   return a.filter(x => s.has(x));
 };
-
-
intersection([1, 2, 3], [4, 3, 2]); // [2,3]
-
-

last

-

Returns the last element in an array.

-

Use arr.length - 1 to compute the index of the last element of the given array and returning it.

-
const last = arr => arr[arr.length - 1];
-
-
last([1, 2, 3]); // 3
-
-

mapObject

-

Maps the values of an array to an object using a function, where the key-value pairs consist of the original value as the key and the mapped value.

-

Use an anonymous inner function scope to declare an undefined memory space, using closures to store a return value. Use a new Array to store the array with a map of the function over its data set and a comma operator to return a second step, without needing to move from one context to another (due to closures and order of operations).

-
const mapObject = (arr, fn) =>
+
intersection([1, 2, 3], [4, 3, 2]); // [2,3]
+

last

Returns the last element in an array.

Use arr.length - 1 to compute the index of the last element of the given array and returning it.

const last = arr => arr[arr.length - 1];
+
last([1, 2, 3]); // 3
+

mapObject

Maps the values of an array to an object using a function, where the key-value pairs consist of the original value as the key and the mapped value.

Use an anonymous inner function scope to declare an undefined memory space, using closures to store a return value. Use a new Array to store the array with a map of the function over its data set and a comma operator to return a second step, without needing to move from one context to another (due to closures and order of operations).

const mapObject = (arr, fn) =>
   (a => (
     (a = [arr, arr.map(fn)]), a[0].reduce((acc, val, ind) => ((acc[val] = a[1][ind]), acc), {})
   ))();
-
-
const squareIt = arr => mapObject(arr, a => a * a);
+
const squareIt = arr => mapObject(arr, a => a * a);
 squareIt([1, 2, 3]); // { 1: 1, 2: 4, 3: 9 }
-
-

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

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'
-
-

pick

-

Picks the key-value pairs corresponding to the given keys from an object.

-

Use Array.reduce() to convert the filtered/picked keys back to an object with the corresponding key-value pair if the key exists in the obj.

-
const pick = (obj, arr) =>
+

pick

Picks the key-value pairs corresponding to the given keys from an object.

Use Array.reduce() to convert the filtered/picked keys back to an object with the corresponding key-value pair if the key exists in the obj.

const pick = (obj, arr) =>
   arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {});
-
-
pick({ a: 1, b: '2', c: 3 }, ['a', 'c']); // { 'a': 1, 'c': 3 }
-
-

pull

-

Mutates the original array to filter out the values specified.

-

Use Array.filter() and Array.includes() to pull out the values that are not needed. -Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values.

-

(For a snippet that does not mutate the original array see without)

-
const pull = (arr, ...args) => {
+
pick({ a: 1, b: '2', c: 3 }, ['a', 'c']); // { 'a': 1, 'c': 3 }
+

pull

Mutates the original array to filter out the values specified.

Use Array.filter() and Array.includes() to pull out the values that are not needed. Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values.

(For a snippet that does not mutate the original array see without)

const pull = (arr, ...args) => {
   let argState = Array.isArray(args[0]) ? args[0] : args;
   let pulled = arr.filter((v, i) => !argState.includes(v));
   arr.length = 0;
   pulled.forEach(v => arr.push(v));
 };
-
-
let myArray1 = ['a', 'b', 'c', 'a', 'b', 'c'];
+
let myArray1 = ['a', 'b', 'c', 'a', 'b', 'c'];
 pull(myArray1, 'a', 'c');
 console.log(myArray1); // [ 'b', 'b' ]
 
 let myArray2 = ['a', 'b', 'c', 'a', 'b', 'c'];
 pull(myArray2, ['a', 'c']);
 console.log(myArray2); // [ 'b', 'b' ]
-
-

pullAtIndex

-

Mutates the original array to filter out the values at the specified indexes.

-

Use Array.filter() and Array.includes() to pull out the values that are not needed. -Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. -Use Array.push() to keep track of pulled values

-
const pullAtIndex = (arr, pullArr) => {
+

pullAtIndex

Mutates the original array to filter out the values at the specified indexes.

Use Array.filter() and Array.includes() to pull out the values that are not needed. Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. Use Array.push() to keep track of pulled values

const pullAtIndex = (arr, pullArr) => {
   let removed = [];
   let pulled = arr
     .map((v, i) => (pullArr.includes(i) ? removed.push(v) : v))
@@ -592,19 +199,12 @@ Use Array.push() to keep track of pulled values

pulled.forEach(v => arr.push(v)); return removed; }; -
-
let myArray = ['a', 'b', 'c', 'd'];
+
let myArray = ['a', 'b', 'c', 'd'];
 let pulled = pullAtIndex(myArray, [1, 3]);
 
 console.log(myArray); // [ 'a', 'c' ]
 console.log(pulled); // [ 'b', 'd' ]
-
-

pullAtValue

-

Mutates the original array to filter out the values specified. Returns the removed elements.

-

Use Array.filter() and Array.includes() to pull out the values that are not needed. -Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. -Use Array.push() to keep track of pulled values

-
const pullAtValue = (arr, pullArr) => {
+

pullAtValue

Mutates the original array to filter out the values specified. Returns the removed elements.

Use Array.filter() and Array.includes() to pull out the values that are not needed. Use Array.length = 0 to mutate the passed in an array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. Use Array.push() to keep track of pulled values

const pullAtValue = (arr, pullArr) => {
   let removed = [],
     pushToRemove = arr.forEach((v, i) => (pullArr.includes(v) ? removed.push(v) : v)),
     mutateTo = arr.filter((v, i) => !pullArr.includes(v));
@@ -612,18 +212,11 @@ Use Array.push() to keep track of pulled values

mutateTo.forEach(v => arr.push(v)); return removed; }; -
-
let myArray = ['a', 'b', 'c', 'd'];
+
let myArray = ['a', 'b', 'c', 'd'];
 let pulled = pullAtValue(myArray, ['b', 'd']);
 console.log(myArray); // [ 'a', 'c' ]
 console.log(pulled); // [ 'b', 'd' ]
-
-

quickSort

-

QuickSort an Array (ascending sort by default).

-

Use recursion. -Use Array.filter and spread operator (...) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. -If the parameter desc is truthy, return array sorts in descending order.

-
const quickSort = ([n, ...nums], desc) =>
+

quickSort

QuickSort an Array (ascending sort by default).

Use recursion. Use Array.filter and spread operator (...) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter desc is truthy, return array sorts in descending order.

const quickSort = ([n, ...nums], desc) =>
   isNaN(n)
     ? []
     : [
@@ -631,36 +224,19 @@ If the parameter desc is truthy, return array sorts in descending o
         n,
         ...quickSort(nums.filter(v => (!desc ? v > n : v <= n)), desc)
       ];
-
-
quickSort([4, 1, 3, 2]); // [1,2,3,4]
+
quickSort([4, 1, 3, 2]); // [1,2,3,4]
 quickSort([4, 1, 3, 2], true); // [4,3,2,1]
-
-

remove

-

Removes elements from an array for which the given function returns false.

-

Use Array.filter() to find array elements that return truthy values and Array.reduce() to remove elements using Array.splice(). -The func is invoked with three arguments (value, index, array).

-
const remove = (arr, func) =>
+

remove

Removes elements from an array for which the given function returns false.

Use Array.filter() to find array elements that return truthy values and Array.reduce() to remove elements using Array.splice(). The func is invoked with three arguments (value, index, array).

const remove = (arr, func) =>
   Array.isArray(arr)
     ? arr.filter(func).reduce((acc, val) => {
         arr.splice(arr.indexOf(val), 1);
         return acc.concat(val);
       }, [])
     : [];
-
-
remove([1, 2, 3, 4], n => n % 2 == 0); // [2, 4]
-
-

sample

-

Returns a random element from an array.

-

Use Math.random() to generate a random number, multiply it by length and round it of to the nearest whole number using Math.floor(). -This method also works with strings.

-
const sample = arr => arr[Math.floor(Math.random() * arr.length)];
-
-
sample([3, 7, 9, 11]); // 9
-
-

shuffle

-

Randomizes the order of the values of an array, returning a new array.

-

Uses the Fisher-Yates algoritm to reorder the elements of the array, based on the Lodash implementation, but as a pure function.

-
const shuffle = ([...arr]) => {
+
remove([1, 2, 3, 4], n => n % 2 == 0); // [2, 4]
+

sample

Returns a random element from an array.

Use Math.random() to generate a random number, multiply it by length and round it of to the nearest whole number using Math.floor(). This method also works with strings.

const sample = arr => arr[Math.floor(Math.random() * arr.length)];
+
sample([3, 7, 9, 11]); // 9
+

shuffle

Randomizes the order of the values of an array, returning a new array.

Uses the Fisher-Yates algoritm to reorder the elements of the array, based on the Lodash implementation, but as a pure function.

const shuffle = ([...arr]) => {
   let m = arr.length;
   while (m) {
     const i = Math.floor(Math.random() * m--);
@@ -668,135 +244,58 @@ This method also works with strings.

} return arr; }; -
-
const foo = [1, 2, 3];
+
const foo = [1, 2, 3];
 shuffle(foo); // [2,3,1]
 console.log(foo); // [1,2,3]
-
-

similarity

-

Returns an array of elements that appear in both arrays.

-

Use filter() to remove values that are not part of values, determined using includes().

-
const similarity = (arr, values) => arr.filter(v => values.includes(v));
-
-
similarity([1, 2, 3], [1, 2, 4]); // [1,2]
-
-

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) => {
+

similarity

Returns an array of elements that appear in both arrays.

Use filter() to remove values that are not part of values, determined using includes().

const similarity = (arr, values) => arr.filter(v => values.includes(v));
+
similarity([1, 2, 3], [1, 2, 4]); // [1,2]
+

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);
   return [...a.filter(x => !sB.has(x)), ...b.filter(x => !sA.has(x))];
 };
-
-
symmetricDifference([1, 2, 3], [1, 2, 4]); // [3,4]
-
-

tail

-

Returns all elements in an array except for the first one.

-

Return arr.slice(1) if the array's length is more than 1, otherwise, return the whole array.

-
const tail = arr => (arr.length > 1 ? arr.slice(1) : arr);
-
-
tail([1, 2, 3]); // [2,3]
+
symmetricDifference([1, 2, 3], [1, 2, 4]); // [3,4]
+

tail

Returns all elements in an array except for the first one.

Return arr.slice(1) if the array's length is more than 1, otherwise, return the whole array.

const tail = arr => (arr.length > 1 ? arr.slice(1) : arr);
+
tail([1, 2, 3]); // [2,3]
 tail([1]); // [1]
-
-

take

-

Returns an array with n elements removed from the beginning.

-

Use Array.slice() to create a slice of the array with n elements taken from the beginning.

-
const take = (arr, n = 1) => arr.slice(0, n);
-
-
take([1, 2, 3], 5); // [1, 2, 3]
+

take

Returns an array with n elements removed from the beginning.

Use Array.slice() to create a slice of the array with n elements taken from the beginning.

const take = (arr, n = 1) => arr.slice(0, n);
+
take([1, 2, 3], 5); // [1, 2, 3]
 take([1, 2, 3], 0); // []
-
-

takeRight

-

Returns an array with n elements removed from the end.

-

Use Array.slice() to create a slice of the array with n elements taken from the end.

-
const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length);
-
-
takeRight([1, 2, 3], 2); // [ 2, 3 ]
+

takeRight

Returns an array with n elements removed from the end.

Use Array.slice() to create a slice of the array with n elements taken from the end.

const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length);
+
takeRight([1, 2, 3], 2); // [ 2, 3 ]
 takeRight([1, 2, 3]); // [3]
-
-

union

-

Returns every element that exists in any of the two arrays once.

-

Create a Set with all values of a and b and convert to an array.

-
const union = (a, b) => Array.from(new Set([...a, ...b]));
-
-
union([1, 2, 3], [4, 3, 2]); // [1,2,3,4]
-
-

without

-

Filters out the elements of an array, that have one of the specified values.

-

Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

-

(For a snippet that mutates the original array see pull)

-
const without = (arr, ...args) => arr.filter(v => !args.includes(v));
-
-
without([2, 1, 2, 3], 1, 2); // [3]
-
-

zip

-

Creates an array of elements, grouped based on the position in the original arrays.

-

Use Math.max.apply() to get the longest array in the arguments. -Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. -If lengths of the argument-arrays vary, undefined is used where no value could be found.

-
const zip = (...arrays) => {
+

union

Returns every element that exists in any of the two arrays once.

Create a Set with all values of a and b and convert to an array.

const union = (a, b) => Array.from(new Set([...a, ...b]));
+
union([1, 2, 3], [4, 3, 2]); // [1,2,3,4]
+

without

Filters out the elements of an array, that have one of the specified values.

Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

(For a snippet that mutates the original array see pull)

const without = (arr, ...args) => arr.filter(v => !args.includes(v));
+
without([2, 1, 2, 3], 1, 2); // [3]
+

zip

Creates an array of elements, grouped based on the position in the original arrays.

Use Math.max.apply() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found.

const zip = (...arrays) => {
   const maxLength = Math.max(...arrays.map(x => x.length));
   return Array.from({ length: maxLength }).map((_, i) => {
     return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]);
   });
 };
-
-
zip(['a', 'b'], [1, 2], [true, false]); // [['a', 1, true], ['b', 2, false]]
+
zip(['a', 'b'], [1, 2], [true, false]); // [['a', 1, true], ['b', 2, false]]
 zip(['a'], [1, 2], [true, false]); // [['a', 1, true], [undefined, 2, false]]
-
-

zipObject

-

Given an array of valid property identifiers and an array of values, return an object associating the properties to the values.

-

Since an object can have undefined values but not undefined property pointers, the array of properties is used to decide the structure of the resulting object using Array.reduce().

-
const zipObject = (props, values) =>
+

zipObject

Given an array of valid property identifiers and an array of values, return an object associating the properties to the values.

Since an object can have undefined values but not undefined property pointers, the array of properties is used to decide the structure of the resulting object using Array.reduce().

const zipObject = (props, values) =>
   props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {});
-
-
zipObject(['a', 'b', 'c'], [1, 2]); // {a: 1, b: 2, c: undefined}
+
zipObject(['a', 'b', 'c'], [1, 2]); // {a: 1, b: 2, c: undefined}
 zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2}
-
-

Browser

-

arrayToHtmlList

-

Converts the given array elements into <li> tags and appends them to the list of the given id.

-

Use Array.map() and document.querySelector() to create a list of html tags.

-
const arrayToHtmlList = (arr, listID) =>
+

Browser

arrayToHtmlList

Converts the given array elements into <li> tags and appends them to the list of the given id.

Use Array.map() and document.querySelector() to create a list of html tags.

const arrayToHtmlList = (arr, listID) =>
   arr.map(item => (document.querySelector('#' + listID).innerHTML += `<li>${item}</li>`));
-
-
arrayToHtmlList(['item 1', 'item 2'], 'myListID');
-
-

bottomVisible

-

Returns true if the bottom of the page is visible, false otherwise.

-

Use scrollY, scrollHeight and clientHeight to determine if the bottom of the page is visible.

-
const bottomVisible = () =>
+
arrayToHtmlList(['item 1', 'item 2'], 'myListID');
+

bottomVisible

Returns true if the bottom of the page is visible, false otherwise.

Use scrollY, scrollHeight and clientHeight to determine if the bottom of the page is visible.

const bottomVisible = () =>
   document.documentElement.clientHeight + window.scrollY >=
   (document.documentElement.scrollHeight || document.documentElement.clientHeight);
-
-
bottomVisible(); // true
-
-

currentURL

-

Returns the current URL.

-

Use window.location.href to get current URL.

-
const currentURL = () => window.location.href;
-
-
currentURL(); // 'https://google.com'
-
-

detectDeviceType

-

Detects wether the website is being opened in a mobile device or a desktop/laptop.

-

Use a regular expression to test the navigator.userAgent property to figure out if the device is a mobile device or a desktop/laptop.

-
const detectDeviceType = () =>
+
bottomVisible(); // true
+

currentURL

Returns the current URL.

Use window.location.href to get current URL.

const currentURL = () => window.location.href;
+
currentURL(); // 'https://google.com'
+

detectDeviceType

Detects wether the website is being opened in a mobile device or a desktop/laptop.

Use a regular expression to test the navigator.userAgent property to figure out if the device is a mobile device or a desktop/laptop.

const detectDeviceType = () =>
   /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
     ? 'Mobile'
     : 'Desktop';
-
-
detectDeviceType(); // "Mobile"
+
detectDeviceType(); // "Mobile"
 detectDeviceType(); // "Desktop"
-
-

elementIsVisibleInViewport

-

Returns true if the element specified is visible in the viewport, false otherwise.

-

Use Element.getBoundingClientRect() and the window.inner(Width|Height) values -to determine if a given element is visible in the viewport. -Omit the second argument to determine if the element is entirely visible, or specify true to determine if -it is partially visible.

-
const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
+

elementIsVisibleInViewport

Returns true if the element specified is visible in the viewport, false otherwise.

Use Element.getBoundingClientRect() and the window.inner(Width|Height) values to determine if a given element is visible in the viewport. Omit the second argument to determine if the element is entirely visible, or specify true to determine if it is partially visible.

const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
   const { top, left, bottom, right } = el.getBoundingClientRect();
   const { innerHeight, innerWidth } = window;
   return partiallyVisible
@@ -804,139 +303,59 @@ it is partially visible.

((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) : top >= 0 && left >= 0 && bottom <= innerHeight && right <= innerWidth; }; -
-
// e.g. 100x100 viewport and a 10x10px element at position {top: -1, left: 0, bottom: 9, right: 10}
+
// e.g. 100x100 viewport and a 10x10px element at position {top: -1, left: 0, bottom: 9, right: 10}
 elementIsVisibleInViewport(el); // false // (not fully visible)
 elementIsVisibleInViewport(el, true); // true // (partially visible)
-
-

getScrollPosition

-

Returns the scroll position of the current page.

-

Use pageXOffset and pageYOffset if they are defined, otherwise scrollLeft and scrollTop. -You can omit el to use a default value of window.

-
const getScrollPosition = (el = window) => ({
+

getScrollPosition

Returns the scroll position of the current page.

Use pageXOffset and pageYOffset if they are defined, otherwise scrollLeft and scrollTop. You can omit el to use a default value of window.

const getScrollPosition = (el = window) => ({
   x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
   y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
 });
-
-
getScrollPosition(); // {x: 0, y: 200}
-
-

getStyle

-

Returns the value of a CSS rule for the specified element.

-

Use Window.getComputedStyle() to get the value of the CSS rule for the specified element.

-
const getStyle = (el, ruleName) => getComputedStyle(el)[ruleName];
-
-
getStyle(document.querySelector('p'), 'font-size'); // '16px'
-
-

getURLParameters

-

Returns an object containing the parameters of the current URL.

-

Use match() with an appropriate regular expression to get all key-value pairs, Array.reduce() to map and combine them into a single object. -Pass location.search as the argument to apply to the current url.

-
const getURLParameters = url =>
+
getScrollPosition(); // {x: 0, y: 200}
+

getStyle

Returns the value of a CSS rule for the specified element.

Use Window.getComputedStyle() to get the value of the CSS rule for the specified element.

const getStyle = (el, ruleName) => getComputedStyle(el)[ruleName];
+
getStyle(document.querySelector('p'), 'font-size'); // '16px'
+

getURLParameters

Returns an object containing the parameters of the current URL.

Use match() with an appropriate regular expression to get all key-value pairs, Array.reduce() to map and combine them into a single object. Pass location.search as the argument to apply to the current url.

const getURLParameters = url =>
   url
     .match(/([^?=&]+)(=([^&]*))/g)
     .reduce((a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a), {});
-
-
getURLParameters('http://url.com/page?name=Adam&surname=Smith'); // {name: 'Adam', surname: 'Smith'}
-
-

hasClass

-

Returns true if the element has the specified class, false otherwise.

-

Use element.classList.contains() to check if the element has the specified class.

-
const hasClass = (el, className) => el.classList.contains(className);
-
-
hasClass(document.querySelector('p.special'), 'special'); // true
-
-

hide

-

Hides all the elements specified.

-

Use the spread operator (...) and Array.forEach() to apply display: none to each element specified.

-
const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));
-
-
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page
-
-

httpsRedirect

-

Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn't take it back to the HTTP page as its replaced in the history.

-

Use location.protocol to get the protocol currently being used. If it's not HTTPS, use location.replace() to replace the existing page with the HTTPS version of the page. Use location.href to get the full address, split it with String.split() and remove the protocol part of the URL.

-
const httpsRedirect = () => {
+
getURLParameters('http://url.com/page?name=Adam&surname=Smith'); // {name: 'Adam', surname: 'Smith'}
+

hasClass

Returns true if the element has the specified class, false otherwise.

Use element.classList.contains() to check if the element has the specified class.

const hasClass = (el, className) => el.classList.contains(className);
+
hasClass(document.querySelector('p.special'), 'special'); // true
+

hide

Hides all the elements specified.

Use the spread operator (...) and Array.forEach() to apply display: none to each element specified.

const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));
+
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page
+

httpsRedirect

Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn't take it back to the HTTP page as its replaced in the history.

Use location.protocol to get the protocol currently being used. If it's not HTTPS, use location.replace() to replace the existing page with the HTTPS version of the page. Use location.href to get the full address, split it with String.split() and remove the protocol part of the URL.

const httpsRedirect = () => {
   if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
 };
-
-

redirect

-

Redirects to a specified URL.

-

Use window.location.href or window.location.replace() to redirect to url. -Pass a second argument to simulate a link click (true - default) or an HTTP redirect (false).

-
const redirect = (url, asLink = true) =>
+

redirect

Redirects to a specified URL.

Use window.location.href or window.location.replace() to redirect to url. Pass a second argument to simulate a link click (true - default) or an HTTP redirect (false).

const redirect = (url, asLink = true) =>
   asLink ? (window.location.href = url) : window.location.replace(url);
-
-
redirect('https://google.com');
-
-

scrollToTop

-

Smooth-scrolls to the top of the page.

-

Get distance from top using document.documentElement.scrollTop or document.body.scrollTop. -Scroll by a fraction of the distance from the top. Use window.requestAnimationFrame() to animate the scrolling.

-
const scrollToTop = () => {
+
redirect('https://google.com');
+

scrollToTop

Smooth-scrolls to the top of the page.

Get distance from top using document.documentElement.scrollTop or document.body.scrollTop. Scroll by a fraction of the distance from the top. Use window.requestAnimationFrame() to animate the scrolling.

const scrollToTop = () => {
   const c = document.documentElement.scrollTop || document.body.scrollTop;
   if (c > 0) {
     window.requestAnimationFrame(scrollToTop);
     window.scrollTo(0, c - c / 8);
   }
 };
-
-
scrollToTop();
-
-

setStyle

-

Sets the value of a CSS rule for the specified element.

-

Use element.style to set the value of the CSS rule for the specified element to value.

-
const setStyle = (el, ruleName, value) => (el.style[ruleName] = value);
-
-
setStyle(document.querySelector('p'), 'font-size', '20px'); // The first <p> element on the page will have a font-size of 20px
-
-

show

-

Shows all the elements specified.

-

Use the spread operator (...) and Array.forEach() to clear the display property for each element specified.

-
const show = (...el) => [...el].forEach(e => (e.style.display = ''));
-
-
show(document.querySelectorAll('img')); // Shows all <img> elements on the page
-
-

toggleClass

-

Toggle a class for an element.

-

Use element.classList.toggle() to toggle the specified class for the element.

-
const toggleClass = (el, className) => el.classList.toggle(className);
-
-
toggleClass(document.querySelector('p.special'), 'special'); // The paragraph will not have the 'special' class anymore
-
-

UUIDGeneratorBrowser

-

Generates a UUID in a browser.

-

Use crypto API to generate a UUID, compliant with RFC4122 version 4.

-
const UUIDGeneratorBrowser = () =>
+
scrollToTop();
+

setStyle

Sets the value of a CSS rule for the specified element.

Use element.style to set the value of the CSS rule for the specified element to value.

const setStyle = (el, ruleName, value) => (el.style[ruleName] = value);
+
setStyle(document.querySelector('p'), 'font-size', '20px'); // The first <p> element on the page will have a font-size of 20px
+

show

Shows all the elements specified.

Use the spread operator (...) and Array.forEach() to clear the display property for each element specified.

const show = (...el) => [...el].forEach(e => (e.style.display = ''));
+
show(document.querySelectorAll('img')); // Shows all <img> elements on the page
+

toggleClass

Toggle a class for an element.

Use element.classList.toggle() to toggle the specified class for the element.

const toggleClass = (el, className) => el.classList.toggle(className);
+
toggleClass(document.querySelector('p.special'), 'special'); // The paragraph will not have the 'special' class anymore
+

UUIDGeneratorBrowser

Generates a UUID in a browser.

Use crypto API to generate a UUID, compliant with RFC4122 version 4.

const UUIDGeneratorBrowser = () =>
   ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
     (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
   );
-
-
UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d'
-
-

Date

-

getDaysDiffBetweenDates

-

Returns the difference (in days) between two dates.

-

Calculate the difference (in days) between two Date objects.

-
const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
+
UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d'
+

Date

getDaysDiffBetweenDates

Returns the difference (in days) between two dates.

Calculate the difference (in days) between two Date objects.

const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
   (dateFinal - dateInitial) / (1000 * 3600 * 24);
-
-
getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9
-
-

JSONToDate

-

Converts a JSON object to a date.

-

Use Date(), to convert dates in JSON format to readable format (dd/mm/yyyy).

-
const JSONToDate = arr => {
+
getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9
+

JSONToDate

Converts a JSON object to a date.

Use Date(), to convert dates in JSON format to readable format (dd/mm/yyyy).

const JSONToDate = arr => {
   const dt = new Date(parseInt(arr.toString().substr(6)));
   return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
 };
-
-
JSONToDate(/Date(1489525200000)/); // "14/3/2017"
-
-

toEnglishDate

-

Converts a date from American format to English format.

-

Use Date.toISOString(), split('T') and replace() to convert a date from American format to the English format. -Throws an error if the passed time cannot be converted to a date.

-
const toEnglishDate = time => {
+
JSONToDate(/Date(1489525200000)/); // "14/3/2017"
+

toEnglishDate

Converts a date from American format to English format.

Use Date.toISOString(), split('T') and replace() to convert a date from American format to the English format. Throws an error if the passed time cannot be converted to a date.

const toEnglishDate = time => {
   try {
     return new Date(time)
       .toISOString()
@@ -944,27 +363,15 @@ Throws an error if the passed time cannot be converted to a date.

.replace(/-/g, '/'); } catch (e) {} }; -
-
toEnglishDate('09/21/2010'); // '21/09/2010'
-
-

tomorrow

-

Results in a string representation of tomorrow's date. -Use new Date() to get today's date, adding 86400000 of seconds to it(24 hours), using toISOString to convert Date object to string.

-
const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
-
-
tomorrow(); // 2017-12-27 (if current date is 2017-12-26)
-
-

Function

-

chainAsync

-

Chains asynchronous functions.

-

Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

-
const chainAsync = fns => {
+
toEnglishDate('09/21/2010'); // '21/09/2010'
+

tomorrow

Results in a string representation of tomorrow's date. Use new Date() to get today's date, adding 86400000 of seconds to it(24 hours), using toISOString to convert Date object to string.

const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
+
tomorrow(); // 2017-12-27 (if current date is 2017-12-26)
+

Function

chainAsync

Chains asynchronous functions.

Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

const chainAsync = fns => {
   let curr = 0;
   const next = () => fns[curr++](next);
   next();
 };
-
-
chainAsync([
+
chainAsync([
   next => {
     console.log('0 seconds');
     setTimeout(next, 1000);
@@ -977,277 +384,120 @@ Use new Date() to get today's date, adding 86400000 of
     console.log('2 seconds');
   }
 ]);
-
-

compose

-

Performs right-to-left function composition.

-

Use Array.reduce() to perform right-to-left function composition. -The last (rightmost) function can accept one or more arguments; the remaining functions must be unary.

-
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
-
-
const add5 = x => x + 5;
+

compose

Performs right-to-left function composition.

Use Array.reduce() to perform right-to-left function composition. The last (rightmost) function can accept one or more arguments; the remaining functions must be unary.

const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
+
const add5 = x => x + 5;
 const multiply = (x, y) => x * y;
 const multiplyAndAdd5 = compose(add5, multiply);
 multiplyAndAdd5(5, 2); // 15
-
-

curry

-

Curries a function.

-

Use recursion. -If the number of provided arguments (args) is sufficient, call the passed function fn. -Otherwise, return a curried function fn that expects the rest of the arguments. -If you want to curry a function that accepts a variable number of arguments (a variadic function, e.g. Math.min()), you can optionally pass the number of arguments to the second parameter arity.

-
const curry = (fn, arity = fn.length, ...args) =>
+

curry

Curries a function.

Use recursion. If the number of provided arguments (args) is sufficient, call the passed function fn. Otherwise, return a curried function fn that expects the rest of the arguments. If you want to curry a function that accepts a variable number of arguments (a variadic function, e.g. Math.min()), you can optionally pass the number of arguments to the second parameter arity.

const curry = (fn, arity = fn.length, ...args) =>
   arity <= args.length ? fn(...args) : curry.bind(null, fn, arity, ...args);
-
-
curry(Math.pow)(2)(10); // 1024
+
curry(Math.pow)(2)(10); // 1024
 curry(Math.min, 3)(10)(50)(2); // 2
-
-

functionName

-

Logs the name of a function.

-

Use console.debug() and the name property of the passed method to log the method's name to the debug channel of the console.

-
const functionName = fn => (console.debug(fn.name), fn);
-
-
functionName(Math.max); // max (logged in debug channel of console)
-
-

runPromisesInSeries

-

Runs an array of promises in series.

-

Use Array.reduce() to create a promise chain, where each promise returns the next promise when resolved.

-
const runPromisesInSeries = ps => ps.reduce((p, next) => p.then(next), Promise.resolve());
-
-
const delay = d => new Promise(r => setTimeout(r, d));
+

functionName

Logs the name of a function.

Use console.debug() and the name property of the passed method to log the method's name to the debug channel of the console.

const functionName = fn => (console.debug(fn.name), fn);
+
functionName(Math.max); // max (logged in debug channel of console)
+

runPromisesInSeries

Runs an array of promises in series.

Use Array.reduce() to create a promise chain, where each promise returns the next promise when resolved.

const runPromisesInSeries = ps => ps.reduce((p, next) => p.then(next), Promise.resolve());
+
const delay = d => new Promise(r => setTimeout(r, d));
 runPromisesInSeries([() => delay(1000), () => delay(2000)]); // //executes each promise sequentially, taking a total of 3 seconds to complete
-
-

sleep

-

Delays the execution of an asynchronous function.

-

Delay executing part of an async function, by putting it to sleep, returning a Promise.

-
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
-
-
async function sleepyWork() {
+

sleep

Delays the execution of an asynchronous function.

Delay executing part of an async function, by putting it to sleep, returning a Promise.

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
+
async function sleepyWork() {
   console.log("I'm going to sleep for 1 second.");
   await sleep(1000);
   console.log('I woke up after 1 second.');
 }
-
-

Logic

-

negate

-

Negates a predicate function.

-

Take a predicate function and apply not to it with its arguments.

-
const negate = func => (...args) => !func(...args);
-
-
filter([1, 2, 3, 4, 5, 6], negate(isEven)); // [1, 3, 5]
+

Logic

negate

Negates a predicate function.

Take a predicate function and apply not to it with its arguments.

const negate = func => (...args) => !func(...args);
+
filter([1, 2, 3, 4, 5, 6], negate(isEven)); // [1, 3, 5]
 negate(isOdd)(1); // false
-
-

Math

-

average

-

Returns the average of an of two or more numbers/arrays.

-

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 = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
-
-
average([1, 2, 3]); // 2
-
-

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
+

Math

average

Returns the average of an of two or more numbers/arrays.

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 = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
+
average([1, 2, 3]); // 2
+

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
 clampNumber(3, 2, 4); // 3
-
-

collatz

-

Applies the Collatz algorithm.

-

If n is even, return n/2. Otherwise, return 3n+1.

-
const collatz = n => (n % 2 == 0 ? n / 2 : 3 * n + 1);
-
-
collatz(8); // 4
+

collatz

Applies the Collatz algorithm.

If n is even, return n/2. Otherwise, return 3n+1.

const collatz = n => (n % 2 == 0 ? n / 2 : 3 * n + 1);
+
collatz(8); // 4
 collatz(5); // 16
-
-

digitize

-

Converts a number to an array of digits.

-

Convert the number to a string, using spread operators in ES6([...string]) 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);
-
-
distance(1, 1, 2, 3); // 2.23606797749979
-
-

factorial

-

Calculates the factorial of a number.

-

Use recursion. -If n is less than or equal to 1, return 1. -Otherwise, return the product of n and the factorial of n - 1. -Throws an exception if n is a negative number.

-
const factorial = n =>
+

digitize

Converts a number to an array of digits.

Convert the number to a string, using spread operators in ES6([...string]) 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);
+
distance(1, 1, 2, 3); // 2.23606797749979
+

factorial

Calculates the factorial of a number.

Use recursion. If n is less than or equal to 1, return 1. Otherwise, return the product of n and the factorial of n - 1. Throws an exception if n is a negative number.

const factorial = n =>
   n < 0
     ? (() => {
         throw new TypeError('Negative numbers are not allowed!');
       })()
     : n <= 1 ? 1 : n * factorial(n - 1);
-
-
factorial(6); // 720
-
-

fibonacci

-

Generates an array, containing the Fibonacci sequence, up until the nth term.

-

Create an empty array of the specific length, initializing the first two values (0 and 1). -Use Array.reduce() to add values into the array, using the sum of the last two values, except for the first two.

-
const fibonacci = n =>
+
factorial(6); // 720
+

fibonacci

Generates an array, containing the Fibonacci sequence, up until the nth term.

Create an empty array of the specific length, initializing the first two values (0 and 1). Use Array.reduce() to add values into the array, using the sum of the last two values, except for the first two.

const fibonacci = n =>
   Array.from({ length: n }).reduce(
     (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
     []
   );
-
-
fibonacci(6); // 720
-
-

fibonacciCountUntilNum

-

Returns the number of fibonnacci numbers up to num(0 and num inclusive).

-

Use a mathematical formula to calculate the number of fibonacci numbers until num.

-
const fibonacciCountUntilNum = num =>
+
fibonacci(6); // 720
+

fibonacciCountUntilNum

Returns the number of fibonnacci numbers up to num(0 and num inclusive).

Use a mathematical formula to calculate the number of fibonacci numbers until num.

const fibonacciCountUntilNum = num =>
   Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));
-
-
fibonacciCountUntilNum(10); // 7
-
-

fibonacciUntilNum

-

Generates an array, containing the Fibonacci sequence, up until the nth term.

-

Create an empty array of the specific length, initializing the first two values (0 and 1). -Use Array.reduce() to add values into the array, using the sum of the last two values, except for the first two. -Uses a mathematical formula to calculate the length of the array required.

-
const fibonacciUntilNum = num => {
+
fibonacciCountUntilNum(10); // 7
+

fibonacciUntilNum

Generates an array, containing the Fibonacci sequence, up until the nth term.

Create an empty array of the specific length, initializing the first two values (0 and 1). Use Array.reduce() to add values into the array, using the sum of the last two values, except for the first two. Uses a mathematical formula to calculate the length of the array required.

const fibonacciUntilNum = num => {
   let n = Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));
   return Array.from({ length: n }).reduce(
     (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
     []
   );
 };
-
-
fibonacciCountUntilNum(10); // 7
-
-

gcd

-

Calculates the greatest common divisor between two or more numbers/arrays.

-

The helperGcdfunction uses recursion. -Base case is when y equals 0. In this case, return x. -Otherwise, return the GCD of y and the remainder of the division x/y.

-
const gcd = (...arr) => {
+
fibonacciCountUntilNum(10); // 7
+

gcd

Calculates the greatest common divisor between two or more numbers/arrays.

The helperGcdfunction uses recursion. Base case is when y equals 0. In this case, return x. Otherwise, return the GCD of y and the remainder of the division x/y.

const gcd = (...arr) => {
   let data = [].concat(...arr);
   const helperGcd = (x, y) => (!y ? x : gcd(y, x % y));
   return data.reduce((a, b) => helperGcd(a, b));
 };
-
-
gcd(8, 36); // 4
-
-

hammingDistance

-

Calculates the Hamming distance between two values.

-

Use XOR operator (^) to find the bit difference between the two numbers, convert to a binary string using toString(2). -Count and return the number of 1s in the string, using match(/1/g).

-
const hammingDistance = (num1, num2) => ((num1 ^ num2).toString(2).match(/1/g) || '').length;
-
-
hammingDistance(2, 3); // 1
-
-

inRange

-

Checks if the given number falls within the given range.

-

Use arithmetic comparison to check if the given number is in the specified range. -If the second parameter, end, is not specified, the range is considered to be from 0 to start.

-
const inRange = (n, start, end = null) => {
+
gcd(8, 36); // 4
+

hammingDistance

Calculates the Hamming distance between two values.

Use XOR operator (^) to find the bit difference between the two numbers, convert to a binary string using toString(2). Count and return the number of 1s in the string, using match(/1/g).

const hammingDistance = (num1, num2) => ((num1 ^ num2).toString(2).match(/1/g) || '').length;
+
hammingDistance(2, 3); // 1
+

inRange

Checks if the given number falls within the given range.

Use arithmetic comparison to check if the given number is in the specified range. If the second parameter, end, is not specified, the range is considered to be from 0 to start.

const inRange = (n, start, end = null) => {
   if (end && start > end) end = [start, (start = end)][0];
   return end == null ? n >= 0 && n < start : n >= start && n < end;
 };
-
-
inRange(3, 2, 5); // true
+
inRange(3, 2, 5); // true
 inRange(3, 4); // true
 inRange(2, 3, 5); // false
 inrange(3, 2); // false
-
-

isArmstrongNumber

-

Checks if the given number is an Armstrong number or not.

-

Convert the given number into an array of digits. Use Math.pow() to get the appropriate power for each digit and sum them up. If the sum is equal to the number itself, return true otherwise false.

-
const isArmstrongNumber = digits =>
+

isArmstrongNumber

Checks if the given number is an Armstrong number or not.

Convert the given number into an array of digits. Use Math.pow() to get the appropriate power for each digit and sum them up. If the sum is equal to the number itself, return true otherwise false.

const isArmstrongNumber = digits =>
   (arr => arr.reduce((a, d) => a + Math.pow(parseInt(d), arr.length), 0) == digits)(
     (digits + '').split('')
   );
-
-
isArmstrongNumber(1634); // true
+
isArmstrongNumber(1634); // true
 isArmstrongNumber(371); // true
 isArmstrongNumber(56); // false
-
-

isDivisible

-

Checks if the first numeric argument is divisible by the second one.

-

Use the modulo operator (%) to check if the remainder is equal to 0.

-
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
-
-
isDivisible(6, 3); // true
-
-

isEven

-

Returns true if the given number is even, false otherwise.

-

Checks whether a number is odd or even using the modulo (%) operator. -Returns true if the number is even, false if the number is odd.

-
const isEven = num => num % 2 === 0;
-
-
isEven(3); // false
-
-

isPrime

-

Checks if the provided integer is a prime number.

-

Check numbers from 2 to the square root of the given number. -Return false if any of them divides the given number, else return true, unless the number is less than 2.

-
const isPrime = num => {
+

isDivisible

Checks if the first numeric argument is divisible by the second one.

Use the modulo operator (%) to check if the remainder is equal to 0.

const isDivisible = (dividend, divisor) => dividend % divisor === 0;
+
isDivisible(6, 3); // true
+

isEven

Returns true if the given number is even, false otherwise.

Checks whether a number is odd or even using the modulo (%) operator. Returns true if the number is even, false if the number is odd.

const isEven = num => num % 2 === 0;
+
isEven(3); // false
+

isPrime

Checks if the provided integer is a prime number.

Check numbers from 2 to the square root of the given number. Return false if any of them divides the given number, else return true, unless the number is less than 2.

const isPrime = num => {
   const boundary = Math.floor(Math.sqrt(num));
   for (var i = 2; i * i <= boundary; i++) if (num % i == 0) return false;
   return num >= 2;
 };
-
-
isPrime(11); // true
+
isPrime(11); // true
 isPrime(12); // false
-
-

lcm

-

Returns the least common multiple of two or numbers/arrays.

-

Use the greatest common divisor (GCD) formula and Math.abs() to determine the least common multiple. -The GCD formula uses recursion.

-
const lcm = (...arr) => {
+

lcm

Returns the least common multiple of two or numbers/arrays.

Use the greatest common divisor (GCD) formula and Math.abs() to determine the least common multiple. The GCD formula uses recursion.

const lcm = (...arr) => {
   let data = [].concat(...arr);
   const gcd = (x, y) => (!y ? x : gcd(y, x % y));
   const helperLcm = (x, y) => x * y / gcd(x, y);
   return arr.reduce((a, b) => helperLcm(a, b));
 };
-
-
lcm(12, 7); // 84
+
lcm(12, 7); // 84
 lcm([1, 3, 4], 5); // 60
-
-

max

-

Returns the maximum value out of two or more numbers/arrays.

-

Use Math.max() combined with the spread operator (...) to get the maximum value in the array.

-
const max = (...arr) => Math.max(...[].concat(...arr));
-
-
max([10, 1, 5]); // 10
-
-

median

-

Returns the median of an array of numbers.

-

Find the middle of the array, use Array.sort() to sort the values. -Return the number at the midpoint if length is odd, otherwise the average of the two middle numbers.

-
const median = arr => {
+

max

Returns the maximum value out of two or more numbers/arrays.

Use Math.max() combined with the spread operator (...) to get the maximum value in the array.

const max = (...arr) => Math.max(...[].concat(...arr));
+
max([10, 1, 5]); // 10
+

median

Returns the median of an array of numbers.

Find the middle of the array, use Array.sort() to sort the values. Return the number at the midpoint if length is odd, otherwise the average of the two middle numbers.

const median = arr => {
   const mid = Math.floor(arr.length / 2),
     nums = [...arr].sort((a, b) => a - b);
   return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
 };
-
-
median([5, 6, 50, 1, -5]); // 5
+
median([5, 6, 50, 1, -5]); // 5
 median([0, 10, -2, 7]); // 3.5
-
-

min

-

Returns the minimum value in an array.

-

Use Math.min() combined with the spread operator (...) to get the minimum value in the array.

-
const min = arr => Math.min(...[].concat(...arr));
-
-
min([10, 1, 5]); // 1
-
-

palindrome

-

Returns true if the given string is a palindrome, false otherwise.

-

Convert string toLowerCase() and use replace() to remove non-alphanumeric characters from it. -Then, split('') into individual characters, reverse(), join('') and compare to the original, unreversed string, after converting it tolowerCase().

-
const palindrome = str => {
+

min

Returns the minimum value in an array.

Use Math.min() combined with the spread operator (...) to get the minimum value in the array.

const min = arr => Math.min(...[].concat(...arr));
+
min([10, 1, 5]); // 1
+

palindrome

Returns true if the given string is a palindrome, false otherwise.

Convert string toLowerCase() and use replace() to remove non-alphanumeric characters from it. Then, split('') into individual characters, reverse(), join('') and compare to the original, unreversed string, after converting it tolowerCase().

const palindrome = str => {
   const s = str.toLowerCase().replace(/[\W_]/g, '');
   return (
     s ===
@@ -1257,65 +507,27 @@ Then, split('') into individual characters, reverse(),
       .join('')
   );
 };
-
-
palindrome('taco cat'); // true
-
-

percentile

-

Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.

-

Use Array.reduce() to calculate how many numbers are below the value and how many are the same value and apply the percentile formula.

-
const percentile = (arr, val) =>
+
palindrome('taco cat'); // true
+

percentile

Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.

Use Array.reduce() to calculate how many numbers are below the value and how many are the same value and apply the percentile formula.

const percentile = (arr, val) =>
   100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0) / arr.length;
-
-
percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6); // 55
-
-

powerset

-

Returns the powerset of a given array of numbers.

-

Use Array.reduce() combined with Array.map() to iterate over elements and combine into an array containing all combinations.

-
const powerset = arr => arr.reduce((a, v) => a.concat(a.map(r => [v].concat(r))), [[]]);
-
-
powerset([1, 2]); // [[], [1], [2], [2,1]]
-
-

primes

-

Generates primes up to a given number, using the Sieve of Eratosthenes.

-

Generate an array from 2 to the given number. Use Array.filter() to filter out the values divisible by any number from 2 to the square root of the provided number.

-
const primes = num => {
+
percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6); // 55
+

powerset

Returns the powerset of a given array of numbers.

Use Array.reduce() combined with Array.map() to iterate over elements and combine into an array containing all combinations.

const powerset = arr => arr.reduce((a, v) => a.concat(a.map(r => [v].concat(r))), [[]]);
+
powerset([1, 2]); // [[], [1], [2], [2,1]]
+

primes

Generates primes up to a given number, using the Sieve of Eratosthenes.

Generate an array from 2 to the given number. Use Array.filter() to filter out the values divisible by any number from 2 to the square root of the provided number.

const primes = num => {
   let arr = Array.from({ length: num - 1 }).map((x, i) => i + 2),
     sqroot = Math.floor(Math.sqrt(num)),
     numsTillSqroot = Array.from({ length: sqroot - 1 }).map((x, i) => i + 2);
   numsTillSqroot.forEach(x => (arr = arr.filter(y => y % x !== 0 || y == x)));
   return arr;
 };
-
-
primes(10); // [2,3,5,7]
-
-

randomIntegerInRange

-

Returns a random integer in the specified range.

-

Use Math.random() to generate a random number and map it to the desired range, using Math.floor() to make it an integer.

-
const randomIntegerInRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
-
-
randomIntegerInRange(0, 5); // 2
-
-

randomNumberInRange

-

Returns a random number in the specified range.

-

Use Math.random() to generate a random value, map it to the desired range using multiplication.

-
const randomNumberInRange = (min, max) => Math.random() * (max - min) + min;
-
-
randomNumberInRange(2, 10); // 6.0211363285087005
-
-

round

-

Rounds a number to a specified amount of digits.

-

Use Math.round() and template literals to round the number to the specified number of digits. -Omit the second argument, decimals to round to an integer.

-
const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`);
-
-
round(1.005, 2); // 1.01
-
-

standardDeviation

-

Returns the standard deviation of an array of numbers.

-

Use Array.reduce() to calculate the mean, variance and the sum of the variance of the values, the variance of the values, then -determine the standard deviation. -You can omit the second argument to get the sample standard deviation or set it to true to get the population standard deviation.

-
const standardDeviation = (arr, usePopulation = false) => {
+
primes(10); // [2,3,5,7]
+

randomIntegerInRange

Returns a random integer in the specified range.

Use Math.random() to generate a random number and map it to the desired range, using Math.floor() to make it an integer.

const randomIntegerInRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
+
randomIntegerInRange(0, 5); // 2
+

randomNumberInRange

Returns a random number in the specified range.

Use Math.random() to generate a random value, map it to the desired range using multiplication.

const randomNumberInRange = (min, max) => Math.random() * (max - min) + min;
+
randomNumberInRange(2, 10); // 6.0211363285087005
+

round

Rounds a number to a specified amount of digits.

Use Math.round() and template literals to round the number to the specified number of digits. Omit the second argument, decimals to round to an integer.

const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`);
+
round(1.005, 2); // 1.01
+

standardDeviation

Returns the standard deviation of an array of numbers.

Use Array.reduce() to calculate the mean, variance and the sum of the variance of the values, the variance of the values, then determine the standard deviation. You can omit the second argument to get the sample standard deviation or set it to true to get the population standard deviation.

const standardDeviation = (arr, usePopulation = false) => {
   const mean = arr.reduce((acc, val) => acc + val, 0) / arr.length;
   return Math.sqrt(
     arr
@@ -1324,54 +536,27 @@ You can omit the second argument to get the sample standard deviation or set it
       (arr.length - (usePopulation ? 0 : 1))
   );
 };
-
-
standardDeviation([10, 2, 38, 23, 38, 23, 21]); // 13.284434142114991 (sample)
+
standardDeviation([10, 2, 38, 23, 38, 23, 21]); // 13.284434142114991 (sample)
 standardDeviation([10, 2, 38, 23, 38, 23, 21], true); // 12.29899614287479 (population)
-
-

sum

-

Returns the sum of an of two or more numbers/arrays.

-

Use Array.reduce() to add each value to an accumulator, initialized with a value of 0.

-
const sum = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0);
-
-
sum([1, 2, 3, 4]); // 10
-
-

Media

-

speechSynthesis

-

Performs speech synthesis (experimental).

-

Use SpeechSynthesisUtterance.voice and window.speechSynthesis.getVoices() to convert a message to speech. -Use window.speechSynthesis.speak() to play the message.

-

Learn more about the SpeechSynthesisUtterance interface of the Web Speech API.

-
const speechSynthesis = message => {
+

sum

Returns the sum of an of two or more numbers/arrays.

Use Array.reduce() to add each value to an accumulator, initialized with a value of 0.

const sum = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0);
+
sum([1, 2, 3, 4]); // 10
+

Media

speechSynthesis

Performs speech synthesis (experimental).

Use SpeechSynthesisUtterance.voice and window.speechSynthesis.getVoices() to convert a message to speech. Use window.speechSynthesis.speak() to play the message.

Learn more about the SpeechSynthesisUtterance interface of the Web Speech API.

const speechSynthesis = message => {
   const msg = new SpeechSynthesisUtterance(message);
   msg.voice = window.speechSynthesis.getVoices()[0];
   window.speechSynthesis.speak(msg);
 };
-
-
speechSynthesis('Hello, World'); // // plays the message
-
-

Node

-

JSONToFile

-

Writes a JSON object to a file.

-

Use fs.writeFile(), template literals and JSON.stringify() to write a json object to a .json file.

-
const fs = require('fs');
+
speechSynthesis('Hello, World'); // // plays the message
+

Node

JSONToFile

Writes a JSON object to a file.

Use fs.writeFile(), template literals and JSON.stringify() to write a json object to a .json file.

const fs = require('fs');
 const JSONToFile = (obj, filename) =>
   fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
-
-
JSONToFile({ test: 'is passed' }, 'testJsonFile'); // writes the object to 'testJsonFile.json'
-
-

readFileLines

-

Returns an array of lines from the specified file.

-

Use readFileSync function in fs node package to create a Buffer from a file. -convert buffer to string using toString(encoding) function. -creating an array from contents of file by spliting file content line by line (each \n).

-
const fs = require('fs');
+
JSONToFile({ test: 'is passed' }, 'testJsonFile'); // writes the object to 'testJsonFile.json'
+

readFileLines

Returns an array of lines from the specified file.

Use readFileSync function in fs node package to create a Buffer from a file. convert buffer to string using toString(encoding) function. creating an array from contents of file by spliting file content line by line (each \n).

const fs = require('fs');
 const readFileLines = filename =>
   fs
     .readFileSync(filename)
     .toString('UTF8')
     .split('\n');
-
-
/*
+
/*
 contents of test.txt :
   line1
   line2
@@ -1380,24 +565,13 @@ contents of test.txt :
 */
 let arr = readFileLines('test.txt');
 console.log(arr); // ['line1', 'line2', 'line3']
-
-

UUIDGeneratorNode

-

Generates a UUID in Node.JS.

-

Use crypto API to generate a UUID, compliant with RFC4122 version 4.

-
const crypto = require('crypto');
+

UUIDGeneratorNode

Generates a UUID in Node.JS.

Use crypto API to generate a UUID, compliant with RFC4122 version 4.

const crypto = require('crypto');
 const UUIDGeneratorNode = () =>
   ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
     (c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
   );
-
-
UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
-
-

Object

-

cleanObj

-

Removes any properties except the ones specified from a JSON object.

-

Use Object.keys() method to loop over given JSON object and deleting keys that are not included in given array. -Also if you give it a special key (childIndicator) it will search deeply inside it to apply function to inner objects too.

-
const cleanObj = (obj, keysToKeep = [], childIndicator) => {
+
UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
+

Object

cleanObj

Removes any properties except the ones specified from a JSON object.

Use Object.keys() method to loop over given JSON object and deleting keys that are not included in given array. Also if you give it a special key (childIndicator) it will search deeply inside it to apply function to inner objects too.

const cleanObj = (obj, keysToKeep = [], childIndicator) => {
   Object.keys(obj).forEach(key => {
     if (key === childIndicator) {
       cleanObj(obj[key], keysToKeep, childIndicator);
@@ -1407,42 +581,20 @@ Also if you give it a special key (childIndicator) it will search d
   });
   return obj;
 };
-
-
const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } };
+
const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } };
 cleanObj(testObj, ['a'], 'children'); // { a: 1, children : { a: 1}}
-
-

lowercaseKeys

-

Creates a new object from the specified object, where all the keys are in lowercase.

-

Use Object.keys() and Array.reduce() to create a new object from the specified object. -Convert each key in the original object to lowercase, using String.toLowerCase().

-
const lowercaseKeys = obj =>
+

lowercaseKeys

Creates a new object from the specified object, where all the keys are in lowercase.

Use Object.keys() and Array.reduce() to create a new object from the specified object. Convert each key in the original object to lowercase, using String.toLowerCase().

const lowercaseKeys = obj =>
   Object.keys(obj).reduce((acc, key) => {
     acc[key.toLowerCase()] = obj[key];
     return acc;
   }, {});
-
-
const myObj = { Name: 'Adam', sUrnAME: 'Smith' };
+
const myObj = { Name: 'Adam', sUrnAME: 'Smith' };
 const myObjLower = lowercaseKeys(myObj); // {name: 'Adam', surname: 'Smith'};
-
-

objectFromPairs

-

Creates an object from the given key-value pairs.

-

Use Array.reduce() to create and combine key-value pairs.

-
const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {});
-
-
objectFromPairs([['a', 1], ['b', 2]]); // {a: 1, b: 2}
-
-

objectToPairs

-

Creates an array of key-value pair arrays from an object.

-

Use Object.keys() and Array.map() to iterate over the object's keys and produce an array with key-value pairs.

-
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
-
-
objectToPairs({ a: 1, b: 2 }); // [['a',1],['b',2]])
-
-

orderBy

-

Returns a sorted array of objects ordered by properties and orders.

-

Uses a custom implementation of sort, that reduces the props array argument with a default value of 0, it uses destructuring to swap the properties position depending on the order passed. -If no orders array is passed it sort by 'asc' by default.

-
const orderBy = (arr, props, orders) =>
+

objectFromPairs

Creates an object from the given key-value pairs.

Use Array.reduce() to create and combine key-value pairs.

const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {});
+
objectFromPairs([['a', 1], ['b', 2]]); // {a: 1, b: 2}
+

objectToPairs

Creates an array of key-value pair arrays from an object.

Use Object.keys() and Array.map() to iterate over the object's keys and produce an array with key-value pairs.

const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
+
objectToPairs({ a: 1, b: 2 }); // [['a',1],['b',2]])
+

orderBy

Returns a sorted array of objects ordered by properties and orders.

Uses a custom implementation of sort, that reduces the props array argument with a default value of 0, it uses destructuring to swap the properties position depending on the order passed. If no orders array is passed it sort by 'asc' by default.

const orderBy = (arr, props, orders) =>
   [...arr].sort((a, b) =>
     props.reduce((acc, prop, i) => {
       if (acc === 0) {
@@ -1452,8 +604,7 @@ If no orders array is passed it sort by 'asc' by default.

return acc; }, 0) ); -
-
const users = [
+
const users = [
   { name: 'fred', age: 48 },
   { name: 'barney', age: 36 },
   { name: 'fred', age: 40 },
@@ -1461,40 +612,17 @@ If no orders array is passed it sort by 'asc' by default.

]; orderBy(users, ['name', 'age'], ['asc', 'desc']); // [{name: 'barney', age: 36}, {name: 'barney', age: 34}, {name: 'fred', age: 48}, {name: 'fred', age: 40}] orderBy(users, ['name', 'age']); // [{name: 'barney', age: 34}, {name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}] -
-

select

-

Retrieve a property that indicated by the selector from an object.

-

If the property does not exists returns undefined.

-
const select = (from, selector) =>
+

select

Retrieve a property that indicated by the selector from an object.

If the property does not exists returns undefined.

const select = (from, selector) =>
   selector.split('.').reduce((prev, cur) => prev && prev[cur], from);
-
-
const obj = { selector: { to: { val: 'val to select' } } };
+
const obj = { selector: { to: { val: 'val to select' } } };
 select(obj, 'selector.to.val'); // 'val to select'
-
-

shallowClone

-

Creates a shallow clone of an object.

-

Use Object.assign() and an empty object ({}) to create a shallow clone of the original.

-
const shallowClone = obj => Object.assign({}, obj);
-
-
const a = { x: true, y: 1 };
+

shallowClone

Creates a shallow clone of an object.

Use Object.assign() and an empty object ({}) to create a shallow clone of the original.

const shallowClone = obj => Object.assign({}, obj);
+
const a = { x: true, y: 1 };
 const b = shallowClone(a);
 a === b; // false
-
-

truthCheckCollection

-

Checks if the predicate (second argument) is truthy on all elements of a collection (first argument).

-

Use Array.every() to check if each passed object has the specified property and if it returns a truthy value.

-
const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]);
-
-
truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'); // true
-
-

String

-

anagrams

-

Generates all anagrams of a string (contains duplicates).

-

Use recursion. -For each letter in the given string, create all the partial anagrams for the rest of its letters. -Use Array.map() to combine the letter with each partial anagram, then Array.reduce() to combine all anagrams in one array. -Base cases are for string length equal to 2 or 1.

-
const anagrams = str => {
+

truthCheckCollection

Checks if the predicate (second argument) is truthy on all elements of a collection (first argument).

Use Array.every() to check if each passed object has the specified property and if it returns a truthy value.

const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]);
+
truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'); // true
+

String

anagrams

Generates all anagrams of a string (contains duplicates).

Use recursion. For each letter in the given string, create all the partial anagrams for the rest of its letters. Use Array.map() to combine the letter with each partial anagram, then Array.reduce() to combine all anagrams in one array. Base cases are for string length equal to 2 or 1.

const anagrams = str => {
   if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
   return str
     .split('')
@@ -1504,38 +632,17 @@ Base cases are for string length equal to 2 or 1
       []
     );
 };
-
-
anagrams('abc'); // ['abc','acb','bac','bca','cab','cba']
-
-

Capitalize

-

Capitalizes the first letter of a string.

-

Use destructuring and toUpperCase() to capitalize first letter, ...rest to get array of characters after first letter and then Array.join('') to make it a string again. -Omit the lowerRest parameter to keep the rest of the string intact, or set it to true to convert to lowercase.

-
const capitalize = ([first, ...rest], lowerRest = false) =>
+
anagrams('abc'); // ['abc','acb','bac','bca','cab','cba']
+

Capitalize

Capitalizes the first letter of a string.

Use destructuring and toUpperCase() to capitalize first letter, ...rest to get array of characters after first letter and then Array.join('') to make it a string again. Omit the lowerRest parameter to keep the rest of the string intact, or set it to true to convert to lowercase.

const capitalize = ([first, ...rest], lowerRest = false) =>
   first.toUpperCase() + (lowerRest ? rest.join('').toLowerCase() : rest.join(''));
-
-
capitalize('fooBar'); // 'FooBar'
+
capitalize('fooBar'); // 'FooBar'
 capitalize('fooBar', true); // 'Foobar'
-
-

capitalizeEveryWord

-

Capitalizes the first letter of every word in a string.

-

Use replace() to match the first character of each word and toUpperCase() to capitalize it.

-
const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
-
-
capitalizeEveryWord('hello world!'); // 'Hello World!'
-
-

countVowels

-

Retuns number of vowels in provided string.

-

Use a regular expression to count the number of vowels (A, E, I, O, U) in a string.

-
const countVowels = str => (str.match(/[aeiou]/gi) || []).length;
-
-
countVowels('foobar'); // 3
+

capitalizeEveryWord

Capitalizes the first letter of every word in a string.

Use replace() to match the first character of each word and toUpperCase() to capitalize it.

const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase());
+
capitalizeEveryWord('hello world!'); // 'Hello World!'
+

countVowels

Retuns number of vowels in provided string.

Use a regular expression to count the number of vowels (A, E, I, O, U) in a string.

const countVowels = str => (str.match(/[aeiou]/gi) || []).length;
+
countVowels('foobar'); // 3
 countVowels('gym'); // 0
-
-

escapeHTML

-

Escapes a string for use in HTML.

-

Use String.replace() with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object).

-
const escapeHTML = str =>
+

escapeHTML

Escapes a string for use in HTML.

Use String.replace() with a regex that matches the characters that need to be escaped, using a callback function to replace each character instance with its associated escaped character using a dictionary (object).

const escapeHTML = str =>
   str.replace(
     /[&<>'"]/g,
     tag =>
@@ -1547,75 +654,37 @@ countVowels('gym'); // 0
         '"': '&quot;'
       }[tag] || tag)
   );
-
-
escapeHTML('<a href="#">Me & you</a>'); // '&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'
-
-

escapeRegExp

-

Escapes a string to use in a regular expression.

-

Use replace() to escape special characters.

-
const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
-
-
escapeRegExp('(test)'); // \\(test\\)
-
-

fromCamelCase

-

Converts a string from camelcase.

-

Use replace() to remove underscores, hyphens, and spaces and convert words to camelcase. -Omit the second argument to use a default separator of _.

-
const fromCamelCase = (str, separator = '_') =>
+
escapeHTML('<a href="#">Me & you</a>'); // '&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'
+

escapeRegExp

Escapes a string to use in a regular expression.

Use replace() to escape special characters.

const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+
escapeRegExp('(test)'); // \\(test\\)
+

fromCamelCase

Converts a string from camelcase.

Use replace() to remove underscores, hyphens, and spaces and convert words to camelcase. Omit the second argument to use a default separator of _.

const fromCamelCase = (str, separator = '_') =>
   str
     .replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2')
     .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2')
     .toLowerCase();
-
-
fromCamelCase('someDatabaseFieldName', ' '); // 'some database field name'
+
fromCamelCase('someDatabaseFieldName', ' '); // 'some database field name'
 fromCamelCase('someLabelThatNeedsToBeCamelized', '-'); // 'some-label-that-needs-to-be-camelized'
 fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property'
-
-

repeatString

-

Repeats a string n times using String.repeat()

-

If no string is provided the default is "" and the default number of times is 2.

-
const repeatString = (str = '', num = 2) => {
+

repeatString

Repeats a string n times using String.repeat()

If no string is provided the default is "" and the default number of times is 2.

const repeatString = (str = '', num = 2) => {
   return num >= 0 ? str.repeat(num) : str;
 };
-
-
repeatString('abc', 3); // 'abcabcabc'
+
repeatString('abc', 3); // 'abcabcabc'
 repeatString('abc'); // 'abcabc'
-
-

reverseString

-

Reverses a string.

-

Use split('') and Array.reverse() to reverse the order of the characters in the string. -Combine characters to get a string using join('').

-
const reverseString = str =>
+

reverseString

Reverses a string.

Use split('') and Array.reverse() to reverse the order of the characters in the string. Combine characters to get a string using join('').

const reverseString = str =>
   str
     .split('')
     .reverse()
     .join('');
-
-
reverseString('foobar'); // 'raboof'
-
-

sortCharactersInString

-

Alphabetically sorts the characters in a string.

-

Split the string using split(''), Array.sort() utilizing localeCompare(), recombine using join('').

-
const sortCharactersInString = str =>
+
reverseString('foobar'); // 'raboof'
+

sortCharactersInString

Alphabetically sorts the characters in a string.

Split the string using split(''), Array.sort() utilizing localeCompare(), recombine using join('').

const sortCharactersInString = str =>
   str
     .split('')
     .sort((a, b) => a.localeCompare(b))
     .join('');
-
-
sortCharactersInString('cabbage'); // 'aabbceg'
-
-

splitLines

-

Splits a multiline string into an array of lines.

-

Use String.split() and a regular expression to match line breaks and create an array.

-
const splitLines = str => str.split(/\r?\n/);
-
-
splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
-
-

toCamelCase

-

Converts a string to camelcase.

-

Break the string into words and combine them capitalizing the first letter of each word. -For more detailed explanation of this Regex, visit this Site.

-
const toCamelCase = str => {
+
sortCharactersInString('cabbage'); // 'aabbceg'
+

splitLines

Splits a multiline string into an array of lines.

Use String.split() and a regular expression to match line breaks and create an array.

const splitLines = str => str.split(/\r?\n/);
+
splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
+

toCamelCase



toKebabCase

Converts a string to kebab case.

Break the string into words and combine them using - as a separator. For more detailed explanation of this Regex, visit this Site.

const toKebabCase = str =>
   str &&
   str
     .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
     .map(x => x.toLowerCase())
     .join('-');
-
-
toKebabCase('camelCase'); // 'camel-case'
+
toKebabCase('camelCase'); // 'camel-case'
 toKebabCase('some text'); // 'some-text'
 toKebabCase('some-mixed_string With spaces_underscores-and-hyphens'); // 'some-mixed-string-with-spaces-underscores-and-hyphens'
 toKebabCase('AllThe-small Things'); // "all-the-small-things"
 toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); // "i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-xml-and-html"
-
-

toSnakeCase

-

Converts a string to snake case.

-

Break the string into words and combine them using _ as a separator. -For more detailed explanation of this Regex, visit this Site.

-
const toSnakeCase = str => {
+

toSnakeCase

Converts a string to snake case.

Break the string into words and combine them using _ as a separator. For more detailed explanation of this Regex, visit this Site.

const toSnakeCase = str => {
   str &&
     str
       .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
       .map(x => x.toLowerCase())
       .join('_');
 };
-
-
toSnakeCase('camelCase'); // 'camel_case'
+
toSnakeCase('camelCase'); // 'camel_case'
 toSnakeCase('some text'); // 'some_text'
 toSnakeCase('some-javascript-property'); // 'some_javascript_property'
 toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'); // 'some_mixed_string_with_spaces_underscores_and_hyphens'
 toSnakeCase('AllThe-small Things'); // "all_the_smal_things"
 toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); // "i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"
-
-

truncateString

-

Truncates a string up to a specified length.

-

Determine if the string's length is greater than num. -Return the string truncated to the desired length, with ... appended to the end or the original string.

-
const truncateString = (str, num) =>
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. Return the string truncated to the desired length, with ... appended to the end or the original string.

const truncateString = (str, num) =>
   str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
-
-
truncateString('boomerang', 7); // 'boom...'
-
-

unescapeHTML

-

Unescapes escaped HTML characters.

-

Use String.replace() with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).

-
const unescapeHTML = str =>
+
truncateString('boomerang', 7); // 'boom...'
+

unescapeHTML

Unescapes escaped HTML characters.

Use String.replace() with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).

const unescapeHTML = str =>
   str.replace(
     /&amp;|&lt;|&gt;|&#39;|&quot;/g,
     tag =>
@@ -1690,61 +736,28 @@ Return the string truncated to the desired length, with ... appende
         '&quot;': '"'
       }[tag] || tag)
   );
-
-
unescapeHTML('&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'); // '<a href="#">Me & you</a>'
-
-

words

-

Converts a given string into an array of words.

-

Use String.split() with a supplied pattern (defaults to non-alpha as a regex) to convert to an array of strings. Use Array.filter() to remove any empty strings. -Omit the second argument to use the default regex.

-
const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
-
-
words('I love javaScript!!'); // ["I", "love", "javaScript"]
+
unescapeHTML('&lt;a href=&quot;#&quot;&gt;Me &amp; you&lt;/a&gt;'); // '<a href="#">Me & you</a>'
+

words

Converts a given string into an array of words.

Use String.split() with a supplied pattern (defaults to non-alpha as a regex) to convert to an array of strings. Use Array.filter() to remove any empty strings. Omit the second argument to use the default regex.

const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
+
words('I love javaScript!!'); // ["I", "love", "javaScript"]
 words('python, javaScript & coffee'); // ["python", "javaScript", "coffee"]
-
-

Utility

-

coalesce

-

Returns the first non-null/undefined argument.

-

Use Array.find() to return the first non null/undefined argument.

-
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
-
-
coalesce(null, undefined, '', NaN, 'Waldo'); // ""
-
-

coalesceFactory

-

Returns a customized coalesce function that returns the first argument that returns true from the provided argument validation function.

-

Use Array.find() to return the first argument that returns true from the provided argument validation function.

-
const coalesceFactory = valid => (...args) => args.find(valid);
-
-
const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_));
+

Utility

coalesce

Returns the first non-null/undefined argument.

Use Array.find() to return the first non null/undefined argument.

const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
+
coalesce(null, undefined, '', NaN, 'Waldo'); // ""
+

coalesceFactory

Returns a customized coalesce function that returns the first argument that returns true from the provided argument validation function.

Use Array.find() to return the first argument that returns true from the provided argument validation function.

const coalesceFactory = valid => (...args) => args.find(valid);
+
const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_));
 customCoalesce(undefined, null, NaN, '', 'Waldo'); // "Waldo"
-
-

extendHex

-

Extends a 3-digit color code to a 6-digit color code.

-

Use Array.map(), split() and Array.join() to join the mapped array for converting a 3-digit RGB notated hexadecimal color-code to the 6-digit form. -String.slice() is used to remove # from string start since it's added once.

-
const extendHex = shortHex =>
+

extendHex

Extends a 3-digit color code to a 6-digit color code.

Use Array.map(), split() and Array.join() to join the mapped array for converting a 3-digit RGB notated hexadecimal color-code to the 6-digit form. String.slice() is used to remove # from string start since it's added once.

const extendHex = shortHex =>
   '#' +
   shortHex
     .slice(shortHex.startsWith('#') ? 1 : 0)
     .split('')
     .map(x => x + x)
     .join('');
-
-
extendHex('#03f'); // '#0033ff'
+
extendHex('#03f'); // '#0033ff'
 extendHex('05a'); // '#0055aa'
-
-

getType

-

Returns the native type of a value.

-

Returns lowercased constructor name of value, "undefined" or "null" if value is undefined or null

-
const getType = v =>
+

getType

Returns the native type of a value.

Returns lowercased constructor name of value, "undefined" or "null" if value is undefined or null

const getType = v =>
   v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name.toLowerCase();
-
-
getType(new Set([1, 2, 3])); // "set"
-
-

hexToRGB

-

Converts a color code to a rgb() or rgba() string if alpha value is provided.

-

Use bitwise right-shift operator and mask bits with & (and) operator to convert a hexadecimal color code (with or without prefixed with #) to a string with the RGB values. If it's 3-digit color code, first convert to 6-digit version. If an alpha value is provided alongside 6-digit hex, give rgba() string in return.

-
const hexToRGB = hex => {
+
getType(new Set([1, 2, 3])); // "set"
+

hexToRGB

Converts a color code to a rgb() or rgba() string if alpha value is provided.

Use bitwise right-shift operator and mask bits with & (and) operator to convert a hexadecimal color code (with or without prefixed with #) to a string with the RGB values. If it's 3-digit color code, first convert to 6-digit version. If an alpha value is provided alongside 6-digit hex, give rgba() string in return.

const hexToRGB = hex => {
   let alpha = false,
     h = hex.slice(hex.startsWith('#') ? 1 : 0);
   if (h.length === 3) h = [...h].map(x => x + x).join('');
@@ -1763,82 +776,37 @@ extendHex('05a'); // '#0055aa'
     ')'
   );
 };
-
-
hexToRGB('#27ae60ff'); // 'rgba(39, 174, 96, 255)'
+
hexToRGB('#27ae60ff'); // 'rgba(39, 174, 96, 255)'
 hexToRGB('27ae60'); // 'rgb(39, 174, 96)'
 hexToRGB('#fff'); // 'rgb(255, 255, 255)'
-
-

isArray

-

Checks if the given argument is an array.

-

Use Array.isArray() to check if a value is classified as an array.

-
const isArray = val => !!val && Array.isArray(val);
-
-
isArray(null); // false
+

isArray

Checks if the given argument is an array.

Use Array.isArray() to check if a value is classified as an array.

const isArray = val => !!val && Array.isArray(val);
+
isArray(null); // false
 isArray([1]); // true
-
-

isBoolean

-

Checks if the given argument is a native boolean element.

-

Use typeof to check if a value is classified as a boolean primitive.

-
const isBoolean = val => typeof val === 'boolean';
-
-
isBoolean(null); // false
+

isBoolean

Checks if the given argument is a native boolean element.

Use typeof to check if a value is classified as a boolean primitive.

const isBoolean = val => typeof val === 'boolean';
+
isBoolean(null); // false
 isBoolean(false); // true
-
-

isFunction

-

Checks if the given argument is a function.

-

Use typeof to check if a value is classified as a function primitive.

-
const isFunction = val => val && typeof val === 'function';
-
-
isFunction('x'); // false
+

isFunction

Checks if the given argument is a function.

Use typeof to check if a value is classified as a function primitive.

const isFunction = val => val && typeof val === 'function';
+
isFunction('x'); // false
 isFunction(x => x); // true
-
-

isNumber

-

Checks if the given argument is a number.

-

Use typeof to check if a value is classified as a number primitive.

-
const isNumber = val => typeof val === 'number';
-
-
isNumber('1'); // false
+

isNumber

Checks if the given argument is a number.

Use typeof to check if a value is classified as a number primitive.

const isNumber = val => typeof val === 'number';
+
isNumber('1'); // false
 isNumber(1); // true
-
-

isString

-

Checks if the given argument is a string.

-

Use typeof to check if a value is classified as a string primitive.

-
const isString = val => typeof val === 'string';
-
-
isString(10); // false
+

isString

Checks if the given argument is a string.

Use typeof to check if a value is classified as a string primitive.

const isString = val => typeof val === 'string';
+
isString(10); // false
 isString('10'); // true
-
-

isSymbol

-

Checks if the given argument is a symbol.

-

Use typeof to check if a value is classified as a symbol primitive.

-
const isSymbol = val => typeof val === 'symbol';
-
-
isSymbol('x'); // false
+

isSymbol

Checks if the given argument is a symbol.

Use typeof to check if a value is classified as a symbol primitive.

const isSymbol = val => typeof val === 'symbol';
+
isSymbol('x'); // false
 isSymbol(Symbol('x')); // true
-
-

randomHexColorCode

-

Generates a random hexadecimal color code.

-

Use Math.random to generate a random 24-bit(6x4bits) hexadecimal number. Use bit shifting and then convert it to an hexadecimal String using toString(16).

-
const randomHexColorCode = () => {
+

randomHexColorCode

Generates a random hexadecimal color code.

Use Math.random to generate a random 24-bit(6x4bits) hexadecimal number. Use bit shifting and then convert it to an hexadecimal String using toString(16).

const randomHexColorCode = () => {
   let n = ((Math.random() * 0xfffff) | 0).toString(16);
   return '#' + (n.length !== 6 ? ((Math.random() * 0xf) | 0).toString(16) + n : n);
 };
-
-
randomHexColorCode(); // "#e34155"
+
randomHexColorCode(); // "#e34155"
 randomHexColorCode(); // "#fd73a6"
 randomHexColorCode(); // "#4144c6"
-
-

RGBToHex

-

Converts the values of RGB components to a color code.

-

Convert given RGB parameters to hexadecimal string using bitwise left-shift operator (<<) and toString(16), then padStart(6,'0') to get a 6-digit hexadecimal value.

-
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
-
-
RGBToHex(255, 165, 1); // 'ffa501'
-
-

sbdm

-

This algorithm is a simple hash-algorithm that hashes it input string s into a whole number.

-

Use split('') and Array.reduce() to create a hash of the input string, utilizing bit shifting.

-
const sdbm = str => {
+

RGBToHex

Converts the values of RGB components to a color code.

Convert given RGB parameters to hexadecimal string using bitwise left-shift operator (<<) and toString(16), then padStart(6,'0') to get a 6-digit hexadecimal value.

const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
+
RGBToHex(255, 165, 1); // 'ffa501'
+

sbdm

This algorithm is a simple hash-algorithm that hashes it input string s into a whole number.

Use split('') and Array.reduce() to create a hash of the input string, utilizing bit shifting.

const sdbm = str => {
   let arr = str.split('');
   return arr.reduce(
     (hashCode, currentVal) =>
@@ -1846,35 +814,19 @@ randomHexColorCode(); // "#4144c6"
     0
   );
 };
-
-
console.log(sdbm('name')); // -3521204949
+
console.log(sdbm('name')); // -3521204949
 console.log(sdbm('age')); // 808122783
-
-

timeTaken

-

Measures the time taken by a function to execute.

-

Use console.time() and console.timeEnd() to measure the difference between the start and end times to determine how long the callback took to execute.

-
const timeTaken = callback => {
+

timeTaken

Measures the time taken by a function to execute.

Use console.time() and console.timeEnd() to measure the difference between the start and end times to determine how long the callback took to execute.

const timeTaken = callback => {
   console.time('timeTaken');
   const r = callback();
   console.timeEnd('timeTaken');
   return r;
 };
-
-
timeTaken(() => Math.pow(2, 10)); // 1024
+
timeTaken(() => Math.pow(2, 10)); // 1024
 // (logged): timeTaken: 0.02099609375ms
-
-

toDecimalMark

-

Use toLocaleString() to convert a float-point arithmetic to the Decimal mark form. It makes a comma separated string from a number.

-
const toDecimalMark = num => num.toLocaleString('en-US');
-
-
toDecimalMark(12305030388.9087); // "12,305,030,388.9087"
-
-

toOrdinalSuffix

-

Adds an ordinal suffix to a number.

-

Use the modulo operator (%) to find values of single and tens digits. -Find which ordinal pattern digits match. -If digit is found in teens pattern, use teens ordinal.

-
const toOrdinalSuffix = num => {
+

toDecimalMark

Use toLocaleString() to convert a float-point arithmetic to the Decimal mark form. It makes a comma separated string from a number.

const toDecimalMark = num => num.toLocaleString('en-US');
+
toDecimalMark(12305030388.9087); // "12,305,030,388.9087"
+

toOrdinalSuffix

Adds an ordinal suffix to a number.

Use the modulo operator (%) to find values of single and tens digits. Find which ordinal pattern digits match. If digit is found in teens pattern, use teens ordinal.

const toOrdinalSuffix = num => {
   const int = parseInt(num),
     digits = [int % 10, int % 100],
     ordinals = ['st', 'nd', 'rd', 'th'],
@@ -1884,26 +836,7 @@ If digit is found in teens pattern, use teens ordinal.

? int + ordinals[digits[0] - 1] : int + ordinals[3]; }; -
-
toOrdinalSuffix('123'); // "123rd"
-
-

validateNumber

-

Returns true if the given value is a number, false otherwise.

-

Use !isNaN in combination with parseFloat() to check if the argument is a number. -Use isFinite() to check if the number is finite. -Use Number() to check if the coercion holds.

-
const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
-
-
validateNumber('10'); // true
-
-

- -
-
- - - - +
toOrdinalSuffix('123'); // "123rd"
+

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
+
validateNumber('10'); // true
+

\ No newline at end of file From 094c55e3a6f1756a85c0f69ab375eab627fe44e3 Mon Sep 17 00:00:00 2001 From: atomiks Date: Sat, 30 Dec 2017 01:41:32 +1100 Subject: [PATCH 53/74] Fix average when passing an array as an argument --- snippets/average.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snippets/average.md b/snippets/average.md index 6477b2535..6eccc0636 100644 --- a/snippets/average.md +++ b/snippets/average.md @@ -5,9 +5,13 @@ Returns the average of an of two or more numbers/arrays. Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array. ```js -const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length; +const average = (...arr) => { + const nums = [].concat(...arr); + return nums.reduce((acc, val) => acc + val, 0) / nums.length; +}; ``` ```js average([1, 2, 3]); // 2 +average(1, 2, 3); // 2 ``` From 3782c6e3a0aa54cc7e65b772478f6a758bbfcff4 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 29 Dec 2017 14:43:26 +0000 Subject: [PATCH 54/74] Travis build: 615 --- README.md | 6 +++++- docs/index.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b5bca310..1e379163e 100644 --- a/README.md +++ b/README.md @@ -2142,7 +2142,10 @@ Returns the average of an of two or more numbers/arrays. Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array. ```js -const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length; +const average = (...arr) => { + const nums = [].concat(...arr); + return nums.reduce((acc, val) => acc + val, 0) / nums.length; +}; ```
@@ -2150,6 +2153,7 @@ const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) ```js average([1, 2, 3]); // 2 +average(1, 2, 3); // 2 ```
diff --git a/docs/index.html b/docs/index.html index 8389e10d5..f2133ab4f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -407,8 +407,12 @@ runPromisesInSeries([() => delay(1000), () => delay(2000)]); // //executes

Logic

negate

Negates a predicate function.

Take a predicate function and apply not to it with its arguments.

const negate = func => (...args) => !func(...args);
 
filter([1, 2, 3, 4, 5, 6], negate(isEven)); // [1, 3, 5]
 negate(isOdd)(1); // false
-

Math

average

Returns the average of an of two or more numbers/arrays.

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 = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
+

Math

average

Returns the average of an of two or more numbers/arrays.

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 = (...arr) => {
+  const nums = [].concat(...arr);
+  return nums.reduce((acc, val) => acc + val, 0) / nums.length;
+};
 
average([1, 2, 3]); // 2
+average(1, 2, 3); // 2
 

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 2b48c2a184a6c8ea3313c20e016f32a64f6141f3 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Fri, 29 Dec 2017 16:47:32 +0200
Subject: [PATCH 55/74] Added caching to .travis.yml

---
 .travis.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 1288ecd12..d5b7684be 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,7 @@
 language: node_js
+cache:
+  directories:
+    node_modules
 node_js:
 - node
 before_install:

From 9f8b72fa64ffc9b5e6b91a941ce18180e6300ab2 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Fri, 29 Dec 2017 16:48:59 +0200
Subject: [PATCH 56/74] Fixed caching in .travis.yml

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index d5b7684be..7b3a3486c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
 language: node_js
 cache:
   directories:
-    node_modules
+    - node_modules
 node_js:
 - node
 before_install:

From d70d11deacd4a9c5a7b4f164113f5b6283c0578c Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 01:54:53 +1100
Subject: [PATCH 57/74] Update lcm.md

---
 snippets/lcm.md | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/snippets/lcm.md b/snippets/lcm.md
index e7bb6a3e0..4b560f29d 100644
--- a/snippets/lcm.md
+++ b/snippets/lcm.md
@@ -1,16 +1,15 @@
 ### lcm
 
-Returns the least common multiple of two or numbers/arrays.
+Returns the least common multiple of two or more numbers/arrays.
 
 Use the greatest common divisor (GCD) formula and `Math.abs()` to determine the least common multiple.
 The GCD formula uses recursion.
 
 ```js
 const lcm = (...arr) => {
-  let data = [].concat(...arr);
   const gcd = (x, y) => (!y ? x : gcd(y, x % y));
-  const helperLcm = (x, y) => x * y / gcd(x, y);
-  return arr.reduce((a, b) => helperLcm(a, b));
+  const _lcm = (x, y) => x * y / gcd(x, y);
+  return [].concat(...arr).reduce((a, b) => _lcm(a, b));
 };
 ```
 

From 43ba1e0bccb05fa1564b9779f0c779a81f8cd81a Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 14:56:07 +0000
Subject: [PATCH 58/74] Travis build: 626

---
 README.md       | 7 +++----
 docs/index.html | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 1e379163e..112aa68c6 100644
--- a/README.md
+++ b/README.md
@@ -2546,17 +2546,16 @@ isPrime(12); // false
 
 ### lcm
 
-Returns the least common multiple of two or numbers/arrays.
+Returns the least common multiple of two or more numbers/arrays.
 
 Use the greatest common divisor (GCD) formula and `Math.abs()` to determine the least common multiple.
 The GCD formula uses recursion.
 
 ```js
 const lcm = (...arr) => {
-  let data = [].concat(...arr);
   const gcd = (x, y) => (!y ? x : gcd(y, x % y));
-  const helperLcm = (x, y) => x * y / gcd(x, y);
-  return arr.reduce((a, b) => helperLcm(a, b));
+  const _lcm = (x, y) => x * y / gcd(x, y);
+  return [].concat(...arr).reduce((a, b) => _lcm(a, b));
 };
 ```
 
diff --git a/docs/index.html b/docs/index.html
index f2133ab4f..a45295e6e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -482,11 +482,10 @@ isArmstrongNumber(56); // false
 };
 
isPrime(11); // true
 isPrime(12); // false
-

lcm

Returns the least common multiple of two or numbers/arrays.

Use the greatest common divisor (GCD) formula and Math.abs() to determine the least common multiple. The GCD formula uses recursion.

const lcm = (...arr) => {
-  let data = [].concat(...arr);
+

lcm

Returns the least common multiple of two or more numbers/arrays.

Use the greatest common divisor (GCD) formula and Math.abs() to determine the least common multiple. The GCD formula uses recursion.

const lcm = (...arr) => {
   const gcd = (x, y) => (!y ? x : gcd(y, x % y));
-  const helperLcm = (x, y) => x * y / gcd(x, y);
-  return arr.reduce((a, b) => helperLcm(a, b));
+  const _lcm = (x, y) => x * y / gcd(x, y);
+  return [].concat(...arr).reduce((a, b) => _lcm(a, b));
 };
 
lcm(12, 7); // 84
 lcm([1, 3, 4], 5); // 60

From e3ba971aa6e8331e9b456a3f38b2fbd509c5e74a Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 02:41:53 +1100
Subject: [PATCH 59/74] Create onUserInputChange.md

---
 snippets/onUserInputChange.md | 43 +++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 snippets/onUserInputChange.md

diff --git a/snippets/onUserInputChange.md b/snippets/onUserInputChange.md
new file mode 100644
index 000000000..f54d84e76
--- /dev/null
+++ b/snippets/onUserInputChange.md
@@ -0,0 +1,43 @@
+### onUserInputChange
+
+Will run the callback whenever the user changes their input type (either `mouse` or `touch`). This is useful
+if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads).
+
+Use two event listeners. Assume `mouse` input initially and bind a `touchstart` event listener to the document. 
+On `touchstart`, the callback is run and supplied with the current input type as an argument. 
+Then, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms 
+using `performance.now()` (browsers recently fire them every animation frame). Run the callback and supply the new type
+`mouse` as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), 
+where the user can switch between either input type at will.
+
+```js
+const onUserInputChange = callback => {
+  let type = 'mouse';
+
+  const mousemoveHandler = (() => {
+    let lastTime = 0;
+    return () => {
+      const now = performance.now();
+      if (now - lastTime < 20) {
+        type = 'mouse';
+        callback(type);
+        document.removeEventListener('mousemove', mousemoveHandler);
+      }
+      lastTime = now;
+    }
+  })();
+
+  document.addEventListener('touchstart', () => {
+    if (type === 'touch') return;
+    type = 'touch';
+    callback(type);
+    document.addEventListener('mousemove', mousemoveHandler)
+  });
+};
+```
+
+```js
+onUserInputChange(type => {
+  console.log('The user is now using', type, 'as an input method.');
+});
+```

From e4f8aa26a1237d0524270c19b2e1acb93e5a91b3 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 02:46:10 +1100
Subject: [PATCH 60/74] Update tag_database

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

diff --git a/tag_database b/tag_database
index f5633a5fa..8169555b8 100644
--- a/tag_database
+++ b/tag_database
@@ -85,6 +85,7 @@ negate:logic
 nthElement:array
 objectFromPairs:object
 objectToPairs:object
+onUserInputChange:browser
 orderBy:object
 palindrome:math
 percentile:math

From f9afb5e0ee86c60470300c677b80801a60a1772c Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 02:51:10 +1100
Subject: [PATCH 61/74] semicolons

---
 snippets/onUserInputChange.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/snippets/onUserInputChange.md b/snippets/onUserInputChange.md
index f54d84e76..5a3063d44 100644
--- a/snippets/onUserInputChange.md
+++ b/snippets/onUserInputChange.md
@@ -24,14 +24,14 @@ const onUserInputChange = callback => {
         document.removeEventListener('mousemove', mousemoveHandler);
       }
       lastTime = now;
-    }
+    };
   })();
 
   document.addEventListener('touchstart', () => {
     if (type === 'touch') return;
     type = 'touch';
     callback(type);
-    document.addEventListener('mousemove', mousemoveHandler)
+    document.addEventListener('mousemove', mousemoveHandler);
   });
 };
 ```

From d85d83a618adca0aa09bb05e3278563474c16b28 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 15:52:38 +0000
Subject: [PATCH 62/74] Travis build: 636

---
 README.md       | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
 docs/index.html | 28 +++++++++++++++++++++++++-
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 112aa68c6..e3a8e7fdf 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,7 @@
 * [`hasClass`](#hasclass)
 * [`hide`](#hide)
 * [`httpsRedirect`](#httpsredirect)
+* [`onUserInputChange`](#onuserinputchange)
 * [`redirect`](#redirect)
 * [`scrollToTop`](#scrolltotop)
 * [`setStyle`](#setstyle)
@@ -1703,6 +1704,58 @@ const httpsRedirect = () => {
 
[⬆ Back to top](#table-of-contents) +### onUserInputChange + +Will run the callback whenever the user changes their input type (either `mouse` or `touch`). This is useful +if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads). + +Use two event listeners. Assume `mouse` input initially and bind a `touchstart` event listener to the document. +On `touchstart`, the callback is run and supplied with the current input type as an argument. +Then, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms +using `performance.now()` (browsers recently fire them every animation frame). Run the callback and supply the new type +`mouse` as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), +where the user can switch between either input type at will. + +```js +const onUserInputChange = callback => { + let type = 'mouse'; + + const mousemoveHandler = (() => { + let lastTime = 0; + return () => { + const now = performance.now(); + if (now - lastTime < 20) { + type = 'mouse'; + callback(type); + document.removeEventListener('mousemove', mousemoveHandler); + } + lastTime = now; + }; + })(); + + document.addEventListener('touchstart', () => { + if (type === 'touch') return; + type = 'touch'; + callback(type); + document.addEventListener('mousemove', mousemoveHandler); + }); +}; +``` + +
+Examples + +```js +onUserInputChange(type => { + console.log('The user is now using', type, 'as an input method.'); +}); +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### redirect Redirects to a specified URL. diff --git a/docs/index.html b/docs/index.html index a45295e6e..e41764024 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -325,6 +325,32 @@ elementIsVisibleInViewport(el, true); // true // (partially visible)
 

httpsRedirect

Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn't take it back to the HTTP page as its replaced in the history.

Use location.protocol to get the protocol currently being used. If it's not HTTPS, use location.replace() to replace the existing page with the HTTPS version of the page. Use location.href to get the full address, split it with String.split() and remove the protocol part of the URL.

const httpsRedirect = () => {
   if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
 };
+

onUserInputChange

Will run the callback whenever the user changes their input type (either mouse or touch). This is useful if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads).

Use two event listeners. Assume mouse input initially and bind a touchstart event listener to the document. On touchstart, the callback is run and supplied with the current input type as an argument. Then, add a mousemove event listener to listen for two consecutive mousemove events firing within 20ms using performance.now() (browsers recently fire them every animation frame). Run the callback and supply the new type mouse as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), where the user can switch between either input type at will.

const onUserInputChange = callback => {
+  let type = 'mouse';
+
+  const mousemoveHandler = (() => {
+    let lastTime = 0;
+    return () => {
+      const now = performance.now();
+      if (now - lastTime < 20) {
+        type = 'mouse';
+        callback(type);
+        document.removeEventListener('mousemove', mousemoveHandler);
+      }
+      lastTime = now;
+    };
+  })();
+
+  document.addEventListener('touchstart', () => {
+    if (type === 'touch') return;
+    type = 'touch';
+    callback(type);
+    document.addEventListener('mousemove', mousemoveHandler);
+  });
+};
+
onUserInputChange(type => {
+  console.log('The user is now using', type, 'as an input method.');
+});
 

redirect

Redirects to a specified URL.

Use window.location.href or window.location.replace() to redirect to url. Pass a second argument to simulate a link click (true - default) or an HTTP redirect (false).

const redirect = (url, asLink = true) =>
   asLink ? (window.location.href = url) : window.location.replace(url);
 
redirect('https://google.com');

From 2331793b75ff22a8e9c3edbbe6da847914b21fab Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 29 Dec 2017 15:54:20 +0000
Subject: [PATCH 63/74] Travis build: 637

---
 README.md       | 53 -------------------------------------------------
 docs/index.html | 28 +-------------------------
 2 files changed, 1 insertion(+), 80 deletions(-)

diff --git a/README.md b/README.md
index e3a8e7fdf..112aa68c6 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,6 @@
 * [`hasClass`](#hasclass)
 * [`hide`](#hide)
 * [`httpsRedirect`](#httpsredirect)
-* [`onUserInputChange`](#onuserinputchange)
 * [`redirect`](#redirect)
 * [`scrollToTop`](#scrolltotop)
 * [`setStyle`](#setstyle)
@@ -1704,58 +1703,6 @@ const httpsRedirect = () => {
 
[⬆ Back to top](#table-of-contents) -### onUserInputChange - -Will run the callback whenever the user changes their input type (either `mouse` or `touch`). This is useful -if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads). - -Use two event listeners. Assume `mouse` input initially and bind a `touchstart` event listener to the document. -On `touchstart`, the callback is run and supplied with the current input type as an argument. -Then, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms -using `performance.now()` (browsers recently fire them every animation frame). Run the callback and supply the new type -`mouse` as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), -where the user can switch between either input type at will. - -```js -const onUserInputChange = callback => { - let type = 'mouse'; - - const mousemoveHandler = (() => { - let lastTime = 0; - return () => { - const now = performance.now(); - if (now - lastTime < 20) { - type = 'mouse'; - callback(type); - document.removeEventListener('mousemove', mousemoveHandler); - } - lastTime = now; - }; - })(); - - document.addEventListener('touchstart', () => { - if (type === 'touch') return; - type = 'touch'; - callback(type); - document.addEventListener('mousemove', mousemoveHandler); - }); -}; -``` - -
-Examples - -```js -onUserInputChange(type => { - console.log('The user is now using', type, 'as an input method.'); -}); -``` - -
- -
[⬆ Back to top](#table-of-contents) - - ### redirect Redirects to a specified URL. diff --git a/docs/index.html b/docs/index.html index e41764024..a45295e6e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -325,32 +325,6 @@ elementIsVisibleInViewport(el, true); // true // (partially visible)
 

httpsRedirect

Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn't take it back to the HTTP page as its replaced in the history.

Use location.protocol to get the protocol currently being used. If it's not HTTPS, use location.replace() to replace the existing page with the HTTPS version of the page. Use location.href to get the full address, split it with String.split() and remove the protocol part of the URL.

const httpsRedirect = () => {
   if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
 };
-

onUserInputChange

Will run the callback whenever the user changes their input type (either mouse or touch). This is useful if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads).

Use two event listeners. Assume mouse input initially and bind a touchstart event listener to the document. On touchstart, the callback is run and supplied with the current input type as an argument. Then, add a mousemove event listener to listen for two consecutive mousemove events firing within 20ms using performance.now() (browsers recently fire them every animation frame). Run the callback and supply the new type mouse as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), where the user can switch between either input type at will.

const onUserInputChange = callback => {
-  let type = 'mouse';
-
-  const mousemoveHandler = (() => {
-    let lastTime = 0;
-    return () => {
-      const now = performance.now();
-      if (now - lastTime < 20) {
-        type = 'mouse';
-        callback(type);
-        document.removeEventListener('mousemove', mousemoveHandler);
-      }
-      lastTime = now;
-    };
-  })();
-
-  document.addEventListener('touchstart', () => {
-    if (type === 'touch') return;
-    type = 'touch';
-    callback(type);
-    document.addEventListener('mousemove', mousemoveHandler);
-  });
-};
-
onUserInputChange(type => {
-  console.log('The user is now using', type, 'as an input method.');
-});
 

redirect

Redirects to a specified URL.

Use window.location.href or window.location.replace() to redirect to url. Pass a second argument to simulate a link click (true - default) or an HTTP redirect (false).

const redirect = (url, asLink = true) =>
   asLink ? (window.location.href = url) : window.location.replace(url);
 
redirect('https://google.com');

From 0fc5cfed996df57bc5d6aa2aa213d3463ed09b80 Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 03:11:20 +1100
Subject: [PATCH 64/74] Make it shorter

---
 snippets/onUserInputChange.md | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/snippets/onUserInputChange.md b/snippets/onUserInputChange.md
index 5a3063d44..d726c51fb 100644
--- a/snippets/onUserInputChange.md
+++ b/snippets/onUserInputChange.md
@@ -12,26 +12,17 @@ where the user can switch between either input type at will.
 
 ```js
 const onUserInputChange = callback => {
-  let type = 'mouse';
-
-  const mousemoveHandler = (() => {
-    let lastTime = 0;
-    return () => {
-      const now = performance.now();
-      if (now - lastTime < 20) {
-        type = 'mouse';
-        callback(type);
-        document.removeEventListener('mousemove', mousemoveHandler);
-      }
-      lastTime = now;
-    };
-  })();
-
+  let type = 'mouse', lastTime = 0;
+  const mousemoveHandler = () => {
+    const now = performance.now();
+    if (now - lastTime < 20) {
+      type = 'mouse', callback(type), document.removeEventListener('mousemove', mousemoveHandler);
+    }
+    lastTime = now;
+  };
   document.addEventListener('touchstart', () => {
     if (type === 'touch') return;
-    type = 'touch';
-    callback(type);
-    document.addEventListener('mousemove', mousemoveHandler);
+    type = 'touch', callback(type), document.addEventListener('mousemove', mousemoveHandler);
   });
 };
 ```

From 474cf7ff42eb388f173b35f5fd4e70f5774583cb Mon Sep 17 00:00:00 2001
From: atomiks 
Date: Sat, 30 Dec 2017 07:19:12 +1100
Subject: [PATCH 65/74] fix conflicts

---
 package.json                        |  18 +--
 scripts/build-script.js             |  99 --------------
 scripts/build.js                    | 127 ++++++++++++++++++
 scripts/{lint-script.js => lint.js} |   6 +-
 scripts/{tag-script.js => tag.js}   |  65 +++++++---
 scripts/tdd-script.js               |  41 ------
 scripts/tdd.js                      |  50 ++++++++
 scripts/web-script.js               | 133 -------------------
 scripts/web.js                      | 192 ++++++++++++++++++++++++++++
 9 files changed, 424 insertions(+), 307 deletions(-)
 delete mode 100644 scripts/build-script.js
 create mode 100644 scripts/build.js
 rename scripts/{lint-script.js => lint.js} (95%)
 rename scripts/{tag-script.js => tag.js} (51%)
 delete mode 100644 scripts/tdd-script.js
 create mode 100644 scripts/tdd.js
 delete mode 100644 scripts/web-script.js
 create mode 100644 scripts/web.js

diff --git a/package.json b/package.json
index d2c5c6ca8..366cba720 100644
--- a/package.json
+++ b/package.json
@@ -10,25 +10,21 @@
     "tape": "^4.8.0"
   },
   "name": "30-seconds-of-code",
-  "description": "A collection of useful Javascript snippets.",
+  "description": "A collection of useful JavaScript snippets.",
   "version": "1.0.0",
   "main": "index.js",
   "scripts": {
-    "builder": "node ./scripts/build-script.js",
-    "linter": "node ./scripts/lint-script.js",
-    "tagger": "node ./scripts/tag-script.js",
-    "webber": "node ./scripts/web-script.js",
-    "tdd": "node ./scripts/tdd-script.js"
+    "builder": "node ./scripts/build.js",
+    "linter": "node ./scripts/lint.js",
+    "tagger": "node ./scripts/tag.js",
+    "webber": "node ./scripts/web.js",
+    "tdd": "node ./scripts/tdd.js"
   },
   "repository": {
     "type": "git",
     "url": "git+https://github.com/Chalarangelo/30-seconds-of-code.git"
   },
-  "keywords": [
-    "javascript",
-    "snippets",
-    "list"
-  ],
+  "keywords": ["javascript", "snippets", "list"],
   "author": "Chalarangelo (chalarangelo@gmail.com)",
   "license": "MIT",
   "bugs": {
diff --git a/scripts/build-script.js b/scripts/build-script.js
deleted file mode 100644
index f8cf3ca8a..000000000
--- a/scripts/build-script.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-  This is the builder script that generates the README file.
-  Run using `npm run builder`.
-*/
-// Load modules
-const fs = require('fs-extra'), path = require('path'), chalk = require('chalk');
-// Set variables for paths
-const snippetsPath = './snippets',  staticPartsPath = './static-parts';
-// Set variables for script
-let snippets = {}, startPart = '', endPart = '', output = '', tagDbData = {};
-// Load helper functions (these are from existing snippets in 30 seconds of code!)
-const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {});
-const capitalize = (str, lowerRest = false) => str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1));
-// Start the timer of the script
-console.time('Builder');
-// Synchronously read all snippets and sort them as necessary (case-insensitive)
-try {
-  let snippetFilenames = fs.readdirSync(snippetsPath);
-  snippetFilenames.sort((a, b) => {
-    a = a.toLowerCase();
-    b = b.toLowerCase();
-    if (a < b) return -1;
-    if (a > b) return 1;
-    return 0;
-  });
-  // Store the data read from each snippet in the appropriate object
-  for(let snippet of snippetFilenames)  snippets[snippet] = fs.readFileSync(path.join(snippetsPath,snippet),'utf8');
-}
-catch (err){  // Handle errors (hopefully not!)
-  console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
-  process.exit(1);
-}
-// Load static parts for the README file
-try {
-  startPart = fs.readFileSync(path.join(staticPartsPath,'README-start.md'),'utf8');
-  endPart = fs.readFileSync(path.join(staticPartsPath,'README-end.md'),'utf8');
-}
-catch (err){ // Handle errors (hopefully not!)
-  console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
-  process.exit(1);
-}
-// Load tag data from the database
-try {
-  tagDbData = objectFromPairs(fs.readFileSync('tag_database','utf8').split('\n').slice(0,-1).map(v => v.split(':').slice(0,2)));
-}
-catch (err){  // Handle errors (hopefully not!)
-  console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`);
-  process.exit(1);
-}
-// Create the output for the README file
-try {
-  // Add the start static part
-  output += `${startPart+'\n'}`;
-  // Loop over tags and snippets to create the table of contents
-  let uncategorizedOutput = '';
-  for(let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))].filter(v => v).sort((a,b) => a.localeCompare(b))){
-    if(capitalize(tag, true)=='Uncategorized') {
-      uncategorizedOutput +=`### _${capitalize(tag, true)}_\n\n
\nView contents\n\n`; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n` - uncategorizedOutput += '\n
\n\n'; - } else { - output +=`### ${capitalize(tag, true)}\n\n
\nView contents\n\n`; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n` - output += '\n
\n\n'; - } - } - output += uncategorizedOutput; - uncategorizedOutput = ''; - // Loop over tags and snippets to create the list of snippets - for(let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))].filter(v => v).sort((a,b) => a.localeCompare(b))){ - if(capitalize(tag, true)=='Uncategorized') { - uncategorizedOutput +=`## _${capitalize(tag, true)}_\n`; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - uncategorizedOutput += `\n${snippets[taggedSnippet[0]+'.md']+'\n
[⬆ back to top](#table-of-contents)\n\n'}`; - } else { - output +=`## ${capitalize(tag, true)}\n`; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)){ - let data = snippets[taggedSnippet[0]+'.md']; - data = data.slice(0,data.lastIndexOf('```js')) + '
\nExamples\n\n' + data.slice(data.lastIndexOf('```js'),data.lastIndexOf('```')) + data.slice(data.lastIndexOf('```')) + '\n
\n'; - output += `\n${data+'\n
[⬆ Back to top](#table-of-contents)\n\n'}`; - } - } - } - output += uncategorizedOutput; - // Add the ending static part - output += `\n${endPart+'\n'}`; - // Write to the README file - fs.writeFileSync('README.md', output); -} -catch (err){ // Handle errors (hopefully not!) - console.log(`${chalk.red('ERROR!')} During README generation: ${err}`); - process.exit(1); -} -// Log a success message -console.log(`${chalk.green('SUCCESS!')} README file generated!`); -// Log the time taken -console.timeEnd('Builder'); diff --git a/scripts/build.js b/scripts/build.js new file mode 100644 index 000000000..a6e6d607d --- /dev/null +++ b/scripts/build.js @@ -0,0 +1,127 @@ +/* + This is the builder script that generates the README file. + Run using `npm run builder`. +*/ +// Load modules +const fs = require('fs-extra'), + path = require('path'), + chalk = require('chalk'); +// Set variables for paths +const snippetsPath = './snippets', + staticPartsPath = './static-parts'; +// Set variables for script +let snippets = {}, + startPart = '', + endPart = '', + output = '', + tagDbData = {}; +// Load helper functions (these are from existing snippets in 30 seconds of code!) +const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); +const capitalize = (str, lowerRest = false) => + str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1)); +// Start the timer of the script +console.time('Builder'); +// Synchronously read all snippets and sort them as necessary (case-insensitive) +try { + let snippetFilenames = fs.readdirSync(snippetsPath); + snippetFilenames.sort((a, b) => { + a = a.toLowerCase(); + b = b.toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + }); + // Store the data read from each snippet in the appropriate object + for (let snippet of snippetFilenames) + snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8'); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`); + process.exit(1); +} +// Load static parts for the README file +try { + startPart = fs.readFileSync(path.join(staticPartsPath, 'README-start.md'), 'utf8'); + endPart = fs.readFileSync(path.join(staticPartsPath, 'README-end.md'), 'utf8'); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`); + process.exit(1); +} +// Load tag data from the database +try { + tagDbData = objectFromPairs( + fs + .readFileSync('tag_database', 'utf8') + .split('\n') + .slice(0, -1) + .map(v => v.split(':').slice(0, 2)) + ); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`); + process.exit(1); +} +// Create the output for the README file +try { + // Add the start static part + output += `${startPart + '\n'}`; + // Loop over tags and snippets to create the table of contents + let uncategorizedOutput = ''; + for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))] + .filter(v => v) + .sort((a, b) => a.localeCompare(b))) { + if (capitalize(tag, true) == 'Uncategorized') { + uncategorizedOutput += `### _${capitalize( + tag, + true + )}_\n\n
\nView contents\n\n`; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`; + uncategorizedOutput += '\n
\n\n'; + } else { + output += `### ${capitalize(tag, true)}\n\n
\nView contents\n\n`; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`; + output += '\n
\n\n'; + } + } + output += uncategorizedOutput; + uncategorizedOutput = ''; + // Loop over tags and snippets to create the list of snippets + for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))] + .filter(v => v) + .sort((a, b) => a.localeCompare(b))) { + if (capitalize(tag, true) == 'Uncategorized') { + uncategorizedOutput += `## _${capitalize(tag, true)}_\n`; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + uncategorizedOutput += `\n${snippets[taggedSnippet[0] + '.md'] + + '\n
[⬆ back to top](#table-of-contents)\n\n'}`; + } else { + output += `## ${capitalize(tag, true)}\n`; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) { + let data = snippets[taggedSnippet[0] + '.md']; + data = + data.slice(0, data.lastIndexOf('```js')) + + '
\nExamples\n\n' + + data.slice(data.lastIndexOf('```js'), data.lastIndexOf('```')) + + data.slice(data.lastIndexOf('```')) + + '\n
\n'; + output += `\n${data + '\n
[⬆ Back to top](#table-of-contents)\n\n'}`; + } + } + } + output += uncategorizedOutput; + // Add the ending static part + output += `\n${endPart + '\n'}`; + // Write to the README file + fs.writeFileSync('README.md', output); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During README generation: ${err}`); + process.exit(1); +} +// Log a success message +console.log(`${chalk.green('SUCCESS!')} README file generated!`); +// Log the time taken +console.timeEnd('Builder'); diff --git a/scripts/lint-script.js b/scripts/lint.js similarity index 95% rename from scripts/lint-script.js rename to scripts/lint.js index ba66f36a8..833ef3dbd 100644 --- a/scripts/lint-script.js +++ b/scripts/lint.js @@ -18,7 +18,8 @@ const codeRE = /```\s*js([\s\S]*?)```/g; console.time('Linter'); try { - const snippets = fs.readdirSync(SNIPPETS_PATH) + const snippets = fs + .readdirSync(SNIPPETS_PATH) .sort((a, b) => a.toLowerCase() - b.toLowerCase()) // turn it into an object so we can add data to it to be used in a different scope .map(name => ({ name })); @@ -46,7 +47,8 @@ try { }); } - const cmd = `semistandard "${TEMP_PATH}" --fix & ` + + const cmd = + `semistandard "${TEMP_PATH}" --fix & ` + `prettier "${TEMP_PATH}/*.js" --single-quote --print-width=100 --write`; cp.exec(cmd, {}, (err, stdout, stderr) => { diff --git a/scripts/tag-script.js b/scripts/tag.js similarity index 51% rename from scripts/tag-script.js rename to scripts/tag.js index b49c6564a..2c8ed9b0a 100644 --- a/scripts/tag-script.js +++ b/scripts/tag.js @@ -3,14 +3,20 @@ Run using `npm run tagger`. */ // Load modules -const fs = require('fs-extra'), path = require('path'), chalk = require('chalk'); +const fs = require('fs-extra'), + path = require('path'), + chalk = require('chalk'); // Set variables for paths const snippetsPath = './snippets'; // Set variables for script -let snippets = {}, output = '', tagDbData = {}, missingTags = 0, tagDbStats = {}; +let snippets = {}, + output = '', + tagDbData = {}, + missingTags = 0, + tagDbStats = {}; // Load helper functions (these are from existing snippets in 30 seconds of code!) -const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {}); -const countOccurrences = (arr, value) => arr.reduce((a, v) => v === value ? a + 1 : a + 0, 0); +const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); +const countOccurrences = (arr, value) => arr.reduce((a, v) => (v === value ? a + 1 : a + 0), 0); // Start the timer of the script console.time('Tagger'); // Synchronously read all snippets and sort them as necessary (case-insensitive) @@ -24,43 +30,60 @@ try { return 0; }); // Store the data read from each snippet in the appropriate object - for(let snippet of snippetFilenames) snippets[snippet] = fs.readFileSync(path.join(snippetsPath,snippet),'utf8'); -} -catch (err){ // Handle errors (hopefully not!) + for (let snippet of snippetFilenames) + snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8'); +} catch (err) { + // Handle errors (hopefully not!) console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`); process.exit(1); } // Load tag data from the database try { - tagDbData = objectFromPairs(fs.readFileSync('tag_database','utf8').split('\n').slice(0,-1).map(v => v.split(':').slice(0,2))); - tagDbStats = Object.entries(tagDbData).sort((a,b) => a[1].localeCompare(b[1])).reduce((acc, val) => {acc.hasOwnProperty(val[1]) ? acc[val[1]]++ : acc[val[1]] = 1; return acc;}, {}); -} -catch (err){ // Handle errors (hopefully not!) + tagDbData = objectFromPairs( + fs + .readFileSync('tag_database', 'utf8') + .split('\n') + .slice(0, -1) + .map(v => v.split(':').slice(0, 2)) + ); + tagDbStats = Object.entries(tagDbData) + .sort((a, b) => a[1].localeCompare(b[1])) + .reduce((acc, val) => { + acc.hasOwnProperty(val[1]) ? acc[val[1]]++ : (acc[val[1]] = 1); + return acc; + }, {}); +} catch (err) { + // Handle errors (hopefully not!) console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`); process.exit(1); } // Update the listing of snippets in tag_database and log the statistics, along with missing scripts try { - for(let snippet of Object.entries(snippets)) - if(tagDbData.hasOwnProperty(snippet[0].slice(0,-3)) && tagDbData[snippet[0].slice(0,-3)].trim()) - output += `${snippet[0].slice(0,-3)}:${tagDbData[snippet[0].slice(0,-3)].trim()}\n`; + for (let snippet of Object.entries(snippets)) + if ( + tagDbData.hasOwnProperty(snippet[0].slice(0, -3)) && + tagDbData[snippet[0].slice(0, -3)].trim() + ) + output += `${snippet[0].slice(0, -3)}:${tagDbData[snippet[0].slice(0, -3)].trim()}\n`; else { - output += `${snippet[0].slice(0,-3)}:uncategorized\n`; + output += `${snippet[0].slice(0, -3)}:uncategorized\n`; missingTags++; - console.log(`${chalk.yellow('Tagged uncategorized:')} ${snippet[0].slice(0,-3)}`); + console.log(`${chalk.yellow('Tagged uncategorized:')} ${snippet[0].slice(0, -3)}`); } // Write to tag_database fs.writeFileSync('tag_database', output); -} -catch (err){ // Handle errors (hopefully not!) +} catch (err) { + // Handle errors (hopefully not!) console.log(`${chalk.red('ERROR!')} During tag_database generation: ${err}`); process.exit(1); } // Log statistics for the tag_database file -console.log(`\n${chalk.bgWhite(chalk.black('=== TAG STATS ==='))}`) -for(let tagData of Object.entries(tagDbStats).filter(v => v[0] !== 'undefined')) +console.log(`\n${chalk.bgWhite(chalk.black('=== TAG STATS ==='))}`); +for (let tagData of Object.entries(tagDbStats).filter(v => v[0] !== 'undefined')) console.log(`${chalk.green(tagData[0])}: ${tagData[1]} snippets`); -console.log(`${chalk.blue('New untagged snippets (will be tagged as \'uncategorized\'):')} ${missingTags}\n`); +console.log( + `${chalk.blue("New untagged snippets (will be tagged as 'uncategorized'):")} ${missingTags}\n` +); // Log a success message console.log(`${chalk.green('SUCCESS!')} tag_database file updated!`); // Log the time taken diff --git a/scripts/tdd-script.js b/scripts/tdd-script.js deleted file mode 100644 index 335ee961f..000000000 --- a/scripts/tdd-script.js +++ /dev/null @@ -1,41 +0,0 @@ -const fs = require('fs-extra'); - -const SNIPPETS_PATH = './snippets'; -const TEST_PATH = './test'; - -const snippetFiles = fs.readdirSync(SNIPPETS_PATH, 'utf8') - .map(fileName => fileName.slice(0, -3)); - -fs.removeSync(TEST_PATH); - -snippetFiles - .map(fileName => { fs.ensureDirSync(`${TEST_PATH}/${fileName}`); return fileName}) - .map(fileName => { - - const fileData = fs.readFileSync(`${SNIPPETS_PATH}/${fileName}.md`, 'utf8'); - const fileCode = fileData.slice( fileData.indexOf('```js'), fileData.lastIndexOf('```') + 3 ); - const blockMarkers = fileCode.split('\n').map((line, lineIndex) => line.slice(0, 3) === '```' ? lineIndex : '//CLEAR//').filter(x => !(x === '//CLEAR//')) - const fileFunction = fileCode.split('\n').map(line => line.trim()).filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]); - const fileExample = fileCode.split('\n').map(line => line.trim()).filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]); - - const exportFile = `module.exports = ${fileFunction.join('\n').slice(17)}`; - const exportTest = [ - `const test = require('tape');`, - `const ${fileName} = require('./${fileName}.js');`, - `test('Testing ${fileName}', (t) => {`, - `//For more information on all the methods supported by tape\n//Please go to https://github.com/substack/tape`, - `//t.deepEqual(${fileName}(args..), 'Expected');`, - `//t.equal(${fileName}(args..), 'Expected');`, - `//t.false(${fileName}(args..), 'Expected');`, - `//t.true(${fileName}(args..), 'Expected');`, - `//t.throws(${fileName}(args..), 'Expected');`, - `t.end();`, - `});` - ].join('\n') - - - fs.writeFileSync(`${TEST_PATH}/${fileName}/${fileName}.js`, exportFile); - fs.writeFileSync(`${TEST_PATH}/${fileName}/${fileName}.test.js`, exportTest); - - return fileName; - }) diff --git a/scripts/tdd.js b/scripts/tdd.js new file mode 100644 index 000000000..d67396d7b --- /dev/null +++ b/scripts/tdd.js @@ -0,0 +1,50 @@ +const fs = require('fs-extra'); + +const SNIPPETS_PATH = './snippets'; +const TEST_PATH = './test'; + +const snippetFiles = fs.readdirSync(SNIPPETS_PATH, 'utf8').map(fileName => fileName.slice(0, -3)); + +fs.removeSync(TEST_PATH); + +snippetFiles + .map(fileName => { + fs.ensureDirSync(`${TEST_PATH}/${fileName}`); + return fileName; + }) + .map(fileName => { + const fileData = fs.readFileSync(`${SNIPPETS_PATH}/${fileName}.md`, 'utf8'); + const fileCode = fileData.slice(fileData.indexOf('```js'), fileData.lastIndexOf('```') + 3); + const blockMarkers = fileCode + .split('\n') + .map((line, lineIndex) => (line.slice(0, 3) === '```' ? lineIndex : '//CLEAR//')) + .filter(x => !(x === '//CLEAR//')); + const fileFunction = fileCode + .split('\n') + .map(line => line.trim()) + .filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]); + const fileExample = fileCode + .split('\n') + .map(line => line.trim()) + .filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]); + + const exportFile = `module.exports = ${fileFunction.join('\n').slice(17)}`; + const exportTest = [ + `const test = require('tape');`, + `const ${fileName} = require('./${fileName}.js');`, + `test('Testing ${fileName}', (t) => {`, + `//For more information on all the methods supported by tape\n//Please go to https://github.com/substack/tape`, + `//t.deepEqual(${fileName}(args..), 'Expected');`, + `//t.equal(${fileName}(args..), 'Expected');`, + `//t.false(${fileName}(args..), 'Expected');`, + `//t.true(${fileName}(args..), 'Expected');`, + `//t.throws(${fileName}(args..), 'Expected');`, + `t.end();`, + `});` + ].join('\n'); + + fs.writeFileSync(`${TEST_PATH}/${fileName}/${fileName}.js`, exportFile); + fs.writeFileSync(`${TEST_PATH}/${fileName}/${fileName}.test.js`, exportTest); + + return fileName; + }); diff --git a/scripts/web-script.js b/scripts/web-script.js deleted file mode 100644 index 1801547fc..000000000 --- a/scripts/web-script.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - This is the web builder script that generates the README file. - Run using `npm run webber`. -*/ -// Load modules -const fs = require('fs-extra'), path = require('path'), chalk = require('chalk'), - md = require('markdown-it')(), minify = require('html-minifier').minify; -// Compile the mini.css framework and custom CSS styles, using `node-sass`. -const sass = require('node-sass'); - sass.render({ - file: path.join('docs','mini','flavor.scss'), - outFile: path.join('docs','mini.css'), - outputStyle: 'compressed' - }, function(err, result) { - if(!err){ - fs.writeFile(path.join('docs','mini.css'), result.css, function(err2){ - if(!err2) console.log(`${chalk.green('SUCCESS!')} mini.css file generated!`); - else console.log(`${chalk.red('ERROR!')} During mini.css file generation: ${err}`); - }); - } - else { - console.log(`${chalk.red('ERROR!')} During mini.css file generation: ${err}`); - } - }); -// Set variables for paths -const snippetsPath = './snippets', staticPartsPath = './static-parts', docsPath = './docs'; -// Set variables for script -let snippets = {}, startPart = '', endPart = '', output = '', tagDbData = {}; -// Load helper functions (these are from existing snippets in 30 seconds of code!) -const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {}); -const capitalize = (str, lowerRest = false) => str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1)); -// Start the timer of the script -console.time('Builder'); -// Synchronously read all snippets and sort them as necessary (case-insensitive) -try { - let snippetFilenames = fs.readdirSync(snippetsPath); - snippetFilenames.sort((a, b) => { - a = a.toLowerCase(); - b = b.toLowerCase(); - if (a < b) return -1; - if (a > b) return 1; - return 0; - }); - // Store the data read from each snippet in the appropriate object - for(let snippet of snippetFilenames) snippets[snippet] = fs.readFileSync(path.join(snippetsPath,snippet),'utf8'); -} -catch (err){ // Handle errors (hopefully not!) - console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`); - process.exit(1); -} -// Load static parts for the index.html file -try { - startPart = fs.readFileSync(path.join(staticPartsPath,'index-start.html'),'utf8'); - endPart = fs.readFileSync(path.join(staticPartsPath,'index-end.html'),'utf8'); -} -catch (err){ // Handle errors (hopefully not!) - console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`); - process.exit(1); -} -// Load tag data from the database -try { - tagDbData = objectFromPairs(fs.readFileSync('tag_database','utf8').split('\n').slice(0,-1).map(v => v.split(':').slice(0,2))); -} -catch (err){ // Handle errors (hopefully not!) - console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`); - process.exit(1); -} -// Create the output for the index.html file -try { - // Add the start static part - output += `${startPart+'\n'}`; - let uncategorizedOutput = ''; - // Loop over tags and snippets to create the table of contents - for(let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))].filter(v => v).sort((a,b) => a.localeCompare(b))){ - if(capitalize(tag, true)=='Uncategorized') { - uncategorizedOutput +=`

`+md.render(`${capitalize(tag, true)}\n`).replace(/

/g,'').replace(/<\/p>/g,'')+`

`; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - uncategorizedOutput += md.render(`[${taggedSnippet[0]}](#${taggedSnippet[0].toLowerCase()})\n`).replace(/

/g,'').replace(/<\/p>/g,'').replace(/`+md.render(`${capitalize(tag, true)}\n`).replace(/

/g,'').replace(/<\/p>/g,'')+``; - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - output += md.render(`[${taggedSnippet[0]}](#${taggedSnippet[0].toLowerCase()})\n`).replace(/

/g,'').replace(/<\/p>/g,'').replace(/

`; - output += ` `; - uncategorizedOutput = ''; - // Loop over tags and snippets to create the list of snippets - for(let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))].filter(v => v).sort((a,b) => a.localeCompare(b))){ - if(capitalize(tag, true)=='Uncategorized') { - uncategorizedOutput +=md.render(`## ${capitalize(tag, true)}\n`).replace(/

/g,'

'); - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - uncategorizedOutput += '
' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(/

/g,'

') + '

'; - } else { - output +=md.render(`## ${capitalize(tag, true)}\n`).replace(/

/g,'

'); - for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) - output += '
' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(/

/g,'

') + '

'; - } - } - output += uncategorizedOutput; - // Add the ending static part - output += `\n${endPart+'\n'}`; - // Minify output - output = minify(output, { - collapseBooleanAttributes: true, - collapseWhitespace: true, - decodeEntities: false, - minifyCSS: true, - minifyJS: true, - keepClosingSlash: true, - processConditionalComments: true, - removeAttributeQuotes: false, - removeComments: true, - removeEmptyAttributes: false, - removeOptionalTags: false, - removeScriptTypeAttributes: false, - removeStyleLinkTypeAttributes: false, - trimCustomFragments: true, - }); - // Write to the index.html file - fs.writeFileSync(path.join(docsPath,'index.html'), output); -} -catch (err){ // Handle errors (hopefully not!) - console.log(`${chalk.red('ERROR!')} During index.html generation: ${err}`); - process.exit(1); -} -// Log a success message -console.log(`${chalk.green('SUCCESS!')} index.html file generated!`); -// Log the time taken -console.timeEnd('Builder'); diff --git a/scripts/web.js b/scripts/web.js new file mode 100644 index 000000000..ac72efc54 --- /dev/null +++ b/scripts/web.js @@ -0,0 +1,192 @@ +/* + This is the web builder script that generates the README file. + Run using `npm run webber`. +*/ +// Load modules +const fs = require('fs-extra'), + path = require('path'), + chalk = require('chalk'), + md = require('markdown-it')(), + minify = require('html-minifier').minify; +// Compile the mini.css framework and custom CSS styles, using `node-sass`. +const sass = require('node-sass'); +sass.render( + { + file: path.join('docs', 'mini', 'flavor.scss'), + outFile: path.join('docs', 'mini.css'), + outputStyle: 'compressed' + }, + function(err, result) { + if (!err) { + fs.writeFile(path.join('docs', 'mini.css'), result.css, function(err2) { + if (!err2) console.log(`${chalk.green('SUCCESS!')} mini.css file generated!`); + else console.log(`${chalk.red('ERROR!')} During mini.css file generation: ${err}`); + }); + } else { + console.log(`${chalk.red('ERROR!')} During mini.css file generation: ${err}`); + } + } +); +// Set variables for paths +const snippetsPath = './snippets', + staticPartsPath = './static-parts', + docsPath = './docs'; +// Set variables for script +let snippets = {}, + startPart = '', + endPart = '', + output = '', + tagDbData = {}; +// Load helper functions (these are from existing snippets in 30 seconds of code!) +const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); +const capitalize = (str, lowerRest = false) => + str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1)); +// Start the timer of the script +console.time('Builder'); +// Synchronously read all snippets and sort them as necessary (case-insensitive) +try { + let snippetFilenames = fs.readdirSync(snippetsPath); + snippetFilenames.sort((a, b) => { + a = a.toLowerCase(); + b = b.toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + }); + // Store the data read from each snippet in the appropriate object + for (let snippet of snippetFilenames) + snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8'); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`); + process.exit(1); +} +// Load static parts for the index.html file +try { + startPart = fs.readFileSync(path.join(staticPartsPath, 'index-start.html'), 'utf8'); + endPart = fs.readFileSync(path.join(staticPartsPath, 'index-end.html'), 'utf8'); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`); + process.exit(1); +} +// Load tag data from the database +try { + tagDbData = objectFromPairs( + fs + .readFileSync('tag_database', 'utf8') + .split('\n') + .slice(0, -1) + .map(v => v.split(':').slice(0, 2)) + ); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`); + process.exit(1); +} +// Create the output for the index.html file +try { + // Add the start static part + output += `${startPart + '\n'}`; + let uncategorizedOutput = ''; + // Loop over tags and snippets to create the table of contents + for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))] + .filter(v => v) + .sort((a, b) => a.localeCompare(b))) { + if (capitalize(tag, true) == 'Uncategorized') { + uncategorizedOutput += + `

` + + md + .render(`${capitalize(tag, true)}\n`) + .replace(/

/g, '') + .replace(/<\/p>/g, '') + + `

`; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + uncategorizedOutput += md + .render(`[${taggedSnippet[0]}](#${taggedSnippet[0].toLowerCase()})\n`) + .replace(/

/g, '') + .replace(/<\/p>/g, '') + .replace(/` + + md + .render(`${capitalize(tag, true)}\n`) + .replace(/

/g, '') + .replace(/<\/p>/g, '') + + ``; + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + output += md + .render(`[${taggedSnippet[0]}](#${taggedSnippet[0].toLowerCase()})\n`) + .replace(/

/g, '') + .replace(/<\/p>/g, '') + .replace(/

`; + output += ` `; + uncategorizedOutput = ''; + // Loop over tags and snippets to create the list of snippets + for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))] + .filter(v => v) + .sort((a, b) => a.localeCompare(b))) { + if (capitalize(tag, true) == 'Uncategorized') { + uncategorizedOutput += md + .render(`## ${capitalize(tag, true)}\n`) + .replace(/

/g, '

'); + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + uncategorizedOutput += + '
' + + md + .render(`\n${snippets[taggedSnippet[0] + '.md']}`) + .replace(/

/g, '

') + + '

'; + } else { + output += md + .render(`## ${capitalize(tag, true)}\n`) + .replace(/

/g, '

'); + for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) + output += + '
' + + md + .render(`\n${snippets[taggedSnippet[0] + '.md']}`) + .replace(/

/g, '

') + + '

'; + } + } + output += uncategorizedOutput; + // Add the ending static part + output += `\n${endPart + '\n'}`; + // Minify output + output = minify(output, { + collapseBooleanAttributes: true, + collapseWhitespace: true, + decodeEntities: false, + minifyCSS: true, + minifyJS: true, + keepClosingSlash: true, + processConditionalComments: true, + removeAttributeQuotes: false, + removeComments: true, + removeEmptyAttributes: false, + removeOptionalTags: false, + removeScriptTypeAttributes: false, + removeStyleLinkTypeAttributes: false, + trimCustomFragments: true + }); + // Write to the index.html file + fs.writeFileSync(path.join(docsPath, 'index.html'), output); +} catch (err) { + // Handle errors (hopefully not!) + console.log(`${chalk.red('ERROR!')} During index.html generation: ${err}`); + process.exit(1); +} +// Log a success message +console.log(`${chalk.green('SUCCESS!')} index.html file generated!`); +// Log the time taken +console.timeEnd('Builder'); From db9c09e07654afc7a4fb4d073b6c149a1ae8684c Mon Sep 17 00:00:00 2001 From: bobby569 Date: Fri, 29 Dec 2017 22:41:43 -0500 Subject: [PATCH 66/74] fix fibonacci example typo --- README.md | 7 +++---- docs/index.html | 4 ++-- snippets/fibonacci.md | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 112aa68c6..eaefaf6ee 100644 --- a/README.md +++ b/README.md @@ -1107,8 +1107,8 @@ console.log(pulled); // [ 'b', 'd' ] QuickSort an Array (ascending sort by default). -Use recursion. -Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. +Use recursion. +Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter `desc` is truthy, return array sorts in descending order. ```js @@ -2276,7 +2276,7 @@ const factorial = n => Examples ```js -factorial(6); // 720 +factorial(6); // [0, 1, 1, 2, 3, 5] ``` @@ -4138,4 +4138,3 @@ validateNumber('10'); // true ## Credits *Icons made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).* - diff --git a/docs/index.html b/docs/index.html index a45295e6e..57d3b801a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -436,7 +436,7 @@ collatz(5); // 16 (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), [] ); -

fibonacci(6); // 720
+
fibonacci(6); // [0, 1, 1, 2, 3, 5]
 

fibonacciCountUntilNum

Returns the number of fibonnacci numbers up to num(0 and num inclusive).

Use a mathematical formula to calculate the number of fibonacci numbers until num.

const fibonacciCountUntilNum = num =>
   Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));
 
fibonacciCountUntilNum(10); // 7
@@ -842,4 +842,4 @@ console.log(sdbm('age')); // 808122783
 
toOrdinalSuffix('123'); // "123rd"
 

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
 
validateNumber('10'); // true
-

\ No newline at end of file +

diff --git a/snippets/fibonacci.md b/snippets/fibonacci.md index 0f14bce2b..382886e66 100644 --- a/snippets/fibonacci.md +++ b/snippets/fibonacci.md @@ -14,5 +14,5 @@ const fibonacci = n => ``` ```js -fibonacci(6); // 720 +fibonacci(6); // [0, 1, 1, 2, 3, 5] ``` From 8a55d2c91bee36e57e905b0e05ce50cc1c8ff883 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 30 Dec 2017 10:38:21 +0000 Subject: [PATCH 67/74] Travis build: 646 --- README.md | 28 ++++++++++++++++++++++++++++ docs/index.html | 5 ++++- snippets/byteSize.md | 4 ++-- tag_database | 1 + 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 112aa68c6..33b2821fd 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,15 @@ +### _Uncategorized_ + +
+View contents + +* [`byteSize`](#bytesize) + +
+ ## Adapter ### call @@ -4134,6 +4143,25 @@ validateNumber('10'); // true
[⬆ Back to top](#table-of-contents) +## _Uncategorized_ + +### byteSize + +Returns the length of string. + +Convert a given string to a [`Blob` Object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and find its `size`. + +```js +const byteSize = str => new Blob([str]).size; +``` + +```js +byteSize('😀'); // 4 +byteSize('Hello World'); // 11 +``` + +
[⬆ back to top](#table-of-contents) + ## Credits diff --git a/docs/index.html b/docs/index.html index a45295e6e..c02a63d29 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -842,4 +842,7 @@ console.log(sdbm('age')); // 808122783
 
toOrdinalSuffix('123'); // "123rd"
 

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
 
validateNumber('10'); // true
+

Uncategorized

byteSize

Returns the length of string.

Convert a given string to a Blob Object and find its size.

const byteSize = str => new Blob([str]).size;
+
byteSize('😀'); // 4
+byteSize('Hello World'); // 11
 

\ No newline at end of file diff --git a/snippets/byteSize.md b/snippets/byteSize.md index f55fcb931..5693da1ab 100644 --- a/snippets/byteSize.md +++ b/snippets/byteSize.md @@ -9,6 +9,6 @@ const byteSize = str => new Blob([str]).size; ``` ```js -byteSize("😀"); // 4 -byteSize("Hello World"); // 11 +byteSize('😀'); // 4 +byteSize('Hello World'); // 11 ``` diff --git a/tag_database b/tag_database index f5633a5fa..27aeb2dfd 100644 --- a/tag_database +++ b/tag_database @@ -2,6 +2,7 @@ anagrams:string arrayToHtmlList:browser average:math bottomVisible:browser +byteSize:uncategorized call:adapter capitalize:string capitalizeEveryWord:string From 72a0bb1b2cc0a4727dc6b126c2f1fb2febc640c6 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 30 Dec 2017 12:40:36 +0200 Subject: [PATCH 68/74] Update tag_database --- tag_database | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_database b/tag_database index 27aeb2dfd..4ed134dee 100644 --- a/tag_database +++ b/tag_database @@ -2,7 +2,7 @@ anagrams:string arrayToHtmlList:browser average:math bottomVisible:browser -byteSize:uncategorized +byteSize:string call:adapter capitalize:string capitalizeEveryWord:string From c527b5d5efc8a465c330cb348409169df1b58285 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 30 Dec 2017 10:41:33 +0000 Subject: [PATCH 69/74] Travis build: 648 --- README.md | 52 +++++++++++++++++++++++-------------------------- docs/index.html | 8 ++++---- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 33b2821fd..940c508a5 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ View contents * [`anagrams`](#anagrams) +* [`byteSize`](#bytesize) * [`capitalize`](#capitalize) * [`capitalizeEveryWord`](#capitalizeeveryword) * [`countVowels`](#countvowels) @@ -259,15 +260,6 @@ -### _Uncategorized_ - -
-View contents - -* [`byteSize`](#bytesize) - -
- ## Adapter ### call @@ -3249,6 +3241,29 @@ anagrams('abc'); // ['abc','acb','bac','bca','cab','cba']
[⬆ Back to top](#table-of-contents) +### byteSize + +Returns the length of string. + +Convert a given string to a [`Blob` Object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and find its `size`. + +```js +const byteSize = str => new Blob([str]).size; +``` + +
+Examples + +```js +byteSize('😀'); // 4 +byteSize('Hello World'); // 11 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### Capitalize Capitalizes the first letter of a string. @@ -4143,25 +4158,6 @@ validateNumber('10'); // true
[⬆ Back to top](#table-of-contents) -## _Uncategorized_ - -### byteSize - -Returns the length of string. - -Convert a given string to a [`Blob` Object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and find its `size`. - -```js -const byteSize = str => new Blob([str]).size; -``` - -```js -byteSize('😀'); // 4 -byteSize('Hello World'); // 11 -``` - -
[⬆ back to top](#table-of-contents) - ## Credits diff --git a/docs/index.html b/docs/index.html index c02a63d29..a5cbe91de 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -636,6 +636,9 @@ a === b; // false
     );
 };
 
anagrams('abc'); // ['abc','acb','bac','bca','cab','cba']
+

byteSize

Returns the length of string.

Convert a given string to a Blob Object and find its size.

const byteSize = str => new Blob([str]).size;
+
byteSize('😀'); // 4
+byteSize('Hello World'); // 11
 

Capitalize

Capitalizes the first letter of a string.

Use destructuring and toUpperCase() to capitalize first letter, ...rest to get array of characters after first letter and then Array.join('') to make it a string again. Omit the lowerRest parameter to keep the rest of the string intact, or set it to true to convert to lowercase.

const capitalize = ([first, ...rest], lowerRest = false) =>
   first.toUpperCase() + (lowerRest ? rest.join('').toLowerCase() : rest.join(''));
 
capitalize('fooBar'); // 'FooBar'
@@ -842,7 +845,4 @@ console.log(sdbm('age')); // 808122783
 
toOrdinalSuffix('123'); // "123rd"
 

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
 
validateNumber('10'); // true
-

Uncategorized

byteSize

Returns the length of string.

Convert a given string to a Blob Object and find its size.

const byteSize = str => new Blob([str]).size;
-
byteSize('😀'); // 4
-byteSize('Hello World'); // 11
 

\ No newline at end of file From 38cdc85f38bc50868749cdd70589c2d5374ea724 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 30 Dec 2017 12:52:30 +0200 Subject: [PATCH 70/74] Update onUserInputChange.md --- snippets/onUserInputChange.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/snippets/onUserInputChange.md b/snippets/onUserInputChange.md index d726c51fb..99f5ac60d 100644 --- a/snippets/onUserInputChange.md +++ b/snippets/onUserInputChange.md @@ -1,23 +1,18 @@ ### onUserInputChange -Will run the callback whenever the user changes their input type (either `mouse` or `touch`). This is useful -if you want to disable certain code depending on if the user is using touch as input or a mouse (including trackpads). +Run the callback whenever the user input type changes (`mouse` or `touch`). Useful for enabling/disabling code depending on the input device. This process is dynamic and works with hybrid devices (e.g. touchscreen laptops). Use two event listeners. Assume `mouse` input initially and bind a `touchstart` event listener to the document. -On `touchstart`, the callback is run and supplied with the current input type as an argument. -Then, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms -using `performance.now()` (browsers recently fire them every animation frame). Run the callback and supply the new type -`mouse` as the argument. This process needs to happen dynamically because of hybrid devices (such as a touchscreen laptop), -where the user can switch between either input type at will. +On `touchstart`, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms, using `performance.now()`. +Run the callback with the input type as an argument in either of these situations. ```js const onUserInputChange = callback => { let type = 'mouse', lastTime = 0; const mousemoveHandler = () => { const now = performance.now(); - if (now - lastTime < 20) { + if (now - lastTime < 20) type = 'mouse', callback(type), document.removeEventListener('mousemove', mousemoveHandler); - } lastTime = now; }; document.addEventListener('touchstart', () => { From 856df6f586ac8bc0502577061ff56e4b8975e964 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 30 Dec 2017 11:00:08 +0000 Subject: [PATCH 71/74] Travis build: 653 --- README.md | 9 +++++---- docs/index.html | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6e58830e2..710164935 100644 --- a/README.md +++ b/README.md @@ -1108,8 +1108,8 @@ console.log(pulled); // [ 'b', 'd' ] QuickSort an Array (ascending sort by default). -Use recursion. -Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. +Use recursion. +Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter `desc` is truthy, return array sorts in descending order. ```js @@ -2277,7 +2277,7 @@ const factorial = n => Examples ```js -factorial(6); // [0, 1, 1, 2, 3, 5] +factorial(6); // 720 ``` @@ -2304,7 +2304,7 @@ const fibonacci = n => Examples ```js -fibonacci(6); // 720 +fibonacci(6); // [0, 1, 1, 2, 3, 5] ``` @@ -4162,3 +4162,4 @@ validateNumber('10'); // true ## Credits *Icons made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).* + diff --git a/docs/index.html b/docs/index.html index be337d555..56bfe1b42 100644 --- a/docs/index.html +++ b/docs/index.html @@ -845,4 +845,4 @@ console.log(sdbm('age')); // 808122783
toOrdinalSuffix('123'); // "123rd"
 

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
 
validateNumber('10'); // true
-

+

\ No newline at end of file From 8d273b5daee010fcb64e3217908365827f816a22 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 30 Dec 2017 11:09:01 +0000 Subject: [PATCH 72/74] Travis build: 655 --- README.md | 40 +++++++++++++++++++++++++++++++++++ docs/index.html | 19 ++++++++++++++++- snippets/onUserInputChange.md | 9 ++++---- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 710164935..c568be78f 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ * [`hasClass`](#hasclass) * [`hide`](#hide) * [`httpsRedirect`](#httpsredirect) +* [`onUserInputChange`](#onuserinputchange) * [`redirect`](#redirect) * [`scrollToTop`](#scrolltotop) * [`setStyle`](#setstyle) @@ -1704,6 +1705,45 @@ const httpsRedirect = () => {
[⬆ Back to top](#table-of-contents) +### onUserInputChange + +Run the callback whenever the user input type changes (`mouse` or `touch`). Useful for enabling/disabling code depending on the input device. This process is dynamic and works with hybrid devices (e.g. touchscreen laptops). + +Use two event listeners. Assume `mouse` input initially and bind a `touchstart` event listener to the document. +On `touchstart`, add a `mousemove` event listener to listen for two consecutive `mousemove` events firing within 20ms, using `performance.now()`. +Run the callback with the input type as an argument in either of these situations. + +```js +const onUserInputChange = callback => { + let type = 'mouse', + lastTime = 0; + const mousemoveHandler = () => { + const now = performance.now(); + if (now - lastTime < 20) + (type = 'mouse'), callback(type), document.removeEventListener('mousemove', mousemoveHandler); + lastTime = now; + }; + document.addEventListener('touchstart', () => { + if (type === 'touch') return; + (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler); + }); +}; +``` + +
+Examples + +```js +onUserInputChange(type => { + console.log('The user is now using', type, 'as an input method.'); +}); +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### redirect Redirects to a specified URL. diff --git a/docs/index.html b/docs/index.html index 56bfe1b42..ec5a6462d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -325,6 +325,23 @@ elementIsVisibleInViewport(el, true); // true // (partially visible)
 

httpsRedirect

Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn't take it back to the HTTP page as its replaced in the history.

Use location.protocol to get the protocol currently being used. If it's not HTTPS, use location.replace() to replace the existing page with the HTTPS version of the page. Use location.href to get the full address, split it with String.split() and remove the protocol part of the URL.

const httpsRedirect = () => {
   if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
 };
+

onUserInputChange

Run the callback whenever the user input type changes (mouse or touch). Useful for enabling/disabling code depending on the input device. This process is dynamic and works with hybrid devices (e.g. touchscreen laptops).

Use two event listeners. Assume mouse input initially and bind a touchstart event listener to the document. On touchstart, add a mousemove event listener to listen for two consecutive mousemove events firing within 20ms, using performance.now(). Run the callback with the input type as an argument in either of these situations.

const onUserInputChange = callback => {
+  let type = 'mouse',
+    lastTime = 0;
+  const mousemoveHandler = () => {
+    const now = performance.now();
+    if (now - lastTime < 20)
+      (type = 'mouse'), callback(type), document.removeEventListener('mousemove', mousemoveHandler);
+    lastTime = now;
+  };
+  document.addEventListener('touchstart', () => {
+    if (type === 'touch') return;
+    (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler);
+  });
+};
+
onUserInputChange(type => {
+  console.log('The user is now using', type, 'as an input method.');
+});
 

redirect

Redirects to a specified URL.

Use window.location.href or window.location.replace() to redirect to url. Pass a second argument to simulate a link click (true - default) or an HTTP redirect (false).

const redirect = (url, asLink = true) =>
   asLink ? (window.location.href = url) : window.location.replace(url);
 
redirect('https://google.com');
diff --git a/snippets/onUserInputChange.md b/snippets/onUserInputChange.md
index 99f5ac60d..a159c835d 100644
--- a/snippets/onUserInputChange.md
+++ b/snippets/onUserInputChange.md
@@ -8,16 +8,17 @@ Run the callback with the input type as an argument in either of these situation
 
 ```js
 const onUserInputChange = callback => {
-  let type = 'mouse', lastTime = 0;
+  let type = 'mouse',
+    lastTime = 0;
   const mousemoveHandler = () => {
     const now = performance.now();
-    if (now - lastTime < 20) 
-      type = 'mouse', callback(type), document.removeEventListener('mousemove', mousemoveHandler);
+    if (now - lastTime < 20)
+      (type = 'mouse'), callback(type), document.removeEventListener('mousemove', mousemoveHandler);
     lastTime = now;
   };
   document.addEventListener('touchstart', () => {
     if (type === 'touch') return;
-    type = 'touch', callback(type), document.addEventListener('mousemove', mousemoveHandler);
+    (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler);
   });
 };
 ```

From 16bf9cfb0b67adb053731f81ff6d79ffc4a9668d Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Sat, 30 Dec 2017 13:19:20 +0200
Subject: [PATCH 73/74] Update tag_database

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

diff --git a/tag_database b/tag_database
index 675b144b9..d897e319c 100644
--- a/tag_database
+++ b/tag_database
@@ -88,7 +88,7 @@ objectFromPairs:object
 objectToPairs:object
 onUserInputChange:browser
 orderBy:object
-palindrome:math
+palindrome:string
 percentile:math
 pick:array
 pipeFunctions:adapter

From 47eda988177e1cbbb032f415adc5589ad7123f09 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Sat, 30 Dec 2017 11:20:36 +0000
Subject: [PATCH 74/74] Travis build: 657

---
 README.md       | 66 ++++++++++++++++++++++++-------------------------
 docs/index.html | 24 +++++++++---------
 2 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/README.md b/README.md
index c568be78f..900a3b462 100644
--- a/README.md
+++ b/README.md
@@ -161,7 +161,6 @@
 * [`max`](#max)
 * [`median`](#median)
 * [`min`](#min)
-* [`palindrome`](#palindrome)
 * [`percentile`](#percentile)
 * [`powerset`](#powerset)
 * [`primes`](#primes)
@@ -222,6 +221,7 @@
 * [`escapeHTML`](#escapehtml)
 * [`escapeRegExp`](#escaperegexp)
 * [`fromCamelCase`](#fromcamelcase)
+* [`palindrome`](#palindrome)
 * [`repeatString`](#repeatstring)
 * [`reverseString`](#reversestring)
 * [`sortCharactersInString`](#sortcharactersinstring)
@@ -2685,38 +2685,6 @@ min([10, 1, 5]); // 1
 
[⬆ Back to top](#table-of-contents) -### palindrome - -Returns `true` if the given string is a palindrome, `false` otherwise. - -Convert string `toLowerCase()` and use `replace()` to remove non-alphanumeric characters from it. -Then, `split('')` into individual characters, `reverse()`, `join('')` and compare to the original, unreversed string, after converting it `tolowerCase()`. - -```js -const palindrome = str => { - const s = str.toLowerCase().replace(/[\W_]/g, ''); - return ( - s === - s - .split('') - .reverse() - .join('') - ); -}; -``` - -
-Examples - -```js -palindrome('taco cat'); // true -``` - -
- -
[⬆ Back to top](#table-of-contents) - - ### percentile Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. @@ -3458,6 +3426,38 @@ fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property'
[⬆ Back to top](#table-of-contents) +### palindrome + +Returns `true` if the given string is a palindrome, `false` otherwise. + +Convert string `toLowerCase()` and use `replace()` to remove non-alphanumeric characters from it. +Then, `split('')` into individual characters, `reverse()`, `join('')` and compare to the original, unreversed string, after converting it `tolowerCase()`. + +```js +const palindrome = str => { + const s = str.toLowerCase().replace(/[\W_]/g, ''); + return ( + s === + s + .split('') + .reverse() + .join('') + ); +}; +``` + +
+Examples + +```js +palindrome('taco cat'); // true +``` + +
+ +
[⬆ Back to top](#table-of-contents) + + ### repeatString Repeats a string n times using `String.repeat()` diff --git a/docs/index.html b/docs/index.html index ec5a6462d..356e7004a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ wrapper.appendChild(box); box.appendChild(el); }); - }

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

 

Adapter

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);
+    }

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

 

Adapter

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);
 
Promise.resolve([1, 2, 3])
   .then(call('map', x => 2 * x))
   .then(console.log); //[ 2, 4, 6 ]
@@ -517,17 +517,6 @@ lcm([1, 3, 4], 5); // 60
 median([0, 10, -2, 7]); // 3.5
 

min

Returns the minimum value in an array.

Use Math.min() combined with the spread operator (...) to get the minimum value in the array.

const min = arr => Math.min(...[].concat(...arr));
 
min([10, 1, 5]); // 1
-

palindrome

Returns true if the given string is a palindrome, false otherwise.

Convert string toLowerCase() and use replace() to remove non-alphanumeric characters from it. Then, split('') into individual characters, reverse(), join('') and compare to the original, unreversed string, after converting it tolowerCase().

const palindrome = str => {
-  const s = str.toLowerCase().replace(/[\W_]/g, '');
-  return (
-    s ===
-    s
-      .split('')
-      .reverse()
-      .join('')
-  );
-};
-
palindrome('taco cat'); // true
 

percentile

Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.

Use Array.reduce() to calculate how many numbers are below the value and how many are the same value and apply the percentile formula.

const percentile = (arr, val) =>
   100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0) / arr.length;
 
percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6); // 55
@@ -688,6 +677,17 @@ countVowels('gym'); // 0
 
fromCamelCase('someDatabaseFieldName', ' '); // 'some database field name'
 fromCamelCase('someLabelThatNeedsToBeCamelized', '-'); // 'some-label-that-needs-to-be-camelized'
 fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property'
+

palindrome

Returns true if the given string is a palindrome, false otherwise.

Convert string toLowerCase() and use replace() to remove non-alphanumeric characters from it. Then, split('') into individual characters, reverse(), join('') and compare to the original, unreversed string, after converting it tolowerCase().

const palindrome = str => {
+  const s = str.toLowerCase().replace(/[\W_]/g, '');
+  return (
+    s ===
+    s
+      .split('')
+      .reverse()
+      .join('')
+  );
+};
+
palindrome('taco cat'); // true
 

repeatString

Repeats a string n times using String.repeat()

If no string is provided the default is "" and the default number of times is 2.

const repeatString = (str = '', num = 2) => {
   return num >= 0 ? str.repeat(num) : str;
 };