Travis build: 613 [custom]
This commit is contained in:
66
dist/_30s.es5.js
vendored
66
dist/_30s.es5.js
vendored
@ -223,7 +223,7 @@
|
||||
};
|
||||
|
||||
var atob = function atob(str) {
|
||||
return new Buffer(str, 'base64').toString('binary');
|
||||
return Buffer.from(str, 'base64').toString('binary');
|
||||
};
|
||||
|
||||
var attempt = function attempt(fn) {
|
||||
@ -328,7 +328,7 @@
|
||||
};
|
||||
|
||||
var btoa = function btoa(str) {
|
||||
return new Buffer(str, 'binary').toString('base64');
|
||||
return Buffer.from(str, 'binary').toString('base64');
|
||||
};
|
||||
|
||||
var byteSize = function byteSize(str) {
|
||||
@ -1007,6 +1007,16 @@
|
||||
return (dateFinal - dateInitial) / (1000 * 3600 * 24);
|
||||
};
|
||||
|
||||
var getImages = function getImages(el) {
|
||||
var includeDuplicates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
|
||||
var images = _toConsumableArray(el.getElementsByTagName('img')).map(function (img) {
|
||||
return img.getAttribute('src');
|
||||
});
|
||||
|
||||
return includeDuplicates ? images : _toConsumableArray(new Set(images));
|
||||
};
|
||||
|
||||
var getMeridiemSuffixOfInteger = function getMeridiemSuffixOfInteger(num) {
|
||||
return num === 0 || num === 24 ? 12 + 'am' : num === 12 ? 12 + 'pm' : num < 12 ? num % 12 + 'am' : num % 12 + 'pm';
|
||||
};
|
||||
@ -1309,6 +1319,10 @@
|
||||
return dividend % divisor === 0;
|
||||
};
|
||||
|
||||
var isDuplexStream = function isDuplexStream(val) {
|
||||
return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._read === 'function' && _typeof(val._readableState) === 'object' && typeof val._write === 'function' && _typeof(val._writableState) === 'object';
|
||||
};
|
||||
|
||||
var isEmpty = function isEmpty(val) {
|
||||
return val == null || !(Object.keys(val) || val).length;
|
||||
};
|
||||
@ -1367,6 +1381,10 @@
|
||||
return obj !== null && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
||||
};
|
||||
|
||||
var isReadableStream = function isReadableStream(val) {
|
||||
return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._read === 'function' && _typeof(val._readableState) === 'object';
|
||||
};
|
||||
|
||||
var isSameDate = function isSameDate(dateA, dateB) {
|
||||
return dateA.toISOString() === dateB.toISOString();
|
||||
};
|
||||
@ -1402,6 +1420,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
var isStream = function isStream(val) {
|
||||
return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function';
|
||||
};
|
||||
|
||||
var isString = function isString(val) {
|
||||
return typeof val === 'string';
|
||||
};
|
||||
@ -1431,6 +1453,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
var isWritableStream = function isWritableStream(val) {
|
||||
return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._write === 'function' && _typeof(val._writableState) === 'object';
|
||||
};
|
||||
|
||||
var join = function join(arr) {
|
||||
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
||||
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : separator;
|
||||
@ -2493,31 +2519,9 @@
|
||||
};
|
||||
|
||||
var takeRightWhile = function takeRightWhile(arr, func) {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = arr.reverse().keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var i = _step.value;
|
||||
if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
return arr.reduceRight(function (acc, el) {
|
||||
return func(el) ? acc : [el].concat(_toConsumableArray(acc));
|
||||
}, []);
|
||||
};
|
||||
|
||||
var takeWhile = function takeWhile(arr, func) {
|
||||
@ -2655,8 +2659,7 @@
|
||||
}, acc);
|
||||
};
|
||||
|
||||
var triggerEvent = function triggerEvent(el, eventType) {
|
||||
var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
||||
var triggerEvent = function triggerEvent(el, eventType, detail) {
|
||||
return el.dispatchEvent(new CustomEvent(eventType, {
|
||||
detail: detail
|
||||
}));
|
||||
@ -3005,6 +3008,7 @@
|
||||
exports.get = get;
|
||||
exports.getColonTimeFromDate = getColonTimeFromDate;
|
||||
exports.getDaysDiffBetweenDates = getDaysDiffBetweenDates;
|
||||
exports.getImages = getImages;
|
||||
exports.getMeridiemSuffixOfInteger = getMeridiemSuffixOfInteger;
|
||||
exports.getScrollPosition = getScrollPosition;
|
||||
exports.getStyle = getStyle;
|
||||
@ -3048,6 +3052,7 @@
|
||||
exports.isBrowser = isBrowser;
|
||||
exports.isBrowserTabFocused = isBrowserTabFocused;
|
||||
exports.isDivisible = isDivisible;
|
||||
exports.isDuplexStream = isDuplexStream;
|
||||
exports.isEmpty = isEmpty;
|
||||
exports.isEven = isEven;
|
||||
exports.isFunction = isFunction;
|
||||
@ -3061,14 +3066,17 @@
|
||||
exports.isPrime = isPrime;
|
||||
exports.isPrimitive = isPrimitive;
|
||||
exports.isPromiseLike = isPromiseLike;
|
||||
exports.isReadableStream = isReadableStream;
|
||||
exports.isSameDate = isSameDate;
|
||||
exports.isSorted = isSorted;
|
||||
exports.isStream = isStream;
|
||||
exports.isString = isString;
|
||||
exports.isSymbol = isSymbol;
|
||||
exports.isTravisCI = isTravisCI;
|
||||
exports.isUndefined = isUndefined;
|
||||
exports.isUpperCase = isUpperCase;
|
||||
exports.isValidJSON = isValidJSON;
|
||||
exports.isWritableStream = isWritableStream;
|
||||
exports.join = join;
|
||||
exports.last = last;
|
||||
exports.lcm = lcm;
|
||||
|
||||
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
47
dist/_30s.esm.js
vendored
47
dist/_30s.esm.js
vendored
@ -72,7 +72,7 @@ const arrayToHtmlList = (arr, listID) =>
|
||||
|
||||
const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
|
||||
|
||||
const atob = str => new Buffer(str, 'base64').toString('binary');
|
||||
const atob = str => Buffer.from(str, 'base64').toString('binary');
|
||||
|
||||
const attempt = (fn, ...args) => {
|
||||
try {
|
||||
@ -124,7 +124,7 @@ const bottomVisible = () =>
|
||||
document.documentElement.clientHeight + window.scrollY >=
|
||||
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
|
||||
|
||||
const btoa = str => new Buffer(str, 'binary').toString('base64');
|
||||
const btoa = str => Buffer.from(str, 'binary').toString('base64');
|
||||
|
||||
const byteSize = str => new Blob([str]).size;
|
||||
|
||||
@ -509,6 +509,11 @@ const getColonTimeFromDate = date => date.toTimeString().slice(0, 8);
|
||||
const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
|
||||
(dateFinal - dateInitial) / (1000 * 3600 * 24);
|
||||
|
||||
const getImages = (el, includeDuplicates = false) => {
|
||||
const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src'));
|
||||
return includeDuplicates ? images : [...new Set(images)];
|
||||
};
|
||||
|
||||
const getMeridiemSuffixOfInteger = num =>
|
||||
num === 0 || num === 24
|
||||
? 12 + 'am'
|
||||
@ -704,6 +709,15 @@ const isBrowserTabFocused = () => !document.hidden;
|
||||
|
||||
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
|
||||
|
||||
const isDuplexStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._read === 'function' &&
|
||||
typeof val._readableState === 'object' &&
|
||||
typeof val._write === 'function' &&
|
||||
typeof val._writableState === 'object';
|
||||
|
||||
const isEmpty = val => val == null || !(Object.keys(val) || val).length;
|
||||
|
||||
const isEven = num => num % 2 === 0;
|
||||
@ -737,6 +751,13 @@ const isPromiseLike = obj =>
|
||||
(typeof obj === 'object' || typeof obj === 'function') &&
|
||||
typeof obj.then === 'function';
|
||||
|
||||
const isReadableStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._read === 'function' &&
|
||||
typeof val._readableState === 'object';
|
||||
|
||||
const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
|
||||
|
||||
const isSorted = arr => {
|
||||
@ -748,6 +769,8 @@ const isSorted = arr => {
|
||||
}
|
||||
};
|
||||
|
||||
const isStream = val => val !== null && typeof val === 'object' && typeof val.pipe === 'function';
|
||||
|
||||
const isString = val => typeof val === 'string';
|
||||
|
||||
const isSymbol = val => typeof val === 'symbol';
|
||||
@ -767,6 +790,13 @@ const isValidJSON = obj => {
|
||||
}
|
||||
};
|
||||
|
||||
const isWritableStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._write === 'function' &&
|
||||
typeof val._writableState === 'object';
|
||||
|
||||
const join = (arr, separator = ',', end = separator) =>
|
||||
arr.reduce(
|
||||
(acc, val, i) =>
|
||||
@ -1385,11 +1415,8 @@ const take = (arr, n = 1) => arr.slice(0, n);
|
||||
|
||||
const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length);
|
||||
|
||||
const takeRightWhile = (arr, func) => {
|
||||
for (let i of arr.reverse().keys())
|
||||
if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length);
|
||||
return arr;
|
||||
};
|
||||
const takeRightWhile = (arr, func) =>
|
||||
arr.reduceRight((acc, el) => (func(el) ? acc : [el, ...acc]), []);
|
||||
|
||||
const takeWhile = (arr, func) => {
|
||||
for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i);
|
||||
@ -1492,8 +1519,8 @@ const tomorrow = (long = false) => {
|
||||
|
||||
const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc);
|
||||
|
||||
const triggerEvent = (el, eventType, detail = undefined) =>
|
||||
el.dispatchEvent(new CustomEvent(eventType, { detail: detail }));
|
||||
const triggerEvent = (el, eventType, detail) =>
|
||||
el.dispatchEvent(new CustomEvent(eventType, { detail }));
|
||||
|
||||
const truncateString = (str, num) =>
|
||||
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
||||
@ -1624,4 +1651,4 @@ const zipWith = (...array) => {
|
||||
);
|
||||
};
|
||||
|
||||
export { CSVToArray, CSVToJSON, JSONToFile, JSONtoCSV, RGBToHex, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, 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, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compose, composeRight, converge, copyToClipboard, countBy, countOccurrences, counter, createElement, createEventHub, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, 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, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, forOwn, forOwnRight, formatDuration, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, inRange, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isEmpty, isEven, isFunction, isLowerCase, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrime, isPrimitive, isPromiseLike, isSameDate, isSorted, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, join, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, observeMutations, off, offset, omit, omitBy, on, onUserInputChange, once, 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, reduceSuccessive, reduceWhich, reducedFilter, reject, remove, removeNonASCII, renameKeys, reverseString, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, 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, timeTaken, times, toCamelCase, toCurrency, toDecimalMark, toHash, toKebabCase, toOrdinalSuffix, toSafeInteger, toSnakeCase, toggleClass, tomorrow, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, validateNumber, when, without, words, xProd, yesNo, zip, zipObject, zipWith };
|
||||
export { CSVToArray, CSVToJSON, JSONToFile, JSONtoCSV, RGBToHex, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, 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, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compose, composeRight, converge, copyToClipboard, countBy, countOccurrences, counter, createElement, createEventHub, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, 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, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, forOwn, forOwnRight, formatDuration, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, inRange, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrime, isPrimitive, isPromiseLike, isReadableStream, isSameDate, isSorted, isStream, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, isWritableStream, join, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, observeMutations, off, offset, omit, omitBy, on, onUserInputChange, once, 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, reduceSuccessive, reduceWhich, reducedFilter, reject, remove, removeNonASCII, renameKeys, reverseString, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, 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, timeTaken, times, toCamelCase, toCurrency, toDecimalMark, toHash, toKebabCase, toOrdinalSuffix, toSafeInteger, toSnakeCase, toggleClass, tomorrow, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, validateNumber, when, without, words, xProd, yesNo, zip, zipObject, zipWith };
|
||||
|
||||
50
dist/_30s.js
vendored
50
dist/_30s.js
vendored
@ -78,7 +78,7 @@
|
||||
|
||||
const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
|
||||
|
||||
const atob = str => new Buffer(str, 'base64').toString('binary');
|
||||
const atob = str => Buffer.from(str, 'base64').toString('binary');
|
||||
|
||||
const attempt = (fn, ...args) => {
|
||||
try {
|
||||
@ -130,7 +130,7 @@
|
||||
document.documentElement.clientHeight + window.scrollY >=
|
||||
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
|
||||
|
||||
const btoa = str => new Buffer(str, 'binary').toString('base64');
|
||||
const btoa = str => Buffer.from(str, 'binary').toString('base64');
|
||||
|
||||
const byteSize = str => new Blob([str]).size;
|
||||
|
||||
@ -515,6 +515,11 @@
|
||||
const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
|
||||
(dateFinal - dateInitial) / (1000 * 3600 * 24);
|
||||
|
||||
const getImages = (el, includeDuplicates = false) => {
|
||||
const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src'));
|
||||
return includeDuplicates ? images : [...new Set(images)];
|
||||
};
|
||||
|
||||
const getMeridiemSuffixOfInteger = num =>
|
||||
num === 0 || num === 24
|
||||
? 12 + 'am'
|
||||
@ -710,6 +715,15 @@
|
||||
|
||||
const isDivisible = (dividend, divisor) => dividend % divisor === 0;
|
||||
|
||||
const isDuplexStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._read === 'function' &&
|
||||
typeof val._readableState === 'object' &&
|
||||
typeof val._write === 'function' &&
|
||||
typeof val._writableState === 'object';
|
||||
|
||||
const isEmpty = val => val == null || !(Object.keys(val) || val).length;
|
||||
|
||||
const isEven = num => num % 2 === 0;
|
||||
@ -743,6 +757,13 @@
|
||||
(typeof obj === 'object' || typeof obj === 'function') &&
|
||||
typeof obj.then === 'function';
|
||||
|
||||
const isReadableStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._read === 'function' &&
|
||||
typeof val._readableState === 'object';
|
||||
|
||||
const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
|
||||
|
||||
const isSorted = arr => {
|
||||
@ -754,6 +775,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
const isStream = val => val !== null && typeof val === 'object' && typeof val.pipe === 'function';
|
||||
|
||||
const isString = val => typeof val === 'string';
|
||||
|
||||
const isSymbol = val => typeof val === 'symbol';
|
||||
@ -773,6 +796,13 @@
|
||||
}
|
||||
};
|
||||
|
||||
const isWritableStream = val =>
|
||||
val !== null &&
|
||||
typeof val === 'object' &&
|
||||
typeof val.pipe === 'function' &&
|
||||
typeof val._write === 'function' &&
|
||||
typeof val._writableState === 'object';
|
||||
|
||||
const join = (arr, separator = ',', end = separator) =>
|
||||
arr.reduce(
|
||||
(acc, val, i) =>
|
||||
@ -1391,11 +1421,8 @@
|
||||
|
||||
const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length);
|
||||
|
||||
const takeRightWhile = (arr, func) => {
|
||||
for (let i of arr.reverse().keys())
|
||||
if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length);
|
||||
return arr;
|
||||
};
|
||||
const takeRightWhile = (arr, func) =>
|
||||
arr.reduceRight((acc, el) => (func(el) ? acc : [el, ...acc]), []);
|
||||
|
||||
const takeWhile = (arr, func) => {
|
||||
for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i);
|
||||
@ -1498,8 +1525,8 @@
|
||||
|
||||
const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc);
|
||||
|
||||
const triggerEvent = (el, eventType, detail = undefined) =>
|
||||
el.dispatchEvent(new CustomEvent(eventType, { detail: detail }));
|
||||
const triggerEvent = (el, eventType, detail) =>
|
||||
el.dispatchEvent(new CustomEvent(eventType, { detail }));
|
||||
|
||||
const truncateString = (str, num) =>
|
||||
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
||||
@ -1734,6 +1761,7 @@
|
||||
exports.get = get;
|
||||
exports.getColonTimeFromDate = getColonTimeFromDate;
|
||||
exports.getDaysDiffBetweenDates = getDaysDiffBetweenDates;
|
||||
exports.getImages = getImages;
|
||||
exports.getMeridiemSuffixOfInteger = getMeridiemSuffixOfInteger;
|
||||
exports.getScrollPosition = getScrollPosition;
|
||||
exports.getStyle = getStyle;
|
||||
@ -1777,6 +1805,7 @@
|
||||
exports.isBrowser = isBrowser;
|
||||
exports.isBrowserTabFocused = isBrowserTabFocused;
|
||||
exports.isDivisible = isDivisible;
|
||||
exports.isDuplexStream = isDuplexStream;
|
||||
exports.isEmpty = isEmpty;
|
||||
exports.isEven = isEven;
|
||||
exports.isFunction = isFunction;
|
||||
@ -1790,14 +1819,17 @@
|
||||
exports.isPrime = isPrime;
|
||||
exports.isPrimitive = isPrimitive;
|
||||
exports.isPromiseLike = isPromiseLike;
|
||||
exports.isReadableStream = isReadableStream;
|
||||
exports.isSameDate = isSameDate;
|
||||
exports.isSorted = isSorted;
|
||||
exports.isStream = isStream;
|
||||
exports.isString = isString;
|
||||
exports.isSymbol = isSymbol;
|
||||
exports.isTravisCI = isTravisCI;
|
||||
exports.isUndefined = isUndefined;
|
||||
exports.isUpperCase = isUpperCase;
|
||||
exports.isValidJSON = isValidJSON;
|
||||
exports.isWritableStream = isWritableStream;
|
||||
exports.join = join;
|
||||
exports.last = last;
|
||||
exports.lcm = lcm;
|
||||
|
||||
Reference in New Issue
Block a user