diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js index f9a417281..11b8b485c 100644 --- a/dist/_30s.es5.js +++ b/dist/_30s.es5.js @@ -93,6 +93,18 @@ var bind = function bind(fn, context) { }; }; +var bindAll = function bindAll(obj) { + for (var _len = arguments.length, fns = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + fns[_key - 1] = arguments[_key]; + } + + return fns.forEach(function (fn) { + return obj[fn] = function () { + return fn.apply(obj); + }; + }); +}; + var bindKey = function bindKey(context, fn) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; @@ -421,10 +433,9 @@ var distance = function distance(x0, y0, x1, y1) { return Math.hypot(x1 - x0, y1 - y0); }; -var dropWhile = function dropWhile(arr, func) { - while (arr.length > 0 && !func(arr[0])) { - arr = arr.slice(1); - }return arr; +var drop = function drop(arr) { + var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + return arr.slice(n); }; var dropRight = function dropRight(arr) { @@ -432,6 +443,18 @@ var dropRight = function dropRight(arr) { return arr.slice(0, -n); }; +var dropRightWhile = function dropRightWhile(arr, func) { + while (arr.length > 0 && !func(arr[arr.length - 1])) { + arr = arr.slice(0, -1); + }return arr; +}; + +var dropWhile = function dropWhile(arr, func) { + while (arr.length > 0 && !func(arr[0])) { + arr = arr.slice(1); + }return arr; +}; + var elementIsVisibleInViewport = function elementIsVisibleInViewport(el) { var partiallyVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; @@ -699,7 +722,7 @@ var getType = function getType(v) { }; var getURLParameters = function getURLParameters(url) { - return url.match(/([^?=&]+)(=([^&]*))/g).reduce(function (a, v) { + return (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(function (a, v) { return a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a; }, {}); }; @@ -1542,6 +1565,26 @@ var pullAtValue = function pullAtValue(arr, pullArr) { return removed; }; +var pullBy = function pullBy(arr) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var length = args.length; + var fn = length > 1 ? args[length - 1] : undefined; + fn = typeof fn == 'function' ? (args.pop(), fn) : undefined; + var argState = (Array.isArray(args[0]) ? args[0] : args).map(function (val) { + return fn(val); + }); + var pulled = arr.filter(function (v, i) { + return !argState.includes(fn(v)); + }); + arr.length = 0; + pulled.forEach(function (v) { + return arr.push(v); + }); +}; + var randomHexColorCode = function randomHexColorCode() { var n = (Math.random() * 0xfffff | 0).toString(16); return '#' + (n.length !== 6 ? (Math.random() * 0xf | 0).toString(16) + n : n); @@ -1603,6 +1646,10 @@ var remove = function remove(arr, func) { }, []) : []; }; +var removeNonASCII = function removeNonASCII(str) { + return str.replace(/[^\x20-\x7E]/g, ''); +}; + function _toConsumableArray$13(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var reverseString = function reverseString(str) { @@ -1746,14 +1793,34 @@ var sortedIndex = function sortedIndex(arr, n) { return index === -1 ? arr.length : index; }; +var sortedIndexBy = function sortedIndexBy(arr, n, fn) { + var isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + var val = fn(n); + var index = arr.findIndex(function (el) { + return isDescending ? val >= fn(el) : val <= fn(el); + }); + return index === -1 ? arr.length : index; +}; + var sortedLastIndex = function sortedLastIndex(arr, n) { var isDescending = arr[0] > arr[arr.length - 1]; var index = arr.map(function (val, i) { return [i, val]; - }).filter(function (el) { - return isDescending ? n >= el[1] : n >= el[1]; - }).slice(-1)[0][0]; - return index === -1 ? arr.length : index; + }).reverse().findIndex(function (el) { + return isDescending ? n <= el[1] : n >= el[1]; + }); + return index === -1 ? 0 : arr.length - index - 1; +}; + +var sortedLastIndexBy = function sortedLastIndexBy(arr, n, fn) { + var isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + var val = fn(n); + var index = arr.map(function (val, i) { + return [i, fn(val)]; + }).reverse().findIndex(function (el) { + return isDescending ? val <= el[1] : val >= el[1]; + }); + return index === -1 ? 0 : arr.length - index; }; var splitLines = function splitLines(str) { @@ -1781,6 +1848,10 @@ var standardDeviation = function standardDeviation(arr) { }, 0) / (arr.length - (usePopulation ? 0 : 1))); }; +var stripHTMLTags = function stripHTMLTags(str) { + return str.replace(/<[^>]*>/g, ''); +}; + var sum = function sum() { for (var _len = arguments.length, arr = Array(_len), _key = 0; _key < _len; _key++) { arr[_key] = arguments[_key]; @@ -1865,6 +1936,63 @@ var takeRight = function takeRight(arr) { return arr.slice(arr.length - n, arr.length); }; +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) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return arr; +}; + +var takeWhile = function takeWhile(arr, func) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = arr.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var i = _step.value; + if (func(arr[i])) return arr.slice(0, i); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return arr; +}; + var timeTaken = function timeTaken(callback) { console.time('timeTaken'); var r = callback(); @@ -2117,7 +2245,7 @@ var zipWith = function zipWith() { }) : result; }; -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, average: average, averageBy: averageBy, bind: bind, bindKey: bindKey, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, dropWhile: dropWhile, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedLastIndex: sortedLastIndex, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, unescapeHTML: unescapeHTML, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith }; +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, ary: ary, atob: atob, average: average, averageBy: averageBy, bind: bind, bindAll: bindAll, bindKey: bindKey, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, castArray: castArray, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, composeRight: composeRight, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, delay: delay, detectDeviceType: detectDeviceType, difference: difference, differenceBy: differenceBy, differenceWith: differenceWith, digitize: digitize, distance: distance, drop: drop, dropRight: dropRight, dropRightWhile: dropRightWhile, dropWhile: dropWhile, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findKey: findKey, findLast: findLast, findLastIndex: findLastIndex, findLastKey: findLastKey, flatten: flatten, flip: flip, forEachRight: forEachRight, forOwn: forOwn, forOwnRight: forOwnRight, formatDuration: formatDuration, fromCamelCase: fromCamelCase, functionName: functionName, functions: functions, gcd: gcd, geometricProgression: geometricProgression, get: get, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, hashBrowser: hashBrowser, hashNode: hashNode, head: head, hexToRGB: hexToRGB, hide: hide, httpGet: httpGet, httpPost: httpPost, httpsRedirect: httpsRedirect, inRange: inRange, indexOfAll: indexOfAll, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithRangeRight: initializeArrayWithRangeRight, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, intersectionBy: intersectionBy, intersectionWith: intersectionWith, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEmpty: isEmpty, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, isObjectLike: isObjectLike, isPlainObject: isPlainObject, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isUndefined: isUndefined, isUpperCase: isUpperCase, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, longestItem: longestItem, lowercaseKeys: lowercaseKeys, luhnCheck: luhnCheck, mapKeys: mapKeys, mapObject: mapObject, mapValues: mapValues, mask: mask, matches: matches, matchesWith: matchesWith, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthArg: nthArg, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, over: over, palindrome: palindrome, parseCookie: parseCookie, partial: partial, partialRight: partialRight, partition: partition, percentile: percentile, pick: pick, pickBy: pickBy, pipeFunctions: pipeFunctions, pluralize: pluralize, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, pullBy: pullBy, randomHexColorCode: randomHexColorCode, randomIntArrayInRange: randomIntArrayInRange, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, redirect: redirect, reduceSuccessive: reduceSuccessive, reduceWhich: reduceWhich, reducedFilter: reducedFilter, remove: remove, removeNonASCII: removeNonASCII, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, serializeCookie: serializeCookie, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, sortedIndexBy: sortedIndexBy, sortedLastIndex: sortedLastIndex, sortedLastIndexBy: sortedLastIndexBy, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, stripHTMLTags: stripHTMLTags, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, symmetricDifferenceBy: symmetricDifferenceBy, symmetricDifferenceWith: symmetricDifferenceWith, tail: tail, take: take, takeRight: takeRight, takeRightWhile: takeRightWhile, takeWhile: takeWhile, timeTaken: timeTaken, times: times, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unary: unary, unescapeHTML: unescapeHTML, unfold: unfold, union: union, unionBy: unionBy, unionWith: unionWith, uniqueElements: uniqueElements, untildify: untildify, unzip: unzip, unzipWith: unzipWith, validateNumber: validateNumber, without: without, words: words, xProd: xProd, yesNo: yesNo, zip: zip, zipObject: zipObject, zipWith: zipWith }; return imports; diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js index 38a430928..bf86404d3 100644 --- a/dist/_30s.es5.min.js +++ b/dist/_30s.es5.min.js @@ -1 +1 @@ -(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e._30s=t()})(this,function(){'use strict';function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^F.randomBytes(1)[0]&15>>e/4).toString(16)})},anagrams:function e(t){return 2>=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},arrayToHtmlList:function(e,t){return e.map(function(e){return document.querySelector('#'+t).innerHTML+='
  • '+e+'
  • '})},ary:function(t,i){return function(){for(var n=arguments.length,r=Array(n),l=0;l=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:O(e/8.64e7),hour:O(e/3.6e6)%24,minute:O(e/6e4)%60,second:O(e/1e3)%60,millisecond:O(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=Y(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':J(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1r-n&&(t='mouse',e(t),document.removeEventListener('mousemove',i)),n=r};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',i))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,i=Array(n),r=0;rc?1:sMath.abs(e))return e+(i?' ':'')+r[0];var l=N(O(Math.log10(0>e?-e:e)/3),r.length-1),o=+((0>e?-e:e)/z(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(i?' ':'')+r[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=O(R(e)),i=Array.from({length:n-1}).map(function(e,t){return t+2});return i.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t==e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),i=0;ie[e.length-1],i=e.findIndex(function(e){return n?t>=e:t<=e});return-1===i?e.length:i},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],i=e.map(function(e,t){return[t,e]}).filter(function(e){return n?t>=e[1]:t>=e[1]}).slice(-1)[0][0];return-1===i?e.length:i},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,_(t))}},standardDeviation:function(e){var t=1t?e.slice(0,3',"'":'\'',""":'"'}[e]||e})},unfold:function(e,t){for(var n=[],i=[null,t];i=e(i[1]);)n.push(i[0]);return n},union:function(e,t){return Array.from(new Set([].concat(C(e),C(t))))},unionBy:function(e,t,n){var i=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(E(e),E(t.filter(function(e){return!i.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(S(e),S(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(x(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:U.apply(Math,L(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:U.apply(Math,w(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,w(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1>e/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^W.randomBytes(1)[0]&15>>e/4).toString(16)})},anagrams:function e(t){return 2>=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},arrayToHtmlList:function(e,t){return e.map(function(e){return document.querySelector('#'+t).innerHTML+='
  • '+e+'
  • '})},ary:function(t,i){return function(){for(var n=arguments.length,r=Array(n),l=0;l=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(e){return new Buffer(e,'binary').toString('base64')},byteSize:function(e){return new Blob([e]).size},call:function(e){for(var t=arguments.length,n=Array(1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(e,t){return e.filter(function(n,e){return e%t==t-1})},extendHex:function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},factorial:function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},fibonacci:function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:O(e/8.64e7),hour:O(e/3.6e6)%24,minute:O(e/6e4)%60,second:O(e/1e3)%60,millisecond:O(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){return e[1]+' '+(1===e[1]?e[0]:e[0]+'s')}).join(', ')},fromCamelCase:function(e){var t=1>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '+(255&n):'')+')'},hide:function(){for(var e=arguments.length,t=Array(e),n=0;nn&&(n=t),null==n?0<=e&&e=t&&ee[1]?-1:1,r=!0,l=!1;try{for(var o,a=e.entries()[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,c=Y(s,2),d=c[0],i=c[1];if(d===e.length-1)return n;if(0<(i-e[d+1])*n)return 0}}catch(e){l=!0,t=e}finally{try{!r&&a.return&&a.return()}finally{if(l)throw t}}},isString:function(e){return'string'==typeof e},isSymbol:function(e){return'symbol'===('undefined'==typeof e?'undefined':J(e))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(e){return e===void 0},isUpperCase:function(e){return e===e.toUpperCase()},isValidJSON:function(e){try{return JSON.parse(e),!0}catch(t){return!1}},join:function(e){var t=1r-n&&(t='mouse',e(t),document.removeEventListener('mousemove',i)),n=r};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',i))})},once:function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,i=Array(n),r=0;rc?1:sMath.abs(e))return e+(i?' ':'')+r[0];var l=N(O(Math.log10(0>e?-e:e)/3),r.length-1),o=+((0>e?-e:e)/z(1e3,l)).toPrecision(t);return(0>e?'-':'')+o+(i?' ':'')+r[l]},primes:function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=O(T(e)),i=Array.from({length:n-1}).map(function(e,t){return t+2});return i.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t==e})}),t},promisify:function(e){return function(){for(var t=arguments.length,n=Array(t),i=0;ie[e.length-1],i=e.findIndex(function(e){return n?t>=e:t<=e});return-1===i?e.length:i},sortedIndexBy:function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),l=e.findIndex(function(e){return i?r>=n(e):r<=n(e)});return-1===l?e.length:l},sortedLastIndex:function(e,t){var n=e[0]>e[e.length-1],i=e.map(function(e,t){return[t,e]}).reverse().findIndex(function(e){return n?t<=e[1]:t>=e[1]});return-1===i?0:e.length-i-1},sortedLastIndexBy:function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),l=e.map(function(e,t){return[t,n(e)]}).reverse().findIndex(function(e){return i?r<=e[1]:r>=e[1]});return-1===l?0:e.length-l},splitLines:function(e){return e.split(/\r?\n/)},spreadOver:function(e){return function(t){return e.apply(void 0,v(t))}},standardDeviation:function(e){var t=1]*>/g,'')},sum:function(){for(var e=arguments.length,t=Array(e),n=0;nt?e.slice(0,3',"'":'\'',""":'"'}[e]||e})},unfold:function(e,t){for(var n=[],i=[null,t];i=e(i[1]);)n.push(i[0]);return n},union:function(e,t){return Array.from(new Set([].concat(C(e),C(t))))},unionBy:function(e,t,n){var i=new Set(e.map(function(e){return n(e)}));return Array.from(new Set([].concat(x(e),x(t.filter(function(e){return!i.has(n(e))})))))},unionWith:function(e,t,n){return Array.from(new Set([].concat(E(e),E(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},uniqueElements:function(e){return[].concat(S(new Set(e)))},untildify:function(e){return e.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},unzip:function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:D.apply(Math,L(e.map(function(e){return e.length})))}).map(function(){return[]}))},unzipWith:function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:D.apply(Math,I(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,I(e))})},validateNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},without:function(e){for(var t=arguments.length,n=Array(1 return fn.apply(context, args.concat(...arguments)); }; +const bindAll = (obj, ...fns) => + fns.forEach( + fn => + (obj[fn] = function() { + return fn.apply(obj); + }) + ); + const bindKey = (context, fn, ...args) => function() { return context[fn].apply(context, args.concat(...arguments)); @@ -214,13 +222,20 @@ const digitize = n => [...`${n}`].map(i => parseInt(i)); const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); +const drop = (arr, n = 1) => arr.slice(n); + +const dropRight = (arr, n = 1) => arr.slice(0, -n); + +const dropRightWhile = (arr, func) => { + while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1); + return arr; +}; + const dropWhile = (arr, func) => { while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1); return arr; }; -const dropRight = (arr, n = 1) => arr.slice(0, -n); - const elementIsVisibleInViewport = (el, partiallyVisible = false) => { const { top, left, bottom, right } = el.getBoundingClientRect(); const { innerHeight, innerWidth } = window; @@ -397,9 +412,10 @@ const getType = v => v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name.toLowerCase(); const getURLParameters = url => - url - .match(/([^?=&]+)(=([^&]*))/g) - .reduce((a, v) => (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a), {}); + (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce( + (a, v) => (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a), + {} + ); const groupBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { @@ -889,6 +905,16 @@ const pullAtValue = (arr, pullArr) => { return removed; }; +const pullBy = (arr, ...args) => { + const length = args.length; + let fn = length > 1 ? args[length - 1] : undefined; + fn = typeof fn == 'function' ? (args.pop(), fn) : undefined; + let argState = (Array.isArray(args[0]) ? args[0] : args).map(val => fn(val)); + let pulled = arr.filter((v, i) => !argState.includes(fn(v))); + arr.length = 0; + pulled.forEach(v => arr.push(v)); +}; + const randomHexColorCode = () => { let n = ((Math.random() * 0xfffff) | 0).toString(16); return '#' + (n.length !== 6 ? ((Math.random() * 0xf) | 0).toString(16) + n : n); @@ -933,6 +959,8 @@ const remove = (arr, func) => }, []) : []; +const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, ''); + const reverseString = str => [...str].reverse().join(''); const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); @@ -1020,13 +1048,30 @@ const sortedIndex = (arr, n) => { return index === -1 ? arr.length : index; }; +const sortedIndexBy = (arr, n, fn) => { + const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + const val = fn(n); + const index = arr.findIndex(el => (isDescending ? val >= fn(el) : val <= fn(el))); + return index === -1 ? arr.length : index; +}; + const sortedLastIndex = (arr, n) => { const isDescending = arr[0] > arr[arr.length - 1]; const index = arr .map((val, i) => [i, val]) - .filter(el => (isDescending ? n >= el[1] : n >= el[1])) - .slice(-1)[0][0]; - return index === -1 ? arr.length : index; + .reverse() + .findIndex(el => (isDescending ? n <= el[1] : n >= el[1])); + return index === -1 ? 0 : arr.length - index - 1; +}; + +const sortedLastIndexBy = (arr, n, fn) => { + const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + const val = fn(n); + const index = arr + .map((val, i) => [i, fn(val)]) + .reverse() + .findIndex(el => (isDescending ? val <= el[1] : val >= el[1])); + return index === -1 ? 0 : arr.length - index; }; const splitLines = str => str.split(/\r?\n/); @@ -1041,6 +1086,8 @@ const standardDeviation = (arr, usePopulation = false) => { ); }; +const stripHTMLTags = str => str.replace(/<[^>]*>/g, ''); + const sum = (...arr) => [...arr].reduce((acc, val) => acc + val, 0); const sumBy = (arr, fn) => @@ -1075,6 +1122,17 @@ 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 takeWhile = (arr, func) => { + for (let i of arr.keys()) if (func(arr[i])) return arr.slice(0, i); + return arr; +}; + const timeTaken = callback => { console.time('timeTaken'); const r = callback(); @@ -1230,6 +1288,6 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,average,averageBy,bind,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,dropWhile,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedLastIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,timeTaken,times,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,average,averageBy,bind,bindAll,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,timeTaken,times,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index ffc1325b7..39a0d8d74 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -60,6 +60,14 @@ const bind = (fn, context, ...args) => return fn.apply(context, args.concat(...arguments)); }; +const bindAll = (obj, ...fns) => + fns.forEach( + fn => + (obj[fn] = function() { + return fn.apply(obj); + }) + ); + const bindKey = (context, fn, ...args) => function() { return context[fn].apply(context, args.concat(...arguments)); @@ -220,13 +228,20 @@ const digitize = n => [...`${n}`].map(i => parseInt(i)); const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); +const drop = (arr, n = 1) => arr.slice(n); + +const dropRight = (arr, n = 1) => arr.slice(0, -n); + +const dropRightWhile = (arr, func) => { + while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1); + return arr; +}; + const dropWhile = (arr, func) => { while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1); return arr; }; -const dropRight = (arr, n = 1) => arr.slice(0, -n); - const elementIsVisibleInViewport = (el, partiallyVisible = false) => { const { top, left, bottom, right } = el.getBoundingClientRect(); const { innerHeight, innerWidth } = window; @@ -403,9 +418,10 @@ const getType = v => v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name.toLowerCase(); const getURLParameters = url => - url - .match(/([^?=&]+)(=([^&]*))/g) - .reduce((a, v) => (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a), {}); + (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce( + (a, v) => (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a), + {} + ); const groupBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { @@ -895,6 +911,16 @@ const pullAtValue = (arr, pullArr) => { return removed; }; +const pullBy = (arr, ...args) => { + const length = args.length; + let fn = length > 1 ? args[length - 1] : undefined; + fn = typeof fn == 'function' ? (args.pop(), fn) : undefined; + let argState = (Array.isArray(args[0]) ? args[0] : args).map(val => fn(val)); + let pulled = arr.filter((v, i) => !argState.includes(fn(v))); + arr.length = 0; + pulled.forEach(v => arr.push(v)); +}; + const randomHexColorCode = () => { let n = ((Math.random() * 0xfffff) | 0).toString(16); return '#' + (n.length !== 6 ? ((Math.random() * 0xf) | 0).toString(16) + n : n); @@ -939,6 +965,8 @@ const remove = (arr, func) => }, []) : []; +const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, ''); + const reverseString = str => [...str].reverse().join(''); const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); @@ -1026,13 +1054,30 @@ const sortedIndex = (arr, n) => { return index === -1 ? arr.length : index; }; +const sortedIndexBy = (arr, n, fn) => { + const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + const val = fn(n); + const index = arr.findIndex(el => (isDescending ? val >= fn(el) : val <= fn(el))); + return index === -1 ? arr.length : index; +}; + const sortedLastIndex = (arr, n) => { const isDescending = arr[0] > arr[arr.length - 1]; const index = arr .map((val, i) => [i, val]) - .filter(el => (isDescending ? n >= el[1] : n >= el[1])) - .slice(-1)[0][0]; - return index === -1 ? arr.length : index; + .reverse() + .findIndex(el => (isDescending ? n <= el[1] : n >= el[1])); + return index === -1 ? 0 : arr.length - index - 1; +}; + +const sortedLastIndexBy = (arr, n, fn) => { + const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); + const val = fn(n); + const index = arr + .map((val, i) => [i, fn(val)]) + .reverse() + .findIndex(el => (isDescending ? val <= el[1] : val >= el[1])); + return index === -1 ? 0 : arr.length - index; }; const splitLines = str => str.split(/\r?\n/); @@ -1047,6 +1092,8 @@ const standardDeviation = (arr, usePopulation = false) => { ); }; +const stripHTMLTags = str => str.replace(/<[^>]*>/g, ''); + const sum = (...arr) => [...arr].reduce((acc, val) => acc + val, 0); const sumBy = (arr, fn) => @@ -1081,6 +1128,17 @@ 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 takeWhile = (arr, func) => { + for (let i of arr.keys()) if (func(arr[i])) return arr.slice(0, i); + return arr; +}; + const timeTaken = callback => { console.time('timeTaken'); const r = callback(); @@ -1236,7 +1294,7 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,average,averageBy,bind,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,dropWhile,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedLastIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,timeTaken,times,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,ary,atob,average,averageBy,bind,bindAll,bindKey,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,composeRight,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,timeTaken,times,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,unescapeHTML,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index 48d695a22..babd1bc80 100644 --- a/dist/_30s.min.js +++ b/dist/_30s.min.js @@ -1 +1 @@ -(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.round,b=Math.sqrt,c=Math.log,d=Math.floor,e=Math.min,f=Math.max,g=Math.ceil;const h='undefined'!=typeof require&&require('fs'),i='undefined'!=typeof require&&require('crypto'),j=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(j(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),k=(a,b=a.length,...c)=>b<=c.length?a(...c):k.bind(null,a,b,...c),l=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?l(a[c]):a[c]),b},m=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?m(a):a)),n=([...c],d=32,e)=>{const[f,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),g=(c,g)=>(e||c)+d*(g-b(g?f:a,g?a:f));if(2===c.length)return[g(f,1),g(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>o(c[a],d[a]))},p=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*p(a-1),q=(a,b=1)=>1==b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?q(a,b-1):a),[]),r=(...a)=>{const c=(a,b)=>b?r(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},s='undefined'!=typeof require&&require('crypto'),t='undefined'!=typeof require&&require('fs'),u=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0h.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^i.randomBytes(1)[0]&15>>a/4).toString(16)),anagrams:j,arrayToHtmlList:(a,b)=>a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},bottomVisible:()=>document.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:g(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>f(e(c,f(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:k,decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:l,deepFlatten:m,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),dropWhile:(a,b)=>{for(;0a.slice(0,-b),elementIsVisibleInViewport:(a,b=!1)=>{const{top:c,left:d,bottom:e,right:f}=a.getBoundingClientRect(),{innerHeight:g,innerWidth:h}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:p,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:q,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:d(a/8.64e7),hour:d(a/3.6e6)%24,minute:d(a/6e4)%60,second:d(a/1e3)%60,millisecond:d(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:r,geometricProgression:(a,b=1,e=2)=>Array.from({length:d(c(a/b)/c(e))+1}).map((a,c)=>b*e**c),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>a.match(/([^?=&]+)(=([^&]*))/g).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(s.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:g((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:g((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(a)=>{const c=d(b(a));for(var e=2;e<=c;e++)if(0==a%e)return!1;return 2<=a},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,f)=>f==a.length-2?d+e+c:f==a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>f(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=d(a.length/2),c=[...a].sort((c,a)=>c-a);return 0==a.length%2?(c[b-1]+c[b])/2:c[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),negate:(a)=>(...b)=>!a(...b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,f)=>{if(0===b){const[g,h]=d&&'desc'===d[f]?[a[c],e[c]]:[e[c],a[c]];b=g>h?1:g(...b)=>a.map((a)=>a.apply(null,b)),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,c=!0)=>{const f=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>Math.abs(a))return a+(c?' ':'')+f[0];const g=e(d(Math.log10(0>a?-a:a)/3),f.length-1),h=+((0>a?-a:a)/1e3**g).toPrecision(b);return(0>a?'-':'')+h+(c?' ':'')+f[g]},primes:(a)=>{let c=Array.from({length:a-1}).map((a,b)=>b+2),e=d(b(a)),f=Array.from({length:e-1}).map((a,b)=>b+2);return f.forEach((a)=>c=c.filter((b)=>0!=b%a||b==a)),c},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},randomHexColorCode:()=>{let a=(0|1048575*Math.random()).toString(16);return'#'+(6===a.length?a:(0|15*Math.random()).toString(16)+a)},randomIntArrayInRange:(a,b,c=1)=>Array.from({length:c},()=>d(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>d(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>t.readFileSync(a).toString('UTF8').split('\n'),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],reverseString:(a)=>[...a].join(''),round:(b,c=0)=>+`${a(`${b}e${c}`)}e-${c}`,runAsync:(a)=>{const b=`var fn = ${a.toString()}; postMessage(fn());`,c=new Worker(URL.createObjectURL(new Blob([b]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,b)=>{c.onmessage=({data:b})=>{a(b),c.terminate()},c.onerror=(a)=>{b(a),c.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[d(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let c=a.length;c;){const b=d(Math.random()*c--);[a[c],a[b]]=[a[b],a[c]]}return a.slice(0,b)},scrollToTop:u,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const c=d(Math.random()*b--);[a[b],a[c]]=[a[c],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).filter((a)=>c?b>=a[1]:b>=a[1]).slice(-1)[0][0];return-1===d?a.length:d},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(a,c=!1)=>{const d=a.reduce((a,b)=>a+b,0)/a.length;return b(a.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(a.length-(c?0:1)))},sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(b)=>a(f(e(b,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:f(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:f(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=f(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); +(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a._30s=b()})(this,function(){'use strict';var a=Math.round,b=Math.sqrt,c=Math.log,d=Math.floor,e=Math.min,f=Math.max,g=Math.ceil;const h='undefined'!=typeof require&&require('fs'),i='undefined'!=typeof require&&require('crypto'),j=(a)=>2>=a.length?2===a.length?[a,a[1]+a[0]]:[a]:a.split('').reduce((b,c,d)=>b.concat(j(a.slice(0,d)+a.slice(d+1)).map((a)=>c+a)),[]),k=(a,b=a.length,...c)=>b<=c.length?a(...c):k.bind(null,a,b,...c),l=(a)=>{let b=Object.assign({},a);return Object.keys(b).forEach((c)=>b[c]='object'==typeof a[c]?l(a[c]):a[c]),b},m=(a)=>[].concat(...a.map((a)=>Array.isArray(a)?m(a):a)),n=([...c],d=32,e)=>{const[f,a]=c,b=(a,b)=>1/(1+10**((b-a)/400)),g=(c,g)=>(e||c)+d*(g-b(g?f:a,g?a:f));if(2===c.length)return[g(f,1),g(a,0)];for(let a,b=0;b{if(c===d)return!0;if(c instanceof Date&&d instanceof Date)return c.getTime()===d.getTime();if(!c||!d||'object'!=typeof c&&'object'!=typeof d)return c===d;if(null===c||void 0===c||null===d||void 0===d)return!1;if(c.prototype!==d.prototype)return!1;let e=Object.keys(c);return!(e.length!==Object.keys(d).length)&&e.every((a)=>o(c[a],d[a]))},p=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*p(a-1),q=(a,b=1)=>1==b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?q(a,b-1):a),[]),r=(...a)=>{const c=(a,b)=>b?r(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},s='undefined'!=typeof require&&require('crypto'),t='undefined'!=typeof require&&require('fs'),u=()=>{const a=document.documentElement.scrollTop||document.body.scrollTop;0h.writeFile(`${b}.json`,JSON.stringify(a,null,2)),RGBToHex:(a,c,d)=>((a<<16)+(c<<8)+d).toString(16).padStart(6,'0'),URLJoin:(...a)=>a.join('/').replace(/[\/]+/g,'/').replace(/^(.+):\//,'$1://').replace(/^file:/,'file:/').replace(/\/(\?|&|#[^!])/g,'$1').replace(/\?/g,'&').replace('&','?'),UUIDGeneratorBrowser:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)),UUIDGeneratorNode:()=>'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,(a)=>(a^i.randomBytes(1)[0]&15>>a/4).toString(16)),anagrams:j,arrayToHtmlList:(a,b)=>a.map((a)=>document.querySelector('#'+b).innerHTML+=`
  • ${a}
  • `),ary:(a,b)=>(...c)=>a(...c.slice(0,b)),atob:(a)=>new Buffer(a,'base64').toString('binary'),average:(...a)=>[...a].reduce((a,b)=>a+b,0)/a.length,averageBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0)/a.length,bind:(a,b,...c)=>function(){return a.apply(b,c.concat(...arguments))},bindAll:(a,...b)=>b.forEach((b)=>a[b]=function(){return b.apply(a)}),bindKey:(a,b,...c)=>function(){return a[b].apply(a,c.concat(...arguments))},bottomVisible:()=>document.documentElement.clientHeight+window.scrollY>=(document.documentElement.scrollHeight||document.documentElement.clientHeight),btoa:(a)=>new Buffer(a,'binary').toString('base64'),byteSize:(a)=>new Blob([a]).size,call:(a,...b)=>(c)=>c[a](...b),capitalize:([a,...b],c=!1)=>a.toUpperCase()+(c?b.join('').toLowerCase():b.join('')),capitalizeEveryWord:(a)=>a.replace(/\b[a-z]/g,(a)=>a.toUpperCase()),castArray:(a)=>Array.isArray(a)?a:[a],chainAsync:(a)=>{let b=0;const c=()=>a[b++](c);c()},chunk:(a,b)=>Array.from({length:g(a.length/b)},(c,d)=>a.slice(d*b,d*b+b)),clampNumber:(c,d,a)=>f(e(c,f(d,a)),e(d,a)),cloneRegExp:(a)=>new RegExp(a.source,a.flags),coalesce:(...a)=>a.find((a)=>![void 0,null].includes(a)),coalesceFactory:(a)=>(...b)=>b.find(a),collectInto:(a)=>(...b)=>a(b),colorize:(...a)=>({black:`\x1b[30m${a.join(' ')}`,red:`\x1b[31m${a.join(' ')}`,green:`\x1b[32m${a.join(' ')}`,yellow:`\x1b[33m${a.join(' ')}`,blue:`\x1b[34m${a.join(' ')}`,magenta:`\x1b[35m${a.join(' ')}`,cyan:`\x1b[36m${a.join(' ')}`,white:`\x1b[37m${a.join(' ')}`,bgBlack:`\x1b[40m${a.join(' ')}\x1b[0m`,bgRed:`\x1b[41m${a.join(' ')}\x1b[0m`,bgGreen:`\x1b[42m${a.join(' ')}\x1b[0m`,bgYellow:`\x1b[43m${a.join(' ')}\x1b[0m`,bgBlue:`\x1b[44m${a.join(' ')}\x1b[0m`,bgMagenta:`\x1b[45m${a.join(' ')}\x1b[0m`,bgCyan:`\x1b[46m${a.join(' ')}\x1b[0m`,bgWhite:`\x1b[47m${a.join(' ')}\x1b[0m`}),compact:(a)=>a.filter(Boolean),compose:(...a)=>a.reduce((a,b)=>(...c)=>a(b(...c))),composeRight:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),copyToClipboard:(a)=>{const b=document.createElement('textarea');b.value=a,b.setAttribute('readonly',''),b.style.position='absolute',b.style.left='-9999px',document.body.appendChild(b);const c=!!(0a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>(a[b]=(a[b]||0)+1,a),{}),countOccurrences:(a,b)=>a.reduce((c,a)=>a===b?c+1:c+0,0),createElement:(a)=>{const b=document.createElement('div');return b.innerHTML=a,b.firstElementChild},createEventHub:()=>({hub:Object.create(null),emit(a,b){(this.hub[a]||[]).forEach((a)=>a(b))},on(a,b){this.hub[a]||(this.hub[a]=[]),this.hub[a].push(b)},off(a,b){const c=(this.hub[a]||[]).findIndex((a)=>a===b);-1window.location.href,curry:k,decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepClone:l,deepFlatten:m,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),delay:(a,b,...c)=>setTimeout(a,b,...c),detectDeviceType:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?'Mobile':'Desktop',difference:(c,a)=>{const b=new Set(a);return c.filter((a)=>!b.has(a))},differenceBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>!d.has(b(a)))},differenceWith:(a,b,c)=>a.filter((d)=>-1===b.findIndex((a)=>c(d,a))),digitize:(a)=>[...`${a}`].map((a)=>parseInt(a)),distance:(a,b,c,d)=>Math.hypot(c-a,d-b),drop:(a,b=1)=>a.slice(b),dropRight:(a,b=1)=>a.slice(0,-b),dropRightWhile:(a,b)=>{for(;0{for(;0{const{top:c,left:d,bottom:e,right:f}=a.getBoundingClientRect(),{innerHeight:g,innerWidth:h}=window;return b?(0a.replace(/[&<>'"]/g,(a)=>({"&":'&',"<":'<',">":'>',"'":''','"':'"'})[a]||a),escapeRegExp:(a)=>a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'),everyNth:(a,b)=>a.filter((a,c)=>c%b==b-1),extendHex:(a)=>'#'+a.slice(a.startsWith('#')?1:0).split('').map((a)=>a+a).join(''),factorial:p,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findKey:(a,b)=>Object.keys(a).find((c)=>b(a[c],c,a)),findLast:(a,b)=>a.filter(b).slice(-1)[0],findLastIndex:(a,b)=>a.map((a,b)=>[b,a]).filter((c)=>b(c[1],c[0],a)).slice(-1)[0][0],findLastKey:(a,b)=>Object.keys(a).reverse().find((c)=>b(a[c],c,a)),flatten:q,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),forOwn:(a,b)=>Object.keys(a).forEach((c)=>b(a[c],c,a)),forOwnRight:(a,b)=>Object.keys(a).reverse().forEach((c)=>b(a[c],c,a)),formatDuration:(a)=>{0>a&&(a=-a);const b={day:d(a/8.64e7),hour:d(a/3.6e6)%24,minute:d(a/6e4)%60,second:d(a/1e3)%60,millisecond:d(a)%1e3};return Object.entries(b).filter((a)=>0!==a[1]).map((a)=>a[1]+' '+(1===a[1]?a[0]:a[0]+'s')).join(', ')},fromCamelCase:(a,b='_')=>a.replace(/([a-z\d])([A-Z])/g,'$1'+b+'$2').replace(/([A-Z]+)([A-Z][a-z\d]+)/g,'$1'+b+'$2').toLowerCase(),functionName:(a)=>(console.debug(a.name),a),functions:(a,b=!1)=>(b?[...Object.keys(a),...Object.keys(Object.getPrototypeOf(a))]:Object.keys(a)).filter((b)=>'function'==typeof a[b]),gcd:r,geometricProgression:(a,b=1,e=2)=>Array.from({length:d(c(a/b)/c(e))+1}).map((a,c)=>b*e**c),get:(a,...b)=>[...b].map((b)=>b.replace(/\[([^\[\]]*)\]/g,'.$1.').split('.').filter((a)=>''!==a).reduce((a,b)=>a&&a[b],a)),getDaysDiffBetweenDates:(a,b)=>(b-a)/86400000,getScrollPosition:(a=window)=>({x:a.pageXOffset===void 0?a.scrollLeft:a.pageXOffset,y:a.pageYOffset===void 0?a.scrollTop:a.pageYOffset}),getStyle:(a,b)=>getComputedStyle(a)[b],getType:(a)=>a===void 0?'undefined':null===a?'null':a.constructor.name.toLowerCase(),getURLParameters:(a)=>(a.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((b,a)=>(b[a.slice(0,a.indexOf('='))]=a.slice(a.indexOf('=')+1),b),{}),groupBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((b,c,d)=>(b[c]=(b[c]||[]).concat(a[d]),b),{}),hammingDistance:(a,b)=>((a^b).toString(2).match(/1/g)||'').length,hasClass:(a,b)=>a.classList.contains(b),hasFlags:(...a)=>a.every((a)=>process.argv.includes(/^-{1,2}/.test(a)?a:'--'+a)),hashBrowser:(a)=>crypto.subtle.digest('SHA-256',new TextEncoder('utf-8').encode(a)).then((a)=>{let b=[],c=new DataView(a);for(let d=0;dnew Promise((b)=>setTimeout(()=>b(s.createHash('sha256').update(a).digest('hex')),0)),head:(a)=>a[0],hexToRGB:(a)=>{let b=!1,c=a.slice(a.startsWith('#')?1:0);return 3===c.length?c=[...c].map((a)=>a+a).join(''):8===c.length&&(b=!0),c=parseInt(c,16),'rgb'+(b?'a':'')+'('+(c>>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?`, ${255&c}`:'')+')'},hide:(...a)=>[...a].forEach((a)=>a.style.display='none'),httpGet:(a,b,c=console.error)=>{const d=new XMLHttpRequest;d.open('GET',a,!0),d.onload=()=>b(d.responseText),d.onerror=()=>c(d),d.send()},httpPost:(a,b,c,d=console.error)=>{const e=new XMLHttpRequest;e.open('POST',a,!0),e.setRequestHeader('Content-type','application/json; charset=utf-8'),e.onload=()=>c(e.responseText),e.onerror=()=>d(e),e.send(b)},httpsRedirect:()=>{'https:'!==location.protocol&&location.replace('https://'+location.href.split('//')[1])},inRange:(a,b,c=null)=>(c&&b>c&&(c=b),null==c?0<=a&&a=b&&a{const c=[];return a.forEach((a,d)=>a===b&&c.push(d)),c},initial:(a)=>a.slice(0,-1),initialize2DArray:(a,b,c=null)=>Array.from({length:b}).map(()=>Array.from({length:a}).fill(c)),initializeArrayWithRange:(a,b=0,c=1)=>Array.from({length:g((a+1-b)/c)}).map((a,d)=>d*c+b),initializeArrayWithRangeRight:(a,b=0,c=1)=>Array.from({length:g((a+1-b)/c)}).map((a,d,e)=>(e.length-d-1)*c+b),initializeArrayWithValues:(a,b=0)=>Array(a).fill(b),intersection:(c,a)=>{const b=new Set(a);return c.filter((a)=>b.has(a))},intersectionBy:(c,a,b)=>{const d=new Set(a.map((a)=>b(a)));return c.filter((a)=>d.has(b(a)))},intersectionWith:(c,a,b)=>c.filter((c)=>-1!==a.findIndex((a)=>b(c,a))),invertKeyValues:(a,b)=>Object.keys(a).reduce((c,d)=>{const e=b?b(a[d]):a[d];return c[e]=c[e]||[],c[e].push(d),c},{}),is:(a,b)=>b instanceof a,isAbsoluteURL:(a)=>/^[a-z][a-z0-9+.-]*:/.test(a),isArrayLike:(a)=>{try{return[...a],!0}catch(a){return!1}},isBoolean:(a)=>'boolean'==typeof a,isDivisible:(a,b)=>0==a%b,isEmpty:(a)=>null==a||!(Object.keys(a)||a).length,isEven:(a)=>0==a%2,isFunction:(a)=>'function'==typeof a,isLowerCase:(a)=>a===a.toLowerCase(),isNil:(a)=>a===void 0||null===a,isNull:(a)=>null===a,isNumber:(a)=>'number'==typeof a,isObject:(a)=>a===Object(a),isObjectLike:(a)=>null!==a&&'object'==typeof a,isPlainObject:(a)=>!!a&&'object'==typeof a&&a.constructor===Object,isPrime:(a)=>{const c=d(b(a));for(var e=2;e<=c;e++)if(0==a%e)return!1;return 2<=a},isPrimitive:(a)=>!['object','function'].includes(typeof a)||null===a,isPromiseLike:(a)=>null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.then,isSorted:(a)=>{const b=a[0]>a[1]?-1:1;for(let[c,d]of a.entries()){if(c===a.length-1)return b;if(0<(d-a[c+1])*b)return 0}},isString:(a)=>'string'==typeof a,isSymbol:(a)=>'symbol'==typeof a,isTravisCI:()=>'TRAVIS'in process.env&&'CI'in process.env,isUndefined:(a)=>a===void 0,isUpperCase:(a)=>a===a.toUpperCase(),isValidJSON:(a)=>{try{return JSON.parse(a),!0}catch(a){return!1}},join:(a,b=',',c=b)=>a.reduce((d,e,f)=>f==a.length-2?d+e+c:f==a.length-1?d+e:d+e+b,''),last:(a)=>a[a.length-1],lcm:(...a)=>{const b=(a,c)=>c?b(c,a%c):a,c=(a,c)=>a*c/b(a,c);return[...a].reduce((d,a)=>c(d,a))},longestItem:(...a)=>[...a].sort((c,a)=>a.length-c.length)[0],lowercaseKeys:(a)=>Object.keys(a).reduce((b,c)=>(b[c.toLowerCase()]=a[c],b),{}),luhnCheck:(a)=>{let b=(a+'').split('').reverse().map((a)=>parseInt(a)),c=b.splice(0,1)[0],d=b.reduce((a,b,c)=>0==c%2?a+2*b%9||9:a+b,0);return d+=c,0==d%10},mapKeys:(a,b)=>Object.keys(a).reduce((c,d)=>(c[b(a[d],d,a)]=a[d],c),{}),mapObject:(b,c)=>((d)=>(d=[b,b.map(c)],d[0].reduce((a,b,c)=>(a[b]=d[1][c],a),{})))(),mapValues:(a,b)=>Object.keys(a).reduce((c,d)=>(c[d]=b(a[d],d,a),c),{}),mask:(a,b=4,c='*')=>(''+a).slice(0,-b).replace(/./g,c)+(''+a).slice(-b),matches:(a,b)=>Object.keys(b).every((c)=>a.hasOwnProperty(c)&&a[c]===b[c]),matchesWith:(a,b,c)=>Object.keys(b).every((d)=>a.hasOwnProperty(d)&&c?c(a[d],b[d],d,a,b):a[d]==b[d]),maxBy:(a,b)=>f(...a.map('function'==typeof b?b:(a)=>a[b])),maxN:(a,b=1)=>[...a].sort((c,a)=>a-c).slice(0,b),median:(a)=>{const b=d(a.length/2),c=[...a].sort((c,a)=>c-a);return 0==a.length%2?(c[b-1]+c[b])/2:c[b]},memoize:(a)=>{const b=new Map,c=function(c){return b.has(c)?b.get(c):b.set(c,a.call(this,c))&&b.get(c)};return c.cache=b,c},merge:(...a)=>[...a].reduce((b,c)=>Object.keys(c).reduce((d,a)=>(b[a]=b.hasOwnProperty(a)?[].concat(b[a]).concat(c[a]):c[a],b),{}),{}),minBy:(a,b)=>e(...a.map('function'==typeof b?b:(a)=>a[b])),minN:(a,b=1)=>[...a].sort((c,a)=>c-a).slice(0,b),negate:(a)=>(...b)=>!a(...b),nthArg:(a)=>(...b)=>b.slice(a)[0],nthElement:(a,b=0)=>(0a.reduce((b,a)=>(b[a[0]]=a[1],b),{}),objectToPairs:(a)=>Object.keys(a).map((b)=>[b,a[b]]),observeMutations:(a,b,c)=>{const d=new MutationObserver((a)=>a.forEach((a)=>b(a)));return d.observe(a,Object.assign({childList:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},c)),d},off:(a,b,c,d=!1)=>a.removeEventListener(b,c,d),omit:(a,b)=>Object.keys(a).filter((a)=>!b.includes(a)).reduce((b,c)=>(b[c]=a[c],b),{}),omitBy:(a,b)=>Object.keys(a).filter((c)=>!b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),on:(a,b,c,d={})=>{const e=(a)=>a.target.matches(d.target)&&c.call(a.target,a);if(a.addEventListener(b,d.target?e:c,d.options||!1),d.target)return e},onUserInputChange:(a)=>{let b='mouse',c=0;const d=()=>{const e=performance.now();20>e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',()=>{'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:(a)=>{let b=!1;return function(...c){if(!b)return b=!0,a.apply(this,c)}},orderBy:(a,c,d)=>[...a].sort((e,a)=>c.reduce((b,c,f)=>{if(0===b){const[g,h]=d&&'desc'===d[f]?[a[c],e[c]]:[e[c],a[c]];b=g>h?1:g(...b)=>a.map((a)=>a.apply(null,b)),palindrome:(a)=>{const b=a.toLowerCase().replace(/[\W_]/g,'');return b===b.split('').reverse().join('')},parseCookie:(a)=>a.split(';').map((a)=>a.split('=')).reduce((a,b)=>(a[decodeURIComponent(b[0].trim())]=decodeURIComponent(b[1].trim()),a),{}),partial:(a,...b)=>(...c)=>a(...b,...c),partialRight:(a,...b)=>(...c)=>a(...c,...b),partition:(a,b)=>a.reduce((a,c,d,e)=>(a[b(c,d,e)?0:1].push(c),a),[[],[]]),percentile:(a,b)=>100*a.reduce((a,c)=>a+(cb.reduce((b,c)=>(c in a&&(b[c]=a[c]),b),{}),pickBy:(a,b)=>Object.keys(a).filter((c)=>b(a[c],c)).reduce((b,c)=>(b[c]=a[c],b),{}),pipeFunctions:(...a)=>a.reduce((a,b)=>(...c)=>b(a(...c))),pluralize:(a,b,c=b+'s')=>{const d=(a,b,c=b+'s')=>[1,-1].includes(+a)?b:c;return'object'==typeof a?(b,c)=>d(b,c,a[c]):d(a,b,c)},powerset:(a)=>a.reduce((b,a)=>b.concat(b.map((b)=>[a].concat(b))),[[]]),prettyBytes:(a,b=3,c=!0)=>{const f=['B','KB','MB','GB','TB','PB','EB','ZB','YB'];if(1>Math.abs(a))return a+(c?' ':'')+f[0];const g=e(d(Math.log10(0>a?-a:a)/3),f.length-1),h=+((0>a?-a:a)/1e3**g).toPrecision(b);return(0>a?'-':'')+h+(c?' ':'')+f[g]},primes:(a)=>{let c=Array.from({length:a-1}).map((a,b)=>b+2),e=d(b(a)),f=Array.from({length:e-1}).map((a,b)=>b+2);return f.forEach((a)=>c=c.filter((b)=>0!=b%a||b==a)),c},promisify:(a)=>(...b)=>new Promise((c,d)=>a(...b,(a,b)=>a?d(a):c(b))),pull:(a,...b)=>{let c=Array.isArray(b[0])?b[0]:b,d=a.filter((a)=>!c.includes(a));a.length=0,d.forEach((b)=>a.push(b))},pullAtIndex:(a,b)=>{let c=[],d=a.map((a,d)=>b.includes(d)?c.push(a):a).filter((a,c)=>!b.includes(c));return a.length=0,d.forEach((b)=>a.push(b)),c},pullAtValue:(a,b)=>{let c=[],d=a.forEach((a)=>b.includes(a)?c.push(a):a),e=a.filter((a)=>!b.includes(a));return a.length=0,e.forEach((b)=>a.push(b)),c},pullBy:(a,...b)=>{const c=b.length;let d=1d(a)),f=a.filter((a)=>!e.includes(d(a)));a.length=0,f.forEach((b)=>a.push(b))},randomHexColorCode:()=>{let a=(0|1048575*Math.random()).toString(16);return'#'+(6===a.length?a:(0|15*Math.random()).toString(16)+a)},randomIntArrayInRange:(a,b,c=1)=>Array.from({length:c},()=>d(Math.random()*(b-a+1))+a),randomIntegerInRange:(a,b)=>d(Math.random()*(b-a+1))+a,randomNumberInRange:(a,b)=>Math.random()*(b-a)+a,readFileLines:(a)=>t.readFileSync(a).toString('UTF8').split('\n'),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),reduceSuccessive:(a,b,c)=>a.reduce((a,c,d,e)=>(a.push(b(a.slice(-1)[0],c,d,e)),a),[c]),reduceWhich:(a,c=(c,a)=>c-a)=>a.reduce((d,a)=>0<=c(d,a)?a:d),reducedFilter:(a,b,c)=>a.filter(c).map((a)=>b.reduce((b,c)=>(b[c]=a[c],b),{})),remove:(a,b)=>Array.isArray(a)?a.filter(b).reduce((b,c)=>(a.splice(a.indexOf(c),1),b.concat(c)),[]):[],removeNonASCII:(a)=>a.replace(/[^\x20-\x7E]/g,''),reverseString:(a)=>[...a].join(''),round:(b,c=0)=>+`${a(`${b}e${c}`)}e-${c}`,runAsync:(a)=>{const b=`var fn = ${a.toString()}; postMessage(fn());`,c=new Worker(URL.createObjectURL(new Blob([b]),{type:'application/javascript; charset=utf-8'}));return new Promise((a,b)=>{c.onmessage=({data:b})=>{a(b),c.terminate()},c.onerror=(a)=>{b(a),c.terminate()}})},runPromisesInSeries:(a)=>a.reduce((a,b)=>a.then(b),Promise.resolve()),sample:(a)=>a[d(Math.random()*a.length)],sampleSize:([...a],b=1)=>{for(let c=a.length;c;){const b=d(Math.random()*c--);[a[c],a[b]]=[a[b],a[c]]}return a.slice(0,b)},scrollToTop:u,sdbm:(a)=>{let b=a.split('');return b.reduce((a,b)=>a=b.charCodeAt(0)+(a<<6)+(a<<16)-a,0)},serializeCookie:(a,b)=>`${encodeURIComponent(a)}=${encodeURIComponent(b)}`,setStyle:(a,b,c)=>a.style[b]=c,shallowClone:(a)=>Object.assign({},a),show:(...a)=>[...a].forEach((a)=>a.style.display=''),shuffle:([...a])=>{for(let b=a.length;b;){const c=d(Math.random()*b--);[a[b],a[c]]=[a[c],a[b]]}return a},similarity:(a,b)=>a.filter((a)=>b.includes(a)),size:(a)=>Array.isArray(a)?a.length:a&&'object'==typeof a?a.size||a.length||Object.keys(a).length:'string'==typeof a?new Blob([a]).size:0,sleep:(a)=>new Promise((b)=>setTimeout(b,a)),sortCharactersInString:(a)=>[...a].sort((c,a)=>c.localeCompare(a)).join(''),sortedIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.findIndex((a)=>c?b>=a:b<=a);return-1===d?a.length:d},sortedIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),f=a.findIndex((a)=>d?e>=c(a):e<=c(a));return-1===f?a.length:f},sortedLastIndex:(a,b)=>{const c=a[0]>a[a.length-1],d=a.map((a,b)=>[b,a]).reverse().findIndex((a)=>c?b<=a[1]:b>=a[1]);return-1===d?0:a.length-d-1},sortedLastIndexBy:(a,b,c)=>{const d=c(a[0])>c(a[a.length-1]),e=c(b),f=a.map((a,b)=>[b,c(a)]).reverse().findIndex((a)=>d?e<=a[1]:e>=a[1]);return-1===f?0:a.length-f},splitLines:(a)=>a.split(/\r?\n/),spreadOver:(a)=>(b)=>a(...b),standardDeviation:(a,c=!1)=>{const d=a.reduce((a,b)=>a+b,0)/a.length;return b(a.reduce((a,b)=>a.concat((b-d)**2),[]).reduce((a,b)=>a+b,0)/(a.length-(c?0:1)))},stripHTMLTags:(a)=>a.replace(/<[^>]*>/g,''),sum:(...a)=>[...a].reduce((a,b)=>a+b,0),sumBy:(a,b)=>a.map('function'==typeof b?b:(a)=>a[b]).reduce((a,b)=>a+b,0),sumPower:(a,b=2,c=1)=>Array(a+1-c).fill(0).map((a,d)=>(d+c)**b).reduce((c,a)=>c+a,0),symmetricDifference:(c,a)=>{const b=new Set(c),d=new Set(a);return[...c.filter((a)=>!d.has(a)),...a.filter((a)=>!b.has(a))]},symmetricDifferenceBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a))),e=new Set(a.map((a)=>b(a)));return[...c.filter((a)=>!e.has(b(a))),...a.filter((a)=>!d.has(b(a)))]},symmetricDifferenceWith:(b,c,d)=>[...b.filter((e)=>-1===c.findIndex((a)=>d(e,a))),...c.filter((c)=>-1===b.findIndex((a)=>d(c,a)))],tail:(a)=>1a.slice(0,b),takeRight:(a,b=1)=>a.slice(a.length-b,a.length),takeRightWhile:(a,b)=>{for(let c of a.reverse().keys())if(b(a[c]))return a.reverse().slice(a.length-c,a.length);return a},takeWhile:(a,b)=>{for(let c of a.keys())if(b(a[c]))return a.slice(0,c);return a},timeTaken:(a)=>{console.time('timeTaken');const b=a();return console.timeEnd('timeTaken'),b},times:(a,b,c=void 0)=>{for(let d=0;!1!==b.call(c,d)&&++d{let b=a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()).join('');return b.slice(0,1).toLowerCase()+b.slice(1)},toDecimalMark:(a)=>a.toLocaleString('en-US'),toKebabCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('-'),toOrdinalSuffix:(a)=>{const b=parseInt(a),c=[b%10,b%100],d=['st','nd','rd','th'];return[1,2,3,4].includes(c[0])&&![11,12,13,14,15,16,17,18,19].includes(c[1])?b+d[c[0]-1]:b+d[3]},toSafeInteger:(b)=>a(f(e(b,Number.MAX_SAFE_INTEGER),Number.MIN_SAFE_INTEGER)),toSnakeCase:(a)=>a&&a.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map((a)=>a.toLowerCase()).join('_'),toggleClass:(a,b)=>a.classList.toggle(b),tomorrow:()=>{let a=new Date;return a.setDate(a.getDate()+1),`${a.getFullYear()}-${(a.getMonth()+1+'').padStart(2,'0')}-${(a.getDate()+'').padStart(2,'0')}`},transform:(b,c,a)=>Object.keys(b).reduce((d,a)=>c(d,b[a],a,b),a),truncateString:(a,b)=>a.length>b?a.slice(0,3a.every((a)=>a[b]),unary:(a)=>(b)=>a(b),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),unfold:(a,b)=>{let c=[],d=[null,b];for(;d=a(d[1]);)c.push(d[0]);return c},union:(c,a)=>Array.from(new Set([...c,...a])),unionBy:(c,a,b)=>{const d=new Set(c.map((a)=>b(a)));return Array.from(new Set([...c,...a.filter((a)=>!d.has(b(a)))]))},unionWith:(c,a,b)=>Array.from(new Set([...c,...a.filter((a)=>-1===c.findIndex((c)=>b(a,c)))])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),unzip:(a)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:f(...a.map((a)=>a.length))}).map(()=>[])),unzipWith:(a,b)=>a.reduce((a,b)=>(b.forEach((b,c)=>a[c].push(b)),a),Array.from({length:f(...a.map((a)=>a.length))}).map(()=>[])).map((a)=>b(...a)),validateNumber:(a)=>!isNaN(parseFloat(a))&&isFinite(a)&&+a==a,without:(a,...b)=>a.filter((a)=>!b.includes(a)),words:(a,b=/[^a-zA-Z-]+/)=>a.split(b).filter(Boolean),xProd:(c,a)=>c.reduce((b,c)=>b.concat(a.map((a)=>[c,a])),[]),yesNo:(a,b=!1)=>!!/^(y|yes)$/i.test(a)||!/^(n|no)$/i.test(a)&&b,zip:(...a)=>{const b=f(...a.map((a)=>a.length));return Array.from({length:b}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]))},zipObject:(a,b)=>a.reduce((a,c,d)=>(a[c]=b[d],a),{}),zipWith:(...a)=>{const b=a.length;let c=1a.length)),e=Array.from({length:d}).map((b,c)=>Array.from({length:a.length},(b,d)=>a[d][c]));return c?e.map((a)=>c(...a)):e}}}); diff --git a/test/bindAll/bindAll.js b/test/bindAll/bindAll.js new file mode 100644 index 000000000..cf66ad583 --- /dev/null +++ b/test/bindAll/bindAll.js @@ -0,0 +1,8 @@ +const bindAll = (obj, ...fns) => +fns.forEach( +fn => +(obj[fn] = function() { +return fn.apply(obj); +}) +); +module.exports = bindAll \ No newline at end of file diff --git a/test/bindAll/bindAll.test.js b/test/bindAll/bindAll.test.js new file mode 100644 index 000000000..513eae230 --- /dev/null +++ b/test/bindAll/bindAll.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const bindAll = require('./bindAll.js'); + +test('Testing bindAll', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof bindAll === 'function', 'bindAll is a Function'); + //t.deepEqual(bindAll(args..), 'Expected'); + //t.equal(bindAll(args..), 'Expected'); + //t.false(bindAll(args..), 'Expected'); + //t.throws(bindAll(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/drop/drop.js b/test/drop/drop.js new file mode 100644 index 000000000..53f8cd929 --- /dev/null +++ b/test/drop/drop.js @@ -0,0 +1,2 @@ +const drop = (arr, n = 1) => arr.slice(n); +module.exports = drop \ No newline at end of file diff --git a/test/drop/drop.test.js b/test/drop/drop.test.js new file mode 100644 index 000000000..693926c49 --- /dev/null +++ b/test/drop/drop.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const drop = require('./drop.js'); + +test('Testing drop', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof drop === 'function', 'drop is a Function'); + //t.deepEqual(drop(args..), 'Expected'); + //t.equal(drop(args..), 'Expected'); + //t.false(drop(args..), 'Expected'); + //t.throws(drop(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/dropRightWhile/dropRightWhile.js b/test/dropRightWhile/dropRightWhile.js new file mode 100644 index 000000000..3b6dd7ccb --- /dev/null +++ b/test/dropRightWhile/dropRightWhile.js @@ -0,0 +1,5 @@ +const dropRightWhile = (arr, func) => { +while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1); +return arr; +}; +module.exports = dropRightWhile \ No newline at end of file diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js new file mode 100644 index 000000000..81638f00f --- /dev/null +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const dropRightWhile = require('./dropRightWhile.js'); + +test('Testing dropRightWhile', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof dropRightWhile === 'function', 'dropRightWhile is a Function'); + //t.deepEqual(dropRightWhile(args..), 'Expected'); + //t.equal(dropRightWhile(args..), 'Expected'); + //t.false(dropRightWhile(args..), 'Expected'); + //t.throws(dropRightWhile(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/dropWhile/dropWhile.js b/test/dropWhile/dropWhile.js new file mode 100644 index 000000000..655598419 --- /dev/null +++ b/test/dropWhile/dropWhile.js @@ -0,0 +1,5 @@ +const dropWhile = (arr, func) => { +while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1); +return arr; +}; +module.exports = dropWhile \ No newline at end of file diff --git a/test/dropWhile/dropWhile.test.js b/test/dropWhile/dropWhile.test.js new file mode 100644 index 000000000..6e0ecf54e --- /dev/null +++ b/test/dropWhile/dropWhile.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const dropWhile = require('./dropWhile.js'); + +test('Testing dropWhile', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof dropWhile === 'function', 'dropWhile is a Function'); + //t.deepEqual(dropWhile(args..), 'Expected'); + //t.equal(dropWhile(args..), 'Expected'); + //t.false(dropWhile(args..), 'Expected'); + //t.throws(dropWhile(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/pullBy/pullBy.js b/test/pullBy/pullBy.js new file mode 100644 index 000000000..9f7d1f6dc --- /dev/null +++ b/test/pullBy/pullBy.js @@ -0,0 +1,10 @@ +const pullBy = (arr, ...args) => { +const length = args.length; +let fn = length > 1 ? args[length - 1] : undefined; +fn = typeof fn == 'function' ? (args.pop(), fn) : undefined; +let argState = (Array.isArray(args[0]) ? args[0] : args).map(val => fn(val)); +let pulled = arr.filter((v, i) => !argState.includes(fn(v))); +arr.length = 0; +pulled.forEach(v => arr.push(v)); +}; +module.exports = pullBy \ No newline at end of file diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js new file mode 100644 index 000000000..47d00a694 --- /dev/null +++ b/test/pullBy/pullBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const pullBy = require('./pullBy.js'); + +test('Testing pullBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof pullBy === 'function', 'pullBy is a Function'); + //t.deepEqual(pullBy(args..), 'Expected'); + //t.equal(pullBy(args..), 'Expected'); + //t.false(pullBy(args..), 'Expected'); + //t.throws(pullBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/removeNonASCII/removeNonASCII.js b/test/removeNonASCII/removeNonASCII.js new file mode 100644 index 000000000..5d6d25acd --- /dev/null +++ b/test/removeNonASCII/removeNonASCII.js @@ -0,0 +1,2 @@ +const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, ''); +module.exports = removeNonASCII \ No newline at end of file diff --git a/test/removeNonASCII/removeNonASCII.test.js b/test/removeNonASCII/removeNonASCII.test.js new file mode 100644 index 000000000..99d05cf44 --- /dev/null +++ b/test/removeNonASCII/removeNonASCII.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const removeNonASCII = require('./removeNonASCII.js'); + +test('Testing removeNonASCII', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof removeNonASCII === 'function', 'removeNonASCII is a Function'); + //t.deepEqual(removeNonASCII(args..), 'Expected'); + //t.equal(removeNonASCII(args..), 'Expected'); + //t.false(removeNonASCII(args..), 'Expected'); + //t.throws(removeNonASCII(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/sortedIndexBy/sortedIndexBy.js b/test/sortedIndexBy/sortedIndexBy.js new file mode 100644 index 000000000..2d30a90e8 --- /dev/null +++ b/test/sortedIndexBy/sortedIndexBy.js @@ -0,0 +1,7 @@ +const sortedIndexBy = (arr, n, fn) => { +const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); +const val = fn(n); +const index = arr.findIndex(el => (isDescending ? val >= fn(el) : val <= fn(el))); +return index === -1 ? arr.length : index; +}; +module.exports = sortedIndexBy \ No newline at end of file diff --git a/test/sortedIndexBy/sortedIndexBy.test.js b/test/sortedIndexBy/sortedIndexBy.test.js new file mode 100644 index 000000000..ca74bbf15 --- /dev/null +++ b/test/sortedIndexBy/sortedIndexBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const sortedIndexBy = require('./sortedIndexBy.js'); + +test('Testing sortedIndexBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof sortedIndexBy === 'function', 'sortedIndexBy is a Function'); + //t.deepEqual(sortedIndexBy(args..), 'Expected'); + //t.equal(sortedIndexBy(args..), 'Expected'); + //t.false(sortedIndexBy(args..), 'Expected'); + //t.throws(sortedIndexBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/sortedLastIndex/sortedLastIndex.js b/test/sortedLastIndex/sortedLastIndex.js index eaee796a5..0da2ba411 100644 --- a/test/sortedLastIndex/sortedLastIndex.js +++ b/test/sortedLastIndex/sortedLastIndex.js @@ -2,8 +2,8 @@ const sortedLastIndex = (arr, n) => { const isDescending = arr[0] > arr[arr.length - 1]; const index = arr .map((val, i) => [i, val]) -.filter(el => (isDescending ? n >= el[1] : n >= el[1])) -.slice(-1)[0][0]; -return index === -1 ? arr.length : index; +.reverse() +.findIndex(el => (isDescending ? n <= el[1] : n >= el[1])); +return index === -1 ? 0 : arr.length - index - 1; }; module.exports = sortedLastIndex \ No newline at end of file diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.js b/test/sortedLastIndexBy/sortedLastIndexBy.js new file mode 100644 index 000000000..b638df20f --- /dev/null +++ b/test/sortedLastIndexBy/sortedLastIndexBy.js @@ -0,0 +1,10 @@ +const sortedLastIndexBy = (arr, n, fn) => { +const isDescending = fn(arr[0]) > fn(arr[arr.length - 1]); +const val = fn(n); +const index = arr +.map((val, i) => [i, fn(val)]) +.reverse() +.findIndex(el => (isDescending ? val <= el[1] : val >= el[1])); +return index === -1 ? 0 : arr.length - index; +}; +module.exports = sortedLastIndexBy \ No newline at end of file diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.test.js b/test/sortedLastIndexBy/sortedLastIndexBy.test.js new file mode 100644 index 000000000..d681fb357 --- /dev/null +++ b/test/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const sortedLastIndexBy = require('./sortedLastIndexBy.js'); + +test('Testing sortedLastIndexBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof sortedLastIndexBy === 'function', 'sortedLastIndexBy is a Function'); + //t.deepEqual(sortedLastIndexBy(args..), 'Expected'); + //t.equal(sortedLastIndexBy(args..), 'Expected'); + //t.false(sortedLastIndexBy(args..), 'Expected'); + //t.throws(sortedLastIndexBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/stripHTMLTags/stripHTMLTags.js b/test/stripHTMLTags/stripHTMLTags.js new file mode 100644 index 000000000..7c14b0b8a --- /dev/null +++ b/test/stripHTMLTags/stripHTMLTags.js @@ -0,0 +1,2 @@ +const stripHTMLTags = str => str.replace(/<[^>]*>/g, ''); +module.exports = stripHTMLTags \ No newline at end of file diff --git a/test/stripHTMLTags/stripHTMLTags.test.js b/test/stripHTMLTags/stripHTMLTags.test.js new file mode 100644 index 000000000..71222ea7b --- /dev/null +++ b/test/stripHTMLTags/stripHTMLTags.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const stripHTMLTags = require('./stripHTMLTags.js'); + +test('Testing stripHTMLTags', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof stripHTMLTags === 'function', 'stripHTMLTags is a Function'); + //t.deepEqual(stripHTMLTags(args..), 'Expected'); + //t.equal(stripHTMLTags(args..), 'Expected'); + //t.false(stripHTMLTags(args..), 'Expected'); + //t.throws(stripHTMLTags(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/takeRightWhile/takeRightWhile.js b/test/takeRightWhile/takeRightWhile.js new file mode 100644 index 000000000..4dc889aad --- /dev/null +++ b/test/takeRightWhile/takeRightWhile.js @@ -0,0 +1,6 @@ +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; +}; +module.exports = takeRightWhile \ No newline at end of file diff --git a/test/takeRightWhile/takeRightWhile.test.js b/test/takeRightWhile/takeRightWhile.test.js new file mode 100644 index 000000000..bfe8ab71e --- /dev/null +++ b/test/takeRightWhile/takeRightWhile.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const takeRightWhile = require('./takeRightWhile.js'); + +test('Testing takeRightWhile', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof takeRightWhile === 'function', 'takeRightWhile is a Function'); + //t.deepEqual(takeRightWhile(args..), 'Expected'); + //t.equal(takeRightWhile(args..), 'Expected'); + //t.false(takeRightWhile(args..), 'Expected'); + //t.throws(takeRightWhile(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/takeWhile/takeWhile.js b/test/takeWhile/takeWhile.js new file mode 100644 index 000000000..febed48f8 --- /dev/null +++ b/test/takeWhile/takeWhile.js @@ -0,0 +1,5 @@ +const takeWhile = (arr, func) => { +for (let i of arr.keys()) if (func(arr[i])) return arr.slice(0, i); +return arr; +}; +module.exports = takeWhile \ No newline at end of file diff --git a/test/takeWhile/takeWhile.test.js b/test/takeWhile/takeWhile.test.js new file mode 100644 index 000000000..0cd167bf4 --- /dev/null +++ b/test/takeWhile/takeWhile.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const takeWhile = require('./takeWhile.js'); + +test('Testing takeWhile', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof takeWhile === 'function', 'takeWhile is a Function'); + //t.deepEqual(takeWhile(args..), 'Expected'); + //t.equal(takeWhile(args..), 'Expected'); + //t.false(takeWhile(args..), 'Expected'); + //t.throws(takeWhile(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 5231e9992..eebfee7dc 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1487 +1,8 @@ -Test log for: Fri Jan 26 2018 12:00:18 GMT+0200 (GTB Standard Time) +Test log for: Fri Jan 26 2018 20:13:29 GMT+0000 (UTC) -> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code +> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing anagrams - - √ anagrams is a Function - √ Generates all anagrams of a string - - Testing arrayToHtmlList - - √ arrayToHtmlList is a Function - √ Generates and fills a list element - - Testing ary - - √ ary is a Function - - Testing atob - - √ atob is a Function - √ atob("Zm9vYmFy") equals "foobar" - √ atob("Z") returns "" - - Testing average - - √ average is a Function - √ average(true) returns 0 - √ average(false) returns 1 - √ average(9, 1) returns 5 - √ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - √ average(1, 2, 3) returns 2 - √ average(null) returns 0 - √ average(1, 2, 3) returns NaN - √ average(String) returns NaN - √ average({ a: 123}) returns NaN - √ average([undefined, 0, string]) returns NaN - √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing averageBy - - √ averageBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing binarySearch - - √ binarySearch is a Function - - Testing bind - - √ bind is a Function - - Testing bindKey - - √ bindKey is a Function - - Testing bottomVisible - - √ bottomVisible is a Function - - Testing btoa - - √ btoa is a Function - √ btoa("foobar") equals "Zm9vYmFy" - - Testing byteSize - - √ byteSize is a Function - - Testing call - - √ call is a Function - - Testing capitalize - - √ capitalize is a Function - √ Capitalizes the first letter of a string - √ Capitalizes the first letter of a string - - Testing capitalizeEveryWord - - √ capitalizeEveryWord is a Function - √ Capitalizes the first letter of every word in a string - - Testing castArray - - √ castArray is a Function - √ Works for single values - √ Works for arrays with one value - √ Works for arrays with multiple value - √ Works for strings - √ Works for objects - - Testing chainAsync - - √ chainAsync is a Function - - Testing chunk - - √ chunk is a Function - √ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - √ chunk([]) returns [] - √ chunk(123) returns [] - √ chunk({ a: 123}) returns [] - √ chunk(string, 2) returns [ st, ri, ng ] - √ chunk() throws an error - √ chunk(undefined) throws an error - √ chunk(null) throws an error - √ chunk(This is a string, 2) takes less than 2s to run - - Testing clampNumber - - √ clampNumber is a Function - √ Clamps num within the inclusive range specified by the boundary values a and b - - Testing cleanObj - - √ cleanObj is a Function - √ Removes any properties except the ones specified from a JSON object - - Testing cloneRegExp - - √ cloneRegExp is a Function - √ Clones regular expressions properly - - Testing coalesce - - √ coalesce is a Function - √ Returns the first non-null/undefined argument - - Testing coalesceFactory - - √ coalesceFactory is a Function - √ Returns a customized coalesce function - - Testing collatz - - √ collatz is a Function - - Testing collectInto - - √ collectInto is a Function - - Testing colorize - - √ colorize is a Function - - Testing compact - - √ compact is a Function - √ Removes falsey values from an array - - Testing compose - - √ compose is a Function - √ Performs right-to-left function composition - - Testing composeRight - - √ composeRight is a Function - √ Performs left-to-right function composition - - Testing copyToClipboard - - √ copyToClipboard is a Function - - Testing countBy - - √ countBy is a Function - - Testing countOccurrences - - √ countOccurrences is a Function - √ Counts the occurrences of a value in an array - - Testing countVowels - - √ countVowels is a Function - - Testing createElement - - √ createElement is a Function - - Testing createEventHub - - √ createEventHub is a Function - - Testing currentURL - - √ currentURL is a Function - - Testing curry - - √ curry is a Function - √ curries a Math.pow - √ curries a Math.min - - Testing decapitalize - - √ decapitalize is a Function - - Testing deepClone - - √ deepClone is a Function - √ Shallow cloning works - √ Deep cloning works - - Testing deepFlatten - - √ deepFlatten is a Function - √ Deep flattens an array - - Testing defaults - - √ defaults is a Function - - Testing defer - - √ defer is a Function - - Testing delay - - √ delay is a Function - - Testing detectDeviceType - - √ detectDeviceType is a Function - - Testing difference - - √ difference is a Function - √ Returns the difference between two arrays - - Testing differenceBy - - √ differenceBy is a Function - - Testing differenceWith - - √ differenceWith is a Function - √ Filters out all values from an array - - Testing digitize - - √ digitize is a Function - √ Converts a number to an array of digits - - Testing distance - - √ distance is a Function - - Testing dropWhile - - √ dropWhile is a Function - √ Removes elements in an array until the passed function returns true - - Testing dropRight - - √ dropRight is a Function - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - √ Returns a new array with n elements removed from the right - - Testing elementIsVisibleInViewport - - √ elementIsVisibleInViewport is a Function - - Testing elo - - √ elo is a Function - √ Standard 1v1s - √ should be equivalent - √ 4 player FFA, all same rank - - Testing equals - - √ equals is a Function - √ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - √ [1,2,3] is equal to [1,2,3] - √ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - √ [1,2,3] is not equal to [1,2,4] - √ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. - - Testing escapeHTML - - √ escapeHTML is a Function - √ Escapes a string for use in HTML - - Testing escapeRegExp - - √ escapeRegExp is a Function - √ Escapes a string to use in a regular expression - - Testing everyNth - - √ everyNth is a Function - √ Returns every nth element in an array - - Testing extendHex - - √ extendHex is a Function - √ Extends a 3-digit color code to a 6-digit color code - √ Extends a 3-digit color code to a 6-digit color code - - Testing factorial - - √ factorial is a Function - √ Calculates the factorial of 720 - √ Calculates the factorial of 0 - √ Calculates the factorial of 1 - √ Calculates the factorial of 4 - √ Calculates the factorial of 10 - - Testing factors - - √ factors is a Function - - Testing fibonacci - - √ fibonacci is a Function - √ Generates an array, containing the Fibonacci sequence - - Testing fibonacciCountUntilNum - - √ fibonacciCountUntilNum is a Function - - Testing fibonacciUntilNum - - √ fibonacciUntilNum is a Function - - Testing filterNonUnique - - √ filterNonUnique is a Function - √ Filters out the non-unique values in an array - - Testing findKey - - √ findKey is a Function - - Testing findLast - - √ findLast is a Function - - Testing findLastIndex - - √ findLastIndex is a Function - - Testing findLastKey - - √ findLastKey is a Function - - Testing flatten - - √ flatten is a Function - √ Flattens an array - √ Flattens an array - - Testing flip - - √ flip is a Function - - Testing forEachRight - - √ forEachRight is a Function - - Testing formatDuration - - √ formatDuration is a Function - √ Returns the human readable format of the given number of milliseconds - √ Returns the human readable format of the given number of milliseconds - - Testing forOwn - - √ forOwn is a Function - - Testing forOwnRight - - √ forOwnRight is a Function - - Testing fromCamelCase - - √ fromCamelCase is a Function - √ Converts a string from camelcase - √ Converts a string from camelcase - √ Converts a string from camelcase - - Testing functionName - - √ functionName is a Function - - Testing functions - - √ functions is a Function - - Testing gcd - - √ gcd is a Function - √ Calculates the greatest common divisor between two or more numbers/arrays - √ Calculates the greatest common divisor between two or more numbers/arrays - - Testing geometricProgression - - √ geometricProgression is a Function - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - √ Initializes an array containing the numbers in the specified range - - Testing get - - √ get is a Function - √ Retrieve a property indicated by the selector from an object. - - Testing getDaysDiffBetweenDates - - √ getDaysDiffBetweenDates is a Function - √ Returns the difference in days between two dates - - Testing getScrollPosition - - √ getScrollPosition is a Function - - Testing getStyle - - √ getStyle is a Function - - Testing getType - - √ getType is a Function - √ Returns the native type of a value - - Testing getURLParameters - - √ getURLParameters is a Function - √ Returns an object containing the parameters of the current URL - - Testing groupBy - - √ groupBy is a Function - √ Groups the elements of an array based on the given function - √ Groups the elements of an array based on the given function - - Testing hammingDistance - - √ hammingDistance is a Function - √ retuns hamming disance between 2 values - - Testing hasClass - - √ hasClass is a Function - √ element has the specified class - - Testing hasFlags - - √ hasFlags is a Function - - Testing hashBrowser - - √ hashBrowser is a Function - - Testing hashNode - - √ hashNode is a Function - - Testing head - - √ head is a Function - √ head({ a: 1234}) returns undefined - √ head([1, 2, 3]) returns 1 - √ head({ 0: false}) returns false - √ head(String) returns S - √ head(null) throws an Error - √ head(undefined) throws an Error - √ head() throws an Error - √ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing hexToRGB - - √ hexToRGB is a Function - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - √ Converts a color code to a rgb() or rgba() string - - Testing hide - - √ hide is a Function - - Testing howManyTimes - - √ howManyTimes is a Function - - Testing httpDelete - - √ httpDelete is a Function - - Testing httpGet - - √ httpGet is a Function - - Testing httpPost - - √ httpPost is a Function - - Testing httpPut - - √ httpPut is a Function - - Testing httpsRedirect - - √ httpsRedirect is a Function - - Testing indexOfAll - - √ indexOfAll is a Function - √ Returns all indices of val in an array - √ Returns all indices of val in an array - - Testing initial - - √ initial is a Function - √ Returns all the elements of an array except the last one - - Testing initialize2DArray - - √ initialize2DArray is a Function - √ Initializes a 2D array of given width and height and value - - Testing initializeArrayWithRange - - √ initializeArrayWithRange is a Function - √ Initializes an array containing the numbers in the specified range - - Testing initializeArrayWithRangeRight - - √ initializeArrayWithRangeRight is a Function - - Testing initializeArrayWithValues - - √ initializeArrayWithValues is a Function - √ Initializes and fills an array with the specified values - - Testing inRange - - √ inRange is a Function - √ The given number falls within the given range - √ The given number falls within the given range - √ The given number does not falls within the given range - √ The given number does not falls within the given range - - Testing intersection - - √ intersection is a Function - √ Returns a list of elements that exist in both arrays - - Testing intersectionBy - - √ intersectionBy is a Function - - Testing intersectionWith - - √ intersectionWith is a Function - - Testing invertKeyValues - - √ invertKeyValues is a Function - √ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - √ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } - - Testing is - - √ is is a Function - √ Works for arrays with data - √ Works for empty arrays - √ Works for arrays, not objects - √ Works for objects - √ Works for maps - √ Works for regular expressions - √ Works for sets - √ Works for weak maps - √ Works for weak sets - √ Works for strings - returns false for primitive - √ Works for strings - returns true when using constructor - √ Works for numbers - returns false for primitive - √ Works for numbers - returns true when using constructor - √ Works for booleans - returns false for primitive - √ Works for booleans - returns true when using constructor - √ Works for functions - - Testing isAbsoluteURL - - √ isAbsoluteURL is a Function - √ Given string is an absolute URL - √ Given string is an absolute URL - √ Given string is not an absolute URL - - Testing isArmstrongNumber - - √ isArmstrongNumber is a Function - - Testing isArray - - √ isArray is a Function - √ passed value is an array - √ passed value is not an array - - Testing isArrayBuffer - - √ isArrayBuffer is a Function - - Testing isArrayLike - - √ isArrayLike is a Function - - Testing isBoolean - - √ isBoolean is a Function - √ passed value is not a boolean - √ passed value is not a boolean - - Testing isDivisible - - √ isDivisible is a Function - √ The number 6 is divisible by 3 - - Testing isEmpty - - √ isEmpty is a Function - - Testing isEven - - √ isEven is a Function - √ 4 is even number - √ undefined - - Testing isFunction - - √ isFunction is a Function - √ passed value is a function - √ passed value is not a function - - Testing isLowerCase - - √ isLowerCase is a Function - √ passed string is a lowercase - √ passed string is a lowercase - √ passed value is not a lowercase - - Testing isMap - - √ isMap is a Function - - Testing isNil - - √ isNil is a Function - - Testing isNull - - √ isNull is a Function - √ passed argument is a null - √ passed argument is a null - - Testing isNumber - - √ isNumber is a Function - √ passed argument is a number - √ passed argument is not a number - - Testing isObject - - √ isObject is a Function - √ isObject([1, 2, 3, 4]) is a object - √ isObject([]) is a object - √ isObject({ a:1 }) is a object - √ isObject(true) is not a object - - Testing isObjectLike - - √ isObjectLike is a Function - - Testing isPlainObject - - √ isPlainObject is a Function - - Testing isPrime - - √ isPrime is a Function - √ passed number is a prime - - Testing isPrimitive - - √ isPrimitive is a Function - √ isPrimitive(null) is primitive - √ isPrimitive(undefined) is primitive - √ isPrimitive(string) is primitive - √ isPrimitive(true) is primitive - √ isPrimitive(50) is primitive - √ isPrimitive('Hello') is primitive - √ isPrimitive(false) is primitive - √ isPrimitive(Symbol()) is primitive - √ isPrimitive([1, 2, 3]) is not primitive - √ isPrimitive({ a: 123 }) is not primitive - √ isPrimitive({ a: 123 }) takes less than 2s to run - - Testing isPromiseLike - - √ isPromiseLike is a Function - - Testing isRegExp - - √ isRegExp is a Function - - Testing isSet - - √ isSet is a Function - - Testing isSorted - - √ isSorted is a Function - √ Array is sorted in ascending order - √ Array is sorted in descending order - √ Array is not sorted, direction changed in array - - Testing isString - - √ isString is a Function - √ foo is a string - √ "10" is a string - √ Empty string is a string - √ 10 is not a string - √ true is not string - - Testing isSymbol - - √ isSymbol is a Function - √ Checks if the given argument is a symbol - - Testing isTravisCI - - √ isTravisCI is a Function - - Testing isTypedArray - - √ isTypedArray is a Function - - Testing isUndefined - - √ isUndefined is a Function - - Testing isUpperCase - - √ isUpperCase is a Function - √ ABC is all upper case - √ abc is not all upper case - √ A3@$ is all uppercase - - Testing isValidJSON - - √ isValidJSON is a Function - √ {"name":"Adam","age":20} is a valid JSON - √ {"name":"Adam",age:"20"} is not a valid JSON - √ null is a valid JSON - - Testing isWeakMap - - √ isWeakMap is a Function - - Testing isWeakSet - - √ isWeakSet is a Function - - Testing join - - √ join is a Function - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - √ Joins all elements of an array into a string and returns this string - - Testing JSONToDate - - √ JSONToDate is a Function - - Testing JSONToFile - - √ JSONToFile is a Function - - Testing last - - √ last is a Function - √ last({ a: 1234}) returns undefined - √ last([1, 2, 3]) returns 3 - √ last({ 0: false}) returns undefined - √ last(String) returns g - √ last(null) throws an Error - √ last(undefined) throws an Error - √ last() throws an Error - √ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing lcm - - √ lcm is a Function - √ Returns the least common multiple of two or more numbers. - √ Returns the least common multiple of two or more numbers. - - Testing longestItem - - √ longestItem is a Function - √ Returns the longest object - - Testing lowercaseKeys - - √ lowercaseKeys is a Function - - Testing luhnCheck - - √ luhnCheck is a Function - √ validates identification number - √ validates identification number - √ validates identification number - - Testing mapKeys - - √ mapKeys is a Function - - Testing mapObject - - √ mapObject is a Function - √ Maps the values of an array to an object using a function - - Testing mapValues - - √ mapValues is a Function - - Testing mask - - √ mask is a Function - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - √ Replaces all but the last num of characters with the specified mask character - - Testing matches - - √ matches is a Function - - Testing matchesWith - - √ matchesWith is a Function - - Testing maxBy - - √ maxBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing maxN - - √ maxN is a Function - √ Returns the n maximum elements from the provided array - √ Returns the n maximum elements from the provided array - - Testing median - - √ median is a Function - √ Returns the median of an array of numbers - √ Returns the median of an array of numbers - - Testing memoize - - √ memoize is a Function - - Testing merge - - √ merge is a Function - - Testing minBy - - √ minBy is a Function - √ Produces the right result with a function - √ Produces the right result with a property name - - Testing minN - - √ minN is a Function - √ Returns the n minimum elements from the provided array - √ Returns the n minimum elements from the provided array - - Testing negate - - √ negate is a Function - √ Negates a predicate function - - Testing nthArg - - √ nthArg is a Function - - Testing nthElement - - √ nthElement is a Function - √ Returns the nth element of an array. - √ Returns the nth element of an array. - - Testing objectFromPairs - - √ objectFromPairs is a Function - √ Creates an object from the given key-value pairs. - - Testing objectToPairs - - √ objectToPairs is a Function - √ Creates an array of key-value pair arrays from an object. - - Testing observeMutations - - √ observeMutations is a Function - - Testing off - - √ off is a Function - - Testing omit - - √ omit is a Function - - Testing omitBy - - √ omitBy is a Function - - Testing on - - √ on is a Function - - Testing once - - √ once is a Function - - Testing onUserInputChange - - √ onUserInputChange is a Function - - Testing orderBy - - √ orderBy is a Function - √ Returns a sorted array of objects ordered by properties and orders. - √ Returns a sorted array of objects ordered by properties and orders. - - Testing over - - √ over is a Function - - Testing palindrome - - √ palindrome is a Function - √ Given string is a palindrome - √ Given string is not a palindrome - - Testing parseCookie - - √ parseCookie is a Function - - Testing partial - - √ partial is a Function - - Testing partialRight - - √ partialRight is a Function - - Testing partition - - √ partition is a Function - √ Groups the elements into two arrays, depending on the provided function's truthiness for each element. - - Testing percentile - - √ percentile is a Function - √ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. - - Testing pick - - √ pick is a Function - √ Picks the key-value pairs corresponding to the given keys from an object. - - Testing pickBy - - √ pickBy is a Function - - Testing pipeFunctions - - √ pipeFunctions is a Function - - Testing pluralize - - √ pluralize is a Function - - Testing powerset - - √ powerset is a Function - √ Returns the powerset of a given array of numbers. - - Testing prettyBytes - - √ prettyBytes is a Function - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - √ Converts a number in bytes to a human-readable string. - - Testing primes - - √ primes is a Function - √ Generates primes up to a given number, using the Sieve of Eratosthenes. - - Testing promisify - - √ promisify is a Function - - Testing pull - - √ pull is a Function - - Testing pullAtIndex - - √ pullAtIndex is a Function - - Testing pullAtValue - - √ pullAtValue is a Function - - Testing quickSort - - √ quickSort is a Function - √ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - √ quickSort([-1, 0, -2]) returns [-2, -1, 0] - √ quickSort() throws an error - √ quickSort(123) throws an error - √ quickSort({ 234: string}) throws an error - √ quickSort(null) throws an error - √ quickSort(undefined) throws an error - √ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run - - Testing randomHexColorCode - - √ randomHexColorCode is a Function - - Testing randomIntArrayInRange - - √ randomIntArrayInRange is a Function - - Testing randomIntegerInRange - - √ randomIntegerInRange is a Function - - Testing randomNumberInRange - - √ randomNumberInRange is a Function - - Testing readFileLines - - √ readFileLines is a Function - - Testing README - - √ README is a Function - - Testing redirect - - √ redirect is a Function - - Testing reducedFilter - - √ reducedFilter is a Function - √ Filter an array of objects based on a condition while also filtering out unspecified keys. - - Testing reduceSuccessive - - √ reduceSuccessive is a Function - - Testing reduceWhich - - √ reduceWhich is a Function - - Testing remove - - √ remove is a Function - √ Removes elements from an array for which the given function returns false - - Testing removeVowels - - √ removeVowels is a Function - - Testing reverseString - - √ reverseString is a Function - √ Reverses a string. - - Testing RGBToHex - - √ RGBToHex is a Function - √ Converts the values of RGB components to a color code. - - Testing round - - √ round is a Function - √ Rounds a number to a specified amount of digits. - - Testing runAsync - - √ runAsync is a Function - - Testing runPromisesInSeries - - √ runPromisesInSeries is a Function - - Testing sample - - √ sample is a Function - - Testing sampleSize - - √ sampleSize is a Function - - Testing scrollToTop - - √ scrollToTop is a Function - - Testing sdbm - - √ sdbm is a Function - √ Hashes the input string into a whole number. - - Testing serializeCookie - - √ serializeCookie is a Function - - Testing setStyle - - √ setStyle is a Function - - Testing shallowClone - - √ shallowClone is a Function - √ Shallow cloning works - √ Does not clone deeply - - Testing show - - √ show is a Function - - Testing shuffle - - √ shuffle is a Function - - Testing similarity - - √ similarity is a Function - √ Returns an array of elements that appear in both arrays. - - Testing size - - √ size is a Function - √ Get size of arrays, objects or strings. - √ Get size of arrays, objects or strings. - - Testing sleep - - √ sleep is a Function - - Testing solveRPN - - √ solveRPN is a Function - - Testing sortCharactersInString - - √ sortCharactersInString is a Function - √ Alphabetically sorts the characters in a string. - - Testing sortedIndex - - √ sortedIndex is a Function - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - √ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - - Testing sortedLastIndex - - √ sortedLastIndex is a Function - - Testing speechSynthesis - - √ speechSynthesis is a Function - - Testing splitLines - - √ splitLines is a Function - √ Splits a multiline string into an array of lines. - - Testing spreadOver - - √ spreadOver is a Function - √ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. - - Testing standardDeviation - - √ standardDeviation is a Function - √ Returns the standard deviation of an array of numbers - √ Returns the standard deviation of an array of numbers - - Testing sum - - √ sum is a Function - √ Returns the sum of two or more numbers/arrays. - - Testing sumBy - - √ sumBy is a Function - - Testing sumPower - - √ sumPower is a Function - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - √ Returns the sum of the powers of all the numbers from start to end - - Testing symmetricDifference - - √ symmetricDifference is a Function - √ Returns the symmetric difference between two arrays. - - Testing symmetricDifferenceBy - - √ symmetricDifferenceBy is a Function - - Testing symmetricDifferenceWith - - √ symmetricDifferenceWith is a Function - - Testing tail - - √ tail is a Function - √ Returns tail - √ Returns tail - - Testing take - - √ take is a Function - √ Returns an array with n elements removed from the beginning. - √ Returns an array with n elements removed from the beginning. - - Testing takeRight - - √ takeRight is a Function - √ Returns an array with n elements removed from the end - √ Returns an array with n elements removed from the end - - Testing times - - √ times is a Function - - Testing timeTaken - - √ timeTaken is a Function - - Testing toCamelCase - - √ toCamelCase is a Function - √ Converts a string to camelCase - √ Converts a string to camelCase - √ Converts a string to camelCase - √ Converts a string to camelCase - - Testing toDecimalMark - - √ toDecimalMark is a Function - √ convert a float-point arithmetic to the Decimal mark form - - Testing toggleClass - - √ toggleClass is a Function - - Testing toKebabCase - - √ toKebabCase is a Function - √ string converts to snake case - √ string converts to snake case - √ string converts to snake case - √ string converts to snake case - - Testing tomorrow - - √ tomorrow is a Function - - Testing toOrdinalSuffix - - √ toOrdinalSuffix is a Function - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - √ Adds an ordinal suffix to a number - - Testing toSafeInteger - - √ toSafeInteger is a Function - √ Converts a value to a safe integer - √ Converts a value to a safe integer - √ Converts a value to a safe integer - √ Converts a value to a safe integer - √ Converts a value to a safe integer - - Testing toSnakeCase - - √ toSnakeCase is a Function - √ string converts to snake case - √ string converts to snake case - √ string converts to snake case - √ string converts to snake case - - Testing transform - - √ transform is a Function - - Testing truncateString - - √ truncateString is a Function - √ Truncates a "boomerang" up to a specified length. - - Testing truthCheckCollection - - √ truthCheckCollection is a Function - √ second argument is truthy on all elements of a collection - - Testing unary - - √ unary is a Function - - Testing unescapeHTML - - √ unescapeHTML is a Function - √ Unescapes escaped HTML characters. - - Testing unfold - - √ unfold is a Function - - Testing union - - √ union is a Function - √ Returns every element that exists in any of the two arrays once - - Testing unionBy - - √ unionBy is a Function - - Testing unionWith - - √ unionWith is a Function - - Testing uniqueElements - - √ uniqueElements is a Function - √ Returns all unique values of an array - - Testing untildify - - √ untildify is a Function - - Testing unzip - - √ unzip is a Function - √ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - √ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] - - Testing unzipWith - - √ unzipWith is a Function - √ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] - - Testing URLJoin - - √ URLJoin is a Function - √ Returns proper URL - √ Returns proper URL - - Testing UUIDGeneratorBrowser - - √ UUIDGeneratorBrowser is a Function - - Testing UUIDGeneratorNode - - √ UUIDGeneratorNode is a Function - - Testing validateNumber - - √ validateNumber is a Function - √ validateNumber(9) returns true - √ validateNumber(234asd.slice(0, 2)) returns true - √ validateNumber(1232) returns true - √ validateNumber(1232 + 13423) returns true - √ validateNumber(1232 * 2342 * 123) returns true - √ validateNumber(1232.23423536) returns true - √ validateNumber(234asd) returns false - √ validateNumber(e234d) returns false - √ validateNumber(false) returns false - √ validateNumber(true) returns false - √ validateNumber(null) returns false - √ validateNumber(123 * asd) returns false - - Testing without - - √ without is a Function - √ without([2, 1, 2, 3], 1, 2) returns [3] - √ without([]) returns [] - √ without([3, 1, true, '3', true], '3', true) returns [3, 1] - √ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - √ without() throws an error - √ without(null) throws an error - √ without(undefined) throws an error - √ without() throws an error - √ without({}) throws an error - - Testing words - - √ words is a Function - √ words('I love javaScript!!') returns [I, love, javaScript] - √ words('python, javaScript & coffee') returns [python, javaScript, coffee] - √ words(I love javaScript!!) returns an array - √ words() throws a error - √ words(null) throws a error - √ words(undefined) throws a error - √ words({}) throws a error - √ words([]) throws a error - √ words(1234) throws a error - - Testing xProd - - √ xProd is a Function - √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] - - Testing yesNo - - √ yesNo is a Function - √ yesNo(Y) returns true - √ yesNo(yes) returns true - √ yesNo(foo, true) returns true - √ yesNo(No) returns false - √ yesNo() returns false - √ yesNo(null) returns false - √ yesNo(undefined) returns false - √ yesNo([123, null]) returns false - √ yesNo([Yes, No]) returns false - √ yesNo({ 2: Yes }) returns false - √ yesNo([Yes, No], true) returns true - √ yesNo({ 2: Yes }, true) returns true - - Testing zip - - √ zip is a Function - √ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - √ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - √ zip([]) returns [] - √ zip(123) returns [] - √ zip([a, b], [1, 2], [true, false]) returns an Array - √ zip([a], [1, 2], [true, false]) returns an Array - √ zip(null) throws an error - √ zip(undefined) throws an error - - Testing zipObject - - √ zipObject is a Function - √ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - √ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - √ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - √ zipObject([a], string) returns { a: s } - √ zipObject() throws an error - √ zipObject([string], null) throws an error - √ zipObject(null, [1]) throws an error - √ zipObject(string) throws an error - √ zipObject(test, string) throws an error - - Testing zipWith - - √ zipWith is a Function - - - total: 641 - passing: 641 - duration: 1.1s - +undefined \ No newline at end of file