Travis build: 1304 [cron]

This commit is contained in:
30secondsofcode
2019-07-19 16:16:05 +00:00
parent bc0aa14697
commit a7e50ac55f
7 changed files with 157 additions and 55 deletions

28
dist/_30s.js vendored
View File

@ -248,11 +248,11 @@
? 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);
@ -275,9 +275,9 @@
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);
@ -350,8 +350,8 @@
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);
@ -660,6 +660,9 @@
return false;
}
};
const isWeekday = (t = new Date()) => {
return t.getDay() >= 1 && t.getDay() <= 5;
};
const isWritableStream = val =>
val !== null &&
typeof val === 'object' &&
@ -1005,9 +1008,9 @@
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);
}, [])
: [];
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
const renameKeys = (keysMap, obj) =>
@ -1557,6 +1560,7 @@
exports.isUndefined = isUndefined;
exports.isUpperCase = isUpperCase;
exports.isValidJSON = isValidJSON;
exports.isWeekday = isWeekday;
exports.isWritableStream = isWritableStream;
exports.join = join;
exports.last = last;