Travis build: 1513 [cron]

This commit is contained in:
30secondsofcode
2019-10-16 17:03:22 +00:00
parent ca2c1a51c0
commit 29b217e5bc
4 changed files with 99 additions and 70 deletions

72
dist/_30s.es5.js vendored
View File

@ -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;

File diff suppressed because one or more lines are too long

14
dist/_30s.esm.js vendored
View File

@ -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);
}; };
@ -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 };

13
dist/_30s.js vendored
View File

@ -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);
}; };
@ -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;