Travis build: 1684 [cron]
This commit is contained in:
134
dist/_30s.es5.js
vendored
134
dist/_30s.es5.js
vendored
@ -1009,6 +1009,45 @@
|
||||
return true;
|
||||
});
|
||||
};
|
||||
var haveSameContents = function haveSameContents(a, b) {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var v = _step2.value;
|
||||
if (a.filter(function (e) {
|
||||
return e === v;
|
||||
}).length !== b.filter(function (e) {
|
||||
return e === v;
|
||||
}).length) return {
|
||||
v: false
|
||||
};
|
||||
};
|
||||
|
||||
for (var _iterator = new Set([].concat(_toConsumableArray(a), _toConsumableArray(b)))[Symbol.iterator](), _step2; !(_iteratorNormalCompletion = (_step2 = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var _ret = _loop();
|
||||
|
||||
if (_typeof(_ret) === "object") return _ret.v;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
var head = function head(arr) {
|
||||
return arr && arr.length ? arr[0] : undefined;
|
||||
};
|
||||
@ -1214,6 +1253,47 @@
|
||||
var isBrowserTabFocused = function isBrowserTabFocused() {
|
||||
return !document.hidden;
|
||||
};
|
||||
var isContainedIn = function isContainedIn(a, b) {
|
||||
var _iteratorNormalCompletion2 = true;
|
||||
var _didIteratorError2 = false;
|
||||
var _iteratorError2 = undefined;
|
||||
|
||||
try {
|
||||
var _loop2 = function _loop2() {
|
||||
var v = _step3.value;
|
||||
if (!b.some(function (e) {
|
||||
return e === v;
|
||||
}) || a.filter(function (e) {
|
||||
return e === v;
|
||||
}).length > b.filter(function (e) {
|
||||
return e === v;
|
||||
}).length) return {
|
||||
v: false
|
||||
};
|
||||
};
|
||||
|
||||
for (var _iterator2 = new Set(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion2 = (_step3 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
||||
var _ret2 = _loop2();
|
||||
|
||||
if (_typeof(_ret2) === "object") return _ret2.v;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError2 = true;
|
||||
_iteratorError2 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
|
||||
_iterator2["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError2) {
|
||||
throw _iteratorError2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
var isDivisible = function isDivisible(dividend, divisor) {
|
||||
return dividend % divisor === 0;
|
||||
};
|
||||
@ -1282,30 +1362,30 @@
|
||||
};
|
||||
var isSorted = function isSorted(arr) {
|
||||
var direction = -(arr[0] - arr[1]);
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
var _iteratorNormalCompletion3 = true;
|
||||
var _didIteratorError3 = false;
|
||||
var _iteratorError3 = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = arr.entries()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion = (_step2 = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var _step2$value = _slicedToArray(_step2.value, 2),
|
||||
i = _step2$value[0],
|
||||
val = _step2$value[1];
|
||||
for (var _iterator3 = arr.entries()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion3 = (_step4 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
||||
var _step4$value = _slicedToArray(_step4.value, 2),
|
||||
i = _step4$value[0],
|
||||
val = _step4$value[1];
|
||||
|
||||
direction = !direction ? -(arr[i - 1] - arr[i]) : direction;
|
||||
if (i === arr.length - 1) return !direction ? 0 : direction;else if ((val - arr[i + 1]) * direction > 0) return 0;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
_didIteratorError3 = true;
|
||||
_iteratorError3 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
||||
_iterator["return"]();
|
||||
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
|
||||
_iterator3["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
if (_didIteratorError3) {
|
||||
throw _iteratorError3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2335,29 +2415,29 @@
|
||||
}, []);
|
||||
};
|
||||
var takeWhile = function takeWhile(arr, func) {
|
||||
var _iteratorNormalCompletion2 = true;
|
||||
var _didIteratorError2 = false;
|
||||
var _iteratorError2 = undefined;
|
||||
var _iteratorNormalCompletion4 = true;
|
||||
var _didIteratorError4 = false;
|
||||
var _iteratorError4 = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator2 = arr.entries()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion2 = (_step3 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
||||
var _step3$value = _slicedToArray(_step3.value, 2),
|
||||
i = _step3$value[0],
|
||||
val = _step3$value[1];
|
||||
for (var _iterator4 = arr.entries()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion4 = (_step5 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
||||
var _step5$value = _slicedToArray(_step5.value, 2),
|
||||
i = _step5$value[0],
|
||||
val = _step5$value[1];
|
||||
|
||||
if (func(val)) return arr.slice(0, i);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError2 = true;
|
||||
_iteratorError2 = err;
|
||||
_didIteratorError4 = true;
|
||||
_iteratorError4 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
|
||||
_iterator2["return"]();
|
||||
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
|
||||
_iterator4["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError2) {
|
||||
throw _iteratorError2;
|
||||
if (_didIteratorError4) {
|
||||
throw _iteratorError4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3068,6 +3148,7 @@
|
||||
exports.hashBrowser = hashBrowser;
|
||||
exports.hashNode = hashNode;
|
||||
exports.hasKey = hasKey;
|
||||
exports.haveSameContents = haveSameContents;
|
||||
exports.head = head;
|
||||
exports.hexToRGB = hexToRGB;
|
||||
exports.hide = hide;
|
||||
@ -3101,6 +3182,7 @@
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isBrowser = isBrowser;
|
||||
exports.isBrowserTabFocused = isBrowserTabFocused;
|
||||
exports.isContainedIn = isContainedIn;
|
||||
exports.isDivisible = isDivisible;
|
||||
exports.isDuplexStream = isDuplexStream;
|
||||
exports.isEmpty = isEmpty;
|
||||
|
||||
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
43
dist/_30s.esm.js
vendored
43
dist/_30s.esm.js
vendored
@ -479,6 +479,11 @@ const hasKey = (obj, keys) => {
|
||||
})
|
||||
);
|
||||
};
|
||||
const haveSameContents = (a, b) => {
|
||||
for (const v of new Set([...a, ...b]))
|
||||
if (a.filter(e => e === v).length !== b.filter(e => e === v).length) return false;
|
||||
return true;
|
||||
};
|
||||
const head = arr => (arr && arr.length ? arr[0] : undefined);
|
||||
const hexToRGB = hex => {
|
||||
let alpha = false,
|
||||
@ -581,6 +586,16 @@ const isBeforeDate = (dateA, dateB) => dateA < dateB;
|
||||
const isBoolean = val => typeof val === 'boolean';
|
||||
const isBrowser = () => ![typeof window, typeof document].includes('undefined');
|
||||
const isBrowserTabFocused = () => !document.hidden;
|
||||
const isContainedIn = (a, b) => {
|
||||
for (const v of new Set(a)) {
|
||||
if (
|
||||
!b.some(e => e === v) ||
|
||||
a.filter(e => e === v).length > b.filter(e => e === v).length
|
||||
)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
|
||||
const isDuplexStream = val =>
|
||||
val !== null &&
|
||||
@ -660,8 +675,8 @@ const join = (arr, separator = ',', end = separator) =>
|
||||
i === arr.length - 2
|
||||
? acc + val + end
|
||||
: i === arr.length - 1
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
''
|
||||
);
|
||||
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
||||
@ -786,10 +801,10 @@ 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 = queryString.length === 0 ? '?' : '&';
|
||||
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
|
||||
return queryString;
|
||||
}, '')
|
||||
const symbol = queryString.length === 0 ? '?' : '&';
|
||||
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
|
||||
return queryString;
|
||||
}, '')
|
||||
: '';
|
||||
};
|
||||
const observeMutations = (element, callback, options) => {
|
||||
@ -1020,9 +1035,9 @@ const reject = (pred, array) => array.filter((...args) => !pred(...args));
|
||||
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) =>
|
||||
@ -1100,10 +1115,10 @@ const size = val =>
|
||||
Array.isArray(val)
|
||||
? val.length
|
||||
: val && typeof val === 'object'
|
||||
? val.size || val.length || Object.keys(val).length
|
||||
: typeof val === 'string'
|
||||
? new Blob([val]).size
|
||||
: 0;
|
||||
? val.size || val.length || Object.keys(val).length
|
||||
: typeof val === 'string'
|
||||
? new Blob([val]).size
|
||||
: 0;
|
||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
const smoothScroll = element =>
|
||||
document.querySelector(element).scrollIntoView({
|
||||
@ -1581,4 +1596,4 @@ const speechSynthesis = message => {
|
||||
};
|
||||
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, frequencies, 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, includesAll, includesAny, 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, isPowerOfTwo, 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, mostFrequent, 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, weightedSample, 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, frequencies, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, hasKey, haveSameContents, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, includesAll, includesAny, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, inRange, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isContainedIn, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isOdd, isPlainObject, isPowerOfTwo, 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, mostFrequent, 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, weightedSample, 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 };
|
||||
|
||||
43
dist/_30s.js
vendored
43
dist/_30s.js
vendored
@ -485,6 +485,11 @@
|
||||
})
|
||||
);
|
||||
};
|
||||
const haveSameContents = (a, b) => {
|
||||
for (const v of new Set([...a, ...b]))
|
||||
if (a.filter(e => e === v).length !== b.filter(e => e === v).length) return false;
|
||||
return true;
|
||||
};
|
||||
const head = arr => (arr && arr.length ? arr[0] : undefined);
|
||||
const hexToRGB = hex => {
|
||||
let alpha = false,
|
||||
@ -587,6 +592,16 @@
|
||||
const isBoolean = val => typeof val === 'boolean';
|
||||
const isBrowser = () => ![typeof window, typeof document].includes('undefined');
|
||||
const isBrowserTabFocused = () => !document.hidden;
|
||||
const isContainedIn = (a, b) => {
|
||||
for (const v of new Set(a)) {
|
||||
if (
|
||||
!b.some(e => e === v) ||
|
||||
a.filter(e => e === v).length > b.filter(e => e === v).length
|
||||
)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
|
||||
const isDuplexStream = val =>
|
||||
val !== null &&
|
||||
@ -666,8 +681,8 @@
|
||||
i === arr.length - 2
|
||||
? acc + val + end
|
||||
: i === arr.length - 1
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
''
|
||||
);
|
||||
const JSONtoCSV = (arr, columns, delimiter = ',') =>
|
||||
@ -792,10 +807,10 @@
|
||||
const objectToQueryString = queryParameters => {
|
||||
return queryParameters
|
||||
? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {
|
||||
const symbol = queryString.length === 0 ? '?' : '&';
|
||||
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
|
||||
return queryString;
|
||||
}, '')
|
||||
const symbol = queryString.length === 0 ? '?' : '&';
|
||||
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
|
||||
return queryString;
|
||||
}, '')
|
||||
: '';
|
||||
};
|
||||
const observeMutations = (element, callback, options) => {
|
||||
@ -1026,9 +1041,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) =>
|
||||
@ -1106,10 +1121,10 @@
|
||||
Array.isArray(val)
|
||||
? val.length
|
||||
: val && typeof val === 'object'
|
||||
? val.size || val.length || Object.keys(val).length
|
||||
: typeof val === 'string'
|
||||
? new Blob([val]).size
|
||||
: 0;
|
||||
? val.size || val.length || Object.keys(val).length
|
||||
: typeof val === 'string'
|
||||
? new Blob([val]).size
|
||||
: 0;
|
||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
const smoothScroll = element =>
|
||||
document.querySelector(element).scrollIntoView({
|
||||
@ -1706,6 +1721,7 @@
|
||||
exports.hashBrowser = hashBrowser;
|
||||
exports.hashNode = hashNode;
|
||||
exports.hasKey = hasKey;
|
||||
exports.haveSameContents = haveSameContents;
|
||||
exports.head = head;
|
||||
exports.hexToRGB = hexToRGB;
|
||||
exports.hide = hide;
|
||||
@ -1739,6 +1755,7 @@
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isBrowser = isBrowser;
|
||||
exports.isBrowserTabFocused = isBrowserTabFocused;
|
||||
exports.isContainedIn = isContainedIn;
|
||||
exports.isDivisible = isDivisible;
|
||||
exports.isDuplexStream = isDuplexStream;
|
||||
exports.isEmpty = isEmpty;
|
||||
|
||||
Reference in New Issue
Block a user