From bec6123ba5d45f8722f36ded0fda27df705533d5 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Fri, 22 Dec 2017 00:12:38 +0100 Subject: [PATCH 01/96] Insight.io badge --- static-parts/README-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index 08e8ee6b7..bbc9c39e1 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -1,6 +1,6 @@ ![Logo](/logo.png) -# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) +# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From 9cad6395b25a20ae26e2feb1fd2097107c70504e Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Fri, 22 Dec 2017 00:16:02 +0100 Subject: [PATCH 02/96] PRs welcome badge --- static-parts/README-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index bbc9c39e1..f3393baa5 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -1,6 +1,6 @@ ![Logo](/logo.png) -# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) +# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) | [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)]((https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From f19a79b8631197dd68917d9540f41b7c0a3fadea Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Thu, 21 Dec 2017 16:42:15 -0800 Subject: [PATCH 03/96] [Feature] Add flip adapter --- snippets/flip.md | 17 +++++++++++++++++ tag_database | 1 + 2 files changed, 18 insertions(+) create mode 100644 snippets/flip.md diff --git a/snippets/flip.md b/snippets/flip.md new file mode 100644 index 000000000..d20bda267 --- /dev/null +++ b/snippets/flip.md @@ -0,0 +1,17 @@ +### Flip + +Flip recieves a function the make the first argument the last + +Returning a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest + +```js +const flip = fn => (...args) => + fn( args.pop(), ...args ) +/* +var a = {} +var b = {test:1} +const mergeInto = flip(Object.assign) +mergeInto(a, b) // == b +Object.assign(b,a) // == b +*/ +``` diff --git a/tag_database b/tag_database index 78da7daaf..79f4a1318 100644 --- a/tag_database +++ b/tag_database @@ -124,3 +124,4 @@ without:array words:string zip:array zipObject:array +flip:adapter \ No newline at end of file From 963b489088015de04b94f681278e655f4d550eea Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Thu, 21 Dec 2017 16:47:12 -0800 Subject: [PATCH 04/96] Fix: example was a little wrong --- snippets/flip.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/snippets/flip.md b/snippets/flip.md index d20bda267..02901b34d 100644 --- a/snippets/flip.md +++ b/snippets/flip.md @@ -8,10 +8,12 @@ Returning a closure that takes variadic inputs, and splices the last argument to const flip = fn => (...args) => fn( args.pop(), ...args ) /* -var a = {} -var b = {test:1} -const mergeInto = flip(Object.assign) -mergeInto(a, b) // == b +var a = {name: "John Smith"} +var b = {} +const mergeFrom = flip(Object.assign) +let mergePerson = mergeFrom.bind(a) +mergePerson(b) // == b +b = {} Object.assign(b,a) // == b */ -``` +``` From 63f38faa83be04fe272dc5b8f5b611b80e070769 Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Thu, 21 Dec 2017 16:57:21 -0800 Subject: [PATCH 05/96] [UPDATE] Move Promisify to the Adapter category There are more adapters to come --- tag_database | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_database b/tag_database index 78da7daaf..3fbaff741 100644 --- a/tag_database +++ b/tag_database @@ -83,7 +83,7 @@ pick:array pipe:function powerset:math primes:math -promisify:function +promisify:adapter pull:array pullAtIndex:array pullAtValue:array From 3ac39580084ee3c8c25792871b915d6f3ab33a9d Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Thu, 21 Dec 2017 18:33:57 -0800 Subject: [PATCH 06/96] [FEATURE] add spreadOver snippet --- snippets/spreadOver.md | 15 +++++++++++++++ tag_database | 1 + 2 files changed, 16 insertions(+) create mode 100644 snippets/spreadOver.md diff --git a/snippets/spreadOver.md b/snippets/spreadOver.md new file mode 100644 index 000000000..5e8251d87 --- /dev/null +++ b/snippets/spreadOver.md @@ -0,0 +1,15 @@ +### Spread Over + +Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the functions + +Explain briefly how the snippet works. + +```js +const spreadOver = fn => argsArr => + fn(...argsArr) +/* +const arrayMax = spreadOver(Math.max) +arrayMax([1,2,3]) // -> 3 +arrayMax([1,2,4]) // -> 4 +*/ +``` \ No newline at end of file diff --git a/tag_database b/tag_database index 78da7daaf..c2c5be33f 100644 --- a/tag_database +++ b/tag_database @@ -105,6 +105,7 @@ similarity:array sleep:function sortCharactersInString:string speechSynthesis:media +spreadOver:adapter standardDeviation:math symmetricDifference:array tail:array From 8c59d59a9e585b501fe5706abc6e26e0bf4151ef Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Thu, 21 Dec 2017 19:08:36 -0800 Subject: [PATCH 07/96] [FEATURE] add collectInto snippet --- snippets/collectInto.md | 16 ++++++++++++++++ tag_database | 1 + 2 files changed, 17 insertions(+) create mode 100644 snippets/collectInto.md diff --git a/snippets/collectInto.md b/snippets/collectInto.md new file mode 100644 index 000000000..468e2af80 --- /dev/null +++ b/snippets/collectInto.md @@ -0,0 +1,16 @@ +### Colect Into + +Changes a function that accepts an array into a variadic function + +Given a funciton, return a closure that collects all inputs into an array accepting function + +```js +const collectInto = fn => ( ...args ) => fn( args ) +/* +const Pall = collectInto( Promise.all.bind(Promise) ) +var p1 = Promise.resolve(1) +var p2 = Promise.resolve(2) +var p3 = new Promise((resolve) => setTimeout(resolve,2000,3)) +Pall(p1, p2, p3).then(console.log) +*/ +``` \ No newline at end of file diff --git a/tag_database b/tag_database index 78da7daaf..b361fe7cd 100644 --- a/tag_database +++ b/tag_database @@ -16,6 +16,7 @@ cleanObj:object coalesce:utility coalesceFactory:utility collatz:math +collectInto:adapter compact:array compose:function countOccurrences:array From 4bc4a236866430d2a6b1040439fcfa797ad615f6 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 09:36:36 +0200 Subject: [PATCH 08/96] Minor formatting --- snippets/flip.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/snippets/flip.md b/snippets/flip.md index 02901b34d..aed551287 100644 --- a/snippets/flip.md +++ b/snippets/flip.md @@ -1,12 +1,11 @@ ### Flip -Flip recieves a function the make the first argument the last +Flip takes a function as an argument, then makes the first argument the last -Returning a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest +Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest. ```js -const flip = fn => (...args) => - fn( args.pop(), ...args ) +const flip = fn => (...args) => fn( args.pop(), ...args ) /* var a = {name: "John Smith"} var b = {} From 5229f7c558e5c52c436859af2191064c0b1c0398 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 09:41:39 +0200 Subject: [PATCH 09/96] Minor formatting and updated description --- snippets/spreadOver.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/snippets/spreadOver.md b/snippets/spreadOver.md index 5e8251d87..6bfc0d0ed 100644 --- a/snippets/spreadOver.md +++ b/snippets/spreadOver.md @@ -1,15 +1,14 @@ ### Spread Over -Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the functions +Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. -Explain briefly how the snippet works. +Use closures and the spread operator (`...`) to map the array of arguments to the inputs of the function. ```js -const spreadOver = fn => argsArr => - fn(...argsArr) +const spreadOver = fn => argsArr => fn(...argsArr); /* const arrayMax = spreadOver(Math.max) arrayMax([1,2,3]) // -> 3 arrayMax([1,2,4]) // -> 4 */ -``` \ No newline at end of file +``` From af5b5b197ff8483be74bf08557ff42dbf22fde00 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 09:43:49 +0200 Subject: [PATCH 10/96] Update flip.md --- snippets/flip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/flip.md b/snippets/flip.md index aed551287..fa57897b7 100644 --- a/snippets/flip.md +++ b/snippets/flip.md @@ -1,4 +1,4 @@ -### Flip +### flip Flip takes a function as an argument, then makes the first argument the last From 60e4092cf5a6fbaf220c73b3822d355ac4a01ff4 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 09:44:14 +0200 Subject: [PATCH 11/96] Update spreadOver.md --- snippets/spreadOver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/spreadOver.md b/snippets/spreadOver.md index 6bfc0d0ed..39ea7362e 100644 --- a/snippets/spreadOver.md +++ b/snippets/spreadOver.md @@ -1,4 +1,4 @@ -### Spread Over +### spreadOver Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. From a5b4e3a752d1a36fabb971129a44ce653bcdd9dd Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 09:44:59 +0200 Subject: [PATCH 12/96] Minor formatting --- snippets/collectInto.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/collectInto.md b/snippets/collectInto.md index 468e2af80..8f9b34cd4 100644 --- a/snippets/collectInto.md +++ b/snippets/collectInto.md @@ -1,11 +1,11 @@ -### Colect Into +### collectInto -Changes a function that accepts an array into a variadic function +Changes a function that accepts an array into a variadic function. -Given a funciton, return a closure that collects all inputs into an array accepting function +Given a function, return a closure that collects all inputs into an array-accepting function. ```js -const collectInto = fn => ( ...args ) => fn( args ) +const collectInto = fn => ( ...args ) => fn( args ); /* const Pall = collectInto( Promise.all.bind(Promise) ) var p1 = Promise.resolve(1) @@ -13,4 +13,4 @@ var p2 = Promise.resolve(2) var p3 = new Promise((resolve) => setTimeout(resolve,2000,3)) Pall(p1, p2, p3).then(console.log) */ -``` \ No newline at end of file +``` From 979bfbd923af1681a68b60def2f1d662a2a1ba05 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 10:53:42 +0200 Subject: [PATCH 13/96] Update travis push Most of the guides I can find use the travis email and name to differentiate from user commits. This will come in handy later down the line to filter out build commits more easily. I'm pretty certain this will not break anything, but I'd like someone to take a look at it before merging. --- .travis/push.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/push.sh b/.travis/push.sh index 277140235..e3483a676 100755 --- a/.travis/push.sh +++ b/.travis/push.sh @@ -1,8 +1,8 @@ #!/bin/sh setup_git() { - git config --global user.email "david10608@gmail.com" - git config --global user.name "Pl4gue" + git config --global user.email "travis@travis-ci.org" + git config --global user.name "Travis CI" } commit_website_files() { From b8b6832a79c21eb274a28647485abb049bd33ae4 Mon Sep 17 00:00:00 2001 From: gokulk94 Date: Fri, 22 Dec 2017 14:40:18 +0530 Subject: [PATCH 14/96] add missing line of code to elementIsVisibleInViewport --- README.md | 2 +- snippets/elementIsVisibleInViewport.md | 1 + snippets/orderBy.md | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25490e54e..6bf32bb07 100644 --- a/README.md +++ b/README.md @@ -878,6 +878,7 @@ it is partially visible. ```js const elementIsVisibleInViewport = (el, partiallyVisible = false) => { const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; return partiallyVisible ? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) && ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) @@ -1694,7 +1695,6 @@ orderby(users, ['name', 'age']) -> [{name: 'barney', age: 34}, {name: 'barney', */ ``` - [⬆ back to top](#table-of-contents) ### select diff --git a/snippets/elementIsVisibleInViewport.md b/snippets/elementIsVisibleInViewport.md index 4f52d6ad7..01015d4fc 100644 --- a/snippets/elementIsVisibleInViewport.md +++ b/snippets/elementIsVisibleInViewport.md @@ -10,6 +10,7 @@ it is partially visible. ```js const elementIsVisibleInViewport = (el, partiallyVisible = false) => { const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; return partiallyVisible ? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) && ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) diff --git a/snippets/orderBy.md b/snippets/orderBy.md index 21baef3ac..c80b3667f 100644 --- a/snippets/orderBy.md +++ b/snippets/orderBy.md @@ -23,4 +23,3 @@ orderby(users, ['name', 'age'], ['asc', 'desc']) -> [{name: 'barney', age: 36}, orderby(users, ['name', 'age']) -> [{name: 'barney', age: 34}, {name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}] */ ``` - From be1b3d13ed99ce3ccdea21d81f388351ac3417c3 Mon Sep 17 00:00:00 2001 From: Soorena Date: Fri, 22 Dec 2017 14:54:06 +0330 Subject: [PATCH 15/96] Update README-start.md --- static-parts/README-start.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index f3393baa5..5f9eb4159 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -1,6 +1,7 @@ ![Logo](/logo.png) -# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) | [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)]((https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) +# 30 seconds of code +[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From df4d48b80c4c4192e90a8db1440fffadd6c387f3 Mon Sep 17 00:00:00 2001 From: iamsoorena Date: Fri, 22 Dec 2017 15:00:46 +0330 Subject: [PATCH 16/96] Remove redundant number characters check Remove unnecessary multiple array making with `.split()` Reducing lines and making it more terse and readable --- snippets/toDecimalMark.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index 79cea1840..deb196bed 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -6,12 +6,8 @@ Use `toString()` to convert the float `num` to a string, then use regex to separ ```js const toDecimalMark = (num) => { - let cleanNum = num.toString().split('').filter(n => '0123456789.'.includes(n)).join('') - let wholeNum = cleanNum.split('.')[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") - let decNum = `.${cleanNum.split('.')[1]}` - return wholeNum + decNum; + let numberParts = num.toString().split('.') + return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}` } // toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087' -// toDecimalMark(123.889087e2) //-> '12,388.9087' -// toDecimalMark('12305abc030388.9087') // -> '12,305,030,388.9087' ``` From 0bce00743e52f3949eabd74eb4177e4a1386da54 Mon Sep 17 00:00:00 2001 From: iamsoorena Date: Fri, 22 Dec 2017 15:03:55 +0330 Subject: [PATCH 17/96] Update description adding template literal explanation --- snippets/toDecimalMark.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index deb196bed..0a92fc73c 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -4,6 +4,8 @@ Convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/ Use `toString()` to convert the float `num` to a string, then use regex to separate every three characters of the integer part with a comma. +Use [Ttemplate Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to return joined parts. + ```js const toDecimalMark = (num) => { let numberParts = num.toString().split('.') From 0cf46cad2399b927dd1fe8e63910a78774fdeca0 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Fri, 22 Dec 2017 11:45:37 +0000 Subject: [PATCH 18/96] Travis build: 104 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5354b4407..87272c09c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ![Logo](/logo.png) -# 30 seconds of code [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) +# 30 seconds of code +[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From 81b59216bb30ba9e29395fbe9224e2611df37d59 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 13:58:12 +0000 Subject: [PATCH 19/96] Travis build: 111 --- README.md | 21 +++++++++++++++++++++ docs/index.html | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 87272c09c..ccf3db9f7 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ ## Table of Contents +### Adapter +* [`spreadOver`](#spreadover) + ### Array * [`arrayGcd`](#arraygcd) * [`arrayLcm`](#arraylcm) @@ -158,6 +161,24 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) +## Adapter + +### spreadOver + +Takes a veriadic 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. + +```js +const spreadOver = fn => argsArr => fn(...argsArr); +/* +const arrayMax = spreadOver(Math.max) +arrayMax([1,2,3]) // -> 3 +arrayMax([1,2,4]) // -> 4 +*/ +``` + +[⬆ back to top](#table-of-contents) ## Array ### arrayGcd diff --git a/docs/index.html b/docs/index.html index 58e9617c8..d645313ac 100644 --- a/docs/index.html +++ b/docs/index.html @@ -41,6 +41,9 @@ +

Adapter +

spreadOver +

Array

arrayGcd arrayLcm @@ -187,7 +190,18 @@ UUIDGenerator validateNumber -
 

Array

+
 

Adapter

+

spreadOver

+

Takes a veriadic 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

arrayGcd

Calculates the greatest common denominator (gcd) of an array of numbers.

Use Array.reduce() and the gcd formula (uses recursion) to calculate the greatest common denominator of an array of numbers.

From 0511159fe813a52208c8d17a4be3a071c5f61622 Mon Sep 17 00:00:00 2001 From: Soorena Date: Fri, 22 Dec 2017 17:34:45 +0330 Subject: [PATCH 20/96] Update flip.md updated formatting --- snippets/flip.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/flip.md b/snippets/flip.md index fa57897b7..91eae77a0 100644 --- a/snippets/flip.md +++ b/snippets/flip.md @@ -5,14 +5,14 @@ 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. ```js -const flip = fn => (...args) => fn( args.pop(), ...args ) +const flip = fn => (...args) => fn(args.pop(), ...args) /* -var a = {name: "John Smith"} -var b = {} +let a = {name: 'John Smith'} +let b = {} const mergeFrom = flip(Object.assign) let mergePerson = mergeFrom.bind(a) mergePerson(b) // == b b = {} -Object.assign(b,a) // == b +Object.assign(b, a) // == b */ ``` From 10c2adc83db6bbd70b47025df64cd171b3843e70 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 14:11:44 +0000 Subject: [PATCH 21/96] Travis build: 114 --- README.md | 25 +++++++++++++++++++++++++ docs/index.html | 18 ++++++++++++++++++ tag_database | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ccf3db9f7..68211d6e8 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,9 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) +### _Uncategorized_ +* [`flip`](#flip) + ## Adapter ### spreadOver @@ -2203,6 +2206,28 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == // validateNumber('10') -> true ``` +[⬆ back to top](#table-of-contents) +## _Uncategorized_ + +### 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. + +```js +const flip = fn => (...args) => fn(args.pop(), ...args) +/* +let a = {name: 'John Smith'} +let b = {} +const mergeFrom = flip(Object.assign) +let mergePerson = mergeFrom.bind(a) +mergePerson(b) // == b +b = {} +Object.assign(b, a) // == b +*/ +``` + [⬆ back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index d645313ac..734b92754 100644 --- a/docs/index.html +++ b/docs/index.html @@ -190,6 +190,9 @@ UUIDGenerator validateNumber +

Uncategorized +

flip +
 

Adapter

spreadOver

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

@@ -1340,6 +1343,21 @@ Use Number() to check if the coercion holds.

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

Uncategorized

+

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(a)
+mergePerson(b) // == b
+b = {}
+Object.assign(b, a) // == b
+*/
+

30 seconds of code is licensed under the CC0-1.0 license.
Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.
Ribbon made by Tim Holman is licensed by The MIT License
Built with the mini.css framework.

diff --git a/tag_database b/tag_database index a8d9016b2..4e941c125 100644 --- a/tag_database +++ b/tag_database @@ -39,6 +39,7 @@ fibonacci:math filterNonUnique:array flatten:array flattenDepth:array +flip:uncategorized fromCamelCase:string functionName:function gcd:math @@ -125,4 +126,3 @@ without:array words:string zip:array zipObject:array -flip:adapter \ No newline at end of file From dbcdf95162e7bc6ec7a5c60aa3fdc191fe8fe750 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 14:32:45 +0000 Subject: [PATCH 22/96] Travis build: 117 --- docs/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.html b/docs/index.html index 734b92754..b98e50408 100644 --- a/docs/index.html +++ b/docs/index.html @@ -596,6 +596,7 @@ Omit the second argument to determine if the element is entirely visible, or spe it is partially visible.

const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
   const { top, left, bottom, right } = el.getBoundingClientRect();
+  const { innerHeight, innerWidth } = window;
   return partiallyVisible
     ? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) &&
       ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth))

From 0a656f32e394393ece31c271443ab755cda7d407 Mon Sep 17 00:00:00 2001
From: Soorena 
Date: Fri, 22 Dec 2017 18:06:58 +0330
Subject: [PATCH 23/96] Update README-start.md

add semi-standard style badge
---
 static-parts/README-start.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/static-parts/README-start.md b/static-parts/README-start.md
index 5f9eb4159..15508b89b 100644
--- a/static-parts/README-start.md
+++ b/static-parts/README-start.md
@@ -1,7 +1,8 @@
 ![Logo](/logo.png)
 
 # 30 seconds of code 
-[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0)
+[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)
+
 > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.
 
 

From 4ce1a37a8eb20797c625b8f2a57454acee56d23e Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 22 Dec 2017 14:38:35 +0000
Subject: [PATCH 24/96] Travis build: 119

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index e7ae442f2..79f0cb38e 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
 ![Logo](/logo.png)
 
 # 30 seconds of code 
-[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0)
+[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)
+
 > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.
 
 

From c3db1940f703d1025feee5f5c32400fc6ab49491 Mon Sep 17 00:00:00 2001
From: Soorena 
Date: Fri, 22 Dec 2017 18:34:37 +0330
Subject: [PATCH 25/96] Update toDecimalMark.md

---
 snippets/toDecimalMark.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md
index 0a92fc73c..802578ec5 100644
--- a/snippets/toDecimalMark.md
+++ b/snippets/toDecimalMark.md
@@ -3,7 +3,6 @@
 Convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form.
 
 Use `toString()` to convert the float `num` to a string, then use regex to separate every three characters of the integer part with a comma.
-
 Use [Ttemplate Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to return joined parts.
 
  ```js

From 9159e22352a0077086d12151d2e1d1c813a967c3 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 22 Dec 2017 15:12:10 +0000
Subject: [PATCH 26/96] Travis build: 122

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

diff --git a/README.md b/README.md
index 79f0cb38e..8f122036a 100644
--- a/README.md
+++ b/README.md
@@ -2143,17 +2143,14 @@ const timeTaken = callback => {
 Convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form.
 
 Use `toString()` to convert the float `num` to a string, then use regex to separate every three characters of the integer part with a comma.
+Use [Ttemplate Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to return joined parts.
 
  ```js
 const toDecimalMark = (num) => {
-  let cleanNum = num.toString().split('').filter(n => '0123456789.'.includes(n)).join('') 
-  let wholeNum = cleanNum.split('.')[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",")
-  let decNum = `.${cleanNum.split('.')[1]}`
-  return wholeNum + decNum;
+  let numberParts = num.toString().split('.')
+  return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}`
 }
 // toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087'
-// toDecimalMark(123.889087e2) //-> '12,388.9087'
-// toDecimalMark('12305abc030388.9087') // -> '12,305,030,388.9087'
 ```
 
 [⬆ back to top](#table-of-contents)
diff --git a/docs/index.html b/docs/index.html
index b98e50408..9ebc63021 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1303,16 +1303,13 @@ Omit the second argument to use the default regex.


toDecimalMark

Convert a float-point arithmetic to the Decimal mark form.

-

Use toString() to convert the float num to a string, then use regex to separate every three characters of the integer part with a comma.

+

Use toString() to convert the float num to a string, then use regex to separate every three characters of the integer part with a comma. +Use Ttemplate Literals to return joined parts.

const toDecimalMark = (num) => {
- let cleanNum = num.toString().split('').filter(n => '0123456789.'.includes(n)).join('') 
- let wholeNum = cleanNum.split('.')[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",")
- let decNum = `.${cleanNum.split('.')[1]}`
- return wholeNum + decNum;
+ let numberParts = num.toString().split('.')
+ return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}`
 }
 // toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087'
-// toDecimalMark(123.889087e2) //-> '12,388.9087'
-// toDecimalMark('12305abc030388.9087') // -> '12,305,030,388.9087'
 

toOrdinalSuffix

Adds an ordinal suffix to a number.

From d756f47860ac64b1fbcb47514965396d5a49c251 Mon Sep 17 00:00:00 2001 From: iamsoorena Date: Fri, 22 Dec 2017 18:51:50 +0330 Subject: [PATCH 27/96] I found a way more ES6ish way to do this --- snippets/toDecimalMark.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index 802578ec5..4ad259f35 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -1,14 +1,8 @@ ### toDecimalMark -Convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. - -Use `toString()` to convert the float `num` to a string, then use regex to separate every three characters of the integer part with a comma. -Use [Ttemplate Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to return joined parts. +Use `toLocaleString()` to convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. It makes a comma separated string from a number. ```js -const toDecimalMark = (num) => { - let numberParts = num.toString().split('.') - return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}` -} -// toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087' +const toDecimalMark = (num) => num.toLocaleString() +// toDecimalMark(12305030388.9087) -> "12,305,030,388.9087" ``` From 388c56ce2fc16b39751cf19e3969f55d280daf9c Mon Sep 17 00:00:00 2001 From: Soorena Date: Fri, 22 Dec 2017 19:01:24 +0330 Subject: [PATCH 28/96] Update toDecimalMark.md --- snippets/toDecimalMark.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index 4ad259f35..bb7cadf52 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -3,6 +3,6 @@ Use `toLocaleString()` to convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. It makes a comma separated string from a number. ```js -const toDecimalMark = (num) => num.toLocaleString() +const toDecimalMark = num => num.toLocaleString() // toDecimalMark(12305030388.9087) -> "12,305,030,388.9087" ``` From 2ffc3d2b8f44696da25161e666960851df5fe6cd Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 15:57:15 +0000 Subject: [PATCH 29/96] Travis build: 126 --- README.md | 46 +++++++++++++++++++++++----------------------- docs/index.html | 34 +++++++++++++++++----------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 8f122036a..d7b85ac23 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ## Table of Contents ### Adapter +* [`promisify`](#promisify) * [`spreadOver`](#spreadover) ### Array @@ -83,7 +84,6 @@ * [`curry`](#curry) * [`functionName`](#functionname) * [`pipe`](#pipe) -* [`promisify`](#promisify) * [`runPromisesInSeries`](#runpromisesinseries) * [`sleep`](#sleep) @@ -167,6 +167,28 @@ ## Adapter +### 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`](https://nodejs.org/api/util.html#util_util_promisify_original)* + +```js +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)) +// delay(2000).then(() => console.log('Hi!')) -> Promise resolves after 2s +``` + +[⬆ back to top](#table-of-contents) + ### spreadOver Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. @@ -1135,28 +1157,6 @@ multiplyAndAdd5(5, 2) -> 15 [⬆ back to top](#table-of-contents) -### 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`](https://nodejs.org/api/util.html#util_util_promisify_original)* - -```js -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)) -// delay(2000).then(() => console.log('Hi!')) -> Promise resolves after 2s -``` - -[⬆ back to top](#table-of-contents) - ### runPromisesInSeries Runs an array of promises in series. diff --git a/docs/index.html b/docs/index.html index 9ebc63021..551066214 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,8 @@

Adapter -

spreadOver +promisify +spreadOver

Array

arrayGcd @@ -111,7 +112,6 @@ curry functionName pipe -promisify runPromisesInSeries sleep @@ -194,7 +194,21 @@ flip
 

Adapter

-

spreadOver

+

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))
+// delay(2000).then(() => console.log('Hi!')) -> Promise resolves after 2s
+
+

spreadOver

Takes a veriadic 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);
@@ -733,20 +747,6 @@ 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) =>
-    new Promise((resolve, reject) =>
-      func(...args, (err, result) =>
-        err ? reject(err) : resolve(result))
-    );
-// const delay = promisify((d, cb) => setTimeout(cb, d))
-// delay(2000).then(() => console.log('Hi!')) -> Promise resolves after 2s
-

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.

From 5662ba57bde474840799efdeda60fedd462a4b41 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 18:13:22 +0200 Subject: [PATCH 30/96] Add toSnakeCase --- snippets/toSnakeCase.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 snippets/toSnakeCase.md diff --git a/snippets/toSnakeCase.md b/snippets/toSnakeCase.md new file mode 100644 index 000000000..0ea69bcaf --- /dev/null +++ b/snippets/toSnakeCase.md @@ -0,0 +1,14 @@ +### toSnakeCase + +Converts a string to snakecase. + +Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. + +```js +const toSnakeCase = str => + str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_'); +// 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' +``` From 3efb63fa9f7765b7acf7a28c6c191a44c6048c0a Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 22 Dec 2017 18:15:55 +0200 Subject: [PATCH 31/96] Update tag_database --- tag_database | 1 + 1 file changed, 1 insertion(+) diff --git a/tag_database b/tag_database index deb4c8902..e1c6987d5 100644 --- a/tag_database +++ b/tag_database @@ -117,6 +117,7 @@ toCamelCase:string toDecimalMark:utility toEnglishDate:date toOrdinalSuffix:utility +toSnakeCase:string truncateString:string truthCheckCollection:object union:array From def341b116de4a17d6c306ba56ebb194e3ce5f66 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 16:16:52 +0000 Subject: [PATCH 32/96] Travis build: 129 --- README.md | 18 ++++++++++++++++++ docs/index.html | 11 +++++++++++ 2 files changed, 29 insertions(+) diff --git a/README.md b/README.md index d7b85ac23..6911e0d32 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) +* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -1911,6 +1912,23 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) +### toSnakeCase + +Converts a string to snakecase. + +Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. + +```js +const toSnakeCase = str => + str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_'); +// 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' +``` + +[⬆ back to top](#table-of-contents) + ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index 551066214..decde3adc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,6 +168,7 @@ reverseString sortCharactersInString toCamelCase +toSnakeCase truncateString words @@ -1178,6 +1179,16 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens' +

toSnakeCase

+

Converts a string to snakecase.

+

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

+
const toSnakeCase = str =>
+  str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_');
+// 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'
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From 1854b08d760e960d7e55a049e6d81283e00fe919 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 16:19:18 +0000 Subject: [PATCH 33/96] Travis build: 132 --- README.md | 18 ------------------ docs/index.html | 11 ----------- 2 files changed, 29 deletions(-) diff --git a/README.md b/README.md index 6911e0d32..d7b85ac23 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,6 @@ * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) -* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -1912,23 +1911,6 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) -### toSnakeCase - -Converts a string to snakecase. - -Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. - -```js -const toSnakeCase = str => - str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_'); -// 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' -``` - -[⬆ back to top](#table-of-contents) - ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index decde3adc..551066214 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,6 @@ reverseString sortCharactersInString toCamelCase -toSnakeCase truncateString words @@ -1179,16 +1178,6 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens' -

toSnakeCase

-

Converts a string to snakecase.

-

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

-
const toSnakeCase = str =>
-  str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_');
-// 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'
-

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From e11c32070615bf2367a041e74c274e5636c80d9f Mon Sep 17 00:00:00 2001 From: Soorena Date: Fri, 22 Dec 2017 20:56:08 +0330 Subject: [PATCH 34/96] Update toDecimalMark.md --- snippets/toDecimalMark.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index bb7cadf52..94e821376 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -3,6 +3,6 @@ Use `toLocaleString()` to convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. It makes a comma separated string from a number. ```js -const toDecimalMark = num => num.toLocaleString() +const toDecimalMark = num => num.toLocaleString("en-US"); // toDecimalMark(12305030388.9087) -> "12,305,030,388.9087" ``` From 6eb97e3849c8b9783b02ebebc708de62d2611794 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 17:34:12 +0000 Subject: [PATCH 35/96] Travis build: 138 --- README.md | 12 +++--------- docs/index.html | 11 +++-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d7b85ac23..e8db714ab 100644 --- a/README.md +++ b/README.md @@ -2140,17 +2140,11 @@ const timeTaken = callback => { ### toDecimalMark -Convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. - -Use `toString()` to convert the float `num` to a string, then use regex to separate every three characters of the integer part with a comma. -Use [Ttemplate Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to return joined parts. +Use `toLocaleString()` to convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. It makes a comma separated string from a number. ```js -const toDecimalMark = (num) => { - let numberParts = num.toString().split('.') - return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}` -} -// toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087' +const toDecimalMark = num => num.toLocaleString("en-US"); +// toDecimalMark(12305030388.9087) -> "12,305,030,388.9087" ``` [⬆ back to top](#table-of-contents) diff --git a/docs/index.html b/docs/index.html index 551066214..c5dff3d07 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1302,14 +1302,9 @@ Omit the second argument to use the default regex.

// (logged): timeTaken: 0.02099609375ms

toDecimalMark

-

Convert a float-point arithmetic to the Decimal mark form.

-

Use toString() to convert the float num to a string, then use regex to separate every three characters of the integer part with a comma. -Use Ttemplate Literals to return joined parts.

-
const toDecimalMark = (num) => {
- let numberParts = num.toString().split('.')
- return `${numberParts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')}.${numberParts[1]}`
-}
-// toDecimalMark(12305030388.9087) //-> '12,305,030,388.9087'
+

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.

From a35ffe7ec215f3aa97aa12d09b939baba8441278 Mon Sep 17 00:00:00 2001 From: Elder Henrique Souza Date: Fri, 22 Dec 2017 15:55:58 -0200 Subject: [PATCH 36/96] fixed issue described in pull request checks if the uppercase charcater is preceded by another character --- snippets/toSnakeCase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/toSnakeCase.md b/snippets/toSnakeCase.md index 0ea69bcaf..6a82a5ba2 100644 --- a/snippets/toSnakeCase.md +++ b/snippets/toSnakeCase.md @@ -6,7 +6,7 @@ Use `replace()` to add underscores before capital letters, convert `toLowerCase( ```js const toSnakeCase = str => - str.replace(/[A-Z]/g, (match, p1, p2, offset) => '_' + match).toLowerCase().replace(/[\s-]+/g,'_'); + str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase(); // toSnakeCase("camelCase") -> 'camel_case' // toSnakeCase("some text") -> 'some_text' // toSnakeCase("some-javascript-property") -> 'some_javascript_property' From 8d8c593a35cecb477c4578f58335462a668d6817 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 17:58:19 +0000 Subject: [PATCH 37/96] Travis build: 140 --- README.md | 18 ++++++++++++++++++ docs/index.html | 11 +++++++++++ 2 files changed, 29 insertions(+) diff --git a/README.md b/README.md index e8db714ab..c2fd2971c 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) +* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -1911,6 +1912,23 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) +### toSnakeCase + +Converts a string to snakecase. + +Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. + +```js +const toSnakeCase = str => + str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase(); +// 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' +``` + +[⬆ back to top](#table-of-contents) + ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index c5dff3d07..ba6c4f8fe 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,6 +168,7 @@ reverseString sortCharactersInString toCamelCase +toSnakeCase truncateString words @@ -1178,6 +1179,16 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens'
+

toSnakeCase

+

Converts a string to snakecase.

+

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

+
const toSnakeCase = str =>
+  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase();
+// 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'
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From aac191c3c2e8ab17a0c2fac912a26ae70c82986e Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Fri, 22 Dec 2017 10:00:02 -0800 Subject: [PATCH 38/96] Update collectInto.md --- snippets/collectInto.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/collectInto.md b/snippets/collectInto.md index 8f9b34cd4..eb0e4df6c 100644 --- a/snippets/collectInto.md +++ b/snippets/collectInto.md @@ -8,9 +8,9 @@ Given a function, return a closure that collects all inputs into an array-accept const collectInto = fn => ( ...args ) => fn( args ); /* const Pall = collectInto( Promise.all.bind(Promise) ) -var p1 = Promise.resolve(1) -var p2 = Promise.resolve(2) -var p3 = new Promise((resolve) => setTimeout(resolve,2000,3)) +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) */ ``` From 7b0be8c5af63fb20526db1899100f55463a473dc Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 18:00:48 +0000 Subject: [PATCH 39/96] Travis build: 142 --- README.md | 18 ------------------ docs/index.html | 11 ----------- 2 files changed, 29 deletions(-) diff --git a/README.md b/README.md index c2fd2971c..e8db714ab 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,6 @@ * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) -* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -1912,23 +1911,6 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) -### toSnakeCase - -Converts a string to snakecase. - -Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. - -```js -const toSnakeCase = str => - str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase(); -// 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' -``` - -[⬆ back to top](#table-of-contents) - ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index ba6c4f8fe..c5dff3d07 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,6 @@ reverseString sortCharactersInString toCamelCase -toSnakeCase truncateString words @@ -1179,16 +1178,6 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens' -

toSnakeCase

-

Converts a string to snakecase.

-

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

-
const toSnakeCase = str =>
-  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase();
-// 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'
-

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From ac2d70456eb2e9e09c365bb37b170d999e0f5c54 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 18:22:00 +0000 Subject: [PATCH 40/96] Travis build: 145 --- README.md | 20 ++++++++++++++++++++ docs/index.html | 17 +++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e8db714ab..99ac7f01a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ## Table of Contents ### Adapter +* [`collectInto`](#collectinto) * [`promisify`](#promisify) * [`spreadOver`](#spreadover) @@ -167,6 +168,25 @@ ## Adapter +### 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. + +```js +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) +*/ +``` + +[⬆ back to top](#table-of-contents) + ### promisify Converts an asynchronous function to return a promise. diff --git a/docs/index.html b/docs/index.html index c5dff3d07..dcfb4febc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,8 @@

Adapter -

promisify +collectInto +promisify spreadOver

Array @@ -194,7 +195,19 @@

flip
 

Adapter

-

promisify

+

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)
+*/
+
+

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.

From 7b4aa5fd414fc3575f6c407fd86865ccde7dd8c1 Mon Sep 17 00:00:00 2001 From: David Wu Date: Fri, 22 Dec 2017 19:59:45 +0100 Subject: [PATCH 41/96] Update tag_database --- tag_database | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_database b/tag_database index b48cc0e69..71ed0a801 100644 --- a/tag_database +++ b/tag_database @@ -40,7 +40,7 @@ fibonacci:math filterNonUnique:array flatten:array flattenDepth:array -flip:uncategorized +flip:adapter fromCamelCase:string functionName:function gcd:math From d7f6d6a17cbf59564c8dc4801682df09035bca7a Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 19:01:56 +0000 Subject: [PATCH 42/96] Travis build: 147 --- README.md | 47 ++++++++++++++++++++++------------------------- docs/index.html | 33 +++++++++++++++------------------ 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 99ac7f01a..19192f127 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ ### Adapter * [`collectInto`](#collectinto) +* [`flip`](#flip) * [`promisify`](#promisify) * [`spreadOver`](#spreadover) @@ -163,9 +164,6 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) -### _Uncategorized_ -* [`flip`](#flip) - ## Adapter ### collectInto @@ -187,6 +185,27 @@ Pall(p1, p2, p3).then(console.log) [⬆ back to top](#table-of-contents) +### 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. + +```js +const flip = fn => (...args) => fn(args.pop(), ...args) +/* +let a = {name: 'John Smith'} +let b = {} +const mergeFrom = flip(Object.assign) +let mergePerson = mergeFrom.bind(a) +mergePerson(b) // == b +b = {} +Object.assign(b, a) // == b +*/ +``` + +[⬆ back to top](#table-of-contents) + ### promisify Converts an asynchronous function to return a promise. @@ -2218,28 +2237,6 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == // validateNumber('10') -> true ``` -[⬆ back to top](#table-of-contents) -## _Uncategorized_ - -### 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. - -```js -const flip = fn => (...args) => fn(args.pop(), ...args) -/* -let a = {name: 'John Smith'} -let b = {} -const mergeFrom = flip(Object.assign) -let mergePerson = mergeFrom.bind(a) -mergePerson(b) // == b -b = {} -Object.assign(b, a) // == b -*/ -``` - [⬆ back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index dcfb4febc..f4818317f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,6 +43,7 @@

Adapter

collectInto +flip promisify spreadOver @@ -191,9 +192,6 @@ UUIDGenerator validateNumber -

Uncategorized -

flip -
 

Adapter

collectInto

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

@@ -207,6 +205,20 @@ 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'}
+let b = {}
+const mergeFrom = flip(Object.assign)
+let mergePerson = mergeFrom.bind(a)
+mergePerson(b) // == b
+b = {}
+Object.assign(b, a) // == b
+*/
+

promisify

Converts an asynchronous function to return a promise.

Use currying to return a function returning a Promise that calls the original function. @@ -1349,21 +1361,6 @@ Use Number() to check if the coercion holds.

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

Uncategorized

-

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(a)
-mergePerson(b) // == b
-b = {}
-Object.assign(b, a) // == b
-*/
-

30 seconds of code is licensed under the CC0-1.0 license.
Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.
Ribbon made by Tim Holman is licensed by The MIT License
Built with the mini.css framework.

From 748cbbc81e3a39cc39eb7f5842fb15d409142d35 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 19:19:32 +0000 Subject: [PATCH 43/96] Travis build: 150 --- docs/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/index.html b/docs/index.html index f4818317f..157fd1f32 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,6 +12,10 @@ + + + + From 5f269cb4e756a6e3d06482ff94247ee7e5c6dfa2 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 19:21:58 +0000 Subject: [PATCH 44/96] Travis build: 151 --- docs/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index 157fd1f32..f4818317f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,10 +12,6 @@ - - - - From 105573de9aa5eebd45a3ebf206cbb53f2f1827f2 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Fri, 22 Dec 2017 20:30:22 +0100 Subject: [PATCH 45/96] License Badge --- static-parts/README-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index 15508b89b..bc9edbb0c 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -1,7 +1,7 @@ ![Logo](/logo.png) # 30 seconds of code -[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard) +[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From 17796cab8e15345fd731621e384114bbe5c59a74 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 19:36:56 +0000 Subject: [PATCH 46/96] Travis build: 155 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19192f127..87b398a76 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![Logo](/logo.png) # 30 seconds of code -[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard) +[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.org/Chalarangelo/30-seconds-of-code.svg?branch=master)](https://travis-ci.org/Chalarangelo/30-seconds-of-code) [![Insight.io](https://img.shields.io/badge/insight.io-Ready-brightgreen.svg)](https://insight.io/github.com/Chalarangelo/30-seconds-of-code/tree/master/?source=0) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard) > Curated collection of useful Javascript snippets that you can understand in 30 seconds or less. From 12105592cc186f84197c1eb52ccf2efa34ac08d8 Mon Sep 17 00:00:00 2001 From: Selim Ajimi Date: Fri, 22 Dec 2017 21:31:22 +0100 Subject: [PATCH 47/96] Fix small typo --- snippets/spreadOver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/spreadOver.md b/snippets/spreadOver.md index 39ea7362e..94527aa19 100644 --- a/snippets/spreadOver.md +++ b/snippets/spreadOver.md @@ -1,6 +1,6 @@ ### spreadOver -Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. +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. From 5e33d20c6ef820f724a84633ea5723dbaf8a67ae Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Fri, 22 Dec 2017 11:54:30 -0800 Subject: [PATCH 48/96] [FEATURE] add call snippet (#309) --- snippets/call.md | 14 ++++++++++++++ tag_database | 1 + 2 files changed, 15 insertions(+) create mode 100644 snippets/call.md diff --git a/snippets/call.md b/snippets/call.md new file mode 100644 index 000000000..bbc60ecaa --- /dev/null +++ b/snippets/call.md @@ -0,0 +1,14 @@ +### 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. + +```js +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 ] +*/ +``` diff --git a/tag_database b/tag_database index 71ed0a801..c887a1d04 100644 --- a/tag_database +++ b/tag_database @@ -7,6 +7,7 @@ arrayMin:array arraySum:math arrayToHtmlList:browser bottomVisible:browser +call:adapter capitalize:string capitalizeEveryWord:string chainAsync:function From bd7f1f17f7061a63bcb70732e651c05531366468 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 22 Dec 2017 19:56:52 +0000 Subject: [PATCH 49/96] Travis build: 157 --- README.md | 18 ++++++++++++++++++ docs/index.html | 15 +++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87b398a76..95a5000fd 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ## Table of Contents ### Adapter +* [`call`](#call) * [`collectInto`](#collectinto) * [`flip`](#flip) * [`promisify`](#promisify) @@ -166,6 +167,23 @@ ## 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. + +```js +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 ] +*/ +``` + +[⬆ back to top](#table-of-contents) + ### collectInto Changes a function that accepts an array into a variadic function. diff --git a/docs/index.html b/docs/index.html index f4818317f..53d9a58c8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,8 @@

Adapter -

collectInto +call +collectInto flip promisify spreadOver @@ -193,7 +194,17 @@ validateNumber
 

Adapter

-

collectInto

+

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

From d778ddb2c8be9b8401b6f815d7a63be3bb208b4f Mon Sep 17 00:00:00 2001
From: Selim Ajimi 
Date: Fri, 22 Dec 2017 21:32:37 +0100
Subject: [PATCH 50/96] Fix typos in spaces

Fix typo to fit the context

Fix typo add space

Fix small typo

Fix small typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Update tail.md

Fix typo

Fix small typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix small typo

Fix typo

Fix small typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo

Fix typo
---
 snippets/RGBToHex.md                | 2 +-
 snippets/arrayLcm.md                | 4 ++--
 snippets/clampNumber.md             | 2 +-
 snippets/cleanObj.md                | 2 +-
 snippets/collatz.md                 | 2 +-
 snippets/countVowels.md             | 2 +-
 snippets/curry.md                   | 2 +-
 snippets/fromCamelCase.md           | 2 +-
 snippets/getDaysDiffBetweenDates.md | 2 +-
 snippets/groupBy.md                 | 2 +-
 snippets/hammingDistance.md         | 2 +-
 snippets/hexToRGB.md                | 2 +-
 snippets/inRange.md                 | 4 ++--
 snippets/initial.md                 | 2 +-
 snippets/initialize2DArray.md       | 4 ++--
 snippets/isArmstrongNumber.md       | 4 ++--
 snippets/last.md                    | 2 +-
 snippets/mapObject.md               | 2 +-
 snippets/pick.md                    | 2 +-
 snippets/pull.md                    | 2 +-
 snippets/pullAtIndex.md             | 2 +-
 snippets/pullAtValue.md             | 2 +-
 snippets/sample.md                  | 2 +-
 snippets/scrollToTop.md             | 2 +-
 snippets/select.md                  | 4 ++--
 snippets/tail.md                    | 2 +-
 snippets/toCamelCase.md             | 2 +-
 snippets/toEnglishDate.md           | 2 +-
 snippets/words.md                   | 2 +-
 29 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/snippets/RGBToHex.md b/snippets/RGBToHex.md
index 64e880798..eb13cbeb4 100644
--- a/snippets/RGBToHex.md
+++ b/snippets/RGBToHex.md
@@ -1,6 +1,6 @@
 ### RGBToHex
 
-Converts the values of RGB components to a colorcode.
+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.
 
diff --git a/snippets/arrayLcm.md b/snippets/arrayLcm.md
index 5439d5924..3b0ad354c 100644
--- a/snippets/arrayLcm.md
+++ b/snippets/arrayLcm.md
@@ -1,8 +1,8 @@
 ### arrayLcm
 
-Calculates the lowest  common multiple  (lcm) of an array of numbers.
+Calculates the lowest common multiple (lcm) of an array of numbers.
 
-Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the lowest  common multiple  of an array of numbers.
+Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the lowest common multiple of an array of numbers.
 
 ```js
 const arrayLcm = arr =>{
diff --git a/snippets/clampNumber.md b/snippets/clampNumber.md
index ddbb655ff..d1bf9d64f 100644
--- a/snippets/clampNumber.md
+++ b/snippets/clampNumber.md
@@ -4,7 +4,7 @@ Clamps `num` within the inclusive `lower` and `upper` bounds.
 
 If `lower` is greater than `upper`, swap them. 
 If `num` falls within the range, return `num`. 
-Otherwise return the nearest number in the range.
+Otherwise, return the nearest number in the range.
 
 ```js
 const clampNumber = (num, lower, upper) => {
diff --git a/snippets/cleanObj.md b/snippets/cleanObj.md
index 75a8e900b..f2a915719 100644
--- a/snippets/cleanObj.md
+++ b/snippets/cleanObj.md
@@ -2,7 +2,7 @@
 
 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 `include`d in given array.
+Use `Object.keys()` method to loop over given JSON object and deleting keys that are not `include`d 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.
 
 ```js
diff --git a/snippets/collatz.md b/snippets/collatz.md
index b3d277658..8b8903886 100644
--- a/snippets/collatz.md
+++ b/snippets/collatz.md
@@ -2,7 +2,7 @@
 
 Applies the Collatz algorithm.
 
-If `n` is even, return `n/2`. Otherwise  return `3n+1`.
+If `n` is even, return `n/2`. Otherwise, return `3n+1`.
 
 ```js
 const collatz = n => (n % 2 == 0) ? (n / 2) : (3 * n + 1);
diff --git a/snippets/countVowels.md b/snippets/countVowels.md
index bf1f536fc..c91f09442 100644
--- a/snippets/countVowels.md
+++ b/snippets/countVowels.md
@@ -2,7 +2,7 @@
 
 Retuns `number` of vowels in provided string.
 
-Use a regular expression to count number of vowels `(A, E, I, O, U)` in a `string`.
+Use a regular expression to count the number of vowels `(A, E, I, O, U)` in a `string`.
 
 ```js
 const countVowels = str => (str.match(/[aeiou]/ig) || []).length;
diff --git a/snippets/curry.md b/snippets/curry.md
index 50473509e..71d3c12af 100644
--- a/snippets/curry.md
+++ b/snippets/curry.md
@@ -4,7 +4,7 @@ Curries a function.
 
 Use recursion.
 If the number of provided arguments (`args`) is sufficient, call the passed function `f`.
-Otherwise return a curried function `f` that expects the rest of the arguments.
+Otherwise, return a curried function `f` 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`.
 
 ```js
diff --git a/snippets/fromCamelCase.md b/snippets/fromCamelCase.md
index e004e67ef..3d480dc85 100644
--- a/snippets/fromCamelCase.md
+++ b/snippets/fromCamelCase.md
@@ -2,7 +2,7 @@
 
 Converts a string from camelcase.
 
-Use `replace()` to remove underscores, hyphens and spaces and convert words to camelcase.
+Use `replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
 Omit the second argument to use a default separator of `_`.
 
 ```js
diff --git a/snippets/getDaysDiffBetweenDates.md b/snippets/getDaysDiffBetweenDates.md
index d69dea9a3..3b63440c1 100644
--- a/snippets/getDaysDiffBetweenDates.md
+++ b/snippets/getDaysDiffBetweenDates.md
@@ -2,7 +2,7 @@
 
 Returns the difference (in days) between two dates.
 
-Calculate the difference (in days) between to `Date` objects.
+Calculate the difference (in days) between two `Date` objects.
 
 ```js
 const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24);
diff --git a/snippets/groupBy.md b/snippets/groupBy.md
index d5b019498..d83795fdc 100644
--- a/snippets/groupBy.md
+++ b/snippets/groupBy.md
@@ -1,6 +1,6 @@
 ### groupBy
 
-Groups the element of an array based on the given function.
+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.
diff --git a/snippets/hammingDistance.md b/snippets/hammingDistance.md
index bdf3c575b..97c08d2aa 100644
--- a/snippets/hammingDistance.md
+++ b/snippets/hammingDistance.md
@@ -2,7 +2,7 @@
 
 Calculates the Hamming distance between two values.
 
-Use XOR operator (`^`) to find the bit difference between the two numbers, convert to binary string using `toString(2)`.
+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 `1`s in the string, using `match(/1/g)`.
 
 ```js
diff --git a/snippets/hexToRGB.md b/snippets/hexToRGB.md
index 2d08b4321..66c95fd3a 100644
--- a/snippets/hexToRGB.md
+++ b/snippets/hexToRGB.md
@@ -2,7 +2,7 @@
 
 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 any alpha value is provided alongside 6-digit hex, give `rgba()` string in return.
+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.
 
 ```js
 const hexToRGB = hex => {
diff --git a/snippets/inRange.md b/snippets/inRange.md
index 7162c52d8..5089393dc 100644
--- a/snippets/inRange.md
+++ b/snippets/inRange.md
@@ -1,9 +1,9 @@
 ### inRange
 
-Checks if the given number falls in the given range. 
+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 reange is considered to be from `0` to `start`.
+If the second parameter, `end`, is not specified, the range is considered to be from `0` to `start`.
 
 ```js
 const inRange = (n, start, end=null) => {
diff --git a/snippets/initial.md b/snippets/initial.md
index ad358b593..7b1c5c68c 100644
--- a/snippets/initial.md
+++ b/snippets/initial.md
@@ -2,7 +2,7 @@
 
 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.
+Use `arr.slice(0,-1)` to return all but the last element of the array.
 
 ```js
 const initial = arr => arr.slice(0, -1);
diff --git a/snippets/initialize2DArray.md b/snippets/initialize2DArray.md
index cc8b8817b..0cb1df126 100644
--- a/snippets/initialize2DArray.md
+++ b/snippets/initialize2DArray.md
@@ -1,8 +1,8 @@
 ### initialize2DArray
 
-Initializes an 2D array of given width and height and value.
+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 value is not provided, default to `null`.
+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`.
 
 ```js
 const initialize2DArray = (w, h, val = null) => Array(h).fill().map(() => Array(w).fill(val));
diff --git a/snippets/isArmstrongNumber.md b/snippets/isArmstrongNumber.md
index be8857784..139de9d72 100644
--- a/snippets/isArmstrongNumber.md
+++ b/snippets/isArmstrongNumber.md
@@ -1,8 +1,8 @@
 ### isArmstrongNumber
 
-Checks if the given number is an armstrong number or not.
+Checks if the given number is an Armstrong number or not.
 
-Convert the given number into 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`.
+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`.
 
 ```js
 const isArmstrongNumber = digits => 
diff --git a/snippets/last.md b/snippets/last.md
index c72ef4a00..481e2d6e0 100644
--- a/snippets/last.md
+++ b/snippets/last.md
@@ -2,7 +2,7 @@
 
 Returns the last element in an array.
 
-Use `arr.length - 1` to compute index of the last element of the given array and returning it.
+Use `arr.length - 1` to compute the index of the last element of the given array and returning it.
 
 ```js
 const last = arr => arr[arr.length - 1];
diff --git a/snippets/mapObject.md b/snippets/mapObject.md
index 102795a73..eb5ea736f 100644
--- a/snippets/mapObject.md
+++ b/snippets/mapObject.md
@@ -2,7 +2,7 @@
 
 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 stor 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).
+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).
 
 ```js
 const mapObject = (arr, fn) => 
diff --git a/snippets/pick.md b/snippets/pick.md
index b5f5101ea..668c9d30c 100644
--- a/snippets/pick.md
+++ b/snippets/pick.md
@@ -2,7 +2,7 @@
 
 Picks the key-value pairs corresponding to the given keys from an object.
 
-Use `Array.reduce()` to convert the filtered/picked keys back to a object with the corresponding key-value pair if the key exist in the obj.
+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.
 
 ```js
 const pick = (obj, arr) =>
diff --git a/snippets/pull.md b/snippets/pull.md
index 41658a545..d7d0412c0 100644
--- a/snippets/pull.md
+++ b/snippets/pull.md
@@ -3,7 +3,7 @@
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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`](#without))_
 
diff --git a/snippets/pullAtIndex.md b/snippets/pullAtIndex.md
index 0e0d8cf7f..260d7b634 100644
--- a/snippets/pullAtIndex.md
+++ b/snippets/pullAtIndex.md
@@ -3,7 +3,7 @@
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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 
 
 ```js
diff --git a/snippets/pullAtValue.md b/snippets/pullAtValue.md
index 64798068f..52e1eac21 100644
--- a/snippets/pullAtValue.md
+++ b/snippets/pullAtValue.md
@@ -3,7 +3,7 @@
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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 
 
 ```js
diff --git a/snippets/sample.md b/snippets/sample.md
index 241c43167..caf1941e3 100644
--- a/snippets/sample.md
+++ b/snippets/sample.md
@@ -2,7 +2,7 @@
 
 Returns a random element from an array.
 
-Use `Math.random()` to generate a random number, multiply it with `length` and round it of to the nearest whole number using `Math.floor()`.
+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.
 
 ```js
diff --git a/snippets/scrollToTop.md b/snippets/scrollToTop.md
index dc172f3ee..62cad2588 100644
--- a/snippets/scrollToTop.md
+++ b/snippets/scrollToTop.md
@@ -3,7 +3,7 @@
 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 top. Use `window.requestAnimationFrame()` to animate the scrolling.
+Scroll by a fraction of the distance from the top. Use `window.requestAnimationFrame()` to animate the scrolling.
 
 ```js
 const scrollToTop = () => {
diff --git a/snippets/select.md b/snippets/select.md
index 6f60f4d95..ee243bb8e 100644
--- a/snippets/select.md
+++ b/snippets/select.md
@@ -1,8 +1,8 @@
 ### select
 
-Retrieve a property that indicated by the selector from object.
+Retrieve a property that indicated by the selector from an object.
 
-If property not exists returns `undefined`.
+If the property does not exists returns `undefined`.
 
 ```js
 const select = (from, selector) =>
diff --git a/snippets/tail.md b/snippets/tail.md
index 781cd2c33..9d84a17f1 100644
--- a/snippets/tail.md
+++ b/snippets/tail.md
@@ -2,7 +2,7 @@
 
 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.
+Return `arr.slice(1)` if the array's `length` is more than `1`, otherwise, return the whole array.
 
 ```js
 const tail = arr => arr.length > 1 ? arr.slice(1) : arr;
diff --git a/snippets/toCamelCase.md b/snippets/toCamelCase.md
index 47a984629..20e3821e2 100644
--- a/snippets/toCamelCase.md
+++ b/snippets/toCamelCase.md
@@ -2,7 +2,7 @@
 
 Converts a string to camelcase.
 
-Use `replace()` to remove underscores, hyphens and spaces and convert words to camelcase.
+Use `replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
 
 ```js
 const toCamelCase = str =>
diff --git a/snippets/toEnglishDate.md b/snippets/toEnglishDate.md
index 5e3038b9d..329eea38b 100644
--- a/snippets/toEnglishDate.md
+++ b/snippets/toEnglishDate.md
@@ -2,7 +2,7 @@
 
 Converts a date from American format to English format.
 
-Use `Date.toISOString()`, `split('T')` and `replace()` to convert 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.
 
 ```js
diff --git a/snippets/words.md b/snippets/words.md
index 38a363a40..df6b258b7 100644
--- a/snippets/words.md
+++ b/snippets/words.md
@@ -2,7 +2,7 @@
 
 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.
+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.
 
 ```js

From 04b1ae0d1cd1cb03cf2e971182a6149bc8b3e68b Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Fri, 22 Dec 2017 22:32:02 +0000
Subject: [PATCH 51/96] Travis build: 160

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

diff --git a/README.md b/README.md
index 95a5000fd..a64842de8 100644
--- a/README.md
+++ b/README.md
@@ -248,7 +248,7 @@ const promisify = func =>
 
 ### spreadOver
 
-Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.
+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.
 
@@ -283,9 +283,9 @@ const arrayGcd = arr =>{
 
 ### arrayLcm
 
-Calculates the lowest  common multiple  (lcm) of an array of numbers.
+Calculates the lowest common multiple (lcm) of an array of numbers.
 
-Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the lowest  common multiple  of an array of numbers.
+Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the lowest common multiple of an array of numbers.
 
 ```js
 const arrayLcm = arr =>{
@@ -512,7 +512,7 @@ const flattenDepth = (arr, depth = 1) =>
 
 ### groupBy
 
-Groups the element of an array based on the given function.
+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.
@@ -544,7 +544,7 @@ const head = arr => arr[0];
 
 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.
+Use `arr.slice(0,-1)` to return all but the last element of the array.
 
 ```js
 const initial = arr => arr.slice(0, -1);
@@ -555,9 +555,9 @@ const initial = arr => arr.slice(0, -1);
 
 ### initialize2DArray
 
-Initializes an 2D array of given width and height and value.
+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 value is not provided, default to `null`.
+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`.
 
 ```js
 const initialize2DArray = (w, h, val = null) => Array(h).fill().map(() => Array(w).fill(val));
@@ -613,7 +613,7 @@ const intersection = (a, b) => { const s = new Set(b); return a.filter(x => s.ha
 
 Returns the last element in an array.
 
-Use `arr.length - 1` to compute index of the last element of the given array and returning it.
+Use `arr.length - 1` to compute the index of the last element of the given array and returning it.
 
 ```js
 const last = arr => arr[arr.length - 1];
@@ -626,7 +626,7 @@ const last = arr => arr[arr.length - 1];
 
 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 stor 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).
+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).
 
 ```js
 const mapObject = (arr, fn) => 
@@ -659,7 +659,7 @@ const nthElement = (arr, n=0) => (n>0? arr.slice(n,n+1) : arr.slice(n))[0];
 
 Picks the key-value pairs corresponding to the given keys from an object.
 
-Use `Array.reduce()` to convert the filtered/picked keys back to a object with the corresponding key-value pair if the key exist in the obj.
+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.
 
 ```js
 const pick = (obj, arr) =>
@@ -674,7 +674,7 @@ const pick = (obj, arr) =>
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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`](#without))_
 
@@ -702,7 +702,7 @@ const pull = (arr, ...args) => {
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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 
 
 ```js
@@ -729,7 +729,7 @@ const pullAtIndex = (arr, pullArr) => {
 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 array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
+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 
 
 ```js
@@ -773,7 +773,7 @@ const remove = (arr, func) =>
 
 Returns a random element from an array.
 
-Use `Math.random()` to generate a random number, multiply it with `length` and round it of to the nearest whole number using `Math.floor()`.
+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.
 
 ```js
@@ -829,7 +829,7 @@ const symmetricDifference = (a, b) => {
 
 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.
+Return `arr.slice(1)` if the array's `length` is more than `1`, otherwise, return the whole array.
 
 ```js
 const tail = arr => arr.length > 1 ? arr.slice(1) : arr;
@@ -1063,7 +1063,7 @@ const redirect = (url, asLink = true) =>
 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 top. Use `window.requestAnimationFrame()` to animate the scrolling.
+Scroll by a fraction of the distance from the top. Use `window.requestAnimationFrame()` to animate the scrolling.
 
 ```js
 const scrollToTop = () => {
@@ -1083,7 +1083,7 @@ const scrollToTop = () => {
 
 Returns the difference (in days) between two dates.
 
-Calculate the difference (in days) between to `Date` objects.
+Calculate the difference (in days) between two `Date` objects.
 
 ```js
 const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24);
@@ -1112,7 +1112,7 @@ const JSONToDate = arr => {
 
 Converts a date from American format to English format.
 
-Use `Date.toISOString()`, `split('T')` and `replace()` to convert 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.
 
 ```js
@@ -1168,7 +1168,7 @@ Curries a function.
 
 Use recursion.
 If the number of provided arguments (`args`) is sufficient, call the passed function `f`.
-Otherwise return a curried function `f` that expects the rest of the arguments.
+Otherwise, return a curried function `f` 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`.
 
 ```js
@@ -1280,7 +1280,7 @@ Clamps `num` within the inclusive `lower` and `upper` bounds.
 
 If `lower` is greater than `upper`, swap them. 
 If `num` falls within the range, return `num`. 
-Otherwise return the nearest number in the range.
+Otherwise, return the nearest number in the range.
 
 ```js
 const clampNumber = (num, lower, upper) => {
@@ -1298,7 +1298,7 @@ const clampNumber = (num, lower, upper) => {
 
 Applies the Collatz algorithm.
 
-If `n` is even, return `n/2`. Otherwise  return `3n+1`.
+If `n` is even, return `n/2`. Otherwise, return `3n+1`.
 
 ```js
 const collatz = n => (n % 2 == 0) ? (n / 2) : (3 * n + 1);
@@ -1387,7 +1387,7 @@ const gcd = (x, y) => !y ? x : gcd(y, x % y);
 
 Calculates the Hamming distance between two values.
 
-Use XOR operator (`^`) to find the bit difference between the two numbers, convert to binary string using `toString(2)`.
+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 `1`s in the string, using `match(/1/g)`.
 
 ```js
@@ -1400,10 +1400,10 @@ const hammingDistance = (num1, num2) =>
 
 ### inRange
 
-Checks if the given number falls in the given range. 
+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 reange is considered to be from `0` to `start`.
+If the second parameter, `end`, is not specified, the range is considered to be from `0` to `start`.
 
 ```js
 const inRange = (n, start, end=null) => {
@@ -1420,9 +1420,9 @@ const inRange = (n, start, end=null) => {
 
 ### isArmstrongNumber
 
-Checks if the given number is an armstrong number or not.
+Checks if the given number is an Armstrong number or not.
 
-Convert the given number into 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`.
+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`.
 
 ```js
 const isArmstrongNumber = digits => 
@@ -1706,7 +1706,7 @@ const readFileLines = filename => fs.readFileSync(filename).toString('UTF8').spl
 
 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 `include`d in given array.
+Use `Object.keys()` method to loop over given JSON object and deleting keys that are not `include`d 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.
 
 ```js
@@ -1784,9 +1784,9 @@ orderby(users, ['name', 'age']) -> [{name: 'barney', age: 34}, {name: 'barney',
 
 ### select
 
-Retrieve a property that indicated by the selector from object.
+Retrieve a property that indicated by the selector from an object.
 
-If property not exists returns `undefined`.
+If the property does not exists returns `undefined`.
 
 ```js
 const select = (from, selector) =>
@@ -1882,7 +1882,7 @@ const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperC
 
 Retuns `number` of vowels in provided string.
 
-Use a regular expression to count number of vowels `(A, E, I, O, U)` in a `string`.
+Use a regular expression to count the number of vowels `(A, E, I, O, U)` in a `string`.
 
 ```js
 const countVowels = str => (str.match(/[aeiou]/ig) || []).length;
@@ -1909,7 +1909,7 @@ const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
 
 Converts a string from camelcase.
 
-Use `replace()` to remove underscores, hyphens and spaces and convert words to camelcase.
+Use `replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
 Omit the second argument to use a default separator of `_`.
 
 ```js
@@ -1955,7 +1955,7 @@ const sortCharactersInString = str =>
 
 Converts a string to camelcase.
 
-Use `replace()` to remove underscores, hyphens and spaces and convert words to camelcase.
+Use `replace()` to remove underscores, hyphens, and spaces and convert words to camelcase.
 
 ```js
 const toCamelCase = str =>
@@ -1987,7 +1987,7 @@ const truncateString = (str, num) =>
 
 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.
+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.
 
 ```js
@@ -2059,7 +2059,7 @@ const getType = v =>
 
 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 any alpha value is provided alongside 6-digit hex, give `rgba()` string in return.
+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.
 
 ```js
 const hexToRGB = hex => {
@@ -2167,7 +2167,7 @@ const isSymbol = val => typeof val === 'symbol';
 
 ### RGBToHex
 
-Converts the values of RGB components to a colorcode.
+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.
 
diff --git a/docs/index.html b/docs/index.html
index 53d9a58c8..dc8296a8e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -245,7 +245,7 @@ Use the ...rest operator to pass in all the parameters.

// delay(2000).then(() => console.log('Hi!')) -> Promise resolves after 2s

spreadOver

-

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

+

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);
 /*
@@ -266,8 +266,8 @@ arrayMax([1,2,4]) // -> 4
 // arrayGcd([4,8,12]) -> 4
 

arrayLcm

-

Calculates the lowest common multiple (lcm) of an array of numbers.

-

Use Array.reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers.

+

Calculates the lowest common multiple (lcm) of an array of numbers.

+

Use Array.reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers.

const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
   const lcm = (x, y) => (x*y)/gcd(x, y) 
@@ -383,7 +383,7 @@ Omit the second element, depth to flatten only to a depth of 
 // flattenDepth([1,[2],[[[3],4],5]], 2) -> [1,2,[3],4,5]
 

groupBy

-

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

+

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) =>
@@ -400,13 +400,13 @@ Use Array.reduce() to create an object, where the keys are produced
 

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.

+

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 an 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 value is not provided, default to null.

+

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));
 // initializeArrayWithRange(2, 2, 0) -> [[0,0], [0,0]]
 
@@ -434,13 +434,13 @@ You can omit value to use a default value of 0.


last

Returns the last element in an array.

-

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

+

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 stor 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).

+

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), {}) )) ( );
 /*
@@ -459,7 +459,7 @@ Omit the second argument, n, to get the first element of the array.
 

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 a object with the corresponding key-value pair if the key exist in the obj.

+

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 }
@@ -467,7 +467,7 @@ Omit the second argument, n, to get the first element of the array.
 

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 array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values.

+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;
@@ -487,7 +487,7 @@ Use Array.length = 0 to mutate the passed in array by resetting it'
 

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 array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. +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 = [];
@@ -507,7 +507,7 @@ Use Array.push() to keep track of pulled values


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 array by resetting it's length to zero and Array.push() to re-populate it with only the pulled values. +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 = [], 
@@ -537,7 +537,7 @@ The func is invoked with three arguments (value, index, array
 

sample

Returns a random element from an array.

-

Use Math.random() to generate a random number, multiply it with length and round it of to the nearest whole number using Math.floor(). +

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
@@ -565,7 +565,7 @@ This method also works with strings.


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.

+

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]
@@ -693,7 +693,7 @@ Pass a second argument to simulate a link click (true - default) or
 

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 top. Use window.requestAnimationFrame() to animate the scrolling.

+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) {
@@ -706,7 +706,7 @@ Scroll by a fraction of the distance from top. Use window.requestAnimation
 

Date

getDaysDiffBetweenDates

Returns the difference (in days) between two dates.

-

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

+

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
 
@@ -721,7 +721,7 @@ Scroll by a fraction of the distance from top. Use window.requestAnimation

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 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().split('T')[0].replace(/-/g, '/')}catch(e){return}};
@@ -756,7 +756,7 @@ multiplyAndAdd5(5, 2) -> 15
 

Curries a function.

Use recursion. If the number of provided arguments (args) is sufficient, call the passed function f. -Otherwise return a curried function f that expects the rest of the arguments. +Otherwise, return a curried function f 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
@@ -819,7 +819,7 @@ async function sleepyWork() {
 

Clamps num within the inclusive lower and upper bounds.

If lower is greater than upper, swap them. If num falls within the range, return num. -Otherwise return the nearest number in the range.

+Otherwise, return the nearest number in the range.

const clampNumber = (num, lower, upper) => {
   if(lower > upper) upper = [lower, lower = upper][0];
   return (num>=lower && num<=upper) ? num : ((num < lower) ? lower : upper) 
@@ -830,7 +830,7 @@ Otherwise return the nearest number in the range.


collatz

Applies the Collatz algorithm.

-

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

+

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
@@ -877,16 +877,16 @@ Otherwise, return the GCD of y and the remainder of the division 

hammingDistance

Calculates the Hamming distance between two values.

-

Use XOR operator (^) to find the bit difference between the two numbers, convert to binary string using toString(2). +

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 in the given range.

+

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 reange is considered to be from 0 to start.

+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);
@@ -897,8 +897,8 @@ If the second parameter, end, is not specified, the reange is consi
 // inrange(3, 2) -> false
 

isArmstrongNumber

-

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

-

Convert the given number into 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.

+

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 ? true : false )( ( digits+'' ).split( '' ) );
 // isArmstrongNumber(1634) -> true
@@ -1062,7 +1062,7 @@ console.log(arr) // -> ['line1', 'line2', 'line3']
 

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. +

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 => {
@@ -1113,8 +1113,8 @@ orderby(users, ['name', 'age']) -> [{name: 'barney', age: 34}, {name: 'barney
 */
 

select

-

Retrieve a property that indicated by the selector from object.

-

If property not exists returns undefined.

+

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);
 
@@ -1168,7 +1168,7 @@ Omit the lowerRest parameter to keep the rest of the string intact,
 

countVowels

Retuns number of vowels in provided string.

-

Use a regular expression to count number of vowels (A, E, I, O, U) in a 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]/ig) || []).length;
 // countVowels('foobar') -> 3
 // countVowels('gym') -> 0
@@ -1181,7 +1181,7 @@ Omit the lowerRest parameter to keep the rest of the string intact,
 

fromCamelCase

Converts a string from camelcase.

-

Use replace() to remove underscores, hyphens and spaces and convert words to 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')
@@ -1206,7 +1206,7 @@ Combine characters to get a string using join('').


toCamelCase

Converts a string to camelcase.

-

Use replace() to remove underscores, hyphens and spaces and convert words to camelcase.

+

Use replace() to remove underscores, hyphens, and spaces and convert words to camelcase.

const toCamelCase = str =>
   str.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2, offset) =>  p2 ? p2.toUpperCase() : p1.toLowerCase());
 // toCamelCase("some_database_field_name") -> 'someDatabaseFieldName'
@@ -1224,7 +1224,7 @@ Return the string truncated to the desired length, with ... appende
 

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. +

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"]
@@ -1262,7 +1262,7 @@ Omit the second argument to use the default regex.


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 any alpha value is provided alongside 6-digit hex, give rgba() string in return.

+

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('');
@@ -1322,7 +1322,7 @@ Omit the second argument to use the default regex.

// isSymbol(Symbol('x')) -> true

RGBToHex

-

Converts the values of RGB components to a colorcode.

+

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'

From b80b590296c634bdfd0333145c40944273c90f23 Mon Sep 17 00:00:00 2001
From: Pl4gue 
Date: Sat, 23 Dec 2017 00:48:17 +0100
Subject: [PATCH 52/96] Fix "last category stays visible even if empty" issue

---
 static-parts/index-start.html | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/static-parts/index-start.html b/static-parts/index-start.html
index f6c71b064..85453e042 100644
--- a/static-parts/index-start.html
+++ b/static-parts/index-start.html
@@ -17,9 +17,16 @@
   
   
   

From 73bf62173d3ae7d7153e98cc7daeddbf2e8fdebb Mon Sep 17 00:00:00 2001
From: Pl4gue 
Date: Sat, 23 Dec 2017 00:50:21 +0100
Subject: [PATCH 53/96] build

---
 docs/index.html | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/index.html b/docs/index.html
index dc8296a8e..376e2e906 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -17,9 +17,16 @@
   
   
   

From 0ff05e5f6abf0a9e994c56cf39e28ff6f62aaf37 Mon Sep 17 00:00:00 2001
From: lucky4 <591398706@qq.com>
Date: Sat, 23 Dec 2017 07:54:07 +0800
Subject: [PATCH 54/96] fix syntax in README.md arrayLcm part

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index a64842de8..58528c68e 100644
--- a/README.md
+++ b/README.md
@@ -290,7 +290,7 @@ Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the low
 ```js
 const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
-  const lcm = (x, y) => (x*y)/gcd(x, y) 
+  const lcm = (x, y) => (x*y)/gcd(x, y); 
   return arr.reduce((a,b) => lcm(a,b));
 }
 // arrayLcm([1,2,3,4,5]) -> 60

From 3cc1cd50c2b83d95f11a1c264c915a81226bc878 Mon Sep 17 00:00:00 2001
From: lucky4 <591398706@qq.com>
Date: Sat, 23 Dec 2017 08:19:04 +0800
Subject: [PATCH 55/96] fix snippets/arrayLcm part syntax

---
 README.md            | 2 +-
 snippets/arrayLcm.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 58528c68e..a64842de8 100644
--- a/README.md
+++ b/README.md
@@ -290,7 +290,7 @@ Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the low
 ```js
 const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
-  const lcm = (x, y) => (x*y)/gcd(x, y); 
+  const lcm = (x, y) => (x*y)/gcd(x, y) 
   return arr.reduce((a,b) => lcm(a,b));
 }
 // arrayLcm([1,2,3,4,5]) -> 60
diff --git a/snippets/arrayLcm.md b/snippets/arrayLcm.md
index 3b0ad354c..8d4e593fb 100644
--- a/snippets/arrayLcm.md
+++ b/snippets/arrayLcm.md
@@ -7,7 +7,7 @@ Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the low
 ```js
 const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
-  const lcm = (x, y) => (x*y)/gcd(x, y) 
+  const lcm = (x, y) => (x*y)/gcd(x, y); 
   return arr.reduce((a,b) => lcm(a,b));
 }
 // arrayLcm([1,2,3,4,5]) -> 60

From f9441f45bbcc12bd82a5b1f387a872990add49c5 Mon Sep 17 00:00:00 2001
From: Robert Mennell 
Date: Fri, 22 Dec 2017 18:51:43 -0800
Subject: [PATCH 56/96] [UPDATE] Flatten updated to use ES6 spread

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

diff --git a/snippets/flatten.md b/snippets/flatten.md
index 69a492572..deca1d752 100644
--- a/snippets/flatten.md
+++ b/snippets/flatten.md
@@ -2,9 +2,9 @@
 
 Flattens an array.
 
-Use `Array.reduce()` to get all elements inside the array and `concat()` to flatten them.
+Using a new array we concatinate it with the spread input array causing a shallow flatten
 
 ```js
-const flatten = arr => arr.reduce((a, v) => a.concat(v), []);
+const flatten = arr => [ ].concat( ...arr );
 // flatten([1,[2],3,4]) -> [1,2,3,4]
 ```

From d9be9ce0b7dc70cf234959c6f53824616f037bc6 Mon Sep 17 00:00:00 2001
From: Robert Mennell 
Date: Fri, 22 Dec 2017 18:54:23 -0800
Subject: [PATCH 57/96] Fix the description to be a bit more proper

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

diff --git a/snippets/flatten.md b/snippets/flatten.md
index deca1d752..4542d6b18 100644
--- a/snippets/flatten.md
+++ b/snippets/flatten.md
@@ -2,7 +2,7 @@
 
 Flattens an array.
 
-Using a new array we concatinate it with the spread input array causing a shallow flatten
+Using a new array we concatinate it with the spread input array causing a shallow denesting of any contained arrays
 
 ```js
 const flatten = arr => [ ].concat( ...arr );

From 2f152e9fad3a3671c82f0d2557718c37e07ff021 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Sat, 23 Dec 2017 11:39:20 +0200
Subject: [PATCH 58/96] Fixed code fonts in websites

---
 dist/flavor.css       | 1697 +++++++++++++++++++++++++++++++++++++++++
 dist/flavor.min.css   |    1 +
 docs/mini.css         |    2 +-
 docs/mini/flavor.scss |    4 +-
 4 files changed, 1702 insertions(+), 2 deletions(-)
 create mode 100644 dist/flavor.css
 create mode 100644 dist/flavor.min.css

diff --git a/dist/flavor.css b/dist/flavor.css
new file mode 100644
index 000000000..dc63dd137
--- /dev/null
+++ b/dist/flavor.css
@@ -0,0 +1,1697 @@
+@charset "UTF-8";
+/*
+  Flavor name: Default (mini-default)
+  Author: Angelos Chalaris (chalarangelo@gmail.com)
+  Maintainers: Angelos Chalaris
+  mini.css version: v3.0.0-alpha.2
+*/
+/*
+  Browsers resets and base typography.
+*/
+/* Core module CSS variable definitions */
+:root {
+  --fore-color: #111;
+  --secondary-fore-color: #444;
+  --back-color: #f8f8f8;
+  --secondary-back-color: #f0f0f0;
+  --blockquote-color: #f57c00;
+  --pre-color: #1565c0;
+  --border-color: #aaa;
+  --secondary-border-color: #ddd;
+  --heading-ratio: 1.19;
+  --universal-margin: 0.5rem;
+  --universal-padding: 0.5rem;
+  --universal-border-radius: 0.125rem;
+  --a-link-color: #0277bd;
+  --a-visited-color: #01579b;
+}
+
+html {
+  font-size: 16px;
+}
+
+a, b, del, em, i, ins, q, span, strong, u {
+  font-size: 1em;
+}
+
+html, * {
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;
+  line-height: 1.5;
+  -webkit-text-size-adjust: 100%;
+}
+
+* {
+  font-size: 1rem;
+}
+
+body {
+  margin: 0;
+  color: var(--fore-color);
+  background: var(--back-color);
+}
+
+details {
+  display: block;
+}
+
+summary {
+  display: list-item;
+}
+
+abbr[title] {
+  border-bottom: none;
+  text-decoration: underline dotted;
+}
+
+input {
+  overflow: visible;
+}
+
+img {
+  max-width: 100%;
+  height: auto;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  line-height: 1.2;
+  margin: calc(1.5 * var(--universal-margin)) var(--universal-margin);
+  font-weight: 500;
+}
+
+h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
+  color: var(--secondary-fore-color);
+  display: block;
+  margin-top: -0.25rem;
+}
+
+h1 {
+  font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio));
+}
+
+h2 {
+  font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio));
+}
+
+h3 {
+  font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio));
+}
+
+h4 {
+  font-size: calc(1rem * var(--heading-ratio));
+}
+
+h5 {
+  font-size: 1rem;
+}
+
+h6 {
+  font-size: calc(1rem / var(--heading-ratio));
+}
+
+p {
+  margin: var(--universal-margin);
+}
+
+ol, ul {
+  margin: var(--universal-margin);
+  padding-left: calc(2 * var(--universal-margin));
+}
+
+b, strong {
+  font-weight: 700;
+}
+
+hr {
+  box-sizing: content-box;
+  border: 0;
+  line-height: 1.25em;
+  margin: var(--universal-margin);
+  height: 0.0625rem;
+  background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
+}
+
+blockquote {
+  display: block;
+  position: relative;
+  font-style: italic;
+  color: var(--secondary-fore-color);
+  margin: var(--universal-margin);
+  padding: calc(3 * var(--universal-padding));
+  border: 0.0625rem solid var(--secondary-border-color);
+  border-left: 0.375rem solid var(--blockquote-color);
+  border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0;
+}
+
+blockquote:before {
+  position: absolute;
+  top: calc(0rem - var(--universal-padding));
+  left: 0;
+  font-family: sans-serif;
+  font-size: 3rem;
+  font-weight: 700;
+  content: "\201c";
+  color: var(--blockquote-color);
+}
+
+blockquote[cite]:after {
+  font-style: normal;
+  font-size: 0.75em;
+  font-weight: 700;
+  content: "\a—  " attr(cite);
+  white-space: pre;
+}
+
+code, kbd, pre, samp {
+  font-family: Menlo, Consolas, monospace;
+  font-size: 0.85em;
+}
+
+code {
+  background: var(--secondary-back-color);
+  border-radius: var(--universal-border-radius);
+  padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2);
+}
+
+kbd {
+  background: var(--fore-color);
+  color: var(--back-color);
+  border-radius: var(--universal-border-radius);
+  padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2);
+}
+
+pre {
+  overflow: auto;
+  background: var(--secondary-back-color);
+  padding: calc(1.5 * var(--universal-padding));
+  margin: var(--universal-margin);
+  border: 0.0625rem solid var(--secondary-border-color);
+  border-left: 0.25rem solid var(--pre-color);
+  border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0;
+}
+
+sup, sub, code, kbd {
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline;
+}
+
+small, sup, sub, figcaption {
+  font-size: 0.75em;
+}
+
+sup {
+  top: -0.5em;
+}
+
+sub {
+  bottom: -0.25em;
+}
+
+figure {
+  margin: var(--universal-margin);
+}
+
+figcaption {
+  color: var(--secondary-fore-color);
+}
+
+a {
+  text-decoration: none;
+}
+
+a:link {
+  color: var(--a-link-color);
+}
+
+a:visited {
+  color: var(--a-visited-color);
+}
+
+a:hover, a:focus {
+  text-decoration: underline;
+}
+
+/*
+  Definitions for the grid system, cards and containers.
+*/
+.container {
+  margin: 0 auto;
+  padding: 0 calc(1.5 * var(--universal-padding));
+}
+
+.row {
+  box-sizing: border-box;
+  display: flex;
+  flex: 0 1 auto;
+  flex-flow: row wrap;
+}
+
+.col-sm,
+[class^='col-sm-'],
+[class^='col-sm-offset-'],
+.row[class*='cols-sm-'] > * {
+  box-sizing: border-box;
+  flex: 0 0 auto;
+  padding: 0 calc(var(--universal-padding) / 2);
+}
+
+.col-sm,
+.row.cols-sm > * {
+  max-width: 100%;
+  flex-grow: 1;
+  flex-basis: 0;
+}
+
+.col-sm-1,
+.row.cols-sm-1 > * {
+  max-width: 8.33333%;
+  flex-basis: 8.33333%;
+}
+
+.col-sm-offset-0 {
+  margin-left: 0;
+}
+
+.col-sm-2,
+.row.cols-sm-2 > * {
+  max-width: 16.66667%;
+  flex-basis: 16.66667%;
+}
+
+.col-sm-offset-1 {
+  margin-left: 8.33333%;
+}
+
+.col-sm-3,
+.row.cols-sm-3 > * {
+  max-width: 25%;
+  flex-basis: 25%;
+}
+
+.col-sm-offset-2 {
+  margin-left: 16.66667%;
+}
+
+.col-sm-4,
+.row.cols-sm-4 > * {
+  max-width: 33.33333%;
+  flex-basis: 33.33333%;
+}
+
+.col-sm-offset-3 {
+  margin-left: 25%;
+}
+
+.col-sm-5,
+.row.cols-sm-5 > * {
+  max-width: 41.66667%;
+  flex-basis: 41.66667%;
+}
+
+.col-sm-offset-4 {
+  margin-left: 33.33333%;
+}
+
+.col-sm-6,
+.row.cols-sm-6 > * {
+  max-width: 50%;
+  flex-basis: 50%;
+}
+
+.col-sm-offset-5 {
+  margin-left: 41.66667%;
+}
+
+.col-sm-7,
+.row.cols-sm-7 > * {
+  max-width: 58.33333%;
+  flex-basis: 58.33333%;
+}
+
+.col-sm-offset-6 {
+  margin-left: 50%;
+}
+
+.col-sm-8,
+.row.cols-sm-8 > * {
+  max-width: 66.66667%;
+  flex-basis: 66.66667%;
+}
+
+.col-sm-offset-7 {
+  margin-left: 58.33333%;
+}
+
+.col-sm-9,
+.row.cols-sm-9 > * {
+  max-width: 75%;
+  flex-basis: 75%;
+}
+
+.col-sm-offset-8 {
+  margin-left: 66.66667%;
+}
+
+.col-sm-10,
+.row.cols-sm-10 > * {
+  max-width: 83.33333%;
+  flex-basis: 83.33333%;
+}
+
+.col-sm-offset-9 {
+  margin-left: 75%;
+}
+
+.col-sm-11,
+.row.cols-sm-11 > * {
+  max-width: 91.66667%;
+  flex-basis: 91.66667%;
+}
+
+.col-sm-offset-10 {
+  margin-left: 83.33333%;
+}
+
+.col-sm-12,
+.row.cols-sm-12 > * {
+  max-width: 100%;
+  flex-basis: 100%;
+}
+
+.col-sm-offset-11 {
+  margin-left: 91.66667%;
+}
+
+.col-sm-normal {
+  order: initial;
+}
+
+.col-sm-first {
+  order: -999;
+}
+
+.col-sm-last {
+  order: 999;
+}
+
+@media screen and (min-width: 768px) {
+  .col-md,
+  [class^='col-md-'],
+  [class^='col-md-offset-'],
+  .row[class*='cols-md-'] > * {
+    box-sizing: border-box;
+    flex: 0 0 auto;
+    padding: 0 calc(var(--universal-padding) / 2);
+  }
+  .col-md,
+  .row.cols-md > * {
+    max-width: 100%;
+    flex-grow: 1;
+    flex-basis: 0;
+  }
+  .col-md-1,
+  .row.cols-md-1 > * {
+    max-width: 8.33333%;
+    flex-basis: 8.33333%;
+  }
+  .col-md-offset-0 {
+    margin-left: 0;
+  }
+  .col-md-2,
+  .row.cols-md-2 > * {
+    max-width: 16.66667%;
+    flex-basis: 16.66667%;
+  }
+  .col-md-offset-1 {
+    margin-left: 8.33333%;
+  }
+  .col-md-3,
+  .row.cols-md-3 > * {
+    max-width: 25%;
+    flex-basis: 25%;
+  }
+  .col-md-offset-2 {
+    margin-left: 16.66667%;
+  }
+  .col-md-4,
+  .row.cols-md-4 > * {
+    max-width: 33.33333%;
+    flex-basis: 33.33333%;
+  }
+  .col-md-offset-3 {
+    margin-left: 25%;
+  }
+  .col-md-5,
+  .row.cols-md-5 > * {
+    max-width: 41.66667%;
+    flex-basis: 41.66667%;
+  }
+  .col-md-offset-4 {
+    margin-left: 33.33333%;
+  }
+  .col-md-6,
+  .row.cols-md-6 > * {
+    max-width: 50%;
+    flex-basis: 50%;
+  }
+  .col-md-offset-5 {
+    margin-left: 41.66667%;
+  }
+  .col-md-7,
+  .row.cols-md-7 > * {
+    max-width: 58.33333%;
+    flex-basis: 58.33333%;
+  }
+  .col-md-offset-6 {
+    margin-left: 50%;
+  }
+  .col-md-8,
+  .row.cols-md-8 > * {
+    max-width: 66.66667%;
+    flex-basis: 66.66667%;
+  }
+  .col-md-offset-7 {
+    margin-left: 58.33333%;
+  }
+  .col-md-9,
+  .row.cols-md-9 > * {
+    max-width: 75%;
+    flex-basis: 75%;
+  }
+  .col-md-offset-8 {
+    margin-left: 66.66667%;
+  }
+  .col-md-10,
+  .row.cols-md-10 > * {
+    max-width: 83.33333%;
+    flex-basis: 83.33333%;
+  }
+  .col-md-offset-9 {
+    margin-left: 75%;
+  }
+  .col-md-11,
+  .row.cols-md-11 > * {
+    max-width: 91.66667%;
+    flex-basis: 91.66667%;
+  }
+  .col-md-offset-10 {
+    margin-left: 83.33333%;
+  }
+  .col-md-12,
+  .row.cols-md-12 > * {
+    max-width: 100%;
+    flex-basis: 100%;
+  }
+  .col-md-offset-11 {
+    margin-left: 91.66667%;
+  }
+  .col-md-normal {
+    order: initial;
+  }
+  .col-md-first {
+    order: -999;
+  }
+  .col-md-last {
+    order: 999;
+  }
+}
+
+@media screen and (min-width: 1280px) {
+  .col-lg,
+  [class^='col-lg-'],
+  [class^='col-lg-offset-'],
+  .row[class*='cols-lg-'] > * {
+    box-sizing: border-box;
+    flex: 0 0 auto;
+    padding: 0 calc(var(--universal-padding) / 2);
+  }
+  .col-lg,
+  .row.cols-lg > * {
+    max-width: 100%;
+    flex-grow: 1;
+    flex-basis: 0;
+  }
+  .col-lg-1,
+  .row.cols-lg-1 > * {
+    max-width: 8.33333%;
+    flex-basis: 8.33333%;
+  }
+  .col-lg-offset-0 {
+    margin-left: 0;
+  }
+  .col-lg-2,
+  .row.cols-lg-2 > * {
+    max-width: 16.66667%;
+    flex-basis: 16.66667%;
+  }
+  .col-lg-offset-1 {
+    margin-left: 8.33333%;
+  }
+  .col-lg-3,
+  .row.cols-lg-3 > * {
+    max-width: 25%;
+    flex-basis: 25%;
+  }
+  .col-lg-offset-2 {
+    margin-left: 16.66667%;
+  }
+  .col-lg-4,
+  .row.cols-lg-4 > * {
+    max-width: 33.33333%;
+    flex-basis: 33.33333%;
+  }
+  .col-lg-offset-3 {
+    margin-left: 25%;
+  }
+  .col-lg-5,
+  .row.cols-lg-5 > * {
+    max-width: 41.66667%;
+    flex-basis: 41.66667%;
+  }
+  .col-lg-offset-4 {
+    margin-left: 33.33333%;
+  }
+  .col-lg-6,
+  .row.cols-lg-6 > * {
+    max-width: 50%;
+    flex-basis: 50%;
+  }
+  .col-lg-offset-5 {
+    margin-left: 41.66667%;
+  }
+  .col-lg-7,
+  .row.cols-lg-7 > * {
+    max-width: 58.33333%;
+    flex-basis: 58.33333%;
+  }
+  .col-lg-offset-6 {
+    margin-left: 50%;
+  }
+  .col-lg-8,
+  .row.cols-lg-8 > * {
+    max-width: 66.66667%;
+    flex-basis: 66.66667%;
+  }
+  .col-lg-offset-7 {
+    margin-left: 58.33333%;
+  }
+  .col-lg-9,
+  .row.cols-lg-9 > * {
+    max-width: 75%;
+    flex-basis: 75%;
+  }
+  .col-lg-offset-8 {
+    margin-left: 66.66667%;
+  }
+  .col-lg-10,
+  .row.cols-lg-10 > * {
+    max-width: 83.33333%;
+    flex-basis: 83.33333%;
+  }
+  .col-lg-offset-9 {
+    margin-left: 75%;
+  }
+  .col-lg-11,
+  .row.cols-lg-11 > * {
+    max-width: 91.66667%;
+    flex-basis: 91.66667%;
+  }
+  .col-lg-offset-10 {
+    margin-left: 83.33333%;
+  }
+  .col-lg-12,
+  .row.cols-lg-12 > * {
+    max-width: 100%;
+    flex-basis: 100%;
+  }
+  .col-lg-offset-11 {
+    margin-left: 91.66667%;
+  }
+  .col-lg-normal {
+    order: initial;
+  }
+  .col-lg-first {
+    order: -999;
+  }
+  .col-lg-last {
+    order: 999;
+  }
+}
+
+/* Card component CSS variable definitions */
+:root {
+  --card-back-color: #f8f8f8;
+  --card-fore-color: #111;
+  --card-border-color: #ddd;
+}
+
+.card {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  align-self: center;
+  position: relative;
+  width: 100%;
+  background: var(--card-back-color);
+  color: var(--card-fore-color);
+  border: 0.0625rem solid var(--card-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: var(--universal-margin);
+  overflow: hidden;
+}
+
+@media screen and (min-width: 320px) {
+  .card {
+    max-width: 320px;
+  }
+}
+
+.card > .section {
+  background: var(--card-back-color);
+  color: var(--card-fore-color);
+  box-sizing: border-box;
+  margin: 0;
+  border: 0;
+  border-radius: 0;
+  border-bottom: 0.0625rem solid var(--card-border-color);
+  padding: var(--universal-padding);
+  width: 100%;
+}
+
+.card > .section.media {
+  height: 200px;
+  padding: 0;
+  -o-object-fit: cover;
+  object-fit: cover;
+}
+
+.card > .section:last-child {
+  border-bottom: 0;
+}
+
+/*
+  Custom elements for card elements.
+*/
+@media screen and (min-width: 240px) {
+  .card.small {
+    max-width: 240px;
+  }
+}
+
+@media screen and (min-width: 480px) {
+  .card.large {
+    max-width: 480px;
+  }
+}
+
+.card.fluid {
+  max-width: 100%;
+  width: auto;
+}
+
+.card.warning {
+  --card-back-color: #ffca28;
+  --card-border-color: #e8b825;
+}
+
+.card.error {
+  --card-back-color: #b71c1c;
+  --card-fore-color: #f8f8f8;
+  --card-border-color: #a71a1a;
+}
+
+.card > .section.dark {
+  --card-back-color: #e0e0e0;
+}
+
+.card > .section.double-padded {
+  padding: calc(1.5 * var(--universal-padding));
+}
+
+/*
+  Definitions for forms and input elements.
+*/
+/* Input_control module CSS variable definitions */
+:root {
+  --form-back-color: #f0f0f0;
+  --form-fore-color: #111;
+  --form-border-color: #ddd;
+  --input-back-color: #f8f8f8;
+  --input-fore-color: #111;
+  --input-border-color: #ddd;
+  --input-focus-color: #0288d1;
+  --input-invalid-color: #d32f2f;
+  --button-back-color: #e2e2e2;
+  --button-hover-back-color: #dcdcdc;
+  --button-fore-color: #212121;
+  --button-border-color: transparent;
+  --button-hover-border-color: transparent;
+  --button-group-border-color: rgba(124, 124, 124, 0.54);
+}
+
+form {
+  background: var(--form-back-color);
+  color: var(--form-fore-color);
+  border: 0.0625rem solid var(--form-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: var(--universal-margin);
+  padding: calc(2 * var(--universal-padding)) var(--universal-padding);
+}
+
+fieldset {
+  border: 0.0625rem solid var(--form-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: calc(var(--universal-margin) / 4);
+  padding: var(--universal-padding);
+}
+
+legend {
+  box-sizing: border-box;
+  display: table;
+  max-width: 100%;
+  white-space: normal;
+  font-weight: 700;
+  padding: calc(var(--universal-padding) / 2);
+}
+
+label {
+  padding: calc(var(--universal-padding) / 2) var(--universal-padding);
+}
+
+.input-group {
+  display: inline-block;
+}
+
+.input-group.fluid {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.input-group.fluid > input {
+  max-width: 100%;
+  flex-grow: 1;
+  flex-basis: 0px;
+}
+
+@media screen and (max-width: 767px) {
+  .input-group.fluid {
+    align-items: stretch;
+    flex-direction: column;
+  }
+}
+
+.input-group.vertical {
+  display: flex;
+  align-items: stretch;
+  flex-direction: column;
+}
+
+.input-group.vertical > input {
+  max-width: 100%;
+  flex-grow: 1;
+  flex-basis: 0px;
+}
+
+[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {
+  height: auto;
+}
+
+[type="search"] {
+  -webkit-appearance: textfield;
+  outline-offset: -2px;
+}
+
+[type="search"]::-webkit-search-cancel-button,
+[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+
+input:not([type]), [type="text"], [type="email"], [type="number"], [type="search"],
+[type="password"], [type="url"], [type="tel"], [type="checkbox"], [type="radio"], textarea, select {
+  box-sizing: border-box;
+  background: var(--input-back-color);
+  color: var(--input-fore-color);
+  border: 0.0625rem solid var(--input-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: calc(var(--universal-margin) / 2);
+  padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
+}
+
+input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus, textarea:hover, textarea:focus, select:hover, select:focus {
+  border-color: var(--input-focus-color);
+  box-shadow: none;
+}
+
+input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid, textarea:invalid, textarea:focus:invalid, select:invalid, select:focus:invalid {
+  border-color: var(--input-invalid-color);
+  box-shadow: none;
+}
+
+input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly], textarea[readonly], select[readonly] {
+  background: var(--secondary-back-color);
+}
+
+select {
+  max-width: 100%;
+}
+
+option {
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+[type="checkbox"], [type="radio"] {
+  -webkit-appearance: none;
+  -moz-appearance: none;
+  appearance: none;
+  position: relative;
+  height: calc(1rem + var(--universal-padding) / 2);
+  width: calc(1rem + var(--universal-padding) / 2);
+  vertical-align: text-bottom;
+  padding: 0;
+  flex-basis: calc(1rem + var(--universal-padding) / 2) !important;
+  flex-grow: 0 !important;
+}
+
+[type="checkbox"]:checked:before, [type="radio"]:checked:before {
+  position: absolute;
+}
+
+[type="checkbox"]:checked:before {
+  content: '\2713';
+  font-family: sans-serif;
+  font-size: calc(1rem + var(--universal-padding) / 2);
+  top: calc(0rem - var(--universal-padding));
+  left: calc(var(--universal-padding) / 4);
+}
+
+[type="radio"] {
+  border-radius: 100%;
+}
+
+[type="radio"]:checked:before {
+  border-radius: 100%;
+  content: '';
+  top: calc(0.0625rem + var(--universal-padding) / 2);
+  left: calc(0.0625rem + var(--universal-padding) / 2);
+  background: var(--input-fore-color);
+  width: 0.5rem;
+  height: 0.5rem;
+}
+
+:placeholder-shown {
+  color: var(--input-fore-color);
+}
+
+::-ms-placeholder {
+  color: var(--input-fore-color);
+  opacity: 0.54;
+}
+
+button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {
+  border-style: none;
+  padding: 0;
+}
+
+button, html [type="button"], [type="reset"], [type="submit"] {
+  -webkit-appearance: button;
+}
+
+button {
+  overflow: visible;
+  text-transform: none;
+}
+
+button, [type="button"], [type="submit"], [type="reset"],
+a.button, label.button, .button,
+a[role="button"], label[role="button"], [role="button"] {
+  display: inline-block;
+  background: var(--button-back-color);
+  color: var(--button-fore-color);
+  border: 0.0625rem solid var(--button-border-color);
+  border-radius: var(--universal-border-radius);
+  padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
+  margin: var(--universal-margin);
+  text-decoration: none;
+  cursor: pointer;
+  transition: background 0.3s;
+}
+
+button:hover, button:focus, [type="button"]:hover, [type="button"]:focus, [type="submit"]:hover, [type="submit"]:focus, [type="reset"]:hover, [type="reset"]:focus,
+a.button:hover,
+a.button:focus, label.button:hover, label.button:focus, .button:hover, .button:focus,
+a[role="button"]:hover,
+a[role="button"]:focus, label[role="button"]:hover, label[role="button"]:focus, [role="button"]:hover, [role="button"]:focus {
+  background: var(--button-hover-back-color);
+  border-color: var(--button-hover-border-color);
+}
+
+input:disabled, input[disabled], textarea:disabled, textarea[disabled], select:disabled, select[disabled], button:disabled, button[disabled], .button:disabled, .button[disabled], [role="button"]:disabled, [role="button"][disabled] {
+  cursor: not-allowed;
+  opacity: 0.75;
+}
+
+.button-group {
+  display: flex;
+  border: 0.0625rem solid var(--button-group-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: var(--universal-margin);
+}
+
+.button-group > button, .button-group [type="button"], .button-group > [type="submit"], .button-group > [type="reset"],
+.button-group > .button, .button-group > [role="button"] {
+  margin: 0;
+  max-width: 100%;
+  flex: 1 1 auto;
+  text-align: center;
+  border: 0;
+  border-radius: 0;
+  box-shadow: none;
+}
+
+.button-group > :not(:first-child) {
+  border-left: 0.0625rem solid var(--button-group-border-color);
+}
+
+@media screen and (max-width: 767px) {
+  .button-group {
+    flex-direction: column;
+  }
+  .button-group > :not(:first-child) {
+    border: 0;
+    border-top: 0.0625rem solid var(--button-group-border-color);
+  }
+}
+
+/*
+  Custom elements for forms and input elements.
+*/
+button.primary, [type="button"].primary, [type="submit"].primary, [type="reset"].primary, .button.primary, [role="button"].primary {
+  --button-back-color: #1976d2;
+  --button-fore-color: #f8f8f8;
+}
+
+button.primary:hover, button.primary:focus, [type="button"].primary:hover, [type="button"].primary:focus, [type="submit"].primary:hover, [type="submit"].primary:focus, [type="reset"].primary:hover, [type="reset"].primary:focus, .button.primary:hover, .button.primary:focus, [role="button"].primary:hover, [role="button"].primary:focus {
+  --button-hover-back-color: #1565c0;
+}
+
+button.secondary, [type="button"].secondary, [type="submit"].secondary, [type="reset"].secondary, .button.secondary, [role="button"].secondary {
+  --button-back-color: #d32f2f;
+  --button-fore-color: #f8f8f8;
+}
+
+button.secondary:hover, button.secondary:focus, [type="button"].secondary:hover, [type="button"].secondary:focus, [type="submit"].secondary:hover, [type="submit"].secondary:focus, [type="reset"].secondary:hover, [type="reset"].secondary:focus, .button.secondary:hover, .button.secondary:focus, [role="button"].secondary:hover, [role="button"].secondary:focus {
+  --button-hover-back-color: #c62828;
+}
+
+button.tertiary, [type="button"].tertiary, [type="submit"].tertiary, [type="reset"].tertiary, .button.tertiary, [role="button"].tertiary {
+  --button-back-color: #308732;
+  --button-fore-color: #f8f8f8;
+}
+
+button.tertiary:hover, button.tertiary:focus, [type="button"].tertiary:hover, [type="button"].tertiary:focus, [type="submit"].tertiary:hover, [type="submit"].tertiary:focus, [type="reset"].tertiary:hover, [type="reset"].tertiary:focus, .button.tertiary:hover, .button.tertiary:focus, [role="button"].tertiary:hover, [role="button"].tertiary:focus {
+  --button-hover-back-color: #277529;
+}
+
+button.inverse, [type="button"].inverse, [type="submit"].inverse, [type="reset"].inverse, .button.inverse, [role="button"].inverse {
+  --button-back-color: #212121;
+  --button-fore-color: #f8f8f8;
+}
+
+button.inverse:hover, button.inverse:focus, [type="button"].inverse:hover, [type="button"].inverse:focus, [type="submit"].inverse:hover, [type="submit"].inverse:focus, [type="reset"].inverse:hover, [type="reset"].inverse:focus, .button.inverse:hover, .button.inverse:focus, [role="button"].inverse:hover, [role="button"].inverse:focus {
+  --button-hover-back-color: #111;
+}
+
+button.small, [type="button"].small, [type="submit"].small, [type="reset"].small, .button.small, [role="button"].small {
+  padding: calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding));
+  margin: var(--universal-margin);
+}
+
+button.large, [type="button"].large, [type="submit"].large, [type="reset"].large, .button.large, [role="button"].large {
+  padding: calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding));
+  margin: var(--universal-margin);
+}
+
+/*
+  Definitions for navigation elements.
+*/
+/* Navigation module CSS variable definitions */
+:root {
+  --header-back-color: #f8f8f8;
+  --header-hover-back-color: #f0f0f0;
+  --header-fore-color: #444;
+  --header-border-color: #ddd;
+  --nav-back-color: #f8f8f8;
+  --nav-hover-back-color: #f0f0f0;
+  --nav-fore-color: #444;
+  --nav-border-color: #ddd;
+  --nav-link-color: #0277bd;
+  --footer-fore-color: #444;
+  --footer-back-color: #f8f8f8;
+  --footer-border-color: #ddd;
+  --footer-link-color: #0277bd;
+  --drawer-back-color: #f8f8f8;
+  --drawer-hover-back-color: #f0f0f0;
+  --drawer-border-color: #ddd;
+  --drawer-close-color: #444;
+}
+
+header {
+  height: 3.1875rem;
+  background: var(--header-back-color);
+  color: var(--header-fore-color);
+  border-bottom: 0.0625rem solid var(--header-border-color);
+  padding: calc(var(--universal-padding) / 4) 0;
+  white-space: nowrap;
+  overflow-x: auto;
+  overflow-y: hidden;
+}
+
+header.row {
+  box-sizing: content-box;
+}
+
+header .logo {
+  color: var(--header-fore-color);
+  font-size: 1.75rem;
+  padding: var(--universal-padding) calc(2 * var(--universal-padding));
+  text-decoration: none;
+}
+
+header button, header [type="button"], header .button, header [role="button"] {
+  box-sizing: border-box;
+  position: relative;
+  top: calc(0rem - var(--universal-padding) / 4);
+  height: calc(3.1875rem + var(--universal-padding) / 2);
+  background: var(--header-back-color);
+  line-height: calc(3.1875rem - var(--universal-padding) * 1.5);
+  text-align: center;
+  color: var(--header-fore-color);
+  border: 0;
+  border-radius: 0;
+  margin: 0;
+  text-transform: uppercase;
+}
+
+header button:hover, header button:focus, header [type="button"]:hover, header [type="button"]:focus, header .button:hover, header .button:focus, header [role="button"]:hover, header [role="button"]:focus {
+  background: var(--header-hover-back-color);
+}
+
+nav {
+  background: var(--nav-back-color);
+  color: var(--nav-fore-color);
+  border: 0.0625rem solid var(--nav-border-color);
+  border-radius: var(--universal-border-radius);
+  margin: var(--universal-margin);
+}
+
+nav * {
+  padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
+}
+
+nav a, nav a:visited {
+  display: block;
+  color: var(--nav-link-color);
+  border-radius: var(--universal-border-radius);
+  transition: background 0.3s;
+}
+
+nav a:hover, nav a:focus, nav a:visited:hover, nav a:visited:focus {
+  text-decoration: none;
+  background: var(--nav-hover-back-color);
+}
+
+nav .sublink-1 {
+  position: relative;
+  margin-left: calc(2 * var(--universal-padding));
+}
+
+nav .sublink-1:before {
+  position: absolute;
+  left: calc(var(--universal-padding) - 1 * var(--universal-padding));
+  top: -0.0625rem;
+  content: '';
+  height: 100%;
+  border: 0.0625rem solid var(--nav-border-color);
+  border-left: 0;
+}
+
+nav .sublink-2 {
+  position: relative;
+  margin-left: calc(4 * var(--universal-padding));
+}
+
+nav .sublink-2:before {
+  position: absolute;
+  left: calc(var(--universal-padding) - 3 * var(--universal-padding));
+  top: -0.0625rem;
+  content: '';
+  height: 100%;
+  border: 0.0625rem solid var(--nav-border-color);
+  border-left: 0;
+}
+
+footer {
+  background: var(--footer-back-color);
+  color: var(--footer-fore-color);
+  border-top: 0.0625rem solid var(--footer-border-color);
+  padding: calc(2 * var(--universal-padding)) var(--universal-padding);
+  font-size: 0.875rem;
+}
+
+footer a, footer a:visited {
+  color: var(--footer-link-color);
+}
+
+header.sticky {
+  position: -webkit-sticky;
+  position: sticky;
+  z-index: 1101;
+  top: 0;
+}
+
+footer.sticky {
+  position: -webkit-sticky;
+  position: sticky;
+  z-index: 1101;
+  bottom: 0;
+}
+
+.drawer-toggle:before {
+  display: inline-block;
+  position: relative;
+  vertical-align: bottom;
+  content: '\00a0\2261\00a0';
+  font-family: sans-serif;
+  font-size: 1.5em;
+}
+
+@media screen and (min-width: 768px) {
+  .drawer-toggle:not(.persistent) {
+    display: none;
+  }
+}
+
+[type="checkbox"].drawer {
+  height: 1px;
+  width: 1px;
+  margin: -1px;
+  overflow: hidden;
+  position: absolute;
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+}
+
+[type="checkbox"].drawer + * {
+  display: block;
+  box-sizing: border-box;
+  position: fixed;
+  top: 0;
+  width: 320px;
+  height: 100vh;
+  overflow-y: auto;
+  background: var(--drawer-back-color);
+  border: 0.0625rem solid var(--drawer-border-color);
+  border-radius: 0;
+  margin: 0;
+  z-index: 1110;
+  left: -320px;
+  transition: left 0.3s;
+}
+
+[type="checkbox"].drawer + * .drawer-close {
+  position: absolute;
+  top: var(--universal-margin);
+  right: var(--universal-margin);
+  z-index: 1111;
+  width: 2rem;
+  height: 2rem;
+  border-radius: var(--universal-border-radius);
+  padding: var(--universal-padding);
+  margin: 0;
+  cursor: pointer;
+  transition: background 0.3s;
+}
+
+[type="checkbox"].drawer + * .drawer-close:before {
+  display: block;
+  content: '\00D7';
+  color: var(--drawer-close-color);
+  position: relative;
+  font-family: sans-serif;
+  font-size: 2rem;
+  line-height: 1;
+  text-align: center;
+}
+
+[type="checkbox"].drawer + * .drawer-close:hover, [type="checkbox"].drawer + * .drawer-close:focus {
+  background: var(--drawer-hover-back-color);
+}
+
+@media screen and (max-width: 320px) {
+  [type="checkbox"].drawer + * {
+    width: 100%;
+  }
+}
+
+[type="checkbox"].drawer:checked + * {
+  left: 0;
+}
+
+@media screen and (min-width: 768px) {
+  [type="checkbox"].drawer:not(.persistent) + * {
+    position: static;
+    height: 100%;
+    z-index: 1100;
+  }
+  [type="checkbox"].drawer:not(.persistent) + * .drawer-close {
+    display: none;
+  }
+}
+
+/*
+  Definitions for contextual background elements, toasts and tooltips.
+*/
+/* Contextual module CSS variable definitions */
+:root {
+  --mark-back-color: #0277bd;
+  --mark-fore-color: #fafafa;
+}
+
+mark {
+  background: var(--mark-back-color);
+  color: var(--mark-fore-color);
+  font-size: 0.95em;
+  line-height: 1em;
+  border-radius: var(--universal-border-radius);
+  padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2);
+}
+
+mark.inline-block {
+  display: inline-block;
+  font-size: 1em;
+  line-height: 1.5;
+  padding: calc(var(--universal-padding) / 2) var(--universal-padding);
+}
+
+:root {
+  --toast-back-color: #424242;
+  --toast-fore-color: #fafafa;
+}
+
+.toast {
+  position: fixed;
+  bottom: calc(var(--universal-margin) * 3);
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1111;
+  color: var(--toast-fore-color);
+  background: var(--toast-back-color);
+  border-radius: calc(var(--universal-border-radius) * 16);
+  padding: var(--universal-padding) calc(var(--universal-padding) * 3);
+}
+
+:root {
+  --tooltip-back-color: #212121;
+  --tooltip-fore-color: #fafafa;
+}
+
+.tooltip {
+  position: relative;
+  display: inline-block;
+}
+
+.tooltip:before, .tooltip:after {
+  position: absolute;
+  opacity: 0;
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+  transition: all 0.3s;
+  z-index: 1010;
+  left: 50%;
+}
+
+.tooltip:not(.bottom):before, .tooltip:not(.bottom):after {
+  bottom: 75%;
+}
+
+.tooltip.bottom:before, .tooltip.bottom:after {
+  top: 75%;
+}
+
+.tooltip:hover:before, .tooltip:hover:after, .tooltip:focus:before, .tooltip:focus:after {
+  opacity: 1;
+  clip: auto;
+  -webkit-clip-path: inset(0%);
+  clip-path: inset(0%);
+}
+
+.tooltip:before {
+  content: '';
+  background: transparent;
+  border: var(--universal-margin) solid transparent;
+  left: calc(50% - var(--universal-margin));
+}
+
+.tooltip:not(.bottom):before {
+  border-top-color: #212121;
+}
+
+.tooltip.bottom:before {
+  border-bottom-color: #212121;
+}
+
+.tooltip:after {
+  content: attr(aria-label);
+  color: var(--tooltip-fore-color);
+  background: var(--tooltip-back-color);
+  border-radius: var(--universal-border-radius);
+  padding: var(--universal-padding);
+  white-space: nowrap;
+  transform: translateX(-50%);
+}
+
+.tooltip:not(.bottom):after {
+  margin-bottom: calc(2 * var(--universal-margin));
+}
+
+.tooltip.bottom:after {
+  margin-top: calc(2 * var(--universal-margin));
+}
+
+:root {
+  --modal-overlay-color: rgba(0, 0, 0, 0.45);
+  --modal-close-color: #444;
+  --modal-close-hover-color: #f0f0f0;
+}
+
+[type="checkbox"].modal {
+  height: 1px;
+  width: 1px;
+  margin: -1px;
+  overflow: hidden;
+  position: absolute;
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+}
+
+[type="checkbox"].modal + div {
+  position: fixed;
+  top: 0;
+  left: 0;
+  display: none;
+  width: 100vw;
+  height: 100vh;
+  background: var(--modal-overlay-color);
+}
+
+[type="checkbox"].modal + div .card {
+  margin: 0 auto;
+  max-height: 50vh;
+  overflow: auto;
+}
+
+[type="checkbox"].modal + div .card .modal-close {
+  position: absolute;
+  top: 0;
+  right: 0;
+  width: 1.75rem;
+  height: 1.75rem;
+  border-radius: var(--universal-border-radius);
+  padding: var(--universal-padding);
+  margin: 0;
+  cursor: pointer;
+  transition: background 0.3s;
+}
+
+[type="checkbox"].modal + div .card .modal-close:before {
+  display: block;
+  content: '\00D7';
+  color: var(--modal-close-color);
+  position: relative;
+  font-family: sans-serif;
+  font-size: 1.75rem;
+  line-height: 1;
+  text-align: center;
+}
+
+[type="checkbox"].modal + div .card .modal-close:hover, [type="checkbox"].modal + div .card .modal-close:focus {
+  background: var(--modal-close-hover-color);
+}
+
+[type="checkbox"].modal:checked + div {
+  display: flex;
+  flex: 0 1 auto;
+  z-index: 1200;
+}
+
+[type="checkbox"].modal:checked + div .card .modal-close {
+  z-index: 1211;
+}
+
+:root {
+  --collapse-label-back-color: #e8e8e8;
+  --collapse-label-fore-color: #212121;
+  --collapse-label-hover-back-color: #f0f0f0;
+  --collapse-selected-label-back-color: #ececec;
+  --collapse-border-color: #ddd;
+  --collapse-content-back-color: #fafafa;
+  --collapse-selected-label-border-color: #0277bd;
+}
+
+.collapse {
+  width: calc(100% - 2 * var(--universal-margin));
+  opacity: 1;
+  display: flex;
+  flex-direction: column;
+  margin: var(--universal-margin);
+  border-radius: var(--universal-border-radius);
+}
+
+.collapse > [type="radio"], .collapse > [type="checkbox"] {
+  height: 1px;
+  width: 1px;
+  margin: -1px;
+  overflow: hidden;
+  position: absolute;
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+}
+
+.collapse > label {
+  flex-grow: 1;
+  display: inline-block;
+  height: 1.5rem;
+  cursor: pointer;
+  transition: background 0.3s;
+  color: var(--collapse-label-fore-color);
+  background: var(--collapse-label-back-color);
+  border: 0.0625rem solid var(--collapse-border-color);
+  padding: calc(1.5 * var(--universal-padding));
+}
+
+.collapse > label:hover, .collapse > label:focus {
+  background: var(--collapse-label-hover-back-color);
+}
+
+.collapse > label + div {
+  flex-basis: auto;
+  height: 1px;
+  width: 1px;
+  margin: -1px;
+  overflow: hidden;
+  position: absolute;
+  clip: rect(0 0 0 0);
+  -webkit-clip-path: inset(100%);
+  clip-path: inset(100%);
+  transition: max-height 0.3s;
+  max-height: 1px;
+}
+
+.collapse > :checked + label {
+  background: var(--collapse-selected-label-back-color);
+  border-bottom-color: var(--collapse-selected-label-border-color);
+}
+
+.collapse > :checked + label + div {
+  box-sizing: border-box;
+  position: relative;
+  width: 100%;
+  height: auto;
+  overflow: auto;
+  margin: 0;
+  background: var(--collapse-content-back-color);
+  border: 0.0625rem solid var(--collapse-border-color);
+  border-top: 0;
+  padding: var(--universal-padding);
+  clip: auto;
+  -webkit-clip-path: inset(0%);
+  clip-path: inset(0%);
+  max-height: 400px;
+}
+
+.collapse > label:not(:first-of-type) {
+  border-top: 0;
+}
+
+.collapse > label:first-of-type {
+  border-radius: var(--universal-border-radius) var(--universal-border-radius) 0 0;
+}
+
+.collapse > label:last-of-type {
+  border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius);
+}
+
+.collapse > :checked:last-of-type + label {
+  border-radius: 0;
+}
+
+.collapse > :checked:last-of-type + label + div {
+  border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius);
+}
+
+/*
+  Custom elements for contextual background elements, toasts and tooltips.
+*/
+mark.secondary {
+  --mark-back-color: #d32f2f;
+}
+
+mark.tertiary {
+  --mark-back-color: #308732;
+}
+
+mark.tag {
+  padding: calc(var(--universal-padding)/2) var(--universal-padding);
+  border-radius: 1em;
+}
+
+html, * {
+  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;
+}
+
+code, pre, kbd, code *, pre *, kbd *, code[class*="language-"], pre[class*="language-"] {
+  font-family: 'Inconsolata', Menlo, Consolas, monospace !important;
+}
+
+code, kbd {
+  font-size: 1em;
+}
+
+code {
+  transform: scale(1);
+}
+
+/* Deals with the issue described in #243 */
+pre {
+  font-size: 1rem;
+  border: 0.0625rem solid var(--secondary-border-color);
+  border-radius: var(--universal-border-radius);
+}
+
+.group {
+  position: relative;
+  margin-top: 2em;
+  margin-bottom: -1em;
+}
+
+.search {
+  font-size: 14px;
+  margin-top: -.1em;
+  display: block;
+  width: 100%;
+  border: none;
+  border-bottom: 1px solid var(--nav-link-color);
+}
+
+.search:focus {
+  outline: none;
+}
+
+label#search-label {
+  color: var(--nav-link-color);
+  font-size: 18px;
+  font-weight: 400;
+  position: absolute;
+  left: 5px;
+  top: 10px;
+}
+
+.search:focus ~ label#search-label, .search:valid ~ label#search-label {
+  top: -20px;
+  font-size: 14px;
+  color: var(--nav-link-color);
+}
+
+label#menu-toggle {
+  width: 3.4375rem;
+}
+
+header h1.logo {
+  margin-top: -0.8rem;
+  text-align: center;
+}
+
+header h1.logo a {
+  text-decoration: none;
+  color: #111;
+}
+
+header #title {
+  position: relative;
+  top: -1rem;
+}
+
+@media screen and (max-width: 500px) {
+  header #title {
+    font-size: 1rem;
+    display: block;
+  }
+}
+
+header h1 small {
+  display: block;
+  font-size: 0.875rem;
+  font-style: italic;
+  color: #888;
+  margin-top: -0.8rem;
+}
+
+@media screen and (max-width: 768px) {
+  header h1 small {
+    font-size: 0.75rem;
+  }
+}
+
+@media screen and (max-width: 600px) {
+  header h1 small {
+    font-size: 0.625rem;
+  }
+}
+
+@media screen and (max-width: 500px) {
+  header h1 small {
+    font-size: 0.5rem;
+    margin-top: -1.2rem;
+  }
+}
+
+label#menu-toggle {
+  position: absolute;
+  left: 0.5rem;
+  top: 0.5rem;
+  width: 3.4375rem;
+}
+
+.card {
+  box-shadow: 0 0.25rem 0.25rem 0 rgba(0, 0, 0, 0.125), 0 0.125rem 0.125rem -0.125rem rgba(0, 0, 0, 0.25);
+}
+
+main {
+  padding: 0;
+}
diff --git a/dist/flavor.min.css b/dist/flavor.min.css
new file mode 100644
index 000000000..29b6c15ec
--- /dev/null
+++ b/dist/flavor.min.css
@@ -0,0 +1 @@
+:root{--fore-color:#111;--secondary-fore-color:#444;--back-color:#f8f8f8;--secondary-back-color:#f0f0f0;--blockquote-color:#f57c00;--pre-color:#1565c0;--border-color:#aaa;--secondary-border-color:#ddd;--heading-ratio:1.19;--universal-margin:.5rem;--universal-padding:.5rem;--universal-border-radius:.125rem;--a-link-color:#0277bd;--a-visited-color:#01579b}html{font-size:16px}a,b,del,em,i,ins,q,span,strong,u{font-size:1em}html,*{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;line-height:1.5;-webkit-text-size-adjust:100%}*{font-size:1rem}body{margin:0;color:var(--fore-color);background:var(--back-color)}details{display:block}summary{display:list-item}abbr[title]{border-bottom:none;text-decoration:underline dotted}input{overflow:visible}img{max-width:100%;height:auto}h1,h2,h3,h4,h5,h6{line-height:1.2;margin:calc(1.5 * var(--universal-margin)) var(--universal-margin);font-weight:500}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:var(--secondary-fore-color);display:block;margin-top:-.25rem}h1{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h2{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h3{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio))}h4{font-size:calc(1rem * var(--heading-ratio))}h5{font-size:1rem}h6{font-size:calc(1rem / var(--heading-ratio))}p{margin:var(--universal-margin)}ol,ul{margin:var(--universal-margin);padding-left:calc(2 * var(--universal-margin))}b,strong{font-weight:700}hr{box-sizing:content-box;border:0;line-height:1.25em;margin:var(--universal-margin);height:.0625rem;background:linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent)}blockquote{display:block;position:relative;font-style:italic;color:var(--secondary-fore-color);margin:var(--universal-margin);padding:calc(3 * var(--universal-padding));border:.0625rem solid var(--secondary-border-color);border-left:.375rem solid var(--blockquote-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}blockquote:before{position:absolute;top:calc(0rem - var(--universal-padding));left:0;font-family:sans-serif;font-size:3rem;font-weight:700;content:"\201c";color:var(--blockquote-color)}blockquote[cite]:after{font-style:normal;font-size:.75em;font-weight:700;content:"\a—  " attr(cite);white-space:pre}code,kbd,pre,samp{font-family:Menlo, Consolas, monospace;font-size:.85em}code{background:var(--secondary-back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}kbd{background:var(--fore-color);color:var(--back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}pre{overflow:auto;background:var(--secondary-back-color);padding:calc(1.5 * var(--universal-padding));margin:var(--universal-margin);border:.0625rem solid var(--secondary-border-color);border-left:.25rem solid var(--pre-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}sup,sub,code,kbd{line-height:0;position:relative;vertical-align:baseline}small,sup,sub,figcaption{font-size:.75em}sup{top:-.5em}sub{bottom:-.25em}figure{margin:var(--universal-margin)}figcaption{color:var(--secondary-fore-color)}a{text-decoration:none}a:link{color:var(--a-link-color)}a:visited{color:var(--a-visited-color)}a:hover,a:focus{text-decoration:underline}.container{margin:0 auto;padding:0 calc(1.5 * var(--universal-padding))}.row{box-sizing:border-box;display:flex;flex:0 1 auto;flex-flow:row wrap}.col-sm,[class^='col-sm-'],[class^='col-sm-offset-'],.row[class*='cols-sm-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-sm,.row.cols-sm>*{max-width:100%;flex-grow:1;flex-basis:0}.col-sm-1,.row.cols-sm-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-sm-offset-0{margin-left:0}.col-sm-2,.row.cols-sm-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-sm-offset-1{margin-left:8.33333%}.col-sm-3,.row.cols-sm-3>*{max-width:25%;flex-basis:25%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-4,.row.cols-sm-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-sm-offset-3{margin-left:25%}.col-sm-5,.row.cols-sm-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-6,.row.cols-sm-6>*{max-width:50%;flex-basis:50%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-7,.row.cols-sm-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-sm-offset-6{margin-left:50%}.col-sm-8,.row.cols-sm-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-9,.row.cols-sm-9>*{max-width:75%;flex-basis:75%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-10,.row.cols-sm-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-sm-offset-9{margin-left:75%}.col-sm-11,.row.cols-sm-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-12,.row.cols-sm-12>*{max-width:100%;flex-basis:100%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-normal{order:initial}.col-sm-first{order:-999}.col-sm-last{order:999}@media screen and (min-width: 768px){.col-md,[class^='col-md-'],[class^='col-md-offset-'],.row[class*='cols-md-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-md,.row.cols-md>*{max-width:100%;flex-grow:1;flex-basis:0}.col-md-1,.row.cols-md-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-md-offset-0{margin-left:0}.col-md-2,.row.cols-md-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-md-offset-1{margin-left:8.33333%}.col-md-3,.row.cols-md-3>*{max-width:25%;flex-basis:25%}.col-md-offset-2{margin-left:16.66667%}.col-md-4,.row.cols-md-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-md-offset-3{margin-left:25%}.col-md-5,.row.cols-md-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-md-offset-4{margin-left:33.33333%}.col-md-6,.row.cols-md-6>*{max-width:50%;flex-basis:50%}.col-md-offset-5{margin-left:41.66667%}.col-md-7,.row.cols-md-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-md-offset-6{margin-left:50%}.col-md-8,.row.cols-md-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-md-offset-7{margin-left:58.33333%}.col-md-9,.row.cols-md-9>*{max-width:75%;flex-basis:75%}.col-md-offset-8{margin-left:66.66667%}.col-md-10,.row.cols-md-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-md-offset-9{margin-left:75%}.col-md-11,.row.cols-md-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-md-offset-10{margin-left:83.33333%}.col-md-12,.row.cols-md-12>*{max-width:100%;flex-basis:100%}.col-md-offset-11{margin-left:91.66667%}.col-md-normal{order:initial}.col-md-first{order:-999}.col-md-last{order:999}}@media screen and (min-width: 1280px){.col-lg,[class^='col-lg-'],[class^='col-lg-offset-'],.row[class*='cols-lg-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-lg,.row.cols-lg>*{max-width:100%;flex-grow:1;flex-basis:0}.col-lg-1,.row.cols-lg-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-lg-offset-0{margin-left:0}.col-lg-2,.row.cols-lg-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-lg-offset-1{margin-left:8.33333%}.col-lg-3,.row.cols-lg-3>*{max-width:25%;flex-basis:25%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-4,.row.cols-lg-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-lg-offset-3{margin-left:25%}.col-lg-5,.row.cols-lg-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-6,.row.cols-lg-6>*{max-width:50%;flex-basis:50%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-7,.row.cols-lg-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-lg-offset-6{margin-left:50%}.col-lg-8,.row.cols-lg-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-9,.row.cols-lg-9>*{max-width:75%;flex-basis:75%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-10,.row.cols-lg-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-lg-offset-9{margin-left:75%}.col-lg-11,.row.cols-lg-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-12,.row.cols-lg-12>*{max-width:100%;flex-basis:100%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-normal{order:initial}.col-lg-first{order:-999}.col-lg-last{order:999}}:root{--card-back-color:#f8f8f8;--card-fore-color:#111;--card-border-color:#ddd}.card{display:flex;flex-direction:column;justify-content:space-between;align-self:center;position:relative;width:100%;background:var(--card-back-color);color:var(--card-fore-color);border:.0625rem solid var(--card-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);overflow:hidden}@media screen and (min-width: 320px){.card{max-width:320px}}.card>.section{background:var(--card-back-color);color:var(--card-fore-color);box-sizing:border-box;margin:0;border:0;border-radius:0;border-bottom:.0625rem solid var(--card-border-color);padding:var(--universal-padding);width:100%}.card>.section.media{height:200px;padding:0;-o-object-fit:cover;object-fit:cover}.card>.section:last-child{border-bottom:0}@media screen and (min-width: 240px){.card.small{max-width:240px}}@media screen and (min-width: 480px){.card.large{max-width:480px}}.card.fluid{max-width:100%;width:auto}.card.warning{--card-back-color:#ffca28;--card-border-color:#e8b825}.card.error{--card-back-color:#b71c1c;--card-fore-color:#f8f8f8;--card-border-color:#a71a1a}.card>.section.dark{--card-back-color:#e0e0e0}.card>.section.double-padded{padding:calc(1.5 * var(--universal-padding))}:root{--form-back-color:#f0f0f0;--form-fore-color:#111;--form-border-color:#ddd;--input-back-color:#f8f8f8;--input-fore-color:#111;--input-border-color:#ddd;--input-focus-color:#0288d1;--input-invalid-color:#d32f2f;--button-back-color:#e2e2e2;--button-hover-back-color:#dcdcdc;--button-fore-color:#212121;--button-border-color:transparent;--button-hover-border-color:transparent;--button-group-border-color:rgba(124,124,124,0.54)}form{background:var(--form-back-color);color:var(--form-fore-color);border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);padding:calc(2 * var(--universal-padding)) var(--universal-padding)}fieldset{border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 4);padding:var(--universal-padding)}legend{box-sizing:border-box;display:table;max-width:100%;white-space:normal;font-weight:700;padding:calc(var(--universal-padding) / 2)}label{padding:calc(var(--universal-padding) / 2) var(--universal-padding)}.input-group{display:inline-block}.input-group.fluid{display:flex;align-items:center;justify-content:center}.input-group.fluid>input{max-width:100%;flex-grow:1;flex-basis:0px}@media screen and (max-width: 767px){.input-group.fluid{align-items:stretch;flex-direction:column}}.input-group.vertical{display:flex;align-items:stretch;flex-direction:column}.input-group.vertical>input{max-width:100%;flex-grow:1;flex-basis:0px}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input:not([type]),[type="text"],[type="email"],[type="number"],[type="search"],[type="password"],[type="url"],[type="tel"],[type="checkbox"],[type="radio"],textarea,select{box-sizing:border-box;background:var(--input-back-color);color:var(--input-fore-color);border:.0625rem solid var(--input-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 2);padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus,textarea:hover,textarea:focus,select:hover,select:focus{border-color:var(--input-focus-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid,textarea:invalid,textarea:focus:invalid,select:invalid,select:focus:invalid{border-color:var(--input-invalid-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],textarea[readonly],select[readonly]{background:var(--secondary-back-color)}select{max-width:100%}option{overflow:hidden;text-overflow:ellipsis}[type="checkbox"],[type="radio"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;height:calc(1rem + var(--universal-padding) / 2);width:calc(1rem + var(--universal-padding) / 2);vertical-align:text-bottom;padding:0;flex-basis:calc(1rem + var(--universal-padding) / 2) !important;flex-grow:0 !important}[type="checkbox"]:checked:before,[type="radio"]:checked:before{position:absolute}[type="checkbox"]:checked:before{content:'\2713';font-family:sans-serif;font-size:calc(1rem + var(--universal-padding) / 2);top:calc(0rem - var(--universal-padding));left:calc(var(--universal-padding) / 4)}[type="radio"]{border-radius:100%}[type="radio"]:checked:before{border-radius:100%;content:'';top:calc(.0625rem + var(--universal-padding) / 2);left:calc(.0625rem + var(--universal-padding) / 2);background:var(--input-fore-color);width:0.5rem;height:0.5rem}:placeholder-shown{color:var(--input-fore-color)}::-ms-placeholder{color:var(--input-fore-color);opacity:0.54}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button{overflow:visible;text-transform:none}button,[type="button"],[type="submit"],[type="reset"],a.button,label.button,.button,a[role="button"],label[role="button"],[role="button"]{display:inline-block;background:var(--button-back-color);color:var(--button-fore-color);border:.0625rem solid var(--button-border-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding) calc(1.5 * var(--universal-padding));margin:var(--universal-margin);text-decoration:none;cursor:pointer;transition:background 0.3s}button:hover,button:focus,[type="button"]:hover,[type="button"]:focus,[type="submit"]:hover,[type="submit"]:focus,[type="reset"]:hover,[type="reset"]:focus,a.button:hover,a.button:focus,label.button:hover,label.button:focus,.button:hover,.button:focus,a[role="button"]:hover,a[role="button"]:focus,label[role="button"]:hover,label[role="button"]:focus,[role="button"]:hover,[role="button"]:focus{background:var(--button-hover-back-color);border-color:var(--button-hover-border-color)}input:disabled,input[disabled],textarea:disabled,textarea[disabled],select:disabled,select[disabled],button:disabled,button[disabled],.button:disabled,.button[disabled],[role="button"]:disabled,[role="button"][disabled]{cursor:not-allowed;opacity:.75}.button-group{display:flex;border:.0625rem solid var(--button-group-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}.button-group>button,.button-group [type="button"],.button-group>[type="submit"],.button-group>[type="reset"],.button-group>.button,.button-group>[role="button"]{margin:0;max-width:100%;flex:1 1 auto;text-align:center;border:0;border-radius:0;box-shadow:none}.button-group>:not(:first-child){border-left:.0625rem solid var(--button-group-border-color)}@media screen and (max-width: 767px){.button-group{flex-direction:column}.button-group>:not(:first-child){border:0;border-top:.0625rem solid var(--button-group-border-color)}}button.primary,[type="button"].primary,[type="submit"].primary,[type="reset"].primary,.button.primary,[role="button"].primary{--button-back-color:#1976d2;--button-fore-color:#f8f8f8}button.primary:hover,button.primary:focus,[type="button"].primary:hover,[type="button"].primary:focus,[type="submit"].primary:hover,[type="submit"].primary:focus,[type="reset"].primary:hover,[type="reset"].primary:focus,.button.primary:hover,.button.primary:focus,[role="button"].primary:hover,[role="button"].primary:focus{--button-hover-back-color:#1565c0}button.secondary,[type="button"].secondary,[type="submit"].secondary,[type="reset"].secondary,.button.secondary,[role="button"].secondary{--button-back-color:#d32f2f;--button-fore-color:#f8f8f8}button.secondary:hover,button.secondary:focus,[type="button"].secondary:hover,[type="button"].secondary:focus,[type="submit"].secondary:hover,[type="submit"].secondary:focus,[type="reset"].secondary:hover,[type="reset"].secondary:focus,.button.secondary:hover,.button.secondary:focus,[role="button"].secondary:hover,[role="button"].secondary:focus{--button-hover-back-color:#c62828}button.tertiary,[type="button"].tertiary,[type="submit"].tertiary,[type="reset"].tertiary,.button.tertiary,[role="button"].tertiary{--button-back-color:#308732;--button-fore-color:#f8f8f8}button.tertiary:hover,button.tertiary:focus,[type="button"].tertiary:hover,[type="button"].tertiary:focus,[type="submit"].tertiary:hover,[type="submit"].tertiary:focus,[type="reset"].tertiary:hover,[type="reset"].tertiary:focus,.button.tertiary:hover,.button.tertiary:focus,[role="button"].tertiary:hover,[role="button"].tertiary:focus{--button-hover-back-color:#277529}button.inverse,[type="button"].inverse,[type="submit"].inverse,[type="reset"].inverse,.button.inverse,[role="button"].inverse{--button-back-color:#212121;--button-fore-color:#f8f8f8}button.inverse:hover,button.inverse:focus,[type="button"].inverse:hover,[type="button"].inverse:focus,[type="submit"].inverse:hover,[type="submit"].inverse:focus,[type="reset"].inverse:hover,[type="reset"].inverse:focus,.button.inverse:hover,.button.inverse:focus,[role="button"].inverse:hover,[role="button"].inverse:focus{--button-hover-back-color:#111}button.small,[type="button"].small,[type="submit"].small,[type="reset"].small,.button.small,[role="button"].small{padding:calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding));margin:var(--universal-margin)}button.large,[type="button"].large,[type="submit"].large,[type="reset"].large,.button.large,[role="button"].large{padding:calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding));margin:var(--universal-margin)}:root{--header-back-color:#f8f8f8;--header-hover-back-color:#f0f0f0;--header-fore-color:#444;--header-border-color:#ddd;--nav-back-color:#f8f8f8;--nav-hover-back-color:#f0f0f0;--nav-fore-color:#444;--nav-border-color:#ddd;--nav-link-color:#0277bd;--footer-fore-color:#444;--footer-back-color:#f8f8f8;--footer-border-color:#ddd;--footer-link-color:#0277bd;--drawer-back-color:#f8f8f8;--drawer-hover-back-color:#f0f0f0;--drawer-border-color:#ddd;--drawer-close-color:#444}header{height:3.1875rem;background:var(--header-back-color);color:var(--header-fore-color);border-bottom:.0625rem solid var(--header-border-color);padding:calc(var(--universal-padding) / 4) 0;white-space:nowrap;overflow-x:auto;overflow-y:hidden}header.row{box-sizing:content-box}header .logo{color:var(--header-fore-color);font-size:1.75rem;padding:var(--universal-padding) calc(2 * var(--universal-padding));text-decoration:none}header button,header [type="button"],header .button,header [role="button"]{box-sizing:border-box;position:relative;top:calc(0rem - var(--universal-padding) / 4);height:calc(3.1875rem + var(--universal-padding) / 2);background:var(--header-back-color);line-height:calc(3.1875rem - var(--universal-padding) * 1.5);text-align:center;color:var(--header-fore-color);border:0;border-radius:0;margin:0;text-transform:uppercase}header button:hover,header button:focus,header [type="button"]:hover,header [type="button"]:focus,header .button:hover,header .button:focus,header [role="button"]:hover,header [role="button"]:focus{background:var(--header-hover-back-color)}nav{background:var(--nav-back-color);color:var(--nav-fore-color);border:.0625rem solid var(--nav-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}nav *{padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}nav a,nav a:visited{display:block;color:var(--nav-link-color);border-radius:var(--universal-border-radius);transition:background 0.3s}nav a:hover,nav a:focus,nav a:visited:hover,nav a:visited:focus{text-decoration:none;background:var(--nav-hover-back-color)}nav .sublink-1{position:relative;margin-left:calc(2 * var(--universal-padding))}nav .sublink-1:before{position:absolute;left:calc(var(--universal-padding) - 1 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}nav .sublink-2{position:relative;margin-left:calc(4 * var(--universal-padding))}nav .sublink-2:before{position:absolute;left:calc(var(--universal-padding) - 3 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}footer{background:var(--footer-back-color);color:var(--footer-fore-color);border-top:.0625rem solid var(--footer-border-color);padding:calc(2 * var(--universal-padding)) var(--universal-padding);font-size:.875rem}footer a,footer a:visited{color:var(--footer-link-color)}header.sticky{position:-webkit-sticky;position:sticky;z-index:1101;top:0}footer.sticky{position:-webkit-sticky;position:sticky;z-index:1101;bottom:0}.drawer-toggle:before{display:inline-block;position:relative;vertical-align:bottom;content:'\00a0\2261\00a0';font-family:sans-serif;font-size:1.5em}@media screen and (min-width: 768px){.drawer-toggle:not(.persistent){display:none}}[type="checkbox"].drawer{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].drawer+*{display:block;box-sizing:border-box;position:fixed;top:0;width:320px;height:100vh;overflow-y:auto;background:var(--drawer-back-color);border:.0625rem solid var(--drawer-border-color);border-radius:0;margin:0;z-index:1110;left:-320px;transition:left 0.3s}[type="checkbox"].drawer+* .drawer-close{position:absolute;top:var(--universal-margin);right:var(--universal-margin);z-index:1111;width:2rem;height:2rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].drawer+* .drawer-close:before{display:block;content:'\00D7';color:var(--drawer-close-color);position:relative;font-family:sans-serif;font-size:2rem;line-height:1;text-align:center}[type="checkbox"].drawer+* .drawer-close:hover,[type="checkbox"].drawer+* .drawer-close:focus{background:var(--drawer-hover-back-color)}@media screen and (max-width: 320px){[type="checkbox"].drawer+*{width:100%}}[type="checkbox"].drawer:checked+*{left:0}@media screen and (min-width: 768px){[type="checkbox"].drawer:not(.persistent)+*{position:static;height:100%;z-index:1100}[type="checkbox"].drawer:not(.persistent)+* .drawer-close{display:none}}:root{--mark-back-color:#0277bd;--mark-fore-color:#fafafa}mark{background:var(--mark-back-color);color:var(--mark-fore-color);font-size:.95em;line-height:1em;border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}mark.inline-block{display:inline-block;font-size:1em;line-height:1.5;padding:calc(var(--universal-padding) / 2) var(--universal-padding)}:root{--toast-back-color:#424242;--toast-fore-color:#fafafa}.toast{position:fixed;bottom:calc(var(--universal-margin) * 3);left:50%;transform:translate(-50%, -50%);z-index:1111;color:var(--toast-fore-color);background:var(--toast-back-color);border-radius:calc(var(--universal-border-radius) * 16);padding:var(--universal-padding) calc(var(--universal-padding) * 3)}:root{--tooltip-back-color:#212121;--tooltip-fore-color:#fafafa}.tooltip{position:relative;display:inline-block}.tooltip:before,.tooltip:after{position:absolute;opacity:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:all 0.3s;z-index:1010;left:50%}.tooltip:not(.bottom):before,.tooltip:not(.bottom):after{bottom:75%}.tooltip.bottom:before,.tooltip.bottom:after{top:75%}.tooltip:hover:before,.tooltip:hover:after,.tooltip:focus:before,.tooltip:focus:after{opacity:1;clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%)}.tooltip:before{content:'';background:transparent;border:var(--universal-margin) solid transparent;left:calc(50% - var(--universal-margin))}.tooltip:not(.bottom):before{border-top-color:#212121}.tooltip.bottom:before{border-bottom-color:#212121}.tooltip:after{content:attr(aria-label);color:var(--tooltip-fore-color);background:var(--tooltip-back-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding);white-space:nowrap;transform:translateX(-50%)}.tooltip:not(.bottom):after{margin-bottom:calc(2 * var(--universal-margin))}.tooltip.bottom:after{margin-top:calc(2 * var(--universal-margin))}:root{--modal-overlay-color:rgba(0,0,0,0.45);--modal-close-color:#444;--modal-close-hover-color:#f0f0f0}[type="checkbox"].modal{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].modal+div{position:fixed;top:0;left:0;display:none;width:100vw;height:100vh;background:var(--modal-overlay-color)}[type="checkbox"].modal+div .card{margin:0 auto;max-height:50vh;overflow:auto}[type="checkbox"].modal+div .card .modal-close{position:absolute;top:0;right:0;width:1.75rem;height:1.75rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].modal+div .card .modal-close:before{display:block;content:'\00D7';color:var(--modal-close-color);position:relative;font-family:sans-serif;font-size:1.75rem;line-height:1;text-align:center}[type="checkbox"].modal+div .card .modal-close:hover,[type="checkbox"].modal+div .card .modal-close:focus{background:var(--modal-close-hover-color)}[type="checkbox"].modal:checked+div{display:flex;flex:0 1 auto;z-index:1200}[type="checkbox"].modal:checked+div .card .modal-close{z-index:1211}:root{--collapse-label-back-color:#e8e8e8;--collapse-label-fore-color:#212121;--collapse-label-hover-back-color:#f0f0f0;--collapse-selected-label-back-color:#ececec;--collapse-border-color:#ddd;--collapse-content-back-color:#fafafa;--collapse-selected-label-border-color:#0277bd}.collapse{width:calc(100% - 2 * var(--universal-margin));opacity:1;display:flex;flex-direction:column;margin:var(--universal-margin);border-radius:var(--universal-border-radius)}.collapse>[type="radio"],.collapse>[type="checkbox"]{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}.collapse>label{flex-grow:1;display:inline-block;height:1.5rem;cursor:pointer;transition:background 0.3s;color:var(--collapse-label-fore-color);background:var(--collapse-label-back-color);border:.0625rem solid var(--collapse-border-color);padding:calc(1.5 * var(--universal-padding))}.collapse>label:hover,.collapse>label:focus{background:var(--collapse-label-hover-back-color)}.collapse>label+div{flex-basis:auto;height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:max-height 0.3s;max-height:1px}.collapse>:checked+label{background:var(--collapse-selected-label-back-color);border-bottom-color:var(--collapse-selected-label-border-color)}.collapse>:checked+label+div{box-sizing:border-box;position:relative;width:100%;height:auto;overflow:auto;margin:0;background:var(--collapse-content-back-color);border:.0625rem solid var(--collapse-border-color);border-top:0;padding:var(--universal-padding);clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%);max-height:400px}.collapse>label:not(:first-of-type){border-top:0}.collapse>label:first-of-type{border-radius:var(--universal-border-radius) var(--universal-border-radius) 0 0}.collapse>label:last-of-type{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}.collapse>:checked:last-of-type+label{border-radius:0}.collapse>:checked:last-of-type+label+div{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}mark.secondary{--mark-back-color:#d32f2f}mark.tertiary{--mark-back-color:#308732}mark.tag{padding:calc(var(--universal-padding)/2) var(--universal-padding);border-radius:1em}html,*{font-family:'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif}code,pre,kbd,code *,pre *,kbd *,code[class*="language-"],pre[class*="language-"]{font-family:'Inconsolata', Menlo, Consolas, monospace !important}code,kbd{font-size:1em}code{transform:scale(1)}pre{font-size:1rem;border:0.0625rem solid var(--secondary-border-color);border-radius:var(--universal-border-radius)}.group{position:relative;margin-top:2em;margin-bottom:-1em}.search{font-size:14px;margin-top:-.1em;display:block;width:100%;border:none;border-bottom:1px solid var(--nav-link-color)}.search:focus{outline:none}label#search-label{color:var(--nav-link-color);font-size:18px;font-weight:400;position:absolute;left:5px;top:10px}.search:focus ~ label#search-label,.search:valid ~ label#search-label{top:-20px;font-size:14px;color:var(--nav-link-color)}label#menu-toggle{width:3.4375rem}header h1.logo{margin-top:-0.8rem;text-align:center}header h1.logo a{text-decoration:none;color:#111}header #title{position:relative;top:-1rem}@media screen and (max-width: 500px){header #title{font-size:1rem;display:block}}header h1 small{display:block;font-size:0.875rem;font-style:italic;color:#888;margin-top:-0.8rem}@media screen and (max-width: 768px){header h1 small{font-size:0.75rem}}@media screen and (max-width: 600px){header h1 small{font-size:0.625rem}}@media screen and (max-width: 500px){header h1 small{font-size:0.5rem;margin-top:-1.2rem}}label#menu-toggle{position:absolute;left:0.5rem;top:0.5rem;width:3.4375rem}.card{box-shadow:0 0.25rem 0.25rem 0 rgba(0,0,0,0.125),0 0.125rem 0.125rem -0.125rem rgba(0,0,0,0.25)}main{padding:0}
diff --git a/docs/mini.css b/docs/mini.css
index 8d909e24c..29b6c15ec 100644
--- a/docs/mini.css
+++ b/docs/mini.css
@@ -1 +1 @@
-:root{--fore-color:#111;--secondary-fore-color:#444;--back-color:#f8f8f8;--secondary-back-color:#f0f0f0;--blockquote-color:#f57c00;--pre-color:#1565c0;--border-color:#aaa;--secondary-border-color:#ddd;--heading-ratio:1.19;--universal-margin:.5rem;--universal-padding:.5rem;--universal-border-radius:.125rem;--a-link-color:#0277bd;--a-visited-color:#01579b}html{font-size:16px}a,b,del,em,i,ins,q,span,strong,u{font-size:1em}html,*{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;line-height:1.5;-webkit-text-size-adjust:100%}*{font-size:1rem}body{margin:0;color:var(--fore-color);background:var(--back-color)}details{display:block}summary{display:list-item}abbr[title]{border-bottom:none;text-decoration:underline dotted}input{overflow:visible}img{max-width:100%;height:auto}h1,h2,h3,h4,h5,h6{line-height:1.2;margin:calc(1.5 * var(--universal-margin)) var(--universal-margin);font-weight:500}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:var(--secondary-fore-color);display:block;margin-top:-.25rem}h1{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h2{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h3{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio))}h4{font-size:calc(1rem * var(--heading-ratio))}h5{font-size:1rem}h6{font-size:calc(1rem / var(--heading-ratio))}p{margin:var(--universal-margin)}ol,ul{margin:var(--universal-margin);padding-left:calc(2 * var(--universal-margin))}b,strong{font-weight:700}hr{box-sizing:content-box;border:0;line-height:1.25em;margin:var(--universal-margin);height:.0625rem;background:linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent)}blockquote{display:block;position:relative;font-style:italic;color:var(--secondary-fore-color);margin:var(--universal-margin);padding:calc(3 * var(--universal-padding));border:.0625rem solid var(--secondary-border-color);border-left:.375rem solid var(--blockquote-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}blockquote:before{position:absolute;top:calc(0rem - var(--universal-padding));left:0;font-family:sans-serif;font-size:3rem;font-weight:700;content:"\201c";color:var(--blockquote-color)}blockquote[cite]:after{font-style:normal;font-size:.75em;font-weight:700;content:"\a—  " attr(cite);white-space:pre}code,kbd,pre,samp{font-family:Menlo, Consolas, monospace;font-size:.85em}code{background:var(--secondary-back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}kbd{background:var(--fore-color);color:var(--back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}pre{overflow:auto;background:var(--secondary-back-color);padding:calc(1.5 * var(--universal-padding));margin:var(--universal-margin);border:.0625rem solid var(--secondary-border-color);border-left:.25rem solid var(--pre-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}sup,sub,code,kbd{line-height:0;position:relative;vertical-align:baseline}small,sup,sub,figcaption{font-size:.75em}sup{top:-.5em}sub{bottom:-.25em}figure{margin:var(--universal-margin)}figcaption{color:var(--secondary-fore-color)}a{text-decoration:none}a:link{color:var(--a-link-color)}a:visited{color:var(--a-visited-color)}a:hover,a:focus{text-decoration:underline}.container{margin:0 auto;padding:0 calc(1.5 * var(--universal-padding))}.row{box-sizing:border-box;display:flex;flex:0 1 auto;flex-flow:row wrap}.col-sm,[class^='col-sm-'],[class^='col-sm-offset-'],.row[class*='cols-sm-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-sm,.row.cols-sm>*{max-width:100%;flex-grow:1;flex-basis:0}.col-sm-1,.row.cols-sm-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-sm-offset-0{margin-left:0}.col-sm-2,.row.cols-sm-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-sm-offset-1{margin-left:8.33333%}.col-sm-3,.row.cols-sm-3>*{max-width:25%;flex-basis:25%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-4,.row.cols-sm-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-sm-offset-3{margin-left:25%}.col-sm-5,.row.cols-sm-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-6,.row.cols-sm-6>*{max-width:50%;flex-basis:50%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-7,.row.cols-sm-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-sm-offset-6{margin-left:50%}.col-sm-8,.row.cols-sm-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-9,.row.cols-sm-9>*{max-width:75%;flex-basis:75%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-10,.row.cols-sm-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-sm-offset-9{margin-left:75%}.col-sm-11,.row.cols-sm-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-12,.row.cols-sm-12>*{max-width:100%;flex-basis:100%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-normal{order:initial}.col-sm-first{order:-999}.col-sm-last{order:999}@media screen and (min-width: 768px){.col-md,[class^='col-md-'],[class^='col-md-offset-'],.row[class*='cols-md-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-md,.row.cols-md>*{max-width:100%;flex-grow:1;flex-basis:0}.col-md-1,.row.cols-md-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-md-offset-0{margin-left:0}.col-md-2,.row.cols-md-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-md-offset-1{margin-left:8.33333%}.col-md-3,.row.cols-md-3>*{max-width:25%;flex-basis:25%}.col-md-offset-2{margin-left:16.66667%}.col-md-4,.row.cols-md-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-md-offset-3{margin-left:25%}.col-md-5,.row.cols-md-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-md-offset-4{margin-left:33.33333%}.col-md-6,.row.cols-md-6>*{max-width:50%;flex-basis:50%}.col-md-offset-5{margin-left:41.66667%}.col-md-7,.row.cols-md-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-md-offset-6{margin-left:50%}.col-md-8,.row.cols-md-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-md-offset-7{margin-left:58.33333%}.col-md-9,.row.cols-md-9>*{max-width:75%;flex-basis:75%}.col-md-offset-8{margin-left:66.66667%}.col-md-10,.row.cols-md-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-md-offset-9{margin-left:75%}.col-md-11,.row.cols-md-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-md-offset-10{margin-left:83.33333%}.col-md-12,.row.cols-md-12>*{max-width:100%;flex-basis:100%}.col-md-offset-11{margin-left:91.66667%}.col-md-normal{order:initial}.col-md-first{order:-999}.col-md-last{order:999}}@media screen and (min-width: 1280px){.col-lg,[class^='col-lg-'],[class^='col-lg-offset-'],.row[class*='cols-lg-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-lg,.row.cols-lg>*{max-width:100%;flex-grow:1;flex-basis:0}.col-lg-1,.row.cols-lg-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-lg-offset-0{margin-left:0}.col-lg-2,.row.cols-lg-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-lg-offset-1{margin-left:8.33333%}.col-lg-3,.row.cols-lg-3>*{max-width:25%;flex-basis:25%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-4,.row.cols-lg-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-lg-offset-3{margin-left:25%}.col-lg-5,.row.cols-lg-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-6,.row.cols-lg-6>*{max-width:50%;flex-basis:50%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-7,.row.cols-lg-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-lg-offset-6{margin-left:50%}.col-lg-8,.row.cols-lg-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-9,.row.cols-lg-9>*{max-width:75%;flex-basis:75%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-10,.row.cols-lg-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-lg-offset-9{margin-left:75%}.col-lg-11,.row.cols-lg-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-12,.row.cols-lg-12>*{max-width:100%;flex-basis:100%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-normal{order:initial}.col-lg-first{order:-999}.col-lg-last{order:999}}:root{--card-back-color:#f8f8f8;--card-fore-color:#111;--card-border-color:#ddd}.card{display:flex;flex-direction:column;justify-content:space-between;align-self:center;position:relative;width:100%;background:var(--card-back-color);color:var(--card-fore-color);border:.0625rem solid var(--card-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);overflow:hidden}@media screen and (min-width: 320px){.card{max-width:320px}}.card>.section{background:var(--card-back-color);color:var(--card-fore-color);box-sizing:border-box;margin:0;border:0;border-radius:0;border-bottom:.0625rem solid var(--card-border-color);padding:var(--universal-padding);width:100%}.card>.section.media{height:200px;padding:0;-o-object-fit:cover;object-fit:cover}.card>.section:last-child{border-bottom:0}@media screen and (min-width: 240px){.card.small{max-width:240px}}@media screen and (min-width: 480px){.card.large{max-width:480px}}.card.fluid{max-width:100%;width:auto}.card.warning{--card-back-color:#ffca28;--card-border-color:#e8b825}.card.error{--card-back-color:#b71c1c;--card-fore-color:#f8f8f8;--card-border-color:#a71a1a}.card>.section.dark{--card-back-color:#e0e0e0}.card>.section.double-padded{padding:calc(1.5 * var(--universal-padding))}:root{--form-back-color:#f0f0f0;--form-fore-color:#111;--form-border-color:#ddd;--input-back-color:#f8f8f8;--input-fore-color:#111;--input-border-color:#ddd;--input-focus-color:#0288d1;--input-invalid-color:#d32f2f;--button-back-color:#e2e2e2;--button-hover-back-color:#dcdcdc;--button-fore-color:#212121;--button-border-color:transparent;--button-hover-border-color:transparent;--button-group-border-color:rgba(124,124,124,0.54)}form{background:var(--form-back-color);color:var(--form-fore-color);border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);padding:calc(2 * var(--universal-padding)) var(--universal-padding)}fieldset{border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 4);padding:var(--universal-padding)}legend{box-sizing:border-box;display:table;max-width:100%;white-space:normal;font-weight:700;padding:calc(var(--universal-padding) / 2)}label{padding:calc(var(--universal-padding) / 2) var(--universal-padding)}.input-group{display:inline-block}.input-group.fluid{display:flex;align-items:center;justify-content:center}.input-group.fluid>input{max-width:100%;flex-grow:1;flex-basis:0px}@media screen and (max-width: 767px){.input-group.fluid{align-items:stretch;flex-direction:column}}.input-group.vertical{display:flex;align-items:stretch;flex-direction:column}.input-group.vertical>input{max-width:100%;flex-grow:1;flex-basis:0px}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input:not([type]),[type="text"],[type="email"],[type="number"],[type="search"],[type="password"],[type="url"],[type="tel"],[type="checkbox"],[type="radio"],textarea,select{box-sizing:border-box;background:var(--input-back-color);color:var(--input-fore-color);border:.0625rem solid var(--input-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 2);padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus,textarea:hover,textarea:focus,select:hover,select:focus{border-color:var(--input-focus-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid,textarea:invalid,textarea:focus:invalid,select:invalid,select:focus:invalid{border-color:var(--input-invalid-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],textarea[readonly],select[readonly]{background:var(--secondary-back-color)}select{max-width:100%}option{overflow:hidden;text-overflow:ellipsis}[type="checkbox"],[type="radio"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;height:calc(1rem + var(--universal-padding) / 2);width:calc(1rem + var(--universal-padding) / 2);vertical-align:text-bottom;padding:0;flex-basis:calc(1rem + var(--universal-padding) / 2) !important;flex-grow:0 !important}[type="checkbox"]:checked:before,[type="radio"]:checked:before{position:absolute}[type="checkbox"]:checked:before{content:'\2713';font-family:sans-serif;font-size:calc(1rem + var(--universal-padding) / 2);top:calc(0rem - var(--universal-padding));left:calc(var(--universal-padding) / 4)}[type="radio"]{border-radius:100%}[type="radio"]:checked:before{border-radius:100%;content:'';top:calc(.0625rem + var(--universal-padding) / 2);left:calc(.0625rem + var(--universal-padding) / 2);background:var(--input-fore-color);width:0.5rem;height:0.5rem}:placeholder-shown{color:var(--input-fore-color)}::-ms-placeholder{color:var(--input-fore-color);opacity:0.54}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button{overflow:visible;text-transform:none}button,[type="button"],[type="submit"],[type="reset"],a.button,label.button,.button,a[role="button"],label[role="button"],[role="button"]{display:inline-block;background:var(--button-back-color);color:var(--button-fore-color);border:.0625rem solid var(--button-border-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding) calc(1.5 * var(--universal-padding));margin:var(--universal-margin);text-decoration:none;cursor:pointer;transition:background 0.3s}button:hover,button:focus,[type="button"]:hover,[type="button"]:focus,[type="submit"]:hover,[type="submit"]:focus,[type="reset"]:hover,[type="reset"]:focus,a.button:hover,a.button:focus,label.button:hover,label.button:focus,.button:hover,.button:focus,a[role="button"]:hover,a[role="button"]:focus,label[role="button"]:hover,label[role="button"]:focus,[role="button"]:hover,[role="button"]:focus{background:var(--button-hover-back-color);border-color:var(--button-hover-border-color)}input:disabled,input[disabled],textarea:disabled,textarea[disabled],select:disabled,select[disabled],button:disabled,button[disabled],.button:disabled,.button[disabled],[role="button"]:disabled,[role="button"][disabled]{cursor:not-allowed;opacity:.75}.button-group{display:flex;border:.0625rem solid var(--button-group-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}.button-group>button,.button-group [type="button"],.button-group>[type="submit"],.button-group>[type="reset"],.button-group>.button,.button-group>[role="button"]{margin:0;max-width:100%;flex:1 1 auto;text-align:center;border:0;border-radius:0;box-shadow:none}.button-group>:not(:first-child){border-left:.0625rem solid var(--button-group-border-color)}@media screen and (max-width: 767px){.button-group{flex-direction:column}.button-group>:not(:first-child){border:0;border-top:.0625rem solid var(--button-group-border-color)}}button.primary,[type="button"].primary,[type="submit"].primary,[type="reset"].primary,.button.primary,[role="button"].primary{--button-back-color:#1976d2;--button-fore-color:#f8f8f8}button.primary:hover,button.primary:focus,[type="button"].primary:hover,[type="button"].primary:focus,[type="submit"].primary:hover,[type="submit"].primary:focus,[type="reset"].primary:hover,[type="reset"].primary:focus,.button.primary:hover,.button.primary:focus,[role="button"].primary:hover,[role="button"].primary:focus{--button-hover-back-color:#1565c0}button.secondary,[type="button"].secondary,[type="submit"].secondary,[type="reset"].secondary,.button.secondary,[role="button"].secondary{--button-back-color:#d32f2f;--button-fore-color:#f8f8f8}button.secondary:hover,button.secondary:focus,[type="button"].secondary:hover,[type="button"].secondary:focus,[type="submit"].secondary:hover,[type="submit"].secondary:focus,[type="reset"].secondary:hover,[type="reset"].secondary:focus,.button.secondary:hover,.button.secondary:focus,[role="button"].secondary:hover,[role="button"].secondary:focus{--button-hover-back-color:#c62828}button.tertiary,[type="button"].tertiary,[type="submit"].tertiary,[type="reset"].tertiary,.button.tertiary,[role="button"].tertiary{--button-back-color:#308732;--button-fore-color:#f8f8f8}button.tertiary:hover,button.tertiary:focus,[type="button"].tertiary:hover,[type="button"].tertiary:focus,[type="submit"].tertiary:hover,[type="submit"].tertiary:focus,[type="reset"].tertiary:hover,[type="reset"].tertiary:focus,.button.tertiary:hover,.button.tertiary:focus,[role="button"].tertiary:hover,[role="button"].tertiary:focus{--button-hover-back-color:#277529}button.inverse,[type="button"].inverse,[type="submit"].inverse,[type="reset"].inverse,.button.inverse,[role="button"].inverse{--button-back-color:#212121;--button-fore-color:#f8f8f8}button.inverse:hover,button.inverse:focus,[type="button"].inverse:hover,[type="button"].inverse:focus,[type="submit"].inverse:hover,[type="submit"].inverse:focus,[type="reset"].inverse:hover,[type="reset"].inverse:focus,.button.inverse:hover,.button.inverse:focus,[role="button"].inverse:hover,[role="button"].inverse:focus{--button-hover-back-color:#111}button.small,[type="button"].small,[type="submit"].small,[type="reset"].small,.button.small,[role="button"].small{padding:calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding));margin:var(--universal-margin)}button.large,[type="button"].large,[type="submit"].large,[type="reset"].large,.button.large,[role="button"].large{padding:calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding));margin:var(--universal-margin)}:root{--header-back-color:#f8f8f8;--header-hover-back-color:#f0f0f0;--header-fore-color:#444;--header-border-color:#ddd;--nav-back-color:#f8f8f8;--nav-hover-back-color:#f0f0f0;--nav-fore-color:#444;--nav-border-color:#ddd;--nav-link-color:#0277bd;--footer-fore-color:#444;--footer-back-color:#f8f8f8;--footer-border-color:#ddd;--footer-link-color:#0277bd;--drawer-back-color:#f8f8f8;--drawer-hover-back-color:#f0f0f0;--drawer-border-color:#ddd;--drawer-close-color:#444}header{height:3.1875rem;background:var(--header-back-color);color:var(--header-fore-color);border-bottom:.0625rem solid var(--header-border-color);padding:calc(var(--universal-padding) / 4) 0;white-space:nowrap;overflow-x:auto;overflow-y:hidden}header.row{box-sizing:content-box}header .logo{color:var(--header-fore-color);font-size:1.75rem;padding:var(--universal-padding) calc(2 * var(--universal-padding));text-decoration:none}header button,header [type="button"],header .button,header [role="button"]{box-sizing:border-box;position:relative;top:calc(0rem - var(--universal-padding) / 4);height:calc(3.1875rem + var(--universal-padding) / 2);background:var(--header-back-color);line-height:calc(3.1875rem - var(--universal-padding) * 1.5);text-align:center;color:var(--header-fore-color);border:0;border-radius:0;margin:0;text-transform:uppercase}header button:hover,header button:focus,header [type="button"]:hover,header [type="button"]:focus,header .button:hover,header .button:focus,header [role="button"]:hover,header [role="button"]:focus{background:var(--header-hover-back-color)}nav{background:var(--nav-back-color);color:var(--nav-fore-color);border:.0625rem solid var(--nav-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}nav *{padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}nav a,nav a:visited{display:block;color:var(--nav-link-color);border-radius:var(--universal-border-radius);transition:background 0.3s}nav a:hover,nav a:focus,nav a:visited:hover,nav a:visited:focus{text-decoration:none;background:var(--nav-hover-back-color)}nav .sublink-1{position:relative;margin-left:calc(2 * var(--universal-padding))}nav .sublink-1:before{position:absolute;left:calc(var(--universal-padding) - 1 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}nav .sublink-2{position:relative;margin-left:calc(4 * var(--universal-padding))}nav .sublink-2:before{position:absolute;left:calc(var(--universal-padding) - 3 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}footer{background:var(--footer-back-color);color:var(--footer-fore-color);border-top:.0625rem solid var(--footer-border-color);padding:calc(2 * var(--universal-padding)) var(--universal-padding);font-size:.875rem}footer a,footer a:visited{color:var(--footer-link-color)}header.sticky{position:-webkit-sticky;position:sticky;z-index:1101;top:0}footer.sticky{position:-webkit-sticky;position:sticky;z-index:1101;bottom:0}.drawer-toggle:before{display:inline-block;position:relative;vertical-align:bottom;content:'\00a0\2261\00a0';font-family:sans-serif;font-size:1.5em}@media screen and (min-width: 768px){.drawer-toggle:not(.persistent){display:none}}[type="checkbox"].drawer{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].drawer+*{display:block;box-sizing:border-box;position:fixed;top:0;width:320px;height:100vh;overflow-y:auto;background:var(--drawer-back-color);border:.0625rem solid var(--drawer-border-color);border-radius:0;margin:0;z-index:1110;left:-320px;transition:left 0.3s}[type="checkbox"].drawer+* .drawer-close{position:absolute;top:var(--universal-margin);right:var(--universal-margin);z-index:1111;width:2rem;height:2rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].drawer+* .drawer-close:before{display:block;content:'\00D7';color:var(--drawer-close-color);position:relative;font-family:sans-serif;font-size:2rem;line-height:1;text-align:center}[type="checkbox"].drawer+* .drawer-close:hover,[type="checkbox"].drawer+* .drawer-close:focus{background:var(--drawer-hover-back-color)}@media screen and (max-width: 320px){[type="checkbox"].drawer+*{width:100%}}[type="checkbox"].drawer:checked+*{left:0}@media screen and (min-width: 768px){[type="checkbox"].drawer:not(.persistent)+*{position:static;height:100%;z-index:1100}[type="checkbox"].drawer:not(.persistent)+* .drawer-close{display:none}}:root{--mark-back-color:#0277bd;--mark-fore-color:#fafafa}mark{background:var(--mark-back-color);color:var(--mark-fore-color);font-size:.95em;line-height:1em;border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}mark.inline-block{display:inline-block;font-size:1em;line-height:1.5;padding:calc(var(--universal-padding) / 2) var(--universal-padding)}:root{--toast-back-color:#424242;--toast-fore-color:#fafafa}.toast{position:fixed;bottom:calc(var(--universal-margin) * 3);left:50%;transform:translate(-50%, -50%);z-index:1111;color:var(--toast-fore-color);background:var(--toast-back-color);border-radius:calc(var(--universal-border-radius) * 16);padding:var(--universal-padding) calc(var(--universal-padding) * 3)}:root{--tooltip-back-color:#212121;--tooltip-fore-color:#fafafa}.tooltip{position:relative;display:inline-block}.tooltip:before,.tooltip:after{position:absolute;opacity:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:all 0.3s;z-index:1010;left:50%}.tooltip:not(.bottom):before,.tooltip:not(.bottom):after{bottom:75%}.tooltip.bottom:before,.tooltip.bottom:after{top:75%}.tooltip:hover:before,.tooltip:hover:after,.tooltip:focus:before,.tooltip:focus:after{opacity:1;clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%)}.tooltip:before{content:'';background:transparent;border:var(--universal-margin) solid transparent;left:calc(50% - var(--universal-margin))}.tooltip:not(.bottom):before{border-top-color:#212121}.tooltip.bottom:before{border-bottom-color:#212121}.tooltip:after{content:attr(aria-label);color:var(--tooltip-fore-color);background:var(--tooltip-back-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding);white-space:nowrap;transform:translateX(-50%)}.tooltip:not(.bottom):after{margin-bottom:calc(2 * var(--universal-margin))}.tooltip.bottom:after{margin-top:calc(2 * var(--universal-margin))}:root{--modal-overlay-color:rgba(0,0,0,0.45);--modal-close-color:#444;--modal-close-hover-color:#f0f0f0}[type="checkbox"].modal{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].modal+div{position:fixed;top:0;left:0;display:none;width:100vw;height:100vh;background:var(--modal-overlay-color)}[type="checkbox"].modal+div .card{margin:0 auto;max-height:50vh;overflow:auto}[type="checkbox"].modal+div .card .modal-close{position:absolute;top:0;right:0;width:1.75rem;height:1.75rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].modal+div .card .modal-close:before{display:block;content:'\00D7';color:var(--modal-close-color);position:relative;font-family:sans-serif;font-size:1.75rem;line-height:1;text-align:center}[type="checkbox"].modal+div .card .modal-close:hover,[type="checkbox"].modal+div .card .modal-close:focus{background:var(--modal-close-hover-color)}[type="checkbox"].modal:checked+div{display:flex;flex:0 1 auto;z-index:1200}[type="checkbox"].modal:checked+div .card .modal-close{z-index:1211}:root{--collapse-label-back-color:#e8e8e8;--collapse-label-fore-color:#212121;--collapse-label-hover-back-color:#f0f0f0;--collapse-selected-label-back-color:#ececec;--collapse-border-color:#ddd;--collapse-content-back-color:#fafafa;--collapse-selected-label-border-color:#0277bd}.collapse{width:calc(100% - 2 * var(--universal-margin));opacity:1;display:flex;flex-direction:column;margin:var(--universal-margin);border-radius:var(--universal-border-radius)}.collapse>[type="radio"],.collapse>[type="checkbox"]{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}.collapse>label{flex-grow:1;display:inline-block;height:1.5rem;cursor:pointer;transition:background 0.3s;color:var(--collapse-label-fore-color);background:var(--collapse-label-back-color);border:.0625rem solid var(--collapse-border-color);padding:calc(1.5 * var(--universal-padding))}.collapse>label:hover,.collapse>label:focus{background:var(--collapse-label-hover-back-color)}.collapse>label+div{flex-basis:auto;height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:max-height 0.3s;max-height:1px}.collapse>:checked+label{background:var(--collapse-selected-label-back-color);border-bottom-color:var(--collapse-selected-label-border-color)}.collapse>:checked+label+div{box-sizing:border-box;position:relative;width:100%;height:auto;overflow:auto;margin:0;background:var(--collapse-content-back-color);border:.0625rem solid var(--collapse-border-color);border-top:0;padding:var(--universal-padding);clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%);max-height:400px}.collapse>label:not(:first-of-type){border-top:0}.collapse>label:first-of-type{border-radius:var(--universal-border-radius) var(--universal-border-radius) 0 0}.collapse>label:last-of-type{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}.collapse>:checked:last-of-type+label{border-radius:0}.collapse>:checked:last-of-type+label+div{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}mark.secondary{--mark-back-color:#d32f2f}mark.tertiary{--mark-back-color:#308732}mark.tag{padding:calc(var(--universal-padding)/2) var(--universal-padding);border-radius:1em}html,*{font-family:'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif}code,pre,kbd,code *,pre *,kbd *{font-family:'Inconsolata', Menlo, Consolas, monospace}code,kbd{font-size:1em}code{transform:scale(1)}pre{font-size:1rem;border:0.0625rem solid var(--secondary-border-color);border-radius:var(--universal-border-radius)}.group{position:relative;margin-top:2em;margin-bottom:-1em}.search{font-size:14px;margin-top:-.1em;display:block;width:100%;border:none;border-bottom:1px solid var(--nav-link-color)}.search:focus{outline:none}label#search-label{color:var(--nav-link-color);font-size:18px;font-weight:400;position:absolute;left:5px;top:10px}.search:focus ~ label#search-label,.search:valid ~ label#search-label{top:-20px;font-size:14px;color:var(--nav-link-color)}label#menu-toggle{width:3.4375rem}header h1.logo{margin-top:-0.8rem;text-align:center}header h1.logo a{text-decoration:none;color:#111}header #title{position:relative;top:-1rem}@media screen and (max-width: 500px){header #title{font-size:1rem;display:block}}header h1 small{display:block;font-size:0.875rem;font-style:italic;color:#888;margin-top:-0.8rem}@media screen and (max-width: 768px){header h1 small{font-size:0.75rem}}@media screen and (max-width: 600px){header h1 small{font-size:0.625rem}}@media screen and (max-width: 500px){header h1 small{font-size:0.5rem;margin-top:-1.2rem}}label#menu-toggle{position:absolute;left:0.5rem;top:0.5rem;width:3.4375rem}.card{box-shadow:0 0.25rem 0.25rem 0 rgba(0,0,0,0.125),0 0.125rem 0.125rem -0.125rem rgba(0,0,0,0.25)}main{padding:0}
+:root{--fore-color:#111;--secondary-fore-color:#444;--back-color:#f8f8f8;--secondary-back-color:#f0f0f0;--blockquote-color:#f57c00;--pre-color:#1565c0;--border-color:#aaa;--secondary-border-color:#ddd;--heading-ratio:1.19;--universal-margin:.5rem;--universal-padding:.5rem;--universal-border-radius:.125rem;--a-link-color:#0277bd;--a-visited-color:#01579b}html{font-size:16px}a,b,del,em,i,ins,q,span,strong,u{font-size:1em}html,*{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;line-height:1.5;-webkit-text-size-adjust:100%}*{font-size:1rem}body{margin:0;color:var(--fore-color);background:var(--back-color)}details{display:block}summary{display:list-item}abbr[title]{border-bottom:none;text-decoration:underline dotted}input{overflow:visible}img{max-width:100%;height:auto}h1,h2,h3,h4,h5,h6{line-height:1.2;margin:calc(1.5 * var(--universal-margin)) var(--universal-margin);font-weight:500}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:var(--secondary-fore-color);display:block;margin-top:-.25rem}h1{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h2{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio))}h3{font-size:calc(1rem * var(--heading-ratio) * var(--heading-ratio))}h4{font-size:calc(1rem * var(--heading-ratio))}h5{font-size:1rem}h6{font-size:calc(1rem / var(--heading-ratio))}p{margin:var(--universal-margin)}ol,ul{margin:var(--universal-margin);padding-left:calc(2 * var(--universal-margin))}b,strong{font-weight:700}hr{box-sizing:content-box;border:0;line-height:1.25em;margin:var(--universal-margin);height:.0625rem;background:linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent)}blockquote{display:block;position:relative;font-style:italic;color:var(--secondary-fore-color);margin:var(--universal-margin);padding:calc(3 * var(--universal-padding));border:.0625rem solid var(--secondary-border-color);border-left:.375rem solid var(--blockquote-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}blockquote:before{position:absolute;top:calc(0rem - var(--universal-padding));left:0;font-family:sans-serif;font-size:3rem;font-weight:700;content:"\201c";color:var(--blockquote-color)}blockquote[cite]:after{font-style:normal;font-size:.75em;font-weight:700;content:"\a—  " attr(cite);white-space:pre}code,kbd,pre,samp{font-family:Menlo, Consolas, monospace;font-size:.85em}code{background:var(--secondary-back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}kbd{background:var(--fore-color);color:var(--back-color);border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}pre{overflow:auto;background:var(--secondary-back-color);padding:calc(1.5 * var(--universal-padding));margin:var(--universal-margin);border:.0625rem solid var(--secondary-border-color);border-left:.25rem solid var(--pre-color);border-radius:0 var(--universal-border-radius) var(--universal-border-radius) 0}sup,sub,code,kbd{line-height:0;position:relative;vertical-align:baseline}small,sup,sub,figcaption{font-size:.75em}sup{top:-.5em}sub{bottom:-.25em}figure{margin:var(--universal-margin)}figcaption{color:var(--secondary-fore-color)}a{text-decoration:none}a:link{color:var(--a-link-color)}a:visited{color:var(--a-visited-color)}a:hover,a:focus{text-decoration:underline}.container{margin:0 auto;padding:0 calc(1.5 * var(--universal-padding))}.row{box-sizing:border-box;display:flex;flex:0 1 auto;flex-flow:row wrap}.col-sm,[class^='col-sm-'],[class^='col-sm-offset-'],.row[class*='cols-sm-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-sm,.row.cols-sm>*{max-width:100%;flex-grow:1;flex-basis:0}.col-sm-1,.row.cols-sm-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-sm-offset-0{margin-left:0}.col-sm-2,.row.cols-sm-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-sm-offset-1{margin-left:8.33333%}.col-sm-3,.row.cols-sm-3>*{max-width:25%;flex-basis:25%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-4,.row.cols-sm-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-sm-offset-3{margin-left:25%}.col-sm-5,.row.cols-sm-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-6,.row.cols-sm-6>*{max-width:50%;flex-basis:50%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-7,.row.cols-sm-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-sm-offset-6{margin-left:50%}.col-sm-8,.row.cols-sm-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-9,.row.cols-sm-9>*{max-width:75%;flex-basis:75%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-10,.row.cols-sm-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-sm-offset-9{margin-left:75%}.col-sm-11,.row.cols-sm-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-12,.row.cols-sm-12>*{max-width:100%;flex-basis:100%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-normal{order:initial}.col-sm-first{order:-999}.col-sm-last{order:999}@media screen and (min-width: 768px){.col-md,[class^='col-md-'],[class^='col-md-offset-'],.row[class*='cols-md-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-md,.row.cols-md>*{max-width:100%;flex-grow:1;flex-basis:0}.col-md-1,.row.cols-md-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-md-offset-0{margin-left:0}.col-md-2,.row.cols-md-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-md-offset-1{margin-left:8.33333%}.col-md-3,.row.cols-md-3>*{max-width:25%;flex-basis:25%}.col-md-offset-2{margin-left:16.66667%}.col-md-4,.row.cols-md-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-md-offset-3{margin-left:25%}.col-md-5,.row.cols-md-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-md-offset-4{margin-left:33.33333%}.col-md-6,.row.cols-md-6>*{max-width:50%;flex-basis:50%}.col-md-offset-5{margin-left:41.66667%}.col-md-7,.row.cols-md-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-md-offset-6{margin-left:50%}.col-md-8,.row.cols-md-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-md-offset-7{margin-left:58.33333%}.col-md-9,.row.cols-md-9>*{max-width:75%;flex-basis:75%}.col-md-offset-8{margin-left:66.66667%}.col-md-10,.row.cols-md-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-md-offset-9{margin-left:75%}.col-md-11,.row.cols-md-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-md-offset-10{margin-left:83.33333%}.col-md-12,.row.cols-md-12>*{max-width:100%;flex-basis:100%}.col-md-offset-11{margin-left:91.66667%}.col-md-normal{order:initial}.col-md-first{order:-999}.col-md-last{order:999}}@media screen and (min-width: 1280px){.col-lg,[class^='col-lg-'],[class^='col-lg-offset-'],.row[class*='cols-lg-']>*{box-sizing:border-box;flex:0 0 auto;padding:0 calc(var(--universal-padding) / 2)}.col-lg,.row.cols-lg>*{max-width:100%;flex-grow:1;flex-basis:0}.col-lg-1,.row.cols-lg-1>*{max-width:8.33333%;flex-basis:8.33333%}.col-lg-offset-0{margin-left:0}.col-lg-2,.row.cols-lg-2>*{max-width:16.66667%;flex-basis:16.66667%}.col-lg-offset-1{margin-left:8.33333%}.col-lg-3,.row.cols-lg-3>*{max-width:25%;flex-basis:25%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-4,.row.cols-lg-4>*{max-width:33.33333%;flex-basis:33.33333%}.col-lg-offset-3{margin-left:25%}.col-lg-5,.row.cols-lg-5>*{max-width:41.66667%;flex-basis:41.66667%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-6,.row.cols-lg-6>*{max-width:50%;flex-basis:50%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-7,.row.cols-lg-7>*{max-width:58.33333%;flex-basis:58.33333%}.col-lg-offset-6{margin-left:50%}.col-lg-8,.row.cols-lg-8>*{max-width:66.66667%;flex-basis:66.66667%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-9,.row.cols-lg-9>*{max-width:75%;flex-basis:75%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-10,.row.cols-lg-10>*{max-width:83.33333%;flex-basis:83.33333%}.col-lg-offset-9{margin-left:75%}.col-lg-11,.row.cols-lg-11>*{max-width:91.66667%;flex-basis:91.66667%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-12,.row.cols-lg-12>*{max-width:100%;flex-basis:100%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-normal{order:initial}.col-lg-first{order:-999}.col-lg-last{order:999}}:root{--card-back-color:#f8f8f8;--card-fore-color:#111;--card-border-color:#ddd}.card{display:flex;flex-direction:column;justify-content:space-between;align-self:center;position:relative;width:100%;background:var(--card-back-color);color:var(--card-fore-color);border:.0625rem solid var(--card-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);overflow:hidden}@media screen and (min-width: 320px){.card{max-width:320px}}.card>.section{background:var(--card-back-color);color:var(--card-fore-color);box-sizing:border-box;margin:0;border:0;border-radius:0;border-bottom:.0625rem solid var(--card-border-color);padding:var(--universal-padding);width:100%}.card>.section.media{height:200px;padding:0;-o-object-fit:cover;object-fit:cover}.card>.section:last-child{border-bottom:0}@media screen and (min-width: 240px){.card.small{max-width:240px}}@media screen and (min-width: 480px){.card.large{max-width:480px}}.card.fluid{max-width:100%;width:auto}.card.warning{--card-back-color:#ffca28;--card-border-color:#e8b825}.card.error{--card-back-color:#b71c1c;--card-fore-color:#f8f8f8;--card-border-color:#a71a1a}.card>.section.dark{--card-back-color:#e0e0e0}.card>.section.double-padded{padding:calc(1.5 * var(--universal-padding))}:root{--form-back-color:#f0f0f0;--form-fore-color:#111;--form-border-color:#ddd;--input-back-color:#f8f8f8;--input-fore-color:#111;--input-border-color:#ddd;--input-focus-color:#0288d1;--input-invalid-color:#d32f2f;--button-back-color:#e2e2e2;--button-hover-back-color:#dcdcdc;--button-fore-color:#212121;--button-border-color:transparent;--button-hover-border-color:transparent;--button-group-border-color:rgba(124,124,124,0.54)}form{background:var(--form-back-color);color:var(--form-fore-color);border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin);padding:calc(2 * var(--universal-padding)) var(--universal-padding)}fieldset{border:.0625rem solid var(--form-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 4);padding:var(--universal-padding)}legend{box-sizing:border-box;display:table;max-width:100%;white-space:normal;font-weight:700;padding:calc(var(--universal-padding) / 2)}label{padding:calc(var(--universal-padding) / 2) var(--universal-padding)}.input-group{display:inline-block}.input-group.fluid{display:flex;align-items:center;justify-content:center}.input-group.fluid>input{max-width:100%;flex-grow:1;flex-basis:0px}@media screen and (max-width: 767px){.input-group.fluid{align-items:stretch;flex-direction:column}}.input-group.vertical{display:flex;align-items:stretch;flex-direction:column}.input-group.vertical>input{max-width:100%;flex-grow:1;flex-basis:0px}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input:not([type]),[type="text"],[type="email"],[type="number"],[type="search"],[type="password"],[type="url"],[type="tel"],[type="checkbox"],[type="radio"],textarea,select{box-sizing:border-box;background:var(--input-back-color);color:var(--input-fore-color);border:.0625rem solid var(--input-border-color);border-radius:var(--universal-border-radius);margin:calc(var(--universal-margin) / 2);padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus,textarea:hover,textarea:focus,select:hover,select:focus{border-color:var(--input-focus-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid,textarea:invalid,textarea:focus:invalid,select:invalid,select:focus:invalid{border-color:var(--input-invalid-color);box-shadow:none}input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],textarea[readonly],select[readonly]{background:var(--secondary-back-color)}select{max-width:100%}option{overflow:hidden;text-overflow:ellipsis}[type="checkbox"],[type="radio"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;height:calc(1rem + var(--universal-padding) / 2);width:calc(1rem + var(--universal-padding) / 2);vertical-align:text-bottom;padding:0;flex-basis:calc(1rem + var(--universal-padding) / 2) !important;flex-grow:0 !important}[type="checkbox"]:checked:before,[type="radio"]:checked:before{position:absolute}[type="checkbox"]:checked:before{content:'\2713';font-family:sans-serif;font-size:calc(1rem + var(--universal-padding) / 2);top:calc(0rem - var(--universal-padding));left:calc(var(--universal-padding) / 4)}[type="radio"]{border-radius:100%}[type="radio"]:checked:before{border-radius:100%;content:'';top:calc(.0625rem + var(--universal-padding) / 2);left:calc(.0625rem + var(--universal-padding) / 2);background:var(--input-fore-color);width:0.5rem;height:0.5rem}:placeholder-shown{color:var(--input-fore-color)}::-ms-placeholder{color:var(--input-fore-color);opacity:0.54}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button{overflow:visible;text-transform:none}button,[type="button"],[type="submit"],[type="reset"],a.button,label.button,.button,a[role="button"],label[role="button"],[role="button"]{display:inline-block;background:var(--button-back-color);color:var(--button-fore-color);border:.0625rem solid var(--button-border-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding) calc(1.5 * var(--universal-padding));margin:var(--universal-margin);text-decoration:none;cursor:pointer;transition:background 0.3s}button:hover,button:focus,[type="button"]:hover,[type="button"]:focus,[type="submit"]:hover,[type="submit"]:focus,[type="reset"]:hover,[type="reset"]:focus,a.button:hover,a.button:focus,label.button:hover,label.button:focus,.button:hover,.button:focus,a[role="button"]:hover,a[role="button"]:focus,label[role="button"]:hover,label[role="button"]:focus,[role="button"]:hover,[role="button"]:focus{background:var(--button-hover-back-color);border-color:var(--button-hover-border-color)}input:disabled,input[disabled],textarea:disabled,textarea[disabled],select:disabled,select[disabled],button:disabled,button[disabled],.button:disabled,.button[disabled],[role="button"]:disabled,[role="button"][disabled]{cursor:not-allowed;opacity:.75}.button-group{display:flex;border:.0625rem solid var(--button-group-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}.button-group>button,.button-group [type="button"],.button-group>[type="submit"],.button-group>[type="reset"],.button-group>.button,.button-group>[role="button"]{margin:0;max-width:100%;flex:1 1 auto;text-align:center;border:0;border-radius:0;box-shadow:none}.button-group>:not(:first-child){border-left:.0625rem solid var(--button-group-border-color)}@media screen and (max-width: 767px){.button-group{flex-direction:column}.button-group>:not(:first-child){border:0;border-top:.0625rem solid var(--button-group-border-color)}}button.primary,[type="button"].primary,[type="submit"].primary,[type="reset"].primary,.button.primary,[role="button"].primary{--button-back-color:#1976d2;--button-fore-color:#f8f8f8}button.primary:hover,button.primary:focus,[type="button"].primary:hover,[type="button"].primary:focus,[type="submit"].primary:hover,[type="submit"].primary:focus,[type="reset"].primary:hover,[type="reset"].primary:focus,.button.primary:hover,.button.primary:focus,[role="button"].primary:hover,[role="button"].primary:focus{--button-hover-back-color:#1565c0}button.secondary,[type="button"].secondary,[type="submit"].secondary,[type="reset"].secondary,.button.secondary,[role="button"].secondary{--button-back-color:#d32f2f;--button-fore-color:#f8f8f8}button.secondary:hover,button.secondary:focus,[type="button"].secondary:hover,[type="button"].secondary:focus,[type="submit"].secondary:hover,[type="submit"].secondary:focus,[type="reset"].secondary:hover,[type="reset"].secondary:focus,.button.secondary:hover,.button.secondary:focus,[role="button"].secondary:hover,[role="button"].secondary:focus{--button-hover-back-color:#c62828}button.tertiary,[type="button"].tertiary,[type="submit"].tertiary,[type="reset"].tertiary,.button.tertiary,[role="button"].tertiary{--button-back-color:#308732;--button-fore-color:#f8f8f8}button.tertiary:hover,button.tertiary:focus,[type="button"].tertiary:hover,[type="button"].tertiary:focus,[type="submit"].tertiary:hover,[type="submit"].tertiary:focus,[type="reset"].tertiary:hover,[type="reset"].tertiary:focus,.button.tertiary:hover,.button.tertiary:focus,[role="button"].tertiary:hover,[role="button"].tertiary:focus{--button-hover-back-color:#277529}button.inverse,[type="button"].inverse,[type="submit"].inverse,[type="reset"].inverse,.button.inverse,[role="button"].inverse{--button-back-color:#212121;--button-fore-color:#f8f8f8}button.inverse:hover,button.inverse:focus,[type="button"].inverse:hover,[type="button"].inverse:focus,[type="submit"].inverse:hover,[type="submit"].inverse:focus,[type="reset"].inverse:hover,[type="reset"].inverse:focus,.button.inverse:hover,.button.inverse:focus,[role="button"].inverse:hover,[role="button"].inverse:focus{--button-hover-back-color:#111}button.small,[type="button"].small,[type="submit"].small,[type="reset"].small,.button.small,[role="button"].small{padding:calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding));margin:var(--universal-margin)}button.large,[type="button"].large,[type="submit"].large,[type="reset"].large,.button.large,[role="button"].large{padding:calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding));margin:var(--universal-margin)}:root{--header-back-color:#f8f8f8;--header-hover-back-color:#f0f0f0;--header-fore-color:#444;--header-border-color:#ddd;--nav-back-color:#f8f8f8;--nav-hover-back-color:#f0f0f0;--nav-fore-color:#444;--nav-border-color:#ddd;--nav-link-color:#0277bd;--footer-fore-color:#444;--footer-back-color:#f8f8f8;--footer-border-color:#ddd;--footer-link-color:#0277bd;--drawer-back-color:#f8f8f8;--drawer-hover-back-color:#f0f0f0;--drawer-border-color:#ddd;--drawer-close-color:#444}header{height:3.1875rem;background:var(--header-back-color);color:var(--header-fore-color);border-bottom:.0625rem solid var(--header-border-color);padding:calc(var(--universal-padding) / 4) 0;white-space:nowrap;overflow-x:auto;overflow-y:hidden}header.row{box-sizing:content-box}header .logo{color:var(--header-fore-color);font-size:1.75rem;padding:var(--universal-padding) calc(2 * var(--universal-padding));text-decoration:none}header button,header [type="button"],header .button,header [role="button"]{box-sizing:border-box;position:relative;top:calc(0rem - var(--universal-padding) / 4);height:calc(3.1875rem + var(--universal-padding) / 2);background:var(--header-back-color);line-height:calc(3.1875rem - var(--universal-padding) * 1.5);text-align:center;color:var(--header-fore-color);border:0;border-radius:0;margin:0;text-transform:uppercase}header button:hover,header button:focus,header [type="button"]:hover,header [type="button"]:focus,header .button:hover,header .button:focus,header [role="button"]:hover,header [role="button"]:focus{background:var(--header-hover-back-color)}nav{background:var(--nav-back-color);color:var(--nav-fore-color);border:.0625rem solid var(--nav-border-color);border-radius:var(--universal-border-radius);margin:var(--universal-margin)}nav *{padding:var(--universal-padding) calc(1.5 * var(--universal-padding))}nav a,nav a:visited{display:block;color:var(--nav-link-color);border-radius:var(--universal-border-radius);transition:background 0.3s}nav a:hover,nav a:focus,nav a:visited:hover,nav a:visited:focus{text-decoration:none;background:var(--nav-hover-back-color)}nav .sublink-1{position:relative;margin-left:calc(2 * var(--universal-padding))}nav .sublink-1:before{position:absolute;left:calc(var(--universal-padding) - 1 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}nav .sublink-2{position:relative;margin-left:calc(4 * var(--universal-padding))}nav .sublink-2:before{position:absolute;left:calc(var(--universal-padding) - 3 * var(--universal-padding));top:-.0625rem;content:'';height:100%;border:.0625rem solid var(--nav-border-color);border-left:0}footer{background:var(--footer-back-color);color:var(--footer-fore-color);border-top:.0625rem solid var(--footer-border-color);padding:calc(2 * var(--universal-padding)) var(--universal-padding);font-size:.875rem}footer a,footer a:visited{color:var(--footer-link-color)}header.sticky{position:-webkit-sticky;position:sticky;z-index:1101;top:0}footer.sticky{position:-webkit-sticky;position:sticky;z-index:1101;bottom:0}.drawer-toggle:before{display:inline-block;position:relative;vertical-align:bottom;content:'\00a0\2261\00a0';font-family:sans-serif;font-size:1.5em}@media screen and (min-width: 768px){.drawer-toggle:not(.persistent){display:none}}[type="checkbox"].drawer{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].drawer+*{display:block;box-sizing:border-box;position:fixed;top:0;width:320px;height:100vh;overflow-y:auto;background:var(--drawer-back-color);border:.0625rem solid var(--drawer-border-color);border-radius:0;margin:0;z-index:1110;left:-320px;transition:left 0.3s}[type="checkbox"].drawer+* .drawer-close{position:absolute;top:var(--universal-margin);right:var(--universal-margin);z-index:1111;width:2rem;height:2rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].drawer+* .drawer-close:before{display:block;content:'\00D7';color:var(--drawer-close-color);position:relative;font-family:sans-serif;font-size:2rem;line-height:1;text-align:center}[type="checkbox"].drawer+* .drawer-close:hover,[type="checkbox"].drawer+* .drawer-close:focus{background:var(--drawer-hover-back-color)}@media screen and (max-width: 320px){[type="checkbox"].drawer+*{width:100%}}[type="checkbox"].drawer:checked+*{left:0}@media screen and (min-width: 768px){[type="checkbox"].drawer:not(.persistent)+*{position:static;height:100%;z-index:1100}[type="checkbox"].drawer:not(.persistent)+* .drawer-close{display:none}}:root{--mark-back-color:#0277bd;--mark-fore-color:#fafafa}mark{background:var(--mark-back-color);color:var(--mark-fore-color);font-size:.95em;line-height:1em;border-radius:var(--universal-border-radius);padding:calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2)}mark.inline-block{display:inline-block;font-size:1em;line-height:1.5;padding:calc(var(--universal-padding) / 2) var(--universal-padding)}:root{--toast-back-color:#424242;--toast-fore-color:#fafafa}.toast{position:fixed;bottom:calc(var(--universal-margin) * 3);left:50%;transform:translate(-50%, -50%);z-index:1111;color:var(--toast-fore-color);background:var(--toast-back-color);border-radius:calc(var(--universal-border-radius) * 16);padding:var(--universal-padding) calc(var(--universal-padding) * 3)}:root{--tooltip-back-color:#212121;--tooltip-fore-color:#fafafa}.tooltip{position:relative;display:inline-block}.tooltip:before,.tooltip:after{position:absolute;opacity:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:all 0.3s;z-index:1010;left:50%}.tooltip:not(.bottom):before,.tooltip:not(.bottom):after{bottom:75%}.tooltip.bottom:before,.tooltip.bottom:after{top:75%}.tooltip:hover:before,.tooltip:hover:after,.tooltip:focus:before,.tooltip:focus:after{opacity:1;clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%)}.tooltip:before{content:'';background:transparent;border:var(--universal-margin) solid transparent;left:calc(50% - var(--universal-margin))}.tooltip:not(.bottom):before{border-top-color:#212121}.tooltip.bottom:before{border-bottom-color:#212121}.tooltip:after{content:attr(aria-label);color:var(--tooltip-fore-color);background:var(--tooltip-back-color);border-radius:var(--universal-border-radius);padding:var(--universal-padding);white-space:nowrap;transform:translateX(-50%)}.tooltip:not(.bottom):after{margin-bottom:calc(2 * var(--universal-margin))}.tooltip.bottom:after{margin-top:calc(2 * var(--universal-margin))}:root{--modal-overlay-color:rgba(0,0,0,0.45);--modal-close-color:#444;--modal-close-hover-color:#f0f0f0}[type="checkbox"].modal{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}[type="checkbox"].modal+div{position:fixed;top:0;left:0;display:none;width:100vw;height:100vh;background:var(--modal-overlay-color)}[type="checkbox"].modal+div .card{margin:0 auto;max-height:50vh;overflow:auto}[type="checkbox"].modal+div .card .modal-close{position:absolute;top:0;right:0;width:1.75rem;height:1.75rem;border-radius:var(--universal-border-radius);padding:var(--universal-padding);margin:0;cursor:pointer;transition:background 0.3s}[type="checkbox"].modal+div .card .modal-close:before{display:block;content:'\00D7';color:var(--modal-close-color);position:relative;font-family:sans-serif;font-size:1.75rem;line-height:1;text-align:center}[type="checkbox"].modal+div .card .modal-close:hover,[type="checkbox"].modal+div .card .modal-close:focus{background:var(--modal-close-hover-color)}[type="checkbox"].modal:checked+div{display:flex;flex:0 1 auto;z-index:1200}[type="checkbox"].modal:checked+div .card .modal-close{z-index:1211}:root{--collapse-label-back-color:#e8e8e8;--collapse-label-fore-color:#212121;--collapse-label-hover-back-color:#f0f0f0;--collapse-selected-label-back-color:#ececec;--collapse-border-color:#ddd;--collapse-content-back-color:#fafafa;--collapse-selected-label-border-color:#0277bd}.collapse{width:calc(100% - 2 * var(--universal-margin));opacity:1;display:flex;flex-direction:column;margin:var(--universal-margin);border-radius:var(--universal-border-radius)}.collapse>[type="radio"],.collapse>[type="checkbox"]{height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%)}.collapse>label{flex-grow:1;display:inline-block;height:1.5rem;cursor:pointer;transition:background 0.3s;color:var(--collapse-label-fore-color);background:var(--collapse-label-back-color);border:.0625rem solid var(--collapse-border-color);padding:calc(1.5 * var(--universal-padding))}.collapse>label:hover,.collapse>label:focus{background:var(--collapse-label-hover-back-color)}.collapse>label+div{flex-basis:auto;height:1px;width:1px;margin:-1px;overflow:hidden;position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);transition:max-height 0.3s;max-height:1px}.collapse>:checked+label{background:var(--collapse-selected-label-back-color);border-bottom-color:var(--collapse-selected-label-border-color)}.collapse>:checked+label+div{box-sizing:border-box;position:relative;width:100%;height:auto;overflow:auto;margin:0;background:var(--collapse-content-back-color);border:.0625rem solid var(--collapse-border-color);border-top:0;padding:var(--universal-padding);clip:auto;-webkit-clip-path:inset(0%);clip-path:inset(0%);max-height:400px}.collapse>label:not(:first-of-type){border-top:0}.collapse>label:first-of-type{border-radius:var(--universal-border-radius) var(--universal-border-radius) 0 0}.collapse>label:last-of-type{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}.collapse>:checked:last-of-type+label{border-radius:0}.collapse>:checked:last-of-type+label+div{border-radius:0 0 var(--universal-border-radius) var(--universal-border-radius)}mark.secondary{--mark-back-color:#d32f2f}mark.tertiary{--mark-back-color:#308732}mark.tag{padding:calc(var(--universal-padding)/2) var(--universal-padding);border-radius:1em}html,*{font-family:'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif}code,pre,kbd,code *,pre *,kbd *,code[class*="language-"],pre[class*="language-"]{font-family:'Inconsolata', Menlo, Consolas, monospace !important}code,kbd{font-size:1em}code{transform:scale(1)}pre{font-size:1rem;border:0.0625rem solid var(--secondary-border-color);border-radius:var(--universal-border-radius)}.group{position:relative;margin-top:2em;margin-bottom:-1em}.search{font-size:14px;margin-top:-.1em;display:block;width:100%;border:none;border-bottom:1px solid var(--nav-link-color)}.search:focus{outline:none}label#search-label{color:var(--nav-link-color);font-size:18px;font-weight:400;position:absolute;left:5px;top:10px}.search:focus ~ label#search-label,.search:valid ~ label#search-label{top:-20px;font-size:14px;color:var(--nav-link-color)}label#menu-toggle{width:3.4375rem}header h1.logo{margin-top:-0.8rem;text-align:center}header h1.logo a{text-decoration:none;color:#111}header #title{position:relative;top:-1rem}@media screen and (max-width: 500px){header #title{font-size:1rem;display:block}}header h1 small{display:block;font-size:0.875rem;font-style:italic;color:#888;margin-top:-0.8rem}@media screen and (max-width: 768px){header h1 small{font-size:0.75rem}}@media screen and (max-width: 600px){header h1 small{font-size:0.625rem}}@media screen and (max-width: 500px){header h1 small{font-size:0.5rem;margin-top:-1.2rem}}label#menu-toggle{position:absolute;left:0.5rem;top:0.5rem;width:3.4375rem}.card{box-shadow:0 0.25rem 0.25rem 0 rgba(0,0,0,0.125),0 0.125rem 0.125rem -0.125rem rgba(0,0,0,0.25)}main{padding:0}
diff --git a/docs/mini/flavor.scss b/docs/mini/flavor.scss
index e0ab1e425..d7708099f 100644
--- a/docs/mini/flavor.scss
+++ b/docs/mini/flavor.scss
@@ -110,7 +110,9 @@ $mark-tag-border-radius:        1em;
 // Website-specific styles
 
 html, * { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif; }
-code, pre, kbd, code *, pre *, kbd * { font-family: 'Inconsolata', Menlo, Consolas, monospace; }
+code, pre, kbd, code *, pre *, kbd *, code[class*="language-"], pre[class*="language-"] {
+   font-family: 'Inconsolata', Menlo, Consolas, monospace !important;
+ }
 code, kbd { font-size: 1em; }
 code { transform: scale(1); } /* Deals with the issue described in #243 */
 pre { font-size: 1rem; border: 0.0625rem solid var(--secondary-border-color); border-radius: var(--universal-border-radius);}

From bfd242d5e33abe67fcd6433cd822ab0a303a3e82 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Sat, 23 Dec 2017 11:52:07 +0200
Subject: [PATCH 59/96] Updated linter, linted scripts

---
 scripts/lint-script.js  | 6 ++++++
 snippets/call.md        | 2 +-
 snippets/collectInto.md | 2 +-
 snippets/flip.md        | 2 +-
 snippets/spreadOver.md  | 2 +-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/scripts/lint-script.js b/scripts/lint-script.js
index 4aaa7c240..61e394e03 100644
--- a/scripts/lint-script.js
+++ b/scripts/lint-script.js
@@ -10,6 +10,7 @@ var snippetsPath = './snippets';
 // Read files, lint each one individually and update
 try {
   let snippetFilenames = fs.readdirSync(snippetsPath);
+  let jobCounter = 0;
   snippetFilenames.sort((a, b) => {
     a = a.toLowerCase();
     b = b.toLowerCase();
@@ -25,10 +26,14 @@ try {
     // Synchronously read data from the snippet, get the code, write it to a temporary file
     let snippetData = fs.readFileSync(path.join(snippetsPath,snippet),'utf8');
     let originalCode = snippetData.slice(snippetData.indexOf('```js')+5,snippetData.lastIndexOf('```'));
+    while(jobCounter >= 20){
+      setTimeout(()=>{},5000);
+    }
     fs.writeFileSync(`${snippet}.temp.js`,`${originalCode}`);
     // Run semistandard asynchronously (only way this manages to run), get linted code
     // and write back to the original snippet file. Remove temporary file
     cp.exec(`semistandard "${snippet}.temp.js" --fix`,{},(error, stdOut, stdErr) => {
+      jobCounter += 1;
       let lintedCode = fs.readFileSync(`${snippet}.temp.js`,'utf8');
       fs.writeFile(path.join(snippetsPath,snippet), `${snippetData.slice(0, snippetData.indexOf('```js')+5)+lintedCode+'```\n'}`);
       fs.unlink(`${snippet}.temp.js`);
@@ -36,6 +41,7 @@ try {
       console.log(`${chalk.green('SUCCESS!')} Linted snippet: ${snippet}`);
       // Log the time taken for the file
       console.timeEnd(`Linter (${snippet})`);
+      jobCounter -= 1;
     });
   }
 }
diff --git a/snippets/call.md b/snippets/call.md
index bbc60ecaa..a7aec4808 100644
--- a/snippets/call.md
+++ b/snippets/call.md
@@ -11,4 +11,4 @@ Promise.resolve( [ 1, 2, 3 ] ).then( call('map', x => 2 * x ) ).then( console.lo
 const map = call.bind(null, 'map')
 Promise.resolve( [ 1, 2, 3 ] ).then( map( x => 2 * x ) ).then( console.log ) //[ 2, 4, 6 ]
 */
-```
+```
diff --git a/snippets/collectInto.md b/snippets/collectInto.md
index eb0e4df6c..c9a823d3d 100644
--- a/snippets/collectInto.md
+++ b/snippets/collectInto.md
@@ -13,4 +13,4 @@ let p2 = Promise.resolve(2)
 let p3 = new Promise((resolve) => setTimeout(resolve,2000,3))
 Pall(p1, p2, p3).then(console.log)
 */
-```
+```
diff --git a/snippets/flip.md b/snippets/flip.md
index 91eae77a0..ecad926a7 100644
--- a/snippets/flip.md
+++ b/snippets/flip.md
@@ -15,4 +15,4 @@ mergePerson(b) // == b
 b = {}
 Object.assign(b, a) // == b
 */
-```
+```
diff --git a/snippets/spreadOver.md b/snippets/spreadOver.md
index 94527aa19..aff6281a6 100644
--- a/snippets/spreadOver.md
+++ b/snippets/spreadOver.md
@@ -11,4 +11,4 @@ const arrayMax = spreadOver(Math.max)
 arrayMax([1,2,3]) // -> 3
 arrayMax([1,2,4]) // -> 4
 */
-```
+```

From 4f1508ce156d1f3ba8d35b09ef555c3e0fbb2807 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Sat, 23 Dec 2017 09:54:05 +0000
Subject: [PATCH 60/96] Travis build: 173

---
 README.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index a64842de8..b68f397e5 100644
--- a/README.md
+++ b/README.md
@@ -180,7 +180,7 @@ Promise.resolve( [ 1, 2, 3 ] ).then( call('map', x => 2 * x ) ).then( console.lo
 const map = call.bind(null, 'map')
 Promise.resolve( [ 1, 2, 3 ] ).then( map( x => 2 * x ) ).then( console.log ) //[ 2, 4, 6 ]
 */
-```
+```
 
 [⬆ back to top](#table-of-contents)
 
@@ -199,7 +199,7 @@ let p2 = Promise.resolve(2)
 let p3 = new Promise((resolve) => setTimeout(resolve,2000,3))
 Pall(p1, p2, p3).then(console.log)
 */
-```
+```
 
 [⬆ back to top](#table-of-contents)
 
@@ -220,7 +220,7 @@ mergePerson(b) // == b
 b = {}
 Object.assign(b, a) // == b
 */
-```
+```
 
 [⬆ back to top](#table-of-contents)
 
@@ -259,7 +259,7 @@ const arrayMax = spreadOver(Math.max)
 arrayMax([1,2,3]) // -> 3
 arrayMax([1,2,4]) // -> 4
 */
-```
+```
 
 [⬆ back to top](#table-of-contents)
 ## Array

From 48e65910f9931793c994b72a3d50d49d8c48978b Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Sat, 23 Dec 2017 11:58:41 +0200
Subject: [PATCH 61/96] Fixed multiple spaces/hyphens/underscores

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

diff --git a/snippets/toSnakeCase.md b/snippets/toSnakeCase.md
index 6a82a5ba2..957fd3a78 100644
--- a/snippets/toSnakeCase.md
+++ b/snippets/toSnakeCase.md
@@ -6,7 +6,7 @@ Use `replace()` to add underscores before capital letters, convert `toLowerCase(
 
 ```js
 const toSnakeCase = str =>
-  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase();
+  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase();
 // toSnakeCase("camelCase") -> 'camel_case'
 // toSnakeCase("some text") -> 'some_text'
 // toSnakeCase("some-javascript-property") -> 'some_javascript_property'

From 1d3c14c42dd3af61cd99d46836c5765b96be149e Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Sat, 23 Dec 2017 10:00:24 +0000
Subject: [PATCH 62/96] Travis build: 176

---
 README.md       | 18 ++++++++++++++++++
 docs/index.html | 11 +++++++++++
 2 files changed, 29 insertions(+)

diff --git a/README.md b/README.md
index b68f397e5..a94176aca 100644
--- a/README.md
+++ b/README.md
@@ -143,6 +143,7 @@
 * [`reverseString`](#reversestring)
 * [`sortCharactersInString`](#sortcharactersinstring)
 * [`toCamelCase`](#tocamelcase)
+* [`toSnakeCase`](#tosnakecase)
 * [`truncateString`](#truncatestring)
 * [`words`](#words)
 
@@ -1968,6 +1969,23 @@ const toCamelCase = str =>
 
 [⬆ back to top](#table-of-contents)
 
+### toSnakeCase
+
+Converts a string to snakecase.
+
+Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores.
+
+```js
+const toSnakeCase = str =>
+  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase();
+// 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'
+```
+
+[⬆ back to top](#table-of-contents)
+
 ### truncateString
 
 Truncates a string up to a specified length.
diff --git a/docs/index.html b/docs/index.html
index dc8296a8e..7e2d8ff1a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -171,6 +171,7 @@
 reverseString
 sortCharactersInString
 toCamelCase
+toSnakeCase
 truncateString
 words
 
@@ -1214,6 +1215,16 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens'
+

toSnakeCase

+

Converts a string to snakecase.

+

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

+
const toSnakeCase = str =>
+  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase();
+// 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'
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From 74e674aa52bf4eafffdfdfa3b75b1af71b5a4e19 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 23 Dec 2017 12:00:38 +0200 Subject: [PATCH 63/96] Update flatten.md --- snippets/flatten.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/flatten.md b/snippets/flatten.md index 4542d6b18..f070f2cae 100644 --- a/snippets/flatten.md +++ b/snippets/flatten.md @@ -2,7 +2,7 @@ Flattens an array. -Using a new array we concatinate it with the spread input array causing a shallow denesting of any contained arrays +Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays. ```js const flatten = arr => [ ].concat( ...arr ); From 4b13e2ebb04e0e694923ea528bc347d7a5dfa3a9 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 10:02:06 +0000 Subject: [PATCH 64/96] Travis build: 177 --- README.md | 18 ------------------ docs/index.html | 11 ----------- 2 files changed, 29 deletions(-) diff --git a/README.md b/README.md index a94176aca..b68f397e5 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,6 @@ * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) -* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -1969,23 +1968,6 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) -### toSnakeCase - -Converts a string to snakecase. - -Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. - -```js -const toSnakeCase = str => - str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase(); -// 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' -``` - -[⬆ back to top](#table-of-contents) - ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index 7e2d8ff1a..dc8296a8e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -171,7 +171,6 @@ reverseString sortCharactersInString toCamelCase -toSnakeCase truncateString words @@ -1215,16 +1214,6 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens'
-

toSnakeCase

-

Converts a string to snakecase.

-

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

-
const toSnakeCase = str =>
-  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase();
-// 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'
-

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From 04162459b1bb5633e9bc5f23f558705573504c46 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 10:04:21 +0000 Subject: [PATCH 65/96] Travis build: 180 --- README.md | 4 ++-- docs/index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b68f397e5..8556ec300 100644 --- a/README.md +++ b/README.md @@ -483,10 +483,10 @@ const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexO Flattens an array. -Use `Array.reduce()` to get all elements inside the array and `concat()` to flatten them. +Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays. ```js -const flatten = arr => arr.reduce((a, v) => a.concat(v), []); +const flatten = arr => [ ].concat( ...arr ); // flatten([1,[2],3,4]) -> [1,2,3,4] ``` diff --git a/docs/index.html b/docs/index.html index dc8296a8e..0c1ea6384 100644 --- a/docs/index.html +++ b/docs/index.html @@ -367,8 +367,8 @@ Returns the remaining elements.


flatten

Flattens an array.

-

Use Array.reduce() to get all elements inside the array and concat() to flatten them.

-
const flatten = arr => arr.reduce((a, v) => a.concat(v), []);
+

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

From 54e56b32fc1992acd62ea6810bb0c1a4e2889083 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 10:07:07 +0000 Subject: [PATCH 66/96] Travis build: 182 --- README.md | 2 +- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8556ec300..d6a3ffe4b 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ Use `Array.reduce()` and the `lcm` formula (uses recursion) to calculate the low ```js const arrayLcm = arr =>{ const gcd = (x, y) => !y ? x : gcd(y, x % y); - const lcm = (x, y) => (x*y)/gcd(x, y) + const lcm = (x, y) => (x*y)/gcd(x, y); return arr.reduce((a,b) => lcm(a,b)); } // arrayLcm([1,2,3,4,5]) -> 60 diff --git a/docs/index.html b/docs/index.html index 0c1ea6384..b02eda175 100644 --- a/docs/index.html +++ b/docs/index.html @@ -270,7 +270,7 @@ arrayMax([1,2,4]) // -> 4

Use Array.reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers.

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

From 3ebce1453fcf8645e12f1cff44c3bd4b9ce6d0a1 Mon Sep 17 00:00:00 2001
From: Angelos Chalaris 
Date: Sat, 23 Dec 2017 12:20:50 +0200
Subject: [PATCH 67/96] Tagged

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

diff --git a/tag_database b/tag_database
index c887a1d04..db820842c 100644
--- a/tag_database
+++ b/tag_database
@@ -38,6 +38,8 @@ everyNth:array
 extendHex:utility
 factorial:math
 fibonacci:math
+fibonacciCountUntilNum:math
+fibonacciUntilNum:math
 filterNonUnique:array
 flatten:array
 flattenDepth:array

From 2446be2556f1f5c4e162c8ad04d2fe498a5a1ac3 Mon Sep 17 00:00:00 2001
From: Travis CI 
Date: Sat, 23 Dec 2017 10:22:50 +0000
Subject: [PATCH 68/96] Travis build: 187

---
 README.md       | 34 ++++++++++++++++++++++++++++++++++
 docs/index.html | 20 ++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/README.md b/README.md
index d6a3ffe4b..0caf638f1 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,8 @@
 * [`distance`](#distance)
 * [`factorial`](#factorial)
 * [`fibonacci`](#fibonacci)
+* [`fibonacciCountUntilNum`](#fibonaccicountuntilnum)
+* [`fibonacciUntilNum`](#fibonacciuntilnum)
 * [`gcd`](#gcd)
 * [`hammingDistance`](#hammingdistance)
 * [`inRange`](#inrange)
@@ -1368,6 +1370,38 @@ const fibonacci = n =>
 
 [⬆ back to top](#table-of-contents)
 
+### 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`.
+
+```js
+const fibonacciCountUntilNum = num =>
+  Math.ceil(Math.log(num * Math.sqrt(5) + 1/2) / Math.log((Math.sqrt(5)+1)/2));
+// fibonacciCountUntilNum(10) -> 7
+```
+
+[⬆ back to top](#table-of-contents)
+
+### 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.
+
+```js
+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), []);
+}
+// fibonacciUntilNum(15) -> [0,1,1,2,3,5,8,13]
+```
+
+[⬆ back to top](#table-of-contents)
+
 ### gcd
 
 Calculates the greatest common divisor between two numbers.
diff --git a/docs/index.html b/docs/index.html
index b02eda175..ee07a9add 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -127,6 +127,8 @@
 distance
 factorial
 fibonacci
+fibonacciCountUntilNum
+fibonacciUntilNum
 gcd
 hammingDistance
 inRange
@@ -867,6 +869,24 @@ Use Array.reduce() to add values into the array, using the sum of t
   Array.from({ length: n}).reduce((acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), []);
 // fibonacci(5) -> [0,1,1,2,3]
 
+

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 => {
+  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), []);
+}
+// fibonacciUntilNum(15) -> [0,1,1,2,3,5,8,13]
+

gcd

Calculates the greatest common divisor between two numbers.

Use recursion. From 83fb2c523abd7b8b8fc10be3edb91c480f21a6e3 Mon Sep 17 00:00:00 2001 From: David Narbutovich Date: Sat, 23 Dec 2017 14:00:04 +0300 Subject: [PATCH 69/96] =?UTF-8?q?Bad=20example=F0=9F=91=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slice function can take the negative negative value of the second agrimement --- snippets/dropRight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/dropRight.md b/snippets/dropRight.md index d1a56d764..985df7ac3 100644 --- a/snippets/dropRight.md +++ b/snippets/dropRight.md @@ -5,7 +5,7 @@ Returns a new array with `n` elements removed from the right Check if `n` is shorter than the given array and use `Array.slice()` to slice it accordingly or return an empty array. ```js -const dropRight = (arr, n = 1) => n < arr.length ? arr.slice(0, arr.length - n) : [] +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) -> [] From 5c33ce5a1e726e5a93e2e257d1c93ac6d5814a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Sat, 23 Dec 2017 15:19:41 +0100 Subject: [PATCH 70/96] add buttons and eventListeners --- docs/bundle.js | 10 ++++++++++ docs/index.html | 2 ++ static-parts/index-end.html | 1 + static-parts/index-start.html | 1 + 4 files changed, 14 insertions(+) create mode 100644 docs/bundle.js diff --git a/docs/bundle.js b/docs/bundle.js new file mode 100644 index 000000000..eb3d70564 --- /dev/null +++ b/docs/bundle.js @@ -0,0 +1,10 @@ +var s = document.querySelectorAll("pre"); +s.forEach(element => { + var button = document.createElement("button"); + button.innerHTML = "Copy to clipboard"; + element.parentElement.appendChild(button); + + button.addEventListener ("click", function() { + console.log(element.textContent); + }); +}); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index ee07a9add..ecb78bb7a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -14,6 +14,7 @@ + + diff --git a/static-parts/index-end.html b/static-parts/index-end.html index 2dd2aae7e..1b89d551a 100644 --- a/static-parts/index-end.html +++ b/static-parts/index-end.html @@ -5,5 +5,6 @@

+ diff --git a/static-parts/index-start.html b/static-parts/index-start.html index f6c71b064..d1e09b45c 100644 --- a/static-parts/index-start.html +++ b/static-parts/index-start.html @@ -14,6 +14,7 @@ + From c5a4c161adbde1249f410293b4683af3d67e0578 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Sat, 23 Dec 2017 15:52:11 +0100 Subject: [PATCH 74/96] build --- docs/index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/index.html b/docs/index.html index 7b3a62728..ee176bf7d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17,16 +17,20 @@ From e40dd76757a0c7df7fd2887d8cb522f80701a678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Sat, 23 Dec 2017 16:00:07 +0100 Subject: [PATCH 75/96] add copy to clipboard functionality --- docs/bundle.js | 19 ++++++++++++++----- static-parts/index-start.html | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/bundle.js b/docs/bundle.js index c44bc871f..009dec509 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -1,11 +1,20 @@ -var s = document.querySelectorAll("pre"); -s.forEach(element => { - var button = document.createElement("button"); +var pres = document.querySelectorAll("pre"); +pres.forEach(element => { + const button = document.createElement("button"); button.innerHTML = "Copy to clipboard"; element.parentElement.appendChild(button); button.addEventListener ("click", function() { - var text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); - console.log(text); + //The following regex removes all the comments from the snippet + const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); + // Apparently you can copy variable to clipboard so you need to create text input element, + // give it a value, copy it and then remove it + const textArea = document.createElement("textarea"); + textArea.value = text; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand("Copy"); + document.body.removeChild(textArea); + console.log(`copied: ${text}`); }); }); \ No newline at end of file diff --git a/static-parts/index-start.html b/static-parts/index-start.html index d1e09b45c..b81e02d7a 100644 --- a/static-parts/index-start.html +++ b/static-parts/index-start.html @@ -22,6 +22,26 @@ var remove = false, childs = Array.from(node.parentElement.parentElement.children), toRemove = childs[0]; Array.from(node.parentElement.parentElement.children).forEach(x => x.tagName == 'H3' ? (toRemove.style.display = (remove ? 'none' : ''), toRemove = x, remove = true) : (x.style.display == '' ? remove = false : remove=remove)); } + + const pres = document.querySelectorAll("pre"); + pres.forEach(element => { + const button = document.createElement("button"); + button.innerHTML = "Copy to clipboard"; + element.parentElement.appendChild(button); + + button.addEventListener ("click", function() { + //The following regex removes all the comments from the snippet + const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); + // Apparently you can copy variable to clipboard so you need to create text input element, + // give it a value, copy it and then remove it + const textArea = document.createElement("textarea"); + textArea.value = text; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand("Copy"); + document.body.removeChild(textArea); + }); +}); From c4d4691c2ce09eaa8a22d7d1d4af541fed19026c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Sat, 23 Dec 2017 16:11:17 +0100 Subject: [PATCH 76/96] build webber --- docs/index.html | 42 ++++++++++++++++++++++++++--------- static-parts/index-start.html | 8 +++---- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/docs/index.html b/docs/index.html index ecb78bb7a..a10547ab1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -22,6 +22,26 @@ var remove = false, childs = Array.from(node.parentElement.parentElement.children), toRemove = childs[0]; Array.from(node.parentElement.parentElement.children).forEach(x => x.tagName == 'H3' ? (toRemove.style.display = (remove ? 'none' : ''), toRemove = x, remove = true) : (x.style.display == '' ? remove = false : remove=remove)); } + + const snippets = document.querySelectorAll("pre"); + snippets.forEach(element => { + const button = document.createElement("button"); + button.innerHTML = "Copy to clipboard"; + element.parentElement.appendChild(button); + + button.addEventListener ("click", function() { + //The following regex removes all the comments from the snippet + const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); + // Apparently you can't copy a variable to clipboard so you need to create text input element, + // give it a value, copy it and then remove it from DOM. + const textArea = document.createElement("textarea"); + textArea.value = text; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand("Copy"); + document.body.removeChild(textArea); + }); +}); @@ -273,7 +293,7 @@ arrayMax([1,2,4]) // -> 4

Use Array.reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers.

const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
-  const lcm = (x, y) => (x*y)/gcd(x, y); 
+  const lcm = (x, y) => (x*y)/gcd(x, y);
   return arr.reduce((a,b) => lcm(a,b));
 }
 // arrayLcm([1,2,3,4,5]) -> 60
@@ -417,7 +437,7 @@ Use Array.reduce() to create an object, where the keys are produced
 

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) => 
+
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(7, 3) -> [3,4,5,6,7]
@@ -444,7 +464,7 @@ You can omit value to use a default value of 0.


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) => 
+
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)
@@ -475,7 +495,7 @@ Use Array.length = 0 to mutate the passed in an array by resetting
 
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; 
+  arr.length = 0;
   pulled.forEach(v => arr.push(v));
 };
 
@@ -496,7 +516,7 @@ Use Array.push() to keep track of pulled values

let removed = []; let pulled = arr.map((v, i) => pullArr.includes(i) ? removed.push(v) : v) .filter((v, i) => !pullArr.includes(i)) - arr.length = 0; + arr.length = 0; pulled.forEach(v => arr.push(v)); return removed; } @@ -513,7 +533,7 @@ Use Array.push() to keep track of pulled values

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 = [], 
+  let removed = [],
     pushToRemove = arr.forEach((v, i) => pullArr.includes(v) ? removed.push(v) : v),
     mutateTo = arr.filter((v, i) => !pullArr.includes(v));
   arr.length = 0;
@@ -825,7 +845,7 @@ If num falls within the range, return num.
 Otherwise, return the nearest number in the range.

const clampNumber = (num, lower, upper) => {
   if(lower > upper) upper = [lower, lower = upper][0];
-  return (num>=lower && num<=upper) ? num : ((num < lower) ? lower : upper) 
+  return (num>=lower && num<=upper) ? num : ((num < lower) ? lower : upper)
 }
 // clampNumber(2, 3, 5) -> 3
 // clampNumber(1, -1, -5) -> -1
@@ -920,7 +940,7 @@ If the second parameter, end, is not specified, the range is consid
 

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 => 
+
const isArmstrongNumber = digits =>
   ( arr => arr.reduce( ( a, d ) => a + Math.pow( parseInt( d ), arr.length ), 0 ) == digits ? true : false )( ( digits+'' ).split( '' ) );
 // isArmstrongNumber(1634) -> true
 // isArmstrongNumber(371) -> true
@@ -1000,13 +1020,13 @@ Then, split('') into individual characters, reverse(),
 

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), 
+  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; 
+  return arr;
 }
-// primes(10) -> [2,3,5,7] 
+// primes(10) -> [2,3,5,7]
 

randomIntegerInRange

Returns a random integer in the specified range.

diff --git a/static-parts/index-start.html b/static-parts/index-start.html index b81e02d7a..cb8bab170 100644 --- a/static-parts/index-start.html +++ b/static-parts/index-start.html @@ -23,8 +23,8 @@ Array.from(node.parentElement.parentElement.children).forEach(x => x.tagName == 'H3' ? (toRemove.style.display = (remove ? 'none' : ''), toRemove = x, remove = true) : (x.style.display == '' ? remove = false : remove=remove)); } - const pres = document.querySelectorAll("pre"); - pres.forEach(element => { + const snippets = document.querySelectorAll("pre"); + snippets.forEach(element => { const button = document.createElement("button"); button.innerHTML = "Copy to clipboard"; element.parentElement.appendChild(button); @@ -32,8 +32,8 @@ button.addEventListener ("click", function() { //The following regex removes all the comments from the snippet const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); - // Apparently you can copy variable to clipboard so you need to create text input element, - // give it a value, copy it and then remove it + // Apparently you can't copy a variable to clipboard so you need to create text input element, + // give it a value, copy it and then remove it from DOM. const textArea = document.createElement("textarea"); textArea.value = text; document.body.appendChild(textArea); From a536f2a67d846ffd795624b5009bd40463629f48 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Sat, 23 Dec 2017 17:34:12 +0100 Subject: [PATCH 77/96] Delete unnecessary js file --- docs/bundle.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 docs/bundle.js diff --git a/docs/bundle.js b/docs/bundle.js deleted file mode 100644 index 009dec509..000000000 --- a/docs/bundle.js +++ /dev/null @@ -1,20 +0,0 @@ -var pres = document.querySelectorAll("pre"); -pres.forEach(element => { - const button = document.createElement("button"); - button.innerHTML = "Copy to clipboard"; - element.parentElement.appendChild(button); - - button.addEventListener ("click", function() { - //The following regex removes all the comments from the snippet - const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); - // Apparently you can copy variable to clipboard so you need to create text input element, - // give it a value, copy it and then remove it - const textArea = document.createElement("textarea"); - textArea.value = text; - document.body.appendChild(textArea); - textArea.select(); - document.execCommand("Copy"); - document.body.removeChild(textArea); - console.log(`copied: ${text}`); - }); -}); \ No newline at end of file From c12f2c7c7aeebe8d271aedd31ec152627dec708b Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Sat, 23 Dec 2017 17:34:39 +0100 Subject: [PATCH 78/96] Delete unnecessary js file --- static-parts/index-end.html | 1 - 1 file changed, 1 deletion(-) diff --git a/static-parts/index-end.html b/static-parts/index-end.html index 1b89d551a..2dd2aae7e 100644 --- a/static-parts/index-end.html +++ b/static-parts/index-end.html @@ -5,6 +5,5 @@
- From 3ee84679c7623d8403f507267de381da8b8af083 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Sat, 23 Dec 2017 17:34:49 +0100 Subject: [PATCH 79/96] Fix trailing empty lines --- static-parts/index-start.html | 45 ++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/static-parts/index-start.html b/static-parts/index-start.html index 1da0a0a70..3a926ab47 100644 --- a/static-parts/index-start.html +++ b/static-parts/index-start.html @@ -14,11 +14,10 @@ - - +

 30 seconds of code From 36c4af2cae820e990f94c34e3c9aa1f9870c1bf0 Mon Sep 17 00:00:00 2001 From: Pl4gue Date: Sat, 23 Dec 2017 17:37:47 +0100 Subject: [PATCH 80/96] rebuild --- docs/index.html | 68 ++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/index.html b/docs/index.html index 12e0b5d12..07111b089 100644 --- a/docs/index.html +++ b/docs/index.html @@ -14,11 +14,10 @@ - - +

 30 seconds of code @@ -304,7 +305,7 @@ arrayMax([1,2,4]) // -> 4

Use Array.reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers.

const arrayLcm = arr =>{
   const gcd = (x, y) => !y ? x : gcd(y, x % y);
-  const lcm = (x, y) => (x*y)/gcd(x, y);
+  const lcm = (x, y) => (x*y)/gcd(x, y); 
   return arr.reduce((a,b) => lcm(a,b));
 }
 // arrayLcm([1,2,3,4,5]) -> 60
@@ -448,7 +449,7 @@ Use Array.reduce() to create an object, where the keys are produced
 

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) =>
+
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(7, 3) -> [3,4,5,6,7]
@@ -475,7 +476,7 @@ You can omit value to use a default value of 0.


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) =>
+
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)
@@ -506,7 +507,7 @@ Use Array.length = 0 to mutate the passed in an array by resetting
 
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;
+  arr.length = 0; 
   pulled.forEach(v => arr.push(v));
 };
 
@@ -527,7 +528,7 @@ Use Array.push() to keep track of pulled values

let removed = []; let pulled = arr.map((v, i) => pullArr.includes(i) ? removed.push(v) : v) .filter((v, i) => !pullArr.includes(i)) - arr.length = 0; + arr.length = 0; pulled.forEach(v => arr.push(v)); return removed; } @@ -544,7 +545,7 @@ Use Array.push() to keep track of pulled values

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 = [],
+  let removed = [], 
     pushToRemove = arr.forEach((v, i) => pullArr.includes(v) ? removed.push(v) : v),
     mutateTo = arr.filter((v, i) => !pullArr.includes(v));
   arr.length = 0;
@@ -856,7 +857,7 @@ If num falls within the range, return num.
 Otherwise, return the nearest number in the range.

const clampNumber = (num, lower, upper) => {
   if(lower > upper) upper = [lower, lower = upper][0];
-  return (num>=lower && num<=upper) ? num : ((num < lower) ? lower : upper)
+  return (num>=lower && num<=upper) ? num : ((num < lower) ? lower : upper) 
 }
 // clampNumber(2, 3, 5) -> 3
 // clampNumber(1, -1, -5) -> -1
@@ -951,7 +952,7 @@ If the second parameter, end, is not specified, the range is consid
 

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 =>
+
const isArmstrongNumber = digits => 
   ( arr => arr.reduce( ( a, d ) => a + Math.pow( parseInt( d ), arr.length ), 0 ) == digits ? true : false )( ( digits+'' ).split( '' ) );
 // isArmstrongNumber(1634) -> true
 // isArmstrongNumber(371) -> true
@@ -1031,13 +1032,13 @@ Then, split('') into individual characters, reverse(),
 

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),
+  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;
+  return arr; 
 }
-// primes(10) -> [2,3,5,7]
+// primes(10) -> [2,3,5,7] 
 

randomIntegerInRange

Returns a random integer in the specified range.

@@ -1432,7 +1433,6 @@ Use Number() to check if the coercion holds.

- From 85c227d5cd56131409bffe8804d19d27743ed947 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 19:13:32 +0000 Subject: [PATCH 81/96] Travis build: 209 --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ docs/index.html | 27 +++++++++++++++++++++++++++ tag_database | 2 ++ 3 files changed, 69 insertions(+) diff --git a/README.md b/README.md index 0caf638f1..1a47e933c 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,10 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) +### _Uncategorized_ +* [`repeatString`](#repeatstring) +* [`toKebabCase`](#tokebabcase) + ## Adapter ### call @@ -2289,6 +2293,42 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == // validateNumber('10') -> true ``` +[⬆ back to top](#table-of-contents) +## _Uncategorized_ + +### 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. + +```js +const repeatString = (str="",num=2) => { + return num >= 0 ? str.repeat(num) : str; +} +// repeatString("abc",3) -> 'abcabcabc' +// repeatString("abc") -> 'abcabc' +``` + +[⬆ back to top](#table-of-contents) + +### toKebabCase + +Converts a string to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). +Use `replace()` to add spaces before capital letters, convert `toLowerCase()`, then `replace()` underscores and spaces with hyphens. +Also check if a string starts with a hyphen and remove it if yes. + +```js +const toKebabCase = str => { + str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-'); + return str.startsWith('-') ? str.slice(1,str.length) : str; +} +// 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" +``` + [⬆ back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index ee176bf7d..9e3aebd82 100644 --- a/docs/index.html +++ b/docs/index.html @@ -206,6 +206,10 @@ UUIDGenerator validateNumber +

Uncategorized +

repeatString +toKebabCase +
 

Adapter

call

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

@@ -1403,6 +1407,29 @@ Use Number() to check if the coercion holds.

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

Uncategorized

+

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") -> 'abcabc'
+
+

toKebabCase

+

Converts a string to kebab case. +Use replace() to add spaces before capital letters, convert toLowerCase(), then replace() underscores and spaces with hyphens. +Also check if a string starts with a hyphen and remove it if yes.

+
const toKebabCase = str => {
+    str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-');
+    return str.startsWith('-') ? str.slice(1,str.length) : str;
+}
+// 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"
+

30 seconds of code is licensed under the CC0-1.0 license.
Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.
Ribbon made by Tim Holman is licensed by The MIT License
Built with the mini.css framework.

diff --git a/tag_database b/tag_database index db820842c..573e17441 100644 --- a/tag_database +++ b/tag_database @@ -97,6 +97,7 @@ randomNumberInRange:math readFileLines:node redirect:browser remove:array +repeatString:uncategorized reverseString:string RGBToHex:utility round:math @@ -120,6 +121,7 @@ timeTaken:utility toCamelCase:string toDecimalMark:utility toEnglishDate:date +toKebabCase:uncategorized toOrdinalSuffix:utility truncateString:string truthCheckCollection:object From 454189be584249f66b2a617d3c88cc884b08fc7a Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 23 Dec 2017 23:39:57 +0200 Subject: [PATCH 82/96] Tags --- tag_database | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tag_database b/tag_database index 573e17441..9663c2aba 100644 --- a/tag_database +++ b/tag_database @@ -97,7 +97,7 @@ randomNumberInRange:math readFileLines:node redirect:browser remove:array -repeatString:uncategorized +repeatString:string reverseString:string RGBToHex:utility round:math @@ -121,7 +121,7 @@ timeTaken:utility toCamelCase:string toDecimalMark:utility toEnglishDate:date -toKebabCase:uncategorized +toKebabCase:string toOrdinalSuffix:utility truncateString:string truthCheckCollection:object From e927d63cb9999137f3126d84961d7e0e4c1b0c8a Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 21:41:50 +0000 Subject: [PATCH 83/96] Travis build: 211 --- README.md | 77 ++++++++++++++++++++++++------------------------- docs/index.html | 51 +++++++++++++++----------------- 2 files changed, 61 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 1a47e933c..c8a3469be 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,11 @@ * [`countVowels`](#countvowels) * [`escapeRegExp`](#escaperegexp) * [`fromCamelCase`](#fromcamelcase) +* [`repeatString`](#repeatstring) * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) +* [`toKebabCase`](#tokebabcase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -167,10 +169,6 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) -### _Uncategorized_ -* [`repeatString`](#repeatstring) -* [`toKebabCase`](#tokebabcase) - ## Adapter ### call @@ -1961,6 +1959,22 @@ const fromCamelCase = (str, separator = '_') => [⬆ back to top](#table-of-contents) +### 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. + +```js +const repeatString = (str="",num=2) => { + return num >= 0 ? str.repeat(num) : str; +} +// repeatString("abc",3) -> 'abcabcabc' +// repeatString("abc") -> 'abcabc' +``` + +[⬆ back to top](#table-of-contents) + ### reverseString Reverses a string. @@ -2006,6 +2020,25 @@ const toCamelCase = str => [⬆ back to top](#table-of-contents) +### toKebabCase + +Converts a string to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). +Use `replace()` to add spaces before capital letters, convert `toLowerCase()`, then `replace()` underscores and spaces with hyphens. +Also check if a string starts with a hyphen and remove it if yes. + +```js +const toKebabCase = str => { + str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-'); + return str.startsWith('-') ? str.slice(1,str.length) : str; +} +// 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" +``` + +[⬆ back to top](#table-of-contents) + ### truncateString Truncates a string up to a specified length. @@ -2293,42 +2326,6 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == // validateNumber('10') -> true ``` -[⬆ back to top](#table-of-contents) -## _Uncategorized_ - -### 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. - -```js -const repeatString = (str="",num=2) => { - return num >= 0 ? str.repeat(num) : str; -} -// repeatString("abc",3) -> 'abcabcabc' -// repeatString("abc") -> 'abcabc' -``` - -[⬆ back to top](#table-of-contents) - -### toKebabCase - -Converts a string to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). -Use `replace()` to add spaces before capital letters, convert `toLowerCase()`, then `replace()` underscores and spaces with hyphens. -Also check if a string starts with a hyphen and remove it if yes. - -```js -const toKebabCase = str => { - str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-'); - return str.startsWith('-') ? str.slice(1,str.length) : str; -} -// 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" -``` - [⬆ back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index 9e3aebd82..bcb9d5685 100644 --- a/docs/index.html +++ b/docs/index.html @@ -181,9 +181,11 @@ countVowels escapeRegExp fromCamelCase +repeatString reverseString sortCharactersInString toCamelCase +toKebabCase truncateString words @@ -206,10 +208,6 @@ UUIDGenerator validateNumber -

Uncategorized -

repeatString -toKebabCase -
 

Adapter

call

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

@@ -1225,6 +1223,15 @@ Omit the second argument to use a default separator of _.

// 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) => {
+    return num >= 0 ? str.repeat(num) : str;
+}
+// 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. @@ -1249,6 +1256,19 @@ Combine characters to get a string using join('').

// toCamelCase("some-javascript-property") -> 'someJavascriptProperty' // toCamelCase("some-mixed_string with spaces_underscores-and-hyphens") -> 'someMixedStringWithSpacesUnderscoresAndHyphens'
+

toKebabCase

+

Converts a string to kebab case. +Use replace() to add spaces before capital letters, convert toLowerCase(), then replace() underscores and spaces with hyphens. +Also check if a string starts with a hyphen and remove it if yes.

+
const toKebabCase = str => {
+    str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-');
+    return str.startsWith('-') ? str.slice(1,str.length) : str;
+}
+// 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"
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. @@ -1407,29 +1427,6 @@ Use Number() to check if the coercion holds.

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

Uncategorized

-

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") -> 'abcabc'
-
-

toKebabCase

-

Converts a string to kebab case. -Use replace() to add spaces before capital letters, convert toLowerCase(), then replace() underscores and spaces with hyphens. -Also check if a string starts with a hyphen and remove it if yes.

-
const toKebabCase = str => {
-    str = str.replace(/([A-Z])/g," $1").toLowerCase().replace(/_/g,' ').replace(/-/g,' ').replace(/\s\s+/g, ' ').replace(/\s/g,'-');
-    return str.startsWith('-') ? str.slice(1,str.length) : str;
-}
-// 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"
-

30 seconds of code is licensed under the CC0-1.0 license.
Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.
Ribbon made by Tim Holman is licensed by The MIT License
Built with the mini.css framework.

From 7dee2508302e80e8ed82816a27a4b44333382034 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Dec 2017 22:05:28 +0000 Subject: [PATCH 84/96] Travis build: 215 --- README.md | 18 ++++++++++++++++++ docs/index.html | 11 +++++++++++ 2 files changed, 29 insertions(+) diff --git a/README.md b/README.md index c8a3469be..6786ca4aa 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ * [`sortCharactersInString`](#sortcharactersinstring) * [`toCamelCase`](#tocamelcase) * [`toKebabCase`](#tokebabcase) +* [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) @@ -2039,6 +2040,23 @@ const toKebabCase = str => { [⬆ back to top](#table-of-contents) +### toSnakeCase + +Converts a string to snakecase. + +Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores. + +```js +const toSnakeCase = str => + str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase(); +// 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' +``` + +[⬆ back to top](#table-of-contents) + ### truncateString Truncates a string up to a specified length. diff --git a/docs/index.html b/docs/index.html index f4427854c..9b5808ae9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -208,6 +208,7 @@ sortCharactersInString toCamelCase toKebabCase +toSnakeCase truncateString words @@ -1291,6 +1292,16 @@ Also check if a string starts with a hyphen and remove it if yes.

// 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"
+

toSnakeCase

+

Converts a string to snakecase.

+

Use replace() to add underscores before capital letters, convert toLowerCase(), then replace() hyphens and spaces with underscores.

+
const toSnakeCase = str =>
+  str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-_]+/g, '_').toLowerCase();
+// 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'
+

truncateString

Truncates a string up to a specified length.

Determine if the string's length is greater than num. From a038e1250573d068fc61bd7de3e3a53580448f3a Mon Sep 17 00:00:00 2001 From: Michael Gutman Date: Sun, 24 Dec 2017 01:28:52 -0500 Subject: [PATCH 85/96] ADD: negate.md --- snippets/negate.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 snippets/negate.md diff --git a/snippets/negate.md b/snippets/negate.md new file mode 100644 index 000000000..52cbd1cb6 --- /dev/null +++ b/snippets/negate.md @@ -0,0 +1,12 @@ +### negate + +Negates a predicate function. + +Take a predicate and apply `not` to it with its arguments. + +```js +const negate = predicate => (...args) => !predicate(...args) + +// filter([1, 2, 3, 4, 5, 6], negate(isEven)); +// => [1, 3, 5] +``` From fb6b512db01154531d9569fe3e8f44eac858036a Mon Sep 17 00:00:00 2001 From: Michael Gutman Date: Sun, 24 Dec 2017 01:36:12 -0500 Subject: [PATCH 86/96] Fixed styling --- snippets/negate.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/snippets/negate.md b/snippets/negate.md index 52cbd1cb6..d44b4f4dc 100644 --- a/snippets/negate.md +++ b/snippets/negate.md @@ -2,10 +2,12 @@ Negates a predicate function. -Take a predicate and apply `not` to it with its arguments. +Take a predicate function and apply `not` to it with its arguments. ```js -const negate = predicate => (...args) => !predicate(...args) +const negate = func => (...args) => { + return !func(...args); +} // filter([1, 2, 3, 4, 5, 6], negate(isEven)); // => [1, 3, 5] From bc13bc03bbfff56bf30e7ad8219418d4a17a8848 Mon Sep 17 00:00:00 2001 From: Michael Gutman Date: Sun, 24 Dec 2017 01:48:04 -0500 Subject: [PATCH 87/96] Added second example --- snippets/negate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/negate.md b/snippets/negate.md index d44b4f4dc..c847a489a 100644 --- a/snippets/negate.md +++ b/snippets/negate.md @@ -9,6 +9,6 @@ const negate = func => (...args) => { return !func(...args); } -// filter([1, 2, 3, 4, 5, 6], negate(isEven)); -// => [1, 3, 5] +// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5] +// negate(isOdd)(1) -> false ``` From 391b9cdcfe9aaa3a067a34fb1fa7129feb3493bf Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Sun, 24 Dec 2017 13:09:23 +0530 Subject: [PATCH 88/96] Snippet to detect device type --- snippets/detectDeviceType.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 snippets/detectDeviceType.md diff --git a/snippets/detectDeviceType.md b/snippets/detectDeviceType.md new file mode 100644 index 000000000..fcf4ea741 --- /dev/null +++ b/snippets/detectDeviceType.md @@ -0,0 +1,7 @@ +### detectDeviceType + +Detects weather the website is being opened in a mobile device or a desktop + +```js +const detectDevice = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop"; +``` \ No newline at end of file From 99a1564b651006e32f8ef2571f829e18d9b6bc21 Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Sun, 24 Dec 2017 13:10:31 +0530 Subject: [PATCH 89/96] Fixed typo and added examples --- snippets/detectDeviceType.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/detectDeviceType.md b/snippets/detectDeviceType.md index fcf4ea741..26123a32a 100644 --- a/snippets/detectDeviceType.md +++ b/snippets/detectDeviceType.md @@ -3,5 +3,8 @@ Detects weather the website is being opened in a mobile device or a desktop ```js -const detectDevice = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop"; +const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop"; + +detectDeviceType() -> "Mobile" +detectDeviceType() -> "Desktop" ``` \ No newline at end of file From 991413242ca63d9c9eb47650d1cefbd47af12d84 Mon Sep 17 00:00:00 2001 From: lvzhenbang Date: Sun, 24 Dec 2017 17:50:24 +0800 Subject: [PATCH 90/96] [bug] change Array.slice() for String.slice() useage: Array.slice() should be changed to String.slice() --- snippets/extendHex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/extendHex.md b/snippets/extendHex.md index bda2cdd5e..8c7773c5e 100644 --- a/snippets/extendHex.md +++ b/snippets/extendHex.md @@ -3,7 +3,7 @@ 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. -`Array.slice()` is used to remove `#` from string start since it's added once. +`String.slice()` is used to remove `#` from string start since it's added once. ```js const extendHex = shortHex => '#' + shortHex.slice(shortHex.startsWith('#') ? 1 : 0).split('').map(x => x+x).join('') From 5df762902a31cddee78be80613ed08521e227741 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 24 Dec 2017 13:44:04 +0200 Subject: [PATCH 91/96] Update negate.md --- snippets/negate.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/snippets/negate.md b/snippets/negate.md index c847a489a..812b24efb 100644 --- a/snippets/negate.md +++ b/snippets/negate.md @@ -5,10 +5,7 @@ Negates a predicate function. Take a predicate function and apply `not` to it with its arguments. ```js -const negate = func => (...args) => { - return !func(...args); -} - +const negate = func => (...args) => !fun(...args); // filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5] // negate(isOdd)(1) -> false ``` From e0c5fb68b5444ac0939cd11a0f233e6c41062406 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 24 Dec 2017 13:49:11 +0200 Subject: [PATCH 92/96] Update detectDeviceType.md --- snippets/detectDeviceType.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/snippets/detectDeviceType.md b/snippets/detectDeviceType.md index 26123a32a..b2822a458 100644 --- a/snippets/detectDeviceType.md +++ b/snippets/detectDeviceType.md @@ -1,10 +1,11 @@ ### detectDeviceType -Detects weather the website is being opened in a mobile device or a desktop +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. ```js const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop"; - -detectDeviceType() -> "Mobile" -detectDeviceType() -> "Desktop" -``` \ No newline at end of file +// detectDeviceType() -> "Mobile" +// detectDeviceType() -> "Desktop" +``` From bfcddf6266c5c3e8d2f093924989f67b6a1131e3 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sun, 24 Dec 2017 12:06:52 +0000 Subject: [PATCH 93/96] Travis build: 224 --- README.md | 35 ++++++++++++++++++++++++++++++++++- docs/index.html | 21 ++++++++++++++++++++- tag_database | 2 ++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6786ca4aa..99b31269b 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,10 @@ * [`UUIDGenerator`](#uuidgenerator) * [`validateNumber`](#validatenumber) +### _Uncategorized_ +* [`detectDeviceType`](#detectdevicetype) +* [`negate`](#negate) + ## Adapter ### call @@ -2120,7 +2124,7 @@ const coalesceFactory = valid => (...args) => args.find(valid); 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. -`Array.slice()` is used to remove `#` from string start since it's added once. +`String.slice()` is used to remove `#` from string start since it's added once. ```js const extendHex = shortHex => '#' + shortHex.slice(shortHex.startsWith('#') ? 1 : 0).split('').map(x => x+x).join('') @@ -2344,6 +2348,35 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == // validateNumber('10') -> true ``` +[⬆ back to top](#table-of-contents) +## _Uncategorized_ + +### 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. + +```js +const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop"; +// detectDeviceType() -> "Mobile" +// detectDeviceType() -> "Desktop" +``` + +[⬆ back to top](#table-of-contents) + +### negate + +Negates a predicate function. + +Take a predicate function and apply `not` to it with its arguments. + +```js +const negate = func => (...args) => !fun(...args); +// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5] +// negate(isOdd)(1) -> false +``` + [⬆ back to top](#table-of-contents) ## Credits diff --git a/docs/index.html b/docs/index.html index 9b5808ae9..e69391d07 100644 --- a/docs/index.html +++ b/docs/index.html @@ -231,6 +231,10 @@ UUIDGenerator validateNumber +

Uncategorized +

detectDeviceType +negate +
 

Adapter

call

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

@@ -1335,7 +1339,7 @@ Omit the second argument to use the default regex.


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. -Array.slice() is used to remove # from string start since it's added once.

+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'
@@ -1460,6 +1464,21 @@ Use Number() to check if the coercion holds.

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

Uncategorized

+

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() -> "Desktop"
+
+

negate

+

Negates a predicate function.

+

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

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