Travis build: 1513 [cron]
This commit is contained in:
72
dist/_30s.es5.js
vendored
72
dist/_30s.es5.js
vendored
@ -1567,6 +1567,17 @@
|
|||||||
return [k, obj[k]];
|
return [k, obj[k]];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var objectToQueryString = function objectToQueryString(queryParameters) {
|
||||||
|
return queryParameters ? Object.entries(queryParameters).reduce(function (queryString, _ref21, index) {
|
||||||
|
var _ref22 = _slicedToArray(_ref21, 2),
|
||||||
|
key = _ref22[0],
|
||||||
|
val = _ref22[1];
|
||||||
|
|
||||||
|
var symbol = index === 0 ? '?' : '&';
|
||||||
|
queryString += typeof val === 'string' ? "".concat(symbol).concat(key, "=").concat(val) : '';
|
||||||
|
return queryString;
|
||||||
|
}, '') : '';
|
||||||
|
};
|
||||||
var observeMutations = function observeMutations(element, callback, options) {
|
var observeMutations = function observeMutations(element, callback, options) {
|
||||||
var observer = new MutationObserver(function (mutations) {
|
var observer = new MutationObserver(function (mutations) {
|
||||||
return mutations.forEach(function (m) {
|
return mutations.forEach(function (m) {
|
||||||
@ -1646,10 +1657,10 @@
|
|||||||
return _toConsumableArray(arr).sort(function (a, b) {
|
return _toConsumableArray(arr).sort(function (a, b) {
|
||||||
return props.reduce(function (acc, prop, i) {
|
return props.reduce(function (acc, prop, i) {
|
||||||
if (acc === 0) {
|
if (acc === 0) {
|
||||||
var _ref21 = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]],
|
var _ref23 = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]],
|
||||||
_ref22 = _slicedToArray(_ref21, 2),
|
_ref24 = _slicedToArray(_ref23, 2),
|
||||||
p1 = _ref22[0],
|
p1 = _ref24[0],
|
||||||
p2 = _ref22[1];
|
p2 = _ref24[1];
|
||||||
|
|
||||||
acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0;
|
acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0;
|
||||||
}
|
}
|
||||||
@ -2031,8 +2042,8 @@
|
|||||||
type: 'application/javascript; charset=utf-8'
|
type: 'application/javascript; charset=utf-8'
|
||||||
}));
|
}));
|
||||||
return new Promise(function (res, rej) {
|
return new Promise(function (res, rej) {
|
||||||
worker.onmessage = function (_ref23) {
|
worker.onmessage = function (_ref25) {
|
||||||
var data = _ref23.data;
|
var data = _ref25.data;
|
||||||
res(data), worker.terminate();
|
res(data), worker.terminate();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2049,18 +2060,18 @@
|
|||||||
var sample = function sample(arr) {
|
var sample = function sample(arr) {
|
||||||
return arr[Math.floor(Math.random() * arr.length)];
|
return arr[Math.floor(Math.random() * arr.length)];
|
||||||
};
|
};
|
||||||
var sampleSize = function sampleSize(_ref24) {
|
var sampleSize = function sampleSize(_ref26) {
|
||||||
var _ref25 = _toArray(_ref24),
|
var _ref27 = _toArray(_ref26),
|
||||||
arr = _ref25.slice(0);
|
arr = _ref27.slice(0);
|
||||||
|
|
||||||
var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
||||||
var m = arr.length;
|
var m = arr.length;
|
||||||
|
|
||||||
while (m) {
|
while (m) {
|
||||||
var i = Math.floor(Math.random() * m--);
|
var i = Math.floor(Math.random() * m--);
|
||||||
var _ref26 = [arr[i], arr[m]];
|
var _ref28 = [arr[i], arr[m]];
|
||||||
arr[m] = _ref26[0];
|
arr[m] = _ref28[0];
|
||||||
arr[i] = _ref26[1];
|
arr[i] = _ref28[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr.slice(0, n);
|
return arr.slice(0, n);
|
||||||
@ -2112,17 +2123,17 @@
|
|||||||
return e.style.display = '';
|
return e.style.display = '';
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var shuffle = function shuffle(_ref27) {
|
var shuffle = function shuffle(_ref29) {
|
||||||
var _ref28 = _toArray(_ref27),
|
var _ref30 = _toArray(_ref29),
|
||||||
arr = _ref28.slice(0);
|
arr = _ref30.slice(0);
|
||||||
|
|
||||||
var m = arr.length;
|
var m = arr.length;
|
||||||
|
|
||||||
while (m) {
|
while (m) {
|
||||||
var i = Math.floor(Math.random() * m--);
|
var i = Math.floor(Math.random() * m--);
|
||||||
var _ref29 = [arr[i], arr[m]];
|
var _ref31 = [arr[i], arr[m]];
|
||||||
arr[m] = _ref29[0];
|
arr[m] = _ref31[0];
|
||||||
arr[i] = _ref29[1];
|
arr[i] = _ref31[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr;
|
return arr;
|
||||||
@ -2196,8 +2207,8 @@
|
|||||||
};
|
};
|
||||||
}).sort(function (a, b) {
|
}).sort(function (a, b) {
|
||||||
return compare(a.item, b.item) || a.index - b.index;
|
return compare(a.item, b.item) || a.index - b.index;
|
||||||
}).map(function (_ref30) {
|
}).map(function (_ref32) {
|
||||||
var item = _ref30.item;
|
var item = _ref32.item;
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -2837,10 +2848,10 @@
|
|||||||
var pipeLog = function pipeLog(data) {
|
var pipeLog = function pipeLog(data) {
|
||||||
return console.log(data) || data;
|
return console.log(data) || data;
|
||||||
};
|
};
|
||||||
var quickSort = function quickSort(_ref31, desc) {
|
var quickSort = function quickSort(_ref33, desc) {
|
||||||
var _ref32 = _toArray(_ref31),
|
var _ref34 = _toArray(_ref33),
|
||||||
n = _ref32[0],
|
n = _ref34[0],
|
||||||
nums = _ref32.slice(1);
|
nums = _ref34.slice(1);
|
||||||
|
|
||||||
return isNaN(n) ? [] : [].concat(_toConsumableArray(quickSort(nums.filter(function (v) {
|
return isNaN(n) ? [] : [].concat(_toConsumableArray(quickSort(nums.filter(function (v) {
|
||||||
return desc ? v > n : v <= n;
|
return desc ? v > n : v <= n;
|
||||||
@ -2870,18 +2881,18 @@
|
|||||||
return Math.pow(a, b);
|
return Math.pow(a, b);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var _ref33 = [[], rpn.replace(/\^/g, '**').split(/\s+/g).filter(function (el) {
|
var _ref35 = [[], rpn.replace(/\^/g, '**').split(/\s+/g).filter(function (el) {
|
||||||
return !/\s+/.test(el) && el !== '';
|
return !/\s+/.test(el) && el !== '';
|
||||||
})],
|
})],
|
||||||
stack = _ref33[0],
|
stack = _ref35[0],
|
||||||
solve = _ref33[1];
|
solve = _ref35[1];
|
||||||
solve.forEach(function (symbol) {
|
solve.forEach(function (symbol) {
|
||||||
if (!isNaN(parseFloat(symbol)) && isFinite(symbol)) {
|
if (!isNaN(parseFloat(symbol)) && isFinite(symbol)) {
|
||||||
stack.push(symbol);
|
stack.push(symbol);
|
||||||
} else if (Object.keys(OPERATORS).includes(symbol)) {
|
} else if (Object.keys(OPERATORS).includes(symbol)) {
|
||||||
var _ref34 = [stack.pop(), stack.pop()],
|
var _ref36 = [stack.pop(), stack.pop()],
|
||||||
a = _ref34[0],
|
a = _ref36[0],
|
||||||
b = _ref34[1];
|
b = _ref36[1];
|
||||||
stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a)));
|
stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a)));
|
||||||
} else {
|
} else {
|
||||||
throw "".concat(symbol, " is not a recognized symbol");
|
throw "".concat(symbol, " is not a recognized symbol");
|
||||||
@ -3118,6 +3129,7 @@
|
|||||||
exports.nthElement = nthElement;
|
exports.nthElement = nthElement;
|
||||||
exports.objectFromPairs = objectFromPairs;
|
exports.objectFromPairs = objectFromPairs;
|
||||||
exports.objectToPairs = objectToPairs;
|
exports.objectToPairs = objectToPairs;
|
||||||
|
exports.objectToQueryString = objectToQueryString;
|
||||||
exports.observeMutations = observeMutations;
|
exports.observeMutations = observeMutations;
|
||||||
exports.off = off;
|
exports.off = off;
|
||||||
exports.offset = offset;
|
exports.offset = offset;
|
||||||
|
|||||||
2
dist/_30s.es5.min.js
vendored
2
dist/_30s.es5.min.js
vendored
File diff suppressed because one or more lines are too long
48
dist/_30s.esm.js
vendored
48
dist/_30s.esm.js
vendored
@ -198,8 +198,8 @@ const deepClone = obj => {
|
|||||||
return Array.isArray(obj) && obj.length
|
return Array.isArray(obj) && obj.length
|
||||||
? (clone.length = obj.length) && Array.from(clone)
|
? (clone.length = obj.length) && Array.from(clone)
|
||||||
: Array.isArray(obj)
|
: Array.isArray(obj)
|
||||||
? Array.from(obj)
|
? Array.from(obj)
|
||||||
: clone;
|
: clone;
|
||||||
};
|
};
|
||||||
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
||||||
const deepFreeze = obj =>
|
const deepFreeze = obj =>
|
||||||
@ -211,13 +211,13 @@ const deepMapKeys = (obj, f) =>
|
|||||||
Array.isArray(obj)
|
Array.isArray(obj)
|
||||||
? obj.map(val => deepMapKeys(val, f))
|
? obj.map(val => deepMapKeys(val, f))
|
||||||
: typeof obj === 'object'
|
: typeof obj === 'object'
|
||||||
? Object.keys(obj).reduce((acc, current) => {
|
? Object.keys(obj).reduce((acc, current) => {
|
||||||
const val = obj[current];
|
const val = obj[current];
|
||||||
acc[f(current)] =
|
acc[f(current)] =
|
||||||
val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
|
val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: obj;
|
: obj;
|
||||||
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
||||||
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
||||||
const degreesToRads = deg => (deg * Math.PI) / 180.0;
|
const degreesToRads = deg => (deg * Math.PI) / 180.0;
|
||||||
@ -239,9 +239,9 @@ const dig = (obj, target) =>
|
|||||||
target in obj
|
target in obj
|
||||||
? obj[target]
|
? obj[target]
|
||||||
: Object.values(obj).reduce((acc, val) => {
|
: Object.values(obj).reduce((acc, val) => {
|
||||||
if (acc !== undefined) return acc;
|
if (acc !== undefined) return acc;
|
||||||
if (typeof val === 'object') return dig(val, target);
|
if (typeof val === 'object') return dig(val, target);
|
||||||
}, undefined);
|
}, undefined);
|
||||||
const digitize = n => [...`${n}`].map(i => parseInt(i));
|
const digitize = n => [...`${n}`].map(i => parseInt(i));
|
||||||
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
|
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
|
||||||
const drop = (arr, n = 1) => arr.slice(n);
|
const drop = (arr, n = 1) => arr.slice(n);
|
||||||
@ -313,11 +313,11 @@ const extendHex = shortHex =>
|
|||||||
const factorial = n =>
|
const factorial = n =>
|
||||||
n < 0
|
n < 0
|
||||||
? (() => {
|
? (() => {
|
||||||
throw new TypeError('Negative numbers are not allowed!');
|
throw new TypeError('Negative numbers are not allowed!');
|
||||||
})()
|
})()
|
||||||
: n <= 1
|
: n <= 1
|
||||||
? 1
|
? 1
|
||||||
: n * factorial(n - 1);
|
: n * factorial(n - 1);
|
||||||
const fibonacci = n =>
|
const fibonacci = n =>
|
||||||
Array.from({ length: n }).reduce(
|
Array.from({ length: n }).reduce(
|
||||||
(acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
|
(acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
|
||||||
@ -418,10 +418,10 @@ const getMeridiemSuffixOfInteger = num =>
|
|||||||
num === 0 || num === 24
|
num === 0 || num === 24
|
||||||
? 12 + 'am'
|
? 12 + 'am'
|
||||||
: num === 12
|
: num === 12
|
||||||
? 12 + 'pm'
|
? 12 + 'pm'
|
||||||
: num < 12
|
: num < 12
|
||||||
? (num % 12) + 'am'
|
? (num % 12) + 'am'
|
||||||
: (num % 12) + 'pm';
|
: (num % 12) + 'pm';
|
||||||
const getScrollPosition = (el = window) => ({
|
const getScrollPosition = (el = window) => ({
|
||||||
x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
|
x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
|
||||||
y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
|
y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
|
||||||
@ -467,8 +467,7 @@ const hashNode = val =>
|
|||||||
const hasKey = (obj, key) => {
|
const hasKey = (obj, key) => {
|
||||||
if (key.includes('.')) {
|
if (key.includes('.')) {
|
||||||
let _key = key.split('.')[0];
|
let _key = key.split('.')[0];
|
||||||
if (typeof obj[_key] === 'object')
|
if (typeof obj[_key] === 'object') return hasKey(obj[_key], key.slice(key.indexOf('.') + 1));
|
||||||
return hasKey(obj[_key], key.slice(key.indexOf('.') + 1));
|
|
||||||
}
|
}
|
||||||
return Object.keys(obj).includes(key);
|
return Object.keys(obj).includes(key);
|
||||||
};
|
};
|
||||||
@ -650,8 +649,8 @@ const join = (arr, separator = ',', end = separator) =>
|
|||||||
i === arr.length - 2
|
i === arr.length - 2
|
||||||
? acc + val + end
|
? acc + val + end
|
||||||
: i === arr.length - 1
|
: i === arr.length - 1
|
||||||
? acc + val
|
? acc + val
|
||||||
: acc + val + separator,
|
: acc + val + separator,
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
||||||
@ -766,6 +765,15 @@ const nthArg = n => (...args) => args.slice(n)[0];
|
|||||||
const nthElement = (arr, n = 0) => (n === -1 ? arr.slice(n) : arr.slice(n, n + 1))[0];
|
const nthElement = (arr, n = 0) => (n === -1 ? arr.slice(n) : arr.slice(n, n + 1))[0];
|
||||||
const objectFromPairs = arr => arr.reduce((a, [key, val]) => ((a[key] = val), a), {});
|
const objectFromPairs = arr => arr.reduce((a, [key, val]) => ((a[key] = val), a), {});
|
||||||
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
|
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
|
||||||
|
const objectToQueryString = queryParameters => {
|
||||||
|
return queryParameters
|
||||||
|
? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {
|
||||||
|
const symbol = index === 0 ? '?' : '&';
|
||||||
|
queryString += (typeof val === 'string') ? `${symbol}${key}=${val}` : '';
|
||||||
|
return queryString;
|
||||||
|
}, '')
|
||||||
|
: '';
|
||||||
|
};
|
||||||
const observeMutations = (element, callback, options) => {
|
const observeMutations = (element, callback, options) => {
|
||||||
const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)));
|
const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)));
|
||||||
observer.observe(
|
observer.observe(
|
||||||
@ -1547,4 +1555,4 @@ const speechSynthesis = message => {
|
|||||||
};
|
};
|
||||||
const squareSum = (...args) => args.reduce((squareSum, number) => squareSum + Math.pow(number, 2), 0);
|
const squareSum = (...args) => args.reduce((squareSum, number) => squareSum + Math.pow(number, 2), 0);
|
||||||
|
|
||||||
export { all, allEqual, any, approximatelyEqual, arrayToCSV, arrayToHtmlList, ary, atob, attempt, average, averageBy, bifurcate, bifurcateBy, bind, bindAll, bindKey, binomialCoefficient, bottomVisible, btoa, byteSize, call, capitalize, capitalizeEveryWord, castArray, chainAsync, checkProp, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compactWhitespace, compose, composeRight, converge, copyToClipboard, countBy, counter, countOccurrences, createDirIfNotExists, createElement, createEventHub, CSVToArray, CSVToJSON, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, deepGet, deepMapKeys, defaults, defer, degreesToRads, delay, detectDeviceType, difference, differenceBy, differenceWith, dig, digitize, distance, drop, dropRight, dropRightWhile, dropWhile, elementContains, elementIsVisibleInViewport, elo, equals, escapeHTML, escapeRegExp, everyNth, extendHex, factorial, fibonacci, filterFalsy, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, formatDuration, formToObject, forOwn, forOwnRight, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, hasKey, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, inRange, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isOdd, isPlainObject, isPrime, isPrimitive, isPromiseLike, isReadableStream, isSameDate, isSorted, isStream, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, isWeekday, isWeekend, isWritableStream, join, JSONtoCSV, JSONToFile, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapNumRange, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, midpoint, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, observeMutations, off, offset, omit, omitBy, on, once, onUserInputChange, orderBy, over, overArgs, pad, palindrome, parseCookie, partial, partialRight, partition, percentile, permutations, pick, pickBy, pipeAsyncFunctions, pipeFunctions, pluralize, powerset, prefix, prettyBytes, primes, promisify, pull, pullAtIndex, pullAtValue, pullBy, radsToDegrees, randomHexColorCode, randomIntArrayInRange, randomIntegerInRange, randomNumberInRange, readFileLines, rearg, recordAnimationFrames, redirect, reducedFilter, reduceSuccessive, reduceWhich, reject, remove, removeNonASCII, renameKeys, reverseString, RGBToHex, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, serializeForm, setStyle, shallowClone, shank, show, shuffle, similarity, size, sleep, smoothScroll, sortCharactersInString, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, splitLines, spreadOver, stableSort, standardDeviation, stringPermutations, stripHTMLTags, sum, sumBy, sumPower, symmetricDifference, symmetricDifferenceBy, symmetricDifferenceWith, tail, take, takeRight, takeRightWhile, takeWhile, throttle, times, timeTaken, toCamelCase, toCurrency, toDecimalMark, toggleClass, toHash, toKebabCase, tomorrow, toOrdinalSuffix, toSafeInteger, toSnakeCase, toTitleCase, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, validateNumber, vectorDistance, when, without, words, xProd, yesNo, yesterday, zip, zipObject, zipWith, binarySearch, celsiusToFahrenheit, cleanObj, collatz, countVowels, factors, fahrenheitToCelsius, fibonacciCountUntilNum, fibonacciUntilNum, heronArea, howManyTimes, httpDelete, httpPut, isArmstrongNumber, isSimilar, JSONToDate, kmphToMph, levenshteinDistance, mphToKmph, pipeLog, quickSort, removeVowels, solveRPN, speechSynthesis, squareSum };
|
export { all, allEqual, any, approximatelyEqual, arrayToCSV, arrayToHtmlList, ary, atob, attempt, average, averageBy, bifurcate, bifurcateBy, bind, bindAll, bindKey, binomialCoefficient, bottomVisible, btoa, byteSize, call, capitalize, capitalizeEveryWord, castArray, chainAsync, checkProp, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compactWhitespace, compose, composeRight, converge, copyToClipboard, countBy, counter, countOccurrences, createDirIfNotExists, createElement, createEventHub, CSVToArray, CSVToJSON, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, deepGet, deepMapKeys, defaults, defer, degreesToRads, delay, detectDeviceType, difference, differenceBy, differenceWith, dig, digitize, distance, drop, dropRight, dropRightWhile, dropWhile, elementContains, elementIsVisibleInViewport, elo, equals, escapeHTML, escapeRegExp, everyNth, extendHex, factorial, fibonacci, filterFalsy, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, formatDuration, formToObject, forOwn, forOwnRight, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, hasKey, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, inRange, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isOdd, isPlainObject, isPrime, isPrimitive, isPromiseLike, isReadableStream, isSameDate, isSorted, isStream, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, isWeekday, isWeekend, isWritableStream, join, JSONtoCSV, JSONToFile, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapNumRange, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, midpoint, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, objectToQueryString, observeMutations, off, offset, omit, omitBy, on, once, onUserInputChange, orderBy, over, overArgs, pad, palindrome, parseCookie, partial, partialRight, partition, percentile, permutations, pick, pickBy, pipeAsyncFunctions, pipeFunctions, pluralize, powerset, prefix, prettyBytes, primes, promisify, pull, pullAtIndex, pullAtValue, pullBy, radsToDegrees, randomHexColorCode, randomIntArrayInRange, randomIntegerInRange, randomNumberInRange, readFileLines, rearg, recordAnimationFrames, redirect, reducedFilter, reduceSuccessive, reduceWhich, reject, remove, removeNonASCII, renameKeys, reverseString, RGBToHex, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, serializeForm, setStyle, shallowClone, shank, show, shuffle, similarity, size, sleep, smoothScroll, sortCharactersInString, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, splitLines, spreadOver, stableSort, standardDeviation, stringPermutations, stripHTMLTags, sum, sumBy, sumPower, symmetricDifference, symmetricDifferenceBy, symmetricDifferenceWith, tail, take, takeRight, takeRightWhile, takeWhile, throttle, times, timeTaken, toCamelCase, toCurrency, toDecimalMark, toggleClass, toHash, toKebabCase, tomorrow, toOrdinalSuffix, toSafeInteger, toSnakeCase, toTitleCase, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, validateNumber, vectorDistance, when, without, words, xProd, yesNo, yesterday, zip, zipObject, zipWith, binarySearch, celsiusToFahrenheit, cleanObj, collatz, countVowels, factors, fahrenheitToCelsius, fibonacciCountUntilNum, fibonacciUntilNum, heronArea, howManyTimes, httpDelete, httpPut, isArmstrongNumber, isSimilar, JSONToDate, kmphToMph, levenshteinDistance, mphToKmph, pipeLog, quickSort, removeVowels, solveRPN, speechSynthesis, squareSum };
|
||||||
|
|||||||
47
dist/_30s.js
vendored
47
dist/_30s.js
vendored
@ -204,8 +204,8 @@
|
|||||||
return Array.isArray(obj) && obj.length
|
return Array.isArray(obj) && obj.length
|
||||||
? (clone.length = obj.length) && Array.from(clone)
|
? (clone.length = obj.length) && Array.from(clone)
|
||||||
: Array.isArray(obj)
|
: Array.isArray(obj)
|
||||||
? Array.from(obj)
|
? Array.from(obj)
|
||||||
: clone;
|
: clone;
|
||||||
};
|
};
|
||||||
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
||||||
const deepFreeze = obj =>
|
const deepFreeze = obj =>
|
||||||
@ -217,13 +217,13 @@
|
|||||||
Array.isArray(obj)
|
Array.isArray(obj)
|
||||||
? obj.map(val => deepMapKeys(val, f))
|
? obj.map(val => deepMapKeys(val, f))
|
||||||
: typeof obj === 'object'
|
: typeof obj === 'object'
|
||||||
? Object.keys(obj).reduce((acc, current) => {
|
? Object.keys(obj).reduce((acc, current) => {
|
||||||
const val = obj[current];
|
const val = obj[current];
|
||||||
acc[f(current)] =
|
acc[f(current)] =
|
||||||
val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
|
val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: obj;
|
: obj;
|
||||||
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
||||||
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
||||||
const degreesToRads = deg => (deg * Math.PI) / 180.0;
|
const degreesToRads = deg => (deg * Math.PI) / 180.0;
|
||||||
@ -245,9 +245,9 @@
|
|||||||
target in obj
|
target in obj
|
||||||
? obj[target]
|
? obj[target]
|
||||||
: Object.values(obj).reduce((acc, val) => {
|
: Object.values(obj).reduce((acc, val) => {
|
||||||
if (acc !== undefined) return acc;
|
if (acc !== undefined) return acc;
|
||||||
if (typeof val === 'object') return dig(val, target);
|
if (typeof val === 'object') return dig(val, target);
|
||||||
}, undefined);
|
}, undefined);
|
||||||
const digitize = n => [...`${n}`].map(i => parseInt(i));
|
const digitize = n => [...`${n}`].map(i => parseInt(i));
|
||||||
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
|
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
|
||||||
const drop = (arr, n = 1) => arr.slice(n);
|
const drop = (arr, n = 1) => arr.slice(n);
|
||||||
@ -319,11 +319,11 @@
|
|||||||
const factorial = n =>
|
const factorial = n =>
|
||||||
n < 0
|
n < 0
|
||||||
? (() => {
|
? (() => {
|
||||||
throw new TypeError('Negative numbers are not allowed!');
|
throw new TypeError('Negative numbers are not allowed!');
|
||||||
})()
|
})()
|
||||||
: n <= 1
|
: n <= 1
|
||||||
? 1
|
? 1
|
||||||
: n * factorial(n - 1);
|
: n * factorial(n - 1);
|
||||||
const fibonacci = n =>
|
const fibonacci = n =>
|
||||||
Array.from({ length: n }).reduce(
|
Array.from({ length: n }).reduce(
|
||||||
(acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
|
(acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
|
||||||
@ -424,10 +424,10 @@
|
|||||||
num === 0 || num === 24
|
num === 0 || num === 24
|
||||||
? 12 + 'am'
|
? 12 + 'am'
|
||||||
: num === 12
|
: num === 12
|
||||||
? 12 + 'pm'
|
? 12 + 'pm'
|
||||||
: num < 12
|
: num < 12
|
||||||
? (num % 12) + 'am'
|
? (num % 12) + 'am'
|
||||||
: (num % 12) + 'pm';
|
: (num % 12) + 'pm';
|
||||||
const getScrollPosition = (el = window) => ({
|
const getScrollPosition = (el = window) => ({
|
||||||
x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
|
x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
|
||||||
y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
|
y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
|
||||||
@ -473,8 +473,7 @@
|
|||||||
const hasKey = (obj, key) => {
|
const hasKey = (obj, key) => {
|
||||||
if (key.includes('.')) {
|
if (key.includes('.')) {
|
||||||
let _key = key.split('.')[0];
|
let _key = key.split('.')[0];
|
||||||
if (typeof obj[_key] === 'object')
|
if (typeof obj[_key] === 'object') return hasKey(obj[_key], key.slice(key.indexOf('.') + 1));
|
||||||
return hasKey(obj[_key], key.slice(key.indexOf('.') + 1));
|
|
||||||
}
|
}
|
||||||
return Object.keys(obj).includes(key);
|
return Object.keys(obj).includes(key);
|
||||||
};
|
};
|
||||||
@ -656,8 +655,8 @@
|
|||||||
i === arr.length - 2
|
i === arr.length - 2
|
||||||
? acc + val + end
|
? acc + val + end
|
||||||
: i === arr.length - 1
|
: i === arr.length - 1
|
||||||
? acc + val
|
? acc + val
|
||||||
: acc + val + separator,
|
: acc + val + separator,
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
||||||
@ -772,6 +771,15 @@
|
|||||||
const nthElement = (arr, n = 0) => (n === -1 ? arr.slice(n) : arr.slice(n, n + 1))[0];
|
const nthElement = (arr, n = 0) => (n === -1 ? arr.slice(n) : arr.slice(n, n + 1))[0];
|
||||||
const objectFromPairs = arr => arr.reduce((a, [key, val]) => ((a[key] = val), a), {});
|
const objectFromPairs = arr => arr.reduce((a, [key, val]) => ((a[key] = val), a), {});
|
||||||
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
|
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
|
||||||
|
const objectToQueryString = queryParameters => {
|
||||||
|
return queryParameters
|
||||||
|
? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {
|
||||||
|
const symbol = index === 0 ? '?' : '&';
|
||||||
|
queryString += (typeof val === 'string') ? `${symbol}${key}=${val}` : '';
|
||||||
|
return queryString;
|
||||||
|
}, '')
|
||||||
|
: '';
|
||||||
|
};
|
||||||
const observeMutations = (element, callback, options) => {
|
const observeMutations = (element, callback, options) => {
|
||||||
const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)));
|
const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)));
|
||||||
observer.observe(
|
observer.observe(
|
||||||
@ -1767,6 +1775,7 @@
|
|||||||
exports.nthElement = nthElement;
|
exports.nthElement = nthElement;
|
||||||
exports.objectFromPairs = objectFromPairs;
|
exports.objectFromPairs = objectFromPairs;
|
||||||
exports.objectToPairs = objectToPairs;
|
exports.objectToPairs = objectToPairs;
|
||||||
|
exports.objectToQueryString = objectToQueryString;
|
||||||
exports.observeMutations = observeMutations;
|
exports.observeMutations = observeMutations;
|
||||||
exports.off = off;
|
exports.off = off;
|
||||||
exports.offset = offset;
|
exports.offset = offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user