Travis build: 1074

This commit is contained in:
30secondsofcode
2019-03-19 07:46:09 +00:00
parent c1abc7a12b
commit 54ec7f14db
8 changed files with 41 additions and 35 deletions

View File

@ -243,11 +243,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;
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
@ -270,9 +270,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);
const digitize = n => [...`${n}`].map(i => parseInt(i));
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
const drop = (arr, n = 1) => arr.slice(n);
@ -604,7 +604,7 @@ const isLowerCase = str => str === str.toLowerCase();
const isNegativeZero = val => val === 0 && 1 / val === -Infinity;
const isNil = val => val === undefined || val === null;
const isNull = val => val === null;
const isNumber = val => typeof val === 'number';
const isNumber = val => typeof val === 'number' && val === val;
const isObject = obj => obj === Object(obj);
const isObjectLike = val => val !== null && typeof val === 'object';
const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;