From 1d84a5bf9bf75e34dec7be84cea8e822c0118a65 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Fri, 1 Mar 2019 17:48:12 +0000 Subject: [PATCH] Travis build: 1033 --- README.md | 26 +++++++++++++------------- docs/adapter.html | 4 ++-- docs/archive.html | 2 +- docs/browser.html | 2 +- docs/date.html | 2 +- docs/function.html | 2 +- docs/glossary.html | 2 +- docs/index.html | 8 ++++---- docs/math.html | 6 +++--- docs/node.html | 2 +- docs/object.html | 16 ++++++++-------- docs/string.html | 2 +- docs/type.html | 2 +- docs/utility.html | 2 +- snippets/deepMapKeys.md | 8 ++++---- snippets/dig.md | 6 +++--- snippets/factorial.md | 4 ++-- snippets/pipeAsyncFunctions.md | 2 +- snippets/remove.md | 6 +++--- test/_30s.js | 24 ++++++++++++------------ 20 files changed, 64 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 628868add..a464bbcd4 100644 --- a/README.md +++ b/README.md @@ -676,7 +676,7 @@ const sum = pipeAsyncFunctions( x => x + 3, async x => (await x) + 4 ); -(async() => { +(async () => { console.log(await sum(5)); // 15 (after one second) })(); ``` @@ -2321,9 +2321,9 @@ The `func` is invoked with three arguments (`value, index, array`). const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; ``` @@ -5504,8 +5504,8 @@ Throws an exception if `n` is a negative number. const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 ? 1 : n * factorial(n - 1); @@ -6809,11 +6809,11 @@ const deepMapKeys = (obj, f) => ? obj.map(val => deepMapKeys(val, f)) : typeof obj === 'object' ? Object.keys(obj).reduce((acc, current) => { - const val = obj[current]; - acc[f(current)] = + const val = obj[current]; + acc[f(current)] = val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val); - return acc; - }, {}) + return acc; + }, {}) : obj; ``` @@ -6887,9 +6887,9 @@ const dig = (obj, target) => target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); ```
diff --git a/docs/adapter.html b/docs/adapter.html index 6e4c4473c..002459fc2 100644 --- a/docs/adapter.html +++ b/docs/adapter.html @@ -1,6 +1,6 @@ Adapter - 30 seconds of code