From 51ed7b4f7343f0dbec0041379e00546fe1a789cb Mon Sep 17 00:00:00 2001 From: King Date: Thu, 18 Jan 2018 20:05:18 -0500 Subject: [PATCH 001/103] update tdd chained methods making more readable --- scripts/tdd.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/tdd.js b/scripts/tdd.js index f93df6b66..bba8e57fd 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -46,19 +46,19 @@ snippetFiles const fileCode = fileData.slice(fileData.search(/```\s*js/i), fileData.lastIndexOf('```') + 3); // Split code based on code markers const blockMarkers = fileCode - .split('\n') - .map((line, lineIndex) => (line.slice(0, 3) === '```' ? lineIndex : '//CLEAR//')) - .filter(x => !(x === '//CLEAR//')); + .split('\n') + .map((line, lineIndex) => (line.slice(0, 3) === '```' ? lineIndex : '//CLEAR//')) + .filter(x => !(x === '//CLEAR//')); // Grab snippet function based on code markers const fileFunction = fileCode - .split('\n') - .map(line => line.trim()) - .filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]); + .split('\n') + .map(line => line.trim()) + .filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]); // Grab snippet example based on code markers const fileExample = fileCode - .split('\n') - .map(line => line.trim()) - .filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]); + .split('\n') + .map(line => line.trim()) + .filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]); // Export template for snippetName.js const exportFile = `${fileFunction.join('\n')}\n module.exports = ${fileName}`; From ad0bcbd70a1a4604e2d2feed2da1edf899ff09ef Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Fri, 19 Jan 2018 20:10:17 +0000 Subject: [PATCH 002/103] Travis build: 1323 [cron] --- dist/_30s.es5.js | 170 ++++++++++++++--------- dist/_30s.es5.min.js | 2 +- dist/_30s.esm.js | 39 ++++-- dist/_30s.js | 39 ++++-- dist/_30s.min.js | 2 +- test/defaults/defaults.js | 2 + test/defaults/defaults.test.js | 13 ++ test/forOwn/forOwn.js | 2 + test/forOwn/forOwn.test.js | 13 ++ test/forOwnRight/forOwnRight.js | 5 + test/forOwnRight/forOwnRight.test.js | 13 ++ test/isPlainObject/isPlainObject.js | 2 + test/isPlainObject/isPlainObject.test.js | 13 ++ test/omit/omit.js | 5 + test/omit/omit.test.js | 13 ++ test/omitBy/omitBy.js | 5 + test/omitBy/omitBy.test.js | 13 ++ test/pickBy/pickBy.js | 5 + test/pickBy/pickBy.test.js | 13 ++ test/testlog | 36 ++++- 20 files changed, 309 insertions(+), 96 deletions(-) create mode 100644 test/defaults/defaults.js create mode 100644 test/defaults/defaults.test.js create mode 100644 test/forOwn/forOwn.js create mode 100644 test/forOwn/forOwn.test.js create mode 100644 test/forOwnRight/forOwnRight.js create mode 100644 test/forOwnRight/forOwnRight.test.js create mode 100644 test/isPlainObject/isPlainObject.js create mode 100644 test/isPlainObject/isPlainObject.test.js create mode 100644 test/omit/omit.js create mode 100644 test/omit/omit.test.js create mode 100644 test/omitBy/omitBy.js create mode 100644 test/omitBy/omitBy.test.js create mode 100644 test/pickBy/pickBy.js create mode 100644 test/pickBy/pickBy.test.js diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js index b69f665a2..426068879 100644 --- a/dist/_30s.es5.js +++ b/dist/_30s.es5.js @@ -128,20 +128,6 @@ var clampNumber = function clampNumber(num, a, b) { return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b)); }; -var cleanObj = function cleanObj(obj) { - var keysToKeep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var childIndicator = arguments[2]; - - Object.keys(obj).forEach(function (key) { - if (key === childIndicator) { - cleanObj(obj[key], keysToKeep, childIndicator); - } else if (!keysToKeep.includes(key)) { - delete obj[key]; - } - }); - return obj; -}; - var cloneRegExp = function cloneRegExp(regExp) { return new RegExp(regExp.source, regExp.flags); }; @@ -310,6 +296,16 @@ var deepFlatten = function deepFlatten(arr) { }))); }; +function _toConsumableArray$1(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 defaults = function defaults(obj) { + for (var _len = arguments.length, defs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + defs[_key - 1] = arguments[_key]; + } + + return Object.assign.apply(Object, [{}, obj].concat(_toConsumableArray$1(defs.reverse()), [obj])); +}; + var defer = function defer(fn) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; @@ -338,10 +334,10 @@ var differenceWith = function differenceWith(arr, val, comp) { }); }; -function _toConsumableArray$1(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); } } +function _toConsumableArray$2(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 digitize = function digitize(n) { - return [].concat(_toConsumableArray$1("" + n)).map(function (i) { + return [].concat(_toConsumableArray$2("" + n)).map(function (i) { return parseInt(i); }); }; @@ -506,6 +502,18 @@ var forEachRight = function forEachRight(arr, callback) { return arr.slice(0).reverse().forEach(callback); }; +var forOwn = function forOwn(obj, fn) { + return Object.keys(obj).forEach(function (key) { + return fn(obj[key], key, obj); + }); +}; + +var forOwnRight = function forOwnRight(obj, fn) { + return Object.keys(obj).reverse().forEach(function (key) { + return fn(obj[key], key, obj); + }); +}; + var formatDuration = function formatDuration(ms) { if (ms < 0) ms = -ms; var time = { @@ -531,11 +539,11 @@ var functionName = function functionName(fn) { return console.debug(fn.name), fn; }; -function _toConsumableArray$2(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); } } +function _toConsumableArray$3(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 functions = function functions(obj) { var inherited = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return (inherited ? [].concat(_toConsumableArray$2(Object.keys(obj)), _toConsumableArray$2(Object.keys(Object.getPrototypeOf(obj)))) : Object.keys(obj)).filter(function (key) { + return (inherited ? [].concat(_toConsumableArray$3(Object.keys(obj)), _toConsumableArray$3(Object.keys(Object.getPrototypeOf(obj)))) : Object.keys(obj)).filter(function (key) { return typeof obj[key] === 'function'; }); }; @@ -651,12 +659,12 @@ var head = function head(arr) { return arr[0]; }; -function _toConsumableArray$3(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); } } +function _toConsumableArray$4(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 hexToRGB = function hexToRGB(hex) { var alpha = false, h = hex.slice(hex.startsWith('#') ? 1 : 0); - if (h.length === 3) h = [].concat(_toConsumableArray$3(h)).map(function (x) { + if (h.length === 3) h = [].concat(_toConsumableArray$4(h)).map(function (x) { return x + x; }).join('');else if (h.length === 8) alpha = true; h = parseInt(h, 16); @@ -776,11 +784,11 @@ var isAbsoluteURL = function isAbsoluteURL(str) { ); }; -function _toConsumableArray$4(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); } } +function _toConsumableArray$5(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 isArrayLike = function isArrayLike(val) { try { - return [].concat(_toConsumableArray$4(val)), true; + return [].concat(_toConsumableArray$5(val)), true; } catch (e) { return false; } @@ -822,6 +830,12 @@ var isObject = function isObject(obj) { return obj === Object(obj); }; +var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var isPlainObject = function isPlainObject(val) { + return !!val && (typeof val === 'undefined' ? 'undefined' : _typeof$1(val)) === 'object' && val.constructor === Object; +}; + var isPrime = function isPrime(num) { var boundary = Math.floor(Math.sqrt(num)); for (var i = 2; i <= boundary; i++) { @@ -829,16 +843,16 @@ var isPrime = function isPrime(num) { }return num >= 2; }; -var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var isPrimitive = function isPrimitive(val) { - return !['object', 'function'].includes(typeof val === 'undefined' ? 'undefined' : _typeof$1(val)) || val === null; -}; - var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var isPrimitive = function isPrimitive(val) { + return !['object', 'function'].includes(typeof val === 'undefined' ? 'undefined' : _typeof$2(val)) || val === null; +}; + +var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var isPromiseLike = function isPromiseLike(obj) { - return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof$2(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; + return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof$3(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }; var _slicedToArray$1 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -880,10 +894,10 @@ var isString = function isString(val) { return typeof val === 'string'; }; -var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _typeof$4 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var isSymbol = function isSymbol(val) { - return (typeof val === 'undefined' ? 'undefined' : _typeof$3(val)) === 'symbol'; + return (typeof val === 'undefined' ? 'undefined' : _typeof$4(val)) === 'symbol'; }; var isTravisCI = function isTravisCI() { @@ -992,28 +1006,28 @@ var mask = function mask(cc) { return ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num); }; -function _toConsumableArray$5(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); } } +function _toConsumableArray$6(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 maxBy = function maxBy(arr, fn) { - return Math.max.apply(Math, _toConsumableArray$5(arr.map(typeof fn === 'function' ? fn : function (val) { + return Math.max.apply(Math, _toConsumableArray$6(arr.map(typeof fn === 'function' ? fn : function (val) { return val[fn]; }))); }; -function _toConsumableArray$6(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); } } +function _toConsumableArray$7(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 maxN = function maxN(arr) { var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - return [].concat(_toConsumableArray$6(arr)).sort(function (a, b) { + return [].concat(_toConsumableArray$7(arr)).sort(function (a, b) { return b - a; }).slice(0, n); }; -function _toConsumableArray$7(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); } } +function _toConsumableArray$8(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 median = function median(arr) { var mid = Math.floor(arr.length / 2), - nums = [].concat(_toConsumableArray$7(arr)).sort(function (a, b) { + nums = [].concat(_toConsumableArray$8(arr)).sort(function (a, b) { return a - b; }); return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2; @@ -1041,19 +1055,19 @@ var merge = function merge() { }, {}); }; -function _toConsumableArray$8(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); } } +function _toConsumableArray$9(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 minBy = function minBy(arr, fn) { - return Math.min.apply(Math, _toConsumableArray$8(arr.map(typeof fn === 'function' ? fn : function (val) { + return Math.min.apply(Math, _toConsumableArray$9(arr.map(typeof fn === 'function' ? fn : function (val) { return val[fn]; }))); }; -function _toConsumableArray$9(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); } } +function _toConsumableArray$10(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 minN = function minN(arr) { var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - return [].concat(_toConsumableArray$9(arr)).sort(function (a, b) { + return [].concat(_toConsumableArray$10(arr)).sort(function (a, b) { return a - b; }).slice(0, n); }; @@ -1103,6 +1117,22 @@ var off = function off(el, evt, fn) { return el.removeEventListener(evt, fn, opts); }; +var omit = function omit(obj, arr) { + return Object.keys(obj).filter(function (k) { + return !arr.includes(k); + }).reduce(function (acc, key) { + return acc[key] = obj[key], acc; + }, {}); +}; + +var omitBy = function omitBy(obj, fn) { + return Object.keys(obj).filter(function (k) { + return !fn(obj[k], k); + }).reduce(function (acc, key) { + return acc[key] = obj[key], acc; + }, {}); +}; + var on = function on(el, evt, fn) { var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; @@ -1143,10 +1173,10 @@ var once = function once(fn) { var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -function _toConsumableArray$10(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); } } +function _toConsumableArray$11(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 orderBy = function orderBy(arr, props, orders) { - return [].concat(_toConsumableArray$10(arr)).sort(function (a, b) { + return [].concat(_toConsumableArray$11(arr)).sort(function (a, b) { return props.reduce(function (acc, prop, i) { if (acc === 0) { var _ref = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]], @@ -1194,6 +1224,14 @@ var pick = function pick(obj, arr) { }, {}); }; +var pickBy = function pickBy(obj, fn) { + return Object.keys(obj).filter(function (k) { + return fn(obj[k], k); + }).reduce(function (acc, key) { + return acc[key] = obj[key], acc; + }, {}); +}; + var pipeFunctions = function pipeFunctions() { for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { fns[_key] = arguments[_key]; @@ -1206,7 +1244,7 @@ var pipeFunctions = function pipeFunctions() { }); }; -var _typeof$4 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _typeof$5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var pluralize = function pluralize(val, word) { var plural = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : word + 's'; @@ -1215,7 +1253,7 @@ var pluralize = function pluralize(val, word) { var plural = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : word + 's'; return [1, -1].includes(Number(num)) ? word : plural; }; - if ((typeof val === 'undefined' ? 'undefined' : _typeof$4(val)) === 'object') return function (num, word) { + if ((typeof val === 'undefined' ? 'undefined' : _typeof$5(val)) === 'object') return function (num, word) { return _pluralize(num, word, val[word]); }; return _pluralize(val, word, plural); @@ -1360,10 +1398,10 @@ var remove = function remove(arr, func) { }, []) : []; }; -function _toConsumableArray$11(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); } } +function _toConsumableArray$12(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) { - return [].concat(_toConsumableArray$11(str)).reverse().join(''); + return [].concat(_toConsumableArray$12(str)).reverse().join(''); }; var round = function round(n) { @@ -1475,10 +1513,10 @@ var similarity = function similarity(arr, values) { }); }; -var _typeof$5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _typeof$6 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var size = function size(val) { - return Array.isArray(val) ? val.length : val && (typeof val === 'undefined' ? 'undefined' : _typeof$5(val)) === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0; + return Array.isArray(val) ? val.length : val && (typeof val === 'undefined' ? 'undefined' : _typeof$6(val)) === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0; }; var sleep = function sleep(ms) { @@ -1487,10 +1525,10 @@ var sleep = function sleep(ms) { }); }; -function _toConsumableArray$12(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); } } +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 sortCharactersInString = function sortCharactersInString(str) { - return [].concat(_toConsumableArray$12(str)).sort(function (a, b) { + return [].concat(_toConsumableArray$13(str)).sort(function (a, b) { return a.localeCompare(b); }).join(''); }; @@ -1507,11 +1545,11 @@ var splitLines = function splitLines(str) { return str.split(/\r?\n/); }; -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); } } +function _toConsumableArray$14(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 spreadOver = function spreadOver(fn) { return function (argsArr) { - return fn.apply(undefined, _toConsumableArray$13(argsArr)); + return fn.apply(undefined, _toConsumableArray$14(argsArr)); }; }; @@ -1556,14 +1594,14 @@ var sumPower = function sumPower(end) { }, 0); }; -function _toConsumableArray$14(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); } } +function _toConsumableArray$15(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 symmetricDifference = function symmetricDifference(a, b) { var sA = new Set(a), sB = new Set(b); - return [].concat(_toConsumableArray$14(a.filter(function (x) { + return [].concat(_toConsumableArray$15(a.filter(function (x) { return !sB.has(x); - })), _toConsumableArray$14(b.filter(function (x) { + })), _toConsumableArray$15(b.filter(function (x) { return !sA.has(x); }))); }; @@ -1661,16 +1699,16 @@ var unescapeHTML = function unescapeHTML(str) { }); }; -function _toConsumableArray$15(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 union = function union(a, b) { - return Array.from(new Set([].concat(_toConsumableArray$15(a), _toConsumableArray$15(b)))); -}; - function _toConsumableArray$16(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 union = function union(a, b) { + return Array.from(new Set([].concat(_toConsumableArray$16(a), _toConsumableArray$16(b)))); +}; + +function _toConsumableArray$17(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 uniqueElements = function uniqueElements(arr) { - return [].concat(_toConsumableArray$16(new Set(arr))); + return [].concat(_toConsumableArray$17(new Set(arr))); }; var untildify = function untildify(str) { @@ -1702,14 +1740,14 @@ var yesNo = function yesNo(val) { ); }; -function _toConsumableArray$17(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); } } +function _toConsumableArray$18(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 zip = function zip() { for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) { arrays[_key] = arguments[_key]; } - var maxLength = Math.max.apply(Math, _toConsumableArray$17(arrays.map(function (x) { + var maxLength = Math.max.apply(Math, _toConsumableArray$18(arrays.map(function (x) { return x.length; }))); return Array.from({ length: maxLength }).map(function (_, i) { @@ -1725,7 +1763,7 @@ var zipObject = function zipObject(props, values) { }, {}); }; -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, atob: atob, average: average, averageBy: averageBy, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cleanObj: cleanObj, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepFlatten: deepFlatten, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, dropElements: dropElements, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findLast: findLast, flatten: flatten, flip: flip, forEachRight: forEachRight, 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, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, 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, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, palindrome: palindrome, parseCookie: parseCookie, partition: partition, percentile: percentile, pick: pick, 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, 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, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, uniqueElements: uniqueElements, untildify: untildify, validateNumber: validateNumber, without: without, words: words, yesNo: yesNo, zip: zip, zipObject: zipObject }; +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, atob: atob, average: average, averageBy: averageBy, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepFlatten: deepFlatten, defaults: defaults, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, dropElements: dropElements, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findLast: findLast, 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, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, 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, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, palindrome: palindrome, parseCookie: parseCookie, 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, 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, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, uniqueElements: uniqueElements, untildify: untildify, validateNumber: validateNumber, without: without, words: words, yesNo: yesNo, zip: zip, zipObject: zipObject }; return imports; diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js index b01643563..e5ac2d95d 100644 --- a/dist/_30s.es5.min.js +++ b/dist/_30s.es5.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';function a(a){return Array.isArray(a)?a:Array.from(a)}function b(a){return Array.isArray(a)?a:Array.from(a)}function c(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b>a/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(a){return(a^F.randomBytes(1)[0]&15>>a/4).toString(16)})},anagrams:function a(b){return 2>=b.length?2===b.length?[b,b[1]+b[0]]:[b]:b.split('').reduce(function(c,d,e){return c.concat(a(b.slice(0,e)+b.slice(e+1)).map(function(a){return d+a}))},[])},arrayToHtmlList:function(a,b){return a.map(function(a){return document.querySelector('#'+b).innerHTML+='
  • '+a+'
  • '})},atob:function(a){return new Buffer(a,'base64').toString('binary')},average:function(){for(var a=arguments.length,b=Array(a),c=0;c=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(a){return new Buffer(a,'binary').toString('base64')},byteSize:function(a){return new Blob([a]).size},call:function(a){for(var b=arguments.length,c=Array(1'"]/g,function(a){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[a]||a})},escapeRegExp:function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(a,b){return a.filter(function(a,c){return c%b==b-1})},extendHex:function(a){return'#'+a.slice(a.startsWith('#')?1:0).split('').map(function(a){return a+a}).join('')},factorial:function a(b){return 0>b?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=b?1:b*a(b-1)},fibonacci:function(a){return Array.from({length:a}).reduce(function(a,b,c){return a.concat(1a&&(a=-a);var b={day:z(a/8.64e7),hour:z(a/3.6e6)%24,minute:z(a/6e4)%60,second:z(a/1e3)%60,millisecond:z(a)%1e3};return Object.entries(b).filter(function(a){return 0!==a[1]}).map(function(a){return a[1]+' '+(1===a[1]?a[0]:a[0]+'s')}).join(', ')},fromCamelCase:function(a){var b=1>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?', '+(255&c):'')+')'},hide:function(){for(var a=arguments.length,b=Array(a),c=0;cc&&(c=b),null==c?0<=a&&a=b&&aa[1]?-1:1,d=!0,e=!1;try{for(var f,g=a.entries()[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){var h=f.value,j=L(h,2),k=j[0],i=j[1];if(k===a.length-1)return c;if(0<(i-a[k+1])*c)return 0}}catch(a){e=!0,b=a}finally{try{!d&&g.return&&g.return()}finally{if(e)throw b}}},isString:function(a){return'string'==typeof a},isSymbol:function(a){return'symbol'===('undefined'==typeof a?'undefined':M(a))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(a){return a===void 0},isUpperCase:function(a){return a===a.toUpperCase()},isValidJSON:function(a){try{return JSON.parse(a),!0}catch(a){return!1}},join:function(a){var b=1e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',function(){'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:function(a){var b=!1;return function(){if(!b){b=!0;for(var c=arguments.length,d=Array(c),e=0;ej?1:iMath.abs(a))return a+(c?' ':'')+d[0];var e=B(z(Math.log10(0>a?-a:a)/3),d.length-1),f=+((0>a?-a:a)/A(1e3,e)).toPrecision(b);return(0>a?'-':'')+f+(c?' ':'')+d[e]},primes:function(a){var b=Array.from({length:a-1}).map(function(a,b){return b+2}),c=z(y(a)),d=Array.from({length:c-1}).map(function(a,b){return b+2});return d.forEach(function(a){return b=b.filter(function(b){return 0!=b%a||b==a})}),b},promisify:function(a){return function(){for(var b=arguments.length,c=Array(b),d=0;da[a.length-1],d=a.findIndex(function(a){return c?b>=a:b<=a});return-1===d?a.length:d},splitLines:function(a){return a.split(/\r?\n/)},spreadOver:function(a){return function(b){return a.apply(void 0,s(b))}},standardDeviation:function(a){var b=1b?a.slice(0,3',"'":'\'',""":'"'}[a]||a})},union:function(c,a){return Array.from(new Set([].concat(u(c),u(a))))},uniqueElements:function(a){return[].concat(v(new Set(a)))},untildify:function(a){return a.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},validateNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&+a==a},without:function(a){for(var b=arguments.length,c=Array(1>a/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(a){return(a^G.randomBytes(1)[0]&15>>a/4).toString(16)})},anagrams:function a(b){return 2>=b.length?2===b.length?[b,b[1]+b[0]]:[b]:b.split('').reduce(function(c,d,e){return c.concat(a(b.slice(0,e)+b.slice(e+1)).map(function(a){return d+a}))},[])},arrayToHtmlList:function(a,b){return a.map(function(a){return document.querySelector('#'+b).innerHTML+='
  • '+a+'
  • '})},atob:function(a){return new Buffer(a,'base64').toString('binary')},average:function(){for(var a=arguments.length,b=Array(a),c=0;c=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(a){return new Buffer(a,'binary').toString('base64')},byteSize:function(a){return new Blob([a]).size},call:function(a){for(var b=arguments.length,c=Array(1'"]/g,function(a){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[a]||a})},escapeRegExp:function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(a,b){return a.filter(function(a,c){return c%b==b-1})},extendHex:function(a){return'#'+a.slice(a.startsWith('#')?1:0).split('').map(function(a){return a+a}).join('')},factorial:function a(b){return 0>b?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=b?1:b*a(b-1)},fibonacci:function(a){return Array.from({length:a}).reduce(function(a,b,c){return a.concat(1a&&(a=-a);var b={day:A(a/8.64e7),hour:A(a/3.6e6)%24,minute:A(a/6e4)%60,second:A(a/1e3)%60,millisecond:A(a)%1e3};return Object.entries(b).filter(function(a){return 0!==a[1]}).map(function(a){return a[1]+' '+(1===a[1]?a[0]:a[0]+'s')}).join(', ')},fromCamelCase:function(a){var b=1>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?', '+(255&c):'')+')'},hide:function(){for(var a=arguments.length,b=Array(a),c=0;cc&&(c=b),null==c?0<=a&&a=b&&aa[1]?-1:1,d=!0,e=!1;try{for(var f,g=a.entries()[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){var h=f.value,j=N(h,2),k=j[0],i=j[1];if(k===a.length-1)return c;if(0<(i-a[k+1])*c)return 0}}catch(a){e=!0,b=a}finally{try{!d&&g.return&&g.return()}finally{if(e)throw b}}},isString:function(a){return'string'==typeof a},isSymbol:function(a){return'symbol'===('undefined'==typeof a?'undefined':O(a))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(a){return a===void 0},isUpperCase:function(a){return a===a.toUpperCase()},isValidJSON:function(a){try{return JSON.parse(a),!0}catch(a){return!1}},join:function(a){var b=1e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',function(){'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:function(a){var b=!1;return function(){if(!b){b=!0;for(var c=arguments.length,d=Array(c),e=0;ej?1:iMath.abs(a))return a+(c?' ':'')+d[0];var e=C(A(Math.log10(0>a?-a:a)/3),d.length-1),f=+((0>a?-a:a)/B(1e3,e)).toPrecision(b);return(0>a?'-':'')+f+(c?' ':'')+d[e]},primes:function(a){var b=Array.from({length:a-1}).map(function(a,b){return b+2}),c=A(z(a)),d=Array.from({length:c-1}).map(function(a,b){return b+2});return d.forEach(function(a){return b=b.filter(function(b){return 0!=b%a||b==a})}),b},promisify:function(a){return function(){for(var b=arguments.length,c=Array(b),d=0;da[a.length-1],d=a.findIndex(function(a){return c?b>=a:b<=a});return-1===d?a.length:d},splitLines:function(a){return a.split(/\r?\n/)},spreadOver:function(a){return function(b){return a.apply(void 0,t(b))}},standardDeviation:function(a){var b=1b?a.slice(0,3',"'":'\'',""":'"'}[a]||a})},union:function(c,a){return Array.from(new Set([].concat(v(c),v(a))))},uniqueElements:function(a){return[].concat(w(new Set(a)))},untildify:function(a){return a.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},validateNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&+a==a},without:function(a){for(var b=arguments.length,c=Array(1 const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b)); -const cleanObj = (obj, keysToKeep = [], childIndicator) => { - Object.keys(obj).forEach(key => { - if (key === childIndicator) { - cleanObj(obj[key], keysToKeep, childIndicator); - } else if (!keysToKeep.includes(key)) { - delete obj[key]; - } - }); - return obj; -}; - const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags); const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_)); @@ -174,6 +163,8 @@ const decapitalize = ([first, ...rest], upperRest = false) => const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); +const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); + const defer = (fn, ...args) => setTimeout(fn, 1, ...args); const detectDeviceType = () => @@ -293,6 +284,13 @@ const forEachRight = (arr, callback) => .reverse() .forEach(callback); +const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj)); + +const forOwnRight = (obj, fn) => + Object.keys(obj) + .reverse() + .forEach(key => fn(obj[key], key, obj)); + const formatDuration = ms => { if (ms < 0) ms = -ms; const time = { @@ -508,6 +506,8 @@ const isNumber = val => typeof val === 'number'; const isObject = obj => obj === Object(obj); +const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; + const isPrime = num => { const boundary = Math.floor(Math.sqrt(num)); for (var i = 2; i <= boundary; i++) if (num % i == 0) return false; @@ -664,6 +664,16 @@ const observeMutations = (element, callback, options) => { const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts); +const omit = (obj, arr) => + Object.keys(obj) + .filter(k => !arr.includes(k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + +const omitBy = (obj, fn) => + Object.keys(obj) + .filter(k => !fn(obj[k], k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + const on = (el, evt, fn, opts = {}) => { const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e); el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false); @@ -740,6 +750,11 @@ const percentile = (arr, val) => const pick = (obj, arr) => arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {}); +const pickBy = (obj, fn) => + Object.keys(obj) + .filter(k => fn(obj[k], k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); const pluralize = (val, word, plural = word + 's') => { @@ -1054,6 +1069,6 @@ const zip = (...arrays) => { const zipObject = (props, values) => props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index ff86e3451..473666768 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -81,17 +81,6 @@ const chunk = (arr, size) => const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b)); -const cleanObj = (obj, keysToKeep = [], childIndicator) => { - Object.keys(obj).forEach(key => { - if (key === childIndicator) { - cleanObj(obj[key], keysToKeep, childIndicator); - } else if (!keysToKeep.includes(key)) { - delete obj[key]; - } - }); - return obj; -}; - const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags); const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_)); @@ -180,6 +169,8 @@ const decapitalize = ([first, ...rest], upperRest = false) => const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); +const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); + const defer = (fn, ...args) => setTimeout(fn, 1, ...args); const detectDeviceType = () => @@ -299,6 +290,13 @@ const forEachRight = (arr, callback) => .reverse() .forEach(callback); +const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj)); + +const forOwnRight = (obj, fn) => + Object.keys(obj) + .reverse() + .forEach(key => fn(obj[key], key, obj)); + const formatDuration = ms => { if (ms < 0) ms = -ms; const time = { @@ -514,6 +512,8 @@ const isNumber = val => typeof val === 'number'; const isObject = obj => obj === Object(obj); +const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; + const isPrime = num => { const boundary = Math.floor(Math.sqrt(num)); for (var i = 2; i <= boundary; i++) if (num % i == 0) return false; @@ -670,6 +670,16 @@ const observeMutations = (element, callback, options) => { const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts); +const omit = (obj, arr) => + Object.keys(obj) + .filter(k => !arr.includes(k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + +const omitBy = (obj, fn) => + Object.keys(obj) + .filter(k => !fn(obj[k], k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + const on = (el, evt, fn, opts = {}) => { const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e); el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false); @@ -746,6 +756,11 @@ const percentile = (arr, val) => const pick = (obj, arr) => arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {}); +const pickBy = (obj, fn) => + Object.keys(obj) + .filter(k => fn(obj[k], k)) + .reduce((acc, key) => (acc[key] = obj[key], acc), {}); + const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); const pluralize = (val, word, plural = word + 's') => { @@ -1060,7 +1075,7 @@ const zip = (...arrays) => { const zipObject = (props, values) => props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index d7bd82b9d..a9c1d840e 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=[],c)=>(Object.keys(a).forEach((d)=>{d===c?k(a[d],b,c):!b.includes(d)&&delete a[d]}),a),l=(a,b=a.length,...c)=>b<=c.length?a(...c):l.bind(null,a,b,...c),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}
  • `),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,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()),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)),cleanObj:k,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))),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:l,decapitalize:([a,...b],c=!1)=>a.toLowerCase()+(c?b.join('').toUpperCase():b.join('')),deepFlatten:m,defer:(a,...b)=>setTimeout(a,1,...b),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))},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),dropElements:(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)),findLast:(a,b)=>a.filter(b).slice(-1),flatten:q,flip:(a)=>(b,...c)=>a(...c,b),forEachRight:(a,b)=>a.slice(0).reverse().forEach(b),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))},invertKeyValues:(a)=>Object.keys(a).reduce((b,c)=>(b[a[c]]=c,b),{}),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,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),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),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),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),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{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),{}),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),{}),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),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},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))]},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},toCamelCase:(a)=>{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:()=>new Date(new Date().getTime()+8.64e7).toISOString().split('T')[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]),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),union:(c,a)=>Array.from(new Set([...c,...a])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),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),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),{})}}); +(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)=>[].concat(...a.map((a)=>Array.isArray(a)?l(a):a)),m=([...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)=>n(c[a],d[a]))},o=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*o(a-1),p=(a,b=1)=>1==b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?p(a,b-1):a),[]),q=(...a)=>{const c=(a,b)=>b?q(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},r='undefined'!=typeof require&&require('crypto'),s='undefined'!=typeof require&&require('fs'),t=()=>{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}
  • `),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,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()),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))),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('')),deepFlatten:l,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),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))},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),dropElements:(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:o,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findLast:(a,b)=>a.filter(b).slice(-1),flatten:p,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:q,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(r.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))},invertKeyValues:(a)=>Object.keys(a).reduce((b,c)=>(b[a[c]]=c,b),{}),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,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),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),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),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{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),{}),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)=>s.readFileSync(a).toString('UTF8').split('\n'),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),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:t,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},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))]},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},toCamelCase:(a)=>{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:()=>new Date(new Date().getTime()+8.64e7).toISOString().split('T')[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]),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),union:(c,a)=>Array.from(new Set([...c,...a])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),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),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),{})}}); diff --git a/test/defaults/defaults.js b/test/defaults/defaults.js new file mode 100644 index 000000000..39e951cab --- /dev/null +++ b/test/defaults/defaults.js @@ -0,0 +1,2 @@ +const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); + module.exports = defaults \ No newline at end of file diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js new file mode 100644 index 000000000..2497c9c57 --- /dev/null +++ b/test/defaults/defaults.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const defaults = require('./defaults.js'); + +test('Testing defaults', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof defaults === 'function', 'defaults is a Function'); + //t.deepEqual(defaults(args..), 'Expected'); + //t.equal(defaults(args..), 'Expected'); + //t.false(defaults(args..), 'Expected'); + //t.throws(defaults(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/forOwn/forOwn.js b/test/forOwn/forOwn.js new file mode 100644 index 000000000..de8b06fcc --- /dev/null +++ b/test/forOwn/forOwn.js @@ -0,0 +1,2 @@ +const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj)); + module.exports = forOwn \ No newline at end of file diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js new file mode 100644 index 000000000..eb60add6c --- /dev/null +++ b/test/forOwn/forOwn.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const forOwn = require('./forOwn.js'); + +test('Testing forOwn', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof forOwn === 'function', 'forOwn is a Function'); + //t.deepEqual(forOwn(args..), 'Expected'); + //t.equal(forOwn(args..), 'Expected'); + //t.false(forOwn(args..), 'Expected'); + //t.throws(forOwn(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/forOwnRight/forOwnRight.js b/test/forOwnRight/forOwnRight.js new file mode 100644 index 000000000..a74205dca --- /dev/null +++ b/test/forOwnRight/forOwnRight.js @@ -0,0 +1,5 @@ +const forOwnRight = (obj, fn) => +Object.keys(obj) +.reverse() +.forEach(key => fn(obj[key], key, obj)); + module.exports = forOwnRight \ No newline at end of file diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js new file mode 100644 index 000000000..6b80619fe --- /dev/null +++ b/test/forOwnRight/forOwnRight.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const forOwnRight = require('./forOwnRight.js'); + +test('Testing forOwnRight', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof forOwnRight === 'function', 'forOwnRight is a Function'); + //t.deepEqual(forOwnRight(args..), 'Expected'); + //t.equal(forOwnRight(args..), 'Expected'); + //t.false(forOwnRight(args..), 'Expected'); + //t.throws(forOwnRight(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/isPlainObject/isPlainObject.js b/test/isPlainObject/isPlainObject.js new file mode 100644 index 000000000..d740bf7c9 --- /dev/null +++ b/test/isPlainObject/isPlainObject.js @@ -0,0 +1,2 @@ +const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; + module.exports = isPlainObject \ No newline at end of file diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js new file mode 100644 index 000000000..6e749b2c3 --- /dev/null +++ b/test/isPlainObject/isPlainObject.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const isPlainObject = require('./isPlainObject.js'); + +test('Testing isPlainObject', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof isPlainObject === 'function', 'isPlainObject is a Function'); + //t.deepEqual(isPlainObject(args..), 'Expected'); + //t.equal(isPlainObject(args..), 'Expected'); + //t.false(isPlainObject(args..), 'Expected'); + //t.throws(isPlainObject(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/omit/omit.js b/test/omit/omit.js new file mode 100644 index 000000000..9c695ba28 --- /dev/null +++ b/test/omit/omit.js @@ -0,0 +1,5 @@ +const omit = (obj, arr) => +Object.keys(obj) +.filter(k => !arr.includes(k)) +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); + module.exports = omit \ No newline at end of file diff --git a/test/omit/omit.test.js b/test/omit/omit.test.js new file mode 100644 index 000000000..207453a9c --- /dev/null +++ b/test/omit/omit.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const omit = require('./omit.js'); + +test('Testing omit', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof omit === 'function', 'omit is a Function'); + //t.deepEqual(omit(args..), 'Expected'); + //t.equal(omit(args..), 'Expected'); + //t.false(omit(args..), 'Expected'); + //t.throws(omit(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/omitBy/omitBy.js b/test/omitBy/omitBy.js new file mode 100644 index 000000000..d3cbc009a --- /dev/null +++ b/test/omitBy/omitBy.js @@ -0,0 +1,5 @@ +const omitBy = (obj, fn) => +Object.keys(obj) +.filter(k => !fn(obj[k], k)) +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); + module.exports = omitBy \ No newline at end of file diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js new file mode 100644 index 000000000..f187ee9d6 --- /dev/null +++ b/test/omitBy/omitBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const omitBy = require('./omitBy.js'); + +test('Testing omitBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof omitBy === 'function', 'omitBy is a Function'); + //t.deepEqual(omitBy(args..), 'Expected'); + //t.equal(omitBy(args..), 'Expected'); + //t.false(omitBy(args..), 'Expected'); + //t.throws(omitBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/pickBy/pickBy.js b/test/pickBy/pickBy.js new file mode 100644 index 000000000..8ecc72551 --- /dev/null +++ b/test/pickBy/pickBy.js @@ -0,0 +1,5 @@ +const pickBy = (obj, fn) => +Object.keys(obj) +.filter(k => fn(obj[k], k)) +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); + module.exports = pickBy \ No newline at end of file diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js new file mode 100644 index 000000000..013c0cd2f --- /dev/null +++ b/test/pickBy/pickBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const pickBy = require('./pickBy.js'); + +test('Testing pickBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof pickBy === 'function', 'pickBy is a Function'); + //t.deepEqual(pickBy(args..), 'Expected'); + //t.equal(pickBy(args..), 'Expected'); + //t.false(pickBy(args..), 'Expected'); + //t.throws(pickBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 7441a3f3e..4e90e9836 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) +Test log for: Fri Jan 19 2018 20:10:14 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -205,6 +205,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ deepFlatten is a Function ✔ Deep flattens an array + Testing defaults + + ✔ defaults is a Function + Testing defer ✔ defer is a Function @@ -334,6 +338,14 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ forEachRight is a Function + Testing forOwn + + ✔ forOwn is a Function + + Testing forOwnRight + + ✔ forOwnRight is a Function + Testing formatDuration ✔ formatDuration is a Function @@ -605,6 +617,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ isObject({ a:1 }) is a object ✔ isObject(true) is not a object + Testing isPlainObject + + ✔ isPlainObject is a Function + Testing isPrime ✔ isPrime is a Function @@ -816,6 +832,14 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ off is a Function + Testing omit + + ✔ omit is a Function + + Testing omitBy + + ✔ omitBy is a Function + Testing on ✔ on is a Function @@ -859,6 +883,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ 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 @@ -1269,8 +1297,8 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC) ✔ zipObject(test, string) throws an error - total: 556 - passing: 556 - duration: 307ms + total: 563 + passing: 563 + duration: 311ms From 994e14cd0ff7b2333738bed33a49045c2c991f9f Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Sat, 20 Jan 2018 20:51:34 +0530 Subject: [PATCH 003/103] zipWith --- snippets/zipWith.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 snippets/zipWith.md diff --git a/snippets/zipWith.md b/snippets/zipWith.md new file mode 100644 index 000000000..024dca82f --- /dev/null +++ b/snippets/zipWith.md @@ -0,0 +1,22 @@ +### zipWith + +This method is like [zip](https://30secondsofcode.org/#zip) except that it accepts a function (`fn`) as the last value to specify how grouped values should be combined. + +The function is invoked with the elements of each group: `(...group)`. + +``` js +const zipWith = (...arrays) => { + const length = arrays.length; + let fn = length > 1 ? arrays[length - 1] : undefined; + fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; + const maxLength = Math.max(...arrays.map(x => x.length)); + const result = Array.from({ length: maxLength }).map((_, i) => { + return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); + }) + return fn ? result.map(arr => fn(...arr)) : result; +} +``` + +``` js +zipWith([1, 2], [10, 20], [100, 200], (a,b,c) => a + b + c); // [111,222] +``` From c1f5de2b47370c024fd7f0121d79e066dc26d2c5 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sat, 20 Jan 2018 20:10:52 +0000 Subject: [PATCH 004/103] Travis build: 1325 [cron] --- test/testlog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlog b/test/testlog index 4e90e9836..73abf076c 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Fri Jan 19 2018 20:10:14 GMT+0000 (UTC) +Test log for: Sat Jan 20 2018 20:10:48 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1299,6 +1299,6 @@ Test log for: Fri Jan 19 2018 20:10:14 GMT+0000 (UTC) total: 563 passing: 563 - duration: 311ms + duration: 346ms From f7d815f0d91667e717e088cc0019bce7654586a7 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Sun, 21 Jan 2018 12:21:22 +0530 Subject: [PATCH 005/103] Update zipWith.md --- snippets/zipWith.md | 1 + 1 file changed, 1 insertion(+) diff --git a/snippets/zipWith.md b/snippets/zipWith.md index 024dca82f..b9dc53acc 100644 --- a/snippets/zipWith.md +++ b/snippets/zipWith.md @@ -19,4 +19,5 @@ const zipWith = (...arrays) => { ``` js zipWith([1, 2], [10, 20], [100, 200], (a,b,c) => a + b + c); // [111,222] +zipWith([1, 2, 3], [10, 20], [100, 200], (a,b,c) => (a != null ? a : 'a') + (b != null ? b:'b') + (c != null ? c : 'c')); // [111, 222, '3bc] ``` From 871830c6d03d5a4f955dbe4ae2e70804494319a2 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sun, 21 Jan 2018 20:11:28 +0000 Subject: [PATCH 006/103] Travis build: 1329 [cron] --- snippets_archive/README.md | 102 ++++++++++++++++++++++++------------- test/testlog | 4 +- 2 files changed, 70 insertions(+), 36 deletions(-) diff --git a/snippets_archive/README.md b/snippets_archive/README.md index e51a9be23..bd8901939 100644 --- a/snippets_archive/README.md +++ b/snippets_archive/README.md @@ -9,18 +9,19 @@ These snippets, while useful and interesting, didn't quite make it into the repo * [`JSONToDate`](#jsontodate) * [`speechSynthesis`](#speechsynthesis) * [`binarySearch`](#binarysearch) +* [`cleanObj`](#cleanobj) * [`collatz`](#collatz) * [`countVowels`](#countvowels) * [`factors`](#factors) * [`fibonacciCountUntilNum`](#fibonaccicountuntilnum) -* [`fibonacciUntilNum`](#fibonacciuntilnum) +* [`howManyTimes`](#howmanytimes) * [`httpDelete`](#httpdelete) * [`httpPut`](#httpput) * [`isArmstrongNumber`](#isarmstrongnumber) * [`quickSort`](#quicksort) * [`removeVowels`](#removevowels) * [`solveRPN`](#solverpn) -* [`howManyTimes`](#howmanytimes) +* [`fibonacciUntilNum`](#fibonacciuntilnum) --- @@ -111,6 +112,39 @@ binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21); // -1
    [⬆ Back to top](#table-of-contents) +### cleanObj + +Removes any properties except the ones specified from a JSON object. + +Use `Object.keys()` method to loop over given JSON object and deleting keys that are not included in given array. +If you pass a special key,`childIndicator`, it will search deeply apply the function to inner objects, too. + +```js +const cleanObj = (obj, keysToKeep = [], childIndicator) => { + Object.keys(obj).forEach(key => { + if (key === childIndicator) { + cleanObj(obj[key], keysToKeep, childIndicator); + } else if (!keysToKeep.includes(key)) { + delete obj[key]; + } + }); + return obj; +}; +``` + +
    +Examples + +```js +const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; +cleanObj(testObj, ['a'], 'children'); // { a: 1, children : { a: 1}} +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### collatz Applies the Collatz algorithm. @@ -230,21 +264,26 @@ fibonacciCountUntilNum(10); // 7
    [⬆ Back to top](#table-of-contents) -### fibonacciUntilNum +### howManyTimes -Generates an array, containing the Fibonacci sequence, up until the nth term. +Returns the number of times `num` can be divided by `divisor` (integer or fractional) without getting a fractional answer. +Works for both negative and positive integers. -Create an empty array of the specific length, initializing the first two values (`0` and `1`). -Use `Array.reduce()` to add values into the array, using the sum of the last two values, except for the first two. -Uses a mathematical formula to calculate the length of the array required. +If `divisor` is `-1` or `1` return `Infinity`. +If `divisor` is `-0` or `0` return `0`. +Otherwise, keep dividing `num` with `divisor` and incrementing `i`, while the result is an integer. +Return the number of times the loop was executed, `i`. ```js -const fibonacciUntilNum = num => { - let n = Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2)); - return Array.from({ length: n }).reduce( - (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), - [] - ); +const howManyTimes = (num, divisor) => { + if (divisor === 1 || divisor === -1) return Infinity; + if (divisor === 0) return 0; + let i = 0; + while (Number.isInteger(num / divisor)) { + i++; + num = num / divisor; + } + return i; }; ``` @@ -252,7 +291,10 @@ const fibonacciUntilNum = num => { Examples ```js -fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ] +howManyTimes(100, 2); // 2 +howManyTimes(100, 2.5); // 2 +howManyTimes(100, 0); // 0 +howManyTimes(100, -1); // Infinity ``` @@ -466,26 +508,21 @@ solveRPN('2 3 ^'); // 8
    [⬆ Back to top](#table-of-contents) -### howManyTimes +### fibonacciUntilNum -Returns the number of times `num` can be divided by `divisor` (integer or fractional) without getting a fractional answer. -Works for both negative and positive integers. +Generates an array, containing the Fibonacci sequence, up until the nth term. -If `divisor` is `-1` or `1` return `Infinity`. -If `divisor` is `-0` or `0` return `0`. -Otherwise, keep dividing `num` with `divisor` and incrementing `i`, while the result is an integer. -Return the number of times the loop was executed, `i`. +Create an empty array of the specific length, initializing the first two values (`0` and `1`). +Use `Array.reduce()` to add values into the array, using the sum of the last two values, except for the first two. +Uses a mathematical formula to calculate the length of the array required. ```js -const howManyTimes = (num, divisor) => { - if (divisor === 1 || divisor === -1) return Infinity; - if (divisor === 0) return 0; - let i = 0; - while (Number.isInteger(num / divisor)) { - i++; - num = num / divisor; - } - return i; +const fibonacciUntilNum = num => { + let n = Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2)); + return Array.from({ length: n }).reduce( + (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), + [] + ); }; ``` @@ -493,10 +530,7 @@ const howManyTimes = (num, divisor) => { Examples ```js -howManyTimes(100, 2); // 2 -howManyTimes(100, 2.5); // 2 -howManyTimes(100, 0); // 0 -howManyTimes(100, -1); // Infinity +fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ] ``` diff --git a/test/testlog b/test/testlog index 73abf076c..32994aa4e 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sat Jan 20 2018 20:10:48 GMT+0000 (UTC) +Test log for: Sun Jan 21 2018 20:11:24 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1299,6 +1299,6 @@ Test log for: Sat Jan 20 2018 20:10:48 GMT+0000 (UTC) total: 563 passing: 563 - duration: 346ms + duration: 391ms From 3b085cbb042b2791cdd5317f53097268ad552678 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Mon, 22 Jan 2018 20:11:32 +0000 Subject: [PATCH 007/103] Travis build: 1331 [cron] --- test/testlog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlog b/test/testlog index 32994aa4e..24e508045 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sun Jan 21 2018 20:11:24 GMT+0000 (UTC) +Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1299,6 +1299,6 @@ Test log for: Sun Jan 21 2018 20:11:24 GMT+0000 (UTC) total: 563 passing: 563 - duration: 391ms + duration: 314ms From 932424859b76c3e02bdf9676dd6740eb9941aa5f Mon Sep 17 00:00:00 2001 From: Niels Leenheer Date: Mon, 22 Jan 2018 22:38:11 +0100 Subject: [PATCH 008/103] Fix tomorrow() function For details see bug #564 --- snippets/tomorrow.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md index 3bd5a6412..49eb09332 100644 --- a/snippets/tomorrow.md +++ b/snippets/tomorrow.md @@ -1,10 +1,20 @@ ### tomorrow Results in a string representation of tomorrow's date. -Use `new Date()` to get today's date, adding `86400000` of seconds to it(24 hours), using `Date.toISOString()` to convert Date object to string. +Use `new Date()` to get today's date, adding one day using `Date.getDate()` and `Date.setDate()`, and converting the Date object to a string. ```js -const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; +const tomorrow = () => { + let t = new Date(); + t.setDate(t.getDate() + 1); + return ( + t.getFullYear() + + '-' + + String(t.getMonth() + 1).padStart(2, '0') + + '-' + + String(t.getDay()).padStart(2, '0') + ); +}; ``` ```js From 61c006a4268e6675d441be85df2b5881b3f30d70 Mon Sep 17 00:00:00 2001 From: Niels Leenheer Date: Mon, 22 Jan 2018 23:37:04 +0100 Subject: [PATCH 009/103] Use getDate() instead of the obviously wrong getDay() --- snippets/tomorrow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md index 49eb09332..3008f4d65 100644 --- a/snippets/tomorrow.md +++ b/snippets/tomorrow.md @@ -12,7 +12,7 @@ const tomorrow = () => { '-' + String(t.getMonth() + 1).padStart(2, '0') + '-' + - String(t.getDay()).padStart(2, '0') + String(t.getDate()).padStart(2, '0') ); }; ``` From 5e4c23e6de0c54efa39b60e6ef93080e2e7fd9b2 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 23 Jan 2018 13:29:26 +0200 Subject: [PATCH 010/103] Update tomorrow.md --- snippets/tomorrow.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md index 3008f4d65..24bbb530c 100644 --- a/snippets/tomorrow.md +++ b/snippets/tomorrow.md @@ -7,13 +7,7 @@ Use `new Date()` to get today's date, adding one day using `Date.getDate()` and const tomorrow = () => { let t = new Date(); t.setDate(t.getDate() + 1); - return ( - t.getFullYear() + - '-' + - String(t.getMonth() + 1).padStart(2, '0') + - '-' + - String(t.getDate()).padStart(2, '0') - ); + return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String(t.getDate()).padStart(2, '0')}`; }; ``` From d23ef32ac1e2c5134322e9016ce9f5dab92c197b Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Tue, 23 Jan 2018 11:32:13 +0000 Subject: [PATCH 011/103] Travis build: 1333 --- README.md | 10 ++++++++-- docs/index.html | 8 +++++++- snippets/tomorrow.md | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e74ebf0d0..c935c7ce7 100644 --- a/README.md +++ b/README.md @@ -2684,10 +2684,16 @@ getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9 ### tomorrow Results in a string representation of tomorrow's date. -Use `new Date()` to get today's date, adding `86400000` of seconds to it(24 hours), using `Date.toISOString()` to convert Date object to string. +Use `new Date()` to get today's date, adding one day using `Date.getDate()` and `Date.setDate()`, and converting the Date object to a string. ```js -const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; +const tomorrow = () => { + let t = new Date(); + t.setDate(t.getDate() + 1); + return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String( + t.getDate() + ).padStart(2, '0')}`; +}; ```
    diff --git a/docs/index.html b/docs/index.html index 431521070..f2f8b162a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -588,7 +588,13 @@ document.body📋 Copy to clipboard

    getDaysDiffBetweenDates

    Returns the difference (in days) between two dates.

    Calculate the difference (in days) between two Date objects.

    const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
       (dateFinal - dateInitial) / (1000 * 3600 * 24);
     
    getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9
    -

    tomorrow

    Results in a string representation of tomorrow's date. Use new Date() to get today's date, adding 86400000 of seconds to it(24 hours), using Date.toISOString() to convert Date object to string.

    const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
    +

    tomorrow

    Results in a string representation of tomorrow's date. Use new Date() to get today's date, adding one day using Date.getDate() and Date.setDate(), and converting the Date object to a string.

    const tomorrow = () => {
    +  let t = new Date();
    +  t.setDate(t.getDate() + 1);
    +  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String(
    +    t.getDate()
    +  ).padStart(2, '0')}`;
    +};
     
    tomorrow(); // 2017-12-27 (if current date is 2017-12-26)
     

    Function

    chainAsync

    Chains asynchronous functions.

    Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

    const chainAsync = fns => {
       let curr = 0;
    diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md
    index 24bbb530c..fd7c4dfa1 100644
    --- a/snippets/tomorrow.md
    +++ b/snippets/tomorrow.md
    @@ -7,7 +7,9 @@ Use `new Date()` to get today's date, adding one day using `Date.getDate()` and
     const tomorrow = () => {
       let t = new Date();
       t.setDate(t.getDate() + 1);
    -  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String(t.getDate()).padStart(2, '0')}`;
    +  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String(
    +    t.getDate()
    +  ).padStart(2, '0')}`;
     };
     ```
     
    
    From fb37df560d77d21122b3dbd20a0772efbcdbe7c3 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 15:59:43 +0200
    Subject: [PATCH 012/103] Updated description, tags
    
    ---
     snippets/zipWith.md | 10 +++++++---
     tag_database        |  1 +
     2 files changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/snippets/zipWith.md b/snippets/zipWith.md
    index b9dc53acc..e50b9a928 100644
    --- a/snippets/zipWith.md
    +++ b/snippets/zipWith.md
    @@ -1,8 +1,12 @@
     ### zipWith
     
    -This method is like [zip](https://30secondsofcode.org/#zip) except that it accepts a function (`fn`) as the last value to specify how grouped values should be combined. 
    +Creates an array of elements, grouped based on the position in the original arrays and using function as the last value to specify how grouped values should be combined.
     
    -The function is invoked with the elements of each group: `(...group)`.
    +Check if the last argument provided in a function.
    +Use `Math.max()` to get the longest array in the arguments.
    +Creates an array with that length as return value and use `Array.from()` with a map-function to create an array of grouped elements.
    +If lengths of the argument-arrays vary, `undefined` is used where no value could be found.
    +The function is invoked with the elements of each group `(...group)`.
     
     ``` js
     const zipWith = (...arrays) => {
    @@ -19,5 +23,5 @@ const zipWith = (...arrays) => {
     
     ``` js
     zipWith([1, 2], [10, 20], [100, 200], (a,b,c) => a + b + c); // [111,222]
    -zipWith([1, 2, 3], [10, 20], [100, 200], (a,b,c) => (a != null ? a : 'a') + (b != null ? b:'b') + (c != null ? c : 'c')); // [111, 222, '3bc]
    +zipWith([1, 2, 3], [10, 20], [100, 200], (a,b,c) => (a != null ? a : 'a') + (b != null ? b:'b') + (c != null ? c : 'c')); // [111, 222, '3bc']
     ```
    diff --git a/tag_database b/tag_database
    index d1cd81502..6b69c3f7d 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -216,3 +216,4 @@ words:string,regexp
     yesNo:utility,regexp
     zip:array
     zipObject:array,object
    +zipWith:array,advanced
    
    From f264072af0a915ced91047ea10949b9473b72214 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 14:01:35 +0000
    Subject: [PATCH 013/103] Travis build: 1335
    
    ---
     README.md           | 42 ++++++++++++++++++++++++++++++++++++++++++
     docs/index.html     | 19 ++++++++++++++++++-
     snippets/zipWith.md | 19 ++++++++++++-------
     3 files changed, 72 insertions(+), 8 deletions(-)
    
    diff --git a/README.md b/README.md
    index c935c7ce7..dfbf147c2 100644
    --- a/README.md
    +++ b/README.md
    @@ -142,6 +142,7 @@ average(1, 2, 3);
     * [`without`](#without)
     * [`zip`](#zip)
     * [`zipObject`](#zipobject)
    +* [`zipWith`](#zipwith-)
     
     
    @@ -1872,6 +1873,47 @@ zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2}
    [⬆ Back to top](#table-of-contents) + +### zipWith ![advanced](/advanced.svg) + +Creates an array of elements, grouped based on the position in the original arrays and using function as the last value to specify how grouped values should be combined. + +Check if the last argument provided in a function. +Use `Math.max()` to get the longest array in the arguments. +Creates an array with that length as return value and use `Array.from()` with a map-function to create an array of grouped elements. +If lengths of the argument-arrays vary, `undefined` is used where no value could be found. +The function is invoked with the elements of each group `(...group)`. + +```js +const zipWith = (...arrays) => { + const length = arrays.length; + let fn = length > 1 ? arrays[length - 1] : undefined; + fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; + const maxLength = Math.max(...arrays.map(x => x.length)); + const result = Array.from({ length: maxLength }).map((_, i) => { + return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); + }); + return fn ? result.map(arr => fn(...arr)) : result; +}; +``` + +
    +Examples + +```js +zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c); // [111,222] +zipWith( + [1, 2, 3], + [10, 20], + [100, 200], + (a, b, c) => (a != null ? a : 'a') + (b != null ? b : 'b') + (c != null ? c : 'c') +); // [111, 222, '3bc'] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + --- ## 🌐 Browser diff --git a/docs/index.html b/docs/index.html index f2f8b162a..ff75776a2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -353,6 +353,23 @@ Object.assig
       props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {});
     
    zipObject(['a', 'b', 'c'], [1, 2]); // {a: 1, b: 2, c: undefined}
     zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2}
    +

    zipWithadvanced

    Creates an array of elements, grouped based on the position in the original arrays and using function as the last value to specify how grouped values should be combined.

    Check if the last argument provided in a function. Use Math.max() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found. The function is invoked with the elements of each group (...group).

    const zipWith = (...arrays) => {
    +  const length = arrays.length;
    +  let fn = length > 1 ? arrays[length - 1] : undefined;
    +  fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined;
    +  const maxLength = Math.max(...arrays.map(x => x.length));
    +  const result = Array.from({ length: maxLength }).map((_, i) => {
    +    return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]);
    +  });
    +  return fn ? result.map(arr => fn(...arr)) : result;
    +};
    +
    zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c); // [111,222]
    +zipWith(
    +  [1, 2, 3],
    +  [10, 20],
    +  [100, 200],
    +  (a, b, c) => (a != null ? a : 'a') + (b != null ? b : 'b') + (c != null ? c : 'c')
    +); // [111, 222, '3bc']
     

    Browser

    arrayToHtmlList

    Converts the given array elements into <li> tags and appends them to the list of the given id.

    Use Array.map() and document.querySelector() to create a list of html tags.

    const arrayToHtmlList = (arr, listID) =>
       arr.map(item => (document.querySelector('#' + listID).innerHTML += `<li>${item}</li>`));
     
    arrayToHtmlList(['item 1', 'item 2'], 'myListID');
    diff --git a/snippets/zipWith.md b/snippets/zipWith.md
    index e50b9a928..55b6dd446 100644
    --- a/snippets/zipWith.md
    +++ b/snippets/zipWith.md
    @@ -8,20 +8,25 @@ Creates an array with that length as return value and use `Array.from()` with a
     If lengths of the argument-arrays vary, `undefined` is used where no value could be found.
     The function is invoked with the elements of each group `(...group)`.
     
    -``` js
    +```js
     const zipWith = (...arrays) => {
       const length = arrays.length;
       let fn = length > 1 ? arrays[length - 1] : undefined;
       fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined;
       const maxLength = Math.max(...arrays.map(x => x.length));
    -  const result =  Array.from({ length: maxLength }).map((_, i) => {
    +  const result = Array.from({ length: maxLength }).map((_, i) => {
         return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]);
    -  })
    +  });
       return fn ? result.map(arr => fn(...arr)) : result;
    -}
    +};
     ```
     
    -``` js
    -zipWith([1, 2], [10, 20], [100, 200], (a,b,c) => a + b + c); // [111,222]
    -zipWith([1, 2, 3], [10, 20], [100, 200], (a,b,c) => (a != null ? a : 'a') + (b != null ? b:'b') + (c != null ? c : 'c')); // [111, 222, '3bc']
    +```js
    +zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c); // [111,222]
    +zipWith(
    +  [1, 2, 3],
    +  [10, 20],
    +  [100, 200],
    +  (a, b, c) => (a != null ? a : 'a') + (b != null ? b : 'b') + (c != null ? c : 'c')
    +); // [111, 222, '3bc']
     ```
    
    From fefea877750da2d4de16babf8d695d55ddc35c35 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 17:31:50 +0200
    Subject: [PATCH 014/103] Update invertKeyValues
    
    ---
     snippets/invertKeyValues.md | 14 +++++++++-----
     tag_database                |  2 +-
     2 files changed, 10 insertions(+), 6 deletions(-)
    
    diff --git a/snippets/invertKeyValues.md b/snippets/invertKeyValues.md
    index 2d4302145..e50ea0912 100644
    --- a/snippets/invertKeyValues.md
    +++ b/snippets/invertKeyValues.md
    @@ -1,17 +1,21 @@
     ### invertKeyValues
     
    -Inverts the key-value pairs of an object, without mutating it.
    +Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key.
     
    -Use `Object.keys()` and `Array.reduce()` to invert the key-value pairs of an object.
    +Use `Object.keys()` and `Array.reduce()` to invert the key-value pairs of an object and apply the function provided (if any).
    +Omit the second argument, `fn`, to get the inverted keys without applying a function to them.
     
     ```js
    -const invertKeyValues = obj =>
    +const invertKeyValues = (obj, fn) =>
       Object.keys(obj).reduce((acc, key) => {
    -    acc[obj[key]] = key;
    +    const val = fn ? fn(obj[key]) : obj[key];
    +    acc[val] = acc[val] || [];
    +    acc[val].push(key);
         return acc;
       }, {});
     ```
     
     ```js
    -invertKeyValues({ name: 'John', age: 20 }); // { 20: 'age', John: 'name' }
    +invertKeyValues({ a: 1, b: 2, c: 1 }); // { 1: [ 'a', 'c' ], 2: [ 'b' ] }
    +invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value); // { group1: [ 'a', 'c' ], group2: [ 'b' ] }
     ```
    diff --git a/tag_database b/tag_database
    index 6b69c3f7d..17a08401f 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -85,7 +85,7 @@ initializeArrayWithRangeRight:array,math
     initializeArrayWithValues:array,math
     inRange:math
     intersection:array,math
    -invertKeyValues:object
    +invertKeyValues:object,function
     is:type,array,regexp
     isAbsoluteURL:string,utility,browser,url
     isArrayLike:type,array
    
    From d47f85acc06f384dcb90eda9c11dcd56d5ba5d62 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 15:34:14 +0000
    Subject: [PATCH 015/103] Travis build: 1337
    
    ---
     README.md       | 14 +++++++++-----
     docs/index.html | 11 +++++++----
     2 files changed, 16 insertions(+), 9 deletions(-)
    
    diff --git a/README.md b/README.md
    index dfbf147c2..fc9d10648 100644
    --- a/README.md
    +++ b/README.md
    @@ -4354,14 +4354,17 @@ get(obj, 'selector.to.val', 'target[0]', 'target[2].a'); // ['val to select', 1,
     
     ### invertKeyValues
     
    -Inverts the key-value pairs of an object, without mutating it.
    +Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key.
     
    -Use `Object.keys()` and `Array.reduce()` to invert the key-value pairs of an object.
    +Use `Object.keys()` and `Array.reduce()` to invert the key-value pairs of an object and apply the function provided (if any).
    +Omit the second argument, `fn`, to get the inverted keys without applying a function to them.
     
     ```js
    -const invertKeyValues = obj =>
    +const invertKeyValues = (obj, fn) =>
       Object.keys(obj).reduce((acc, key) => {
    -    acc[obj[key]] = key;
    +    const val = fn ? fn(obj[key]) : obj[key];
    +    acc[val] = acc[val] || [];
    +    acc[val].push(key);
         return acc;
       }, {});
     ```
    @@ -4370,7 +4373,8 @@ const invertKeyValues = obj =>
     Examples
     
     ```js
    -invertKeyValues({ name: 'John', age: 20 }); // { 20: 'age', John: 'name' }
    +invertKeyValues({ a: 1, b: 2, c: 1 }); // { 1: [ 'a', 'c' ], 2: [ 'b' ] }
    +invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value); // { group1: [ 'a', 'c' ], group2: [ 'b' ] }
     ```
     
     
    diff --git a/docs/index.html b/docs/index.html
    index ff75776a2..90e378a0e 100644
    --- a/docs/index.html
    +++ b/docs/index.html
    @@ -50,7 +50,7 @@
                 scrollToTop();
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -978,12 +978,15 @@ Foo.prototypeShow examples
    const obj = { selector: { to: { val: 'val to select' } }, target: [1, 2, { a: 'test' }] };
     get(obj, 'selector.to.val', 'target[0]', 'target[2].a'); // ['val to select', 1, 'test']
    -

    invertKeyValues

    Inverts the key-value pairs of an object, without mutating it.

    Use Object.keys() and Array.reduce() to invert the key-value pairs of an object.

    const invertKeyValues = obj =>
    +

    invertKeyValues

    Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key.

    Use Object.keys() and Array.reduce() to invert the key-value pairs of an object and apply the function provided (if any). Omit the second argument, fn, to get the inverted keys without applying a function to them.

    const invertKeyValues = (obj, fn) =>
       Object.keys(obj).reduce((acc, key) => {
    -    acc[obj[key]] = key;
    +    const val = fn ? fn(obj[key]) : obj[key];
    +    acc[val] = acc[val] || [];
    +    acc[val].push(key);
         return acc;
       }, {});
    -
    invertKeyValues({ name: 'John', age: 20 }); // { 20: 'age', John: 'name' }
    +
    invertKeyValues({ a: 1, b: 2, c: 1 }); // { 1: [ 'a', 'c' ], 2: [ 'b' ] }
    +invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value); // { group1: [ 'a', 'c' ], group2: [ 'b' ] }
     

    lowercaseKeys

    Creates a new object from the specified object, where all the keys are in lowercase.

    Use Object.keys() and Array.reduce() to create a new object from the specified object. Convert each key in the original object to lowercase, using String.toLowerCase().

    const lowercaseKeys = obj =>
       Object.keys(obj).reduce((acc, key) => {
         acc[key.toLowerCase()] = obj[key];
    
    From 16b7df3783bb5c8aab1de109b4824bf8d8eeac29 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 18:23:20 +0200
    Subject: [PATCH 016/103] Add findKey, findLastKey
    
    ---
     snippets/findKey.md     | 14 ++++++++++++++
     snippets/findLastKey.md | 14 ++++++++++++++
     tag_database            |  2 ++
     3 files changed, 30 insertions(+)
     create mode 100644 snippets/findKey.md
     create mode 100644 snippets/findLastKey.md
    
    diff --git a/snippets/findKey.md b/snippets/findKey.md
    new file mode 100644
    index 000000000..96d563f83
    --- /dev/null
    +++ b/snippets/findKey.md
    @@ -0,0 +1,14 @@
    +### findKey
    +
    +Returns the first key that satisfies the provided testing function. Otherwise `undefined` is returned.
    +
    +Use `Object.keys(obj)` to get all the properties of the object, `Array.find()` to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.
    +
    +```js
    +const findKey = (obj, fn) =>
    +  Object.keys(obj).find(key => fn(obj[key], key, obj));
    +```
    +
    +```js
    +findKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'barney'
    +```
    diff --git a/snippets/findLastKey.md b/snippets/findLastKey.md
    new file mode 100644
    index 000000000..dcaed6232
    --- /dev/null
    +++ b/snippets/findLastKey.md
    @@ -0,0 +1,14 @@
    +### findLastKey
    +
    +Returns the last key that satisfies the provided testing function. Otherwise `undefined` is returned.
    +
    +Use `Object.keys(obj)` to get all the properties of the object, `Array.reverse()` to reverse their order and `Array.find()` to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.
    +
    +```js
    +const findLastKey = (obj, fn) =>
    +  Object.keys(obj).reverse().find(key => fn(obj[key], key, obj));
    +```
    +
    +```js
    +findKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'pebbles'
    +```
    diff --git a/tag_database b/tag_database
    index 17a08401f..85c99fe29 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -47,7 +47,9 @@ extendHex:utility,string
     factorial:math,recursion
     fibonacci:math,array
     filterNonUnique:array
    +findKey:object,function
     findLast:array
    +findLastKey:object,function
     flatten:array
     flip:adapter,function
     forEachRight:array,function
    
    From 51f5dee152b2730ab59aa67a9b9c7a4a6336fd1a Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 18:23:40 +0200
    Subject: [PATCH 017/103] Fix findLastKey example
    
    ---
     snippets/findLastKey.md | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/snippets/findLastKey.md b/snippets/findLastKey.md
    index dcaed6232..ee1390a21 100644
    --- a/snippets/findLastKey.md
    +++ b/snippets/findLastKey.md
    @@ -10,5 +10,5 @@ const findLastKey = (obj, fn) =>
     ```
     
     ```js
    -findKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'pebbles'
    +findLastKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'pebbles'
     ```
    
    From b706d928faa90a2b072b565f2ba38fb9c9ca4770 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 16:25:07 +0000
    Subject: [PATCH 018/103] Travis build: 1340
    
    ---
     README.md               | 63 +++++++++++++++++++++++++++++++++++++++++
     docs/index.html         | 23 ++++++++++++++-
     snippets/findKey.md     | 12 ++++++--
     snippets/findLastKey.md | 13 +++++++--
     4 files changed, 105 insertions(+), 6 deletions(-)
    
    diff --git a/README.md b/README.md
    index fc9d10648..ba96ed086 100644
    --- a/README.md
    +++ b/README.md
    @@ -274,6 +274,8 @@ average(1, 2, 3);
     
     * [`defaults`](#defaults)
     * [`equals`](#equals-)
    +* [`findKey`](#findkey)
    +* [`findLastKey`](#findlastkey)
     * [`forOwn`](#forown)
     * [`forOwnRight`](#forownright)
     * [`functions`](#functions)
    @@ -4240,6 +4242,67 @@ equals({ a: [2, { e: 3 }], b: [4], c: 'foo' }, { a: [2, { e: 3 }], b: [4], c: 'f
     
    [⬆ Back to top](#table-of-contents) +### findKey + +Returns the first key that satisfies the provided testing function. Otherwise `undefined` is returned. + +Use `Object.keys(obj)` to get all the properties of the object, `Array.find()` to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object. + +```js +const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); +``` + +
    +Examples + +```js +findKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +); // 'barney' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### findLastKey + +Returns the last key that satisfies the provided testing function. Otherwise `undefined` is returned. + +Use `Object.keys(obj)` to get all the properties of the object, `Array.reverse()` to reverse their order and `Array.find()` to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object. + +```js +const findLastKey = (obj, fn) => + Object.keys(obj) + .reverse() + .find(key => fn(obj[key], key, obj)); +``` + +
    +Examples + +```js +findLastKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +); // 'pebbles' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### forOwn Iterates over all own properties of an object, running a callback for each one. diff --git a/docs/index.html b/docs/index.html index 90e378a0e..35079591d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -949,6 +949,27 @@ console.log<
       return keys.every(k => equals(a[k], b[k]));
     };
     
    equals({ a: [2, { e: 3 }], b: [4], c: 'foo' }, { a: [2, { e: 3 }], b: [4], c: 'foo' }); // true
    +

    findKey

    Returns the first key that satisfies the provided testing function. Otherwise undefined is returned.

    Use Object.keys(obj) to get all the properties of the object, Array.find() to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.

    const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj));
    +
    findKey(
    +  {
    +    barney: { age: 36, active: true },
    +    fred: { age: 40, active: false },
    +    pebbles: { age: 1, active: true }
    +  },
    +  o => o['active']
    +); // 'barney'
    +

    findLastKey

    Returns the last key that satisfies the provided testing function. Otherwise undefined is returned.

    Use Object.keys(obj) to get all the properties of the object, Array.reverse() to reverse their order and Array.find() to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.

    const findLastKey = (obj, fn) =>
    +  Object.keys(obj)
    +    .reverse()
    +    .find(key => fn(obj[key], key, obj));
    +
    findLastKey(
    +  {
    +    barney: { age: 36, active: true },
    +    fred: { age: 40, active: false },
    +    pebbles: { age: 1, active: true }
    +  },
    +  o => o['active']
    +); // 'pebbles'
     

    forOwn

    Iterates over all own properties of an object, running a callback for each one.

    Use Object.keys(obj) to get all the properties of the object, Array.forEach() to run the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.

    const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj));
     
    forOwn({ foo: 'bar', a: 1 }, v => console.log(v)); // 'bar', 1
     

    forOwnRight

    Iterates over all own properties of an object in reverse, running a callback for each one.

    Use Object.keys(obj) to get all the properties of the object, Array.reverse() to reverse their order and Array.forEach() to run the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.

    const forOwnRight = (obj, fn) =>
    diff --git a/snippets/findKey.md b/snippets/findKey.md
    index 96d563f83..81e41d226 100644
    --- a/snippets/findKey.md
    +++ b/snippets/findKey.md
    @@ -5,10 +5,16 @@ Returns the first key that satisfies the provided testing function. Otherwise `u
     Use `Object.keys(obj)` to get all the properties of the object, `Array.find()` to test the provided function for each key-value pair. The callback receives three arguments - the value, the key and the object.
     
     ```js
    -const findKey = (obj, fn) =>
    -  Object.keys(obj).find(key => fn(obj[key], key, obj));
    +const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj));
     ```
     
     ```js
    -findKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'barney'
    +findKey(
    +  {
    +    barney: { age: 36, active: true },
    +    fred: { age: 40, active: false },
    +    pebbles: { age: 1, active: true }
    +  },
    +  o => o['active']
    +); // 'barney'
     ```
    diff --git a/snippets/findLastKey.md b/snippets/findLastKey.md
    index ee1390a21..1333a98d3 100644
    --- a/snippets/findLastKey.md
    +++ b/snippets/findLastKey.md
    @@ -6,9 +6,18 @@ Use `Object.keys(obj)` to get all the properties of the object, `Array.reverse()
     
     ```js
     const findLastKey = (obj, fn) =>
    -  Object.keys(obj).reverse().find(key => fn(obj[key], key, obj));
    +  Object.keys(obj)
    +    .reverse()
    +    .find(key => fn(obj[key], key, obj));
     ```
     
     ```js
    -findLastKey({barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true }}, o => o['active']); // 'pebbles'
    +findLastKey(
    +  {
    +    barney: { age: 36, active: true },
    +    fred: { age: 40, active: false },
    +    pebbles: { age: 1, active: true }
    +  },
    +  o => o['active']
    +); // 'pebbles'
     ```
    
    From 321b662ec751d0008bb519f39bac0d02b5bb451c Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 19:25:17 +0200
    Subject: [PATCH 019/103] Add isEmpty
    
    ---
     snippets/isEmpty.md | 22 ++++++++++++++++++++++
     tag_database        |  1 +
     2 files changed, 23 insertions(+)
     create mode 100644 snippets/isEmpty.md
    
    diff --git a/snippets/isEmpty.md b/snippets/isEmpty.md
    new file mode 100644
    index 000000000..f620f3727
    --- /dev/null
    +++ b/snippets/isEmpty.md
    @@ -0,0 +1,22 @@
    +### isEmpty
    +
    +Returns true if the a value is an empty object, collection, map or set, has no enumerable properties or is any type that is not considered a collection.
    +
    +Check if the provided value is `null` or if its `length` is equal to `0`.
    +
    +```js
    +const isEmpty = val => val == null || !(Object.keys(val) || val).length;
    +```
    +
    +```js
    +isEmpty(new Map()); // true
    +isEmpty(new Set()); // true
    +isEmpty([]); // true
    +isEmpty({}); // true
    +isEmpty(''); // true
    +isEmpty([1, 2]); // false
    +isEmpty({ a: 1, b: 2 }); // false
    +isEmpty('text'); // false
    +isEmpty(123); // true - type is not considered a collection
    +isEmpty(true); // true - type is not considered a collection
    +```
    diff --git a/tag_database b/tag_database
    index 85c99fe29..df181e65a 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -93,6 +93,7 @@ isAbsoluteURL:string,utility,browser,url
     isArrayLike:type,array
     isBoolean:type
     isDivisible:math
    +isEmpty:type,array,object,string
     isEven:math
     isFunction:type,function
     isLowerCase:string,utility
    
    From 6c28ff453277d1b3017dab50be35806b587977e3 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 17:28:14 +0000
    Subject: [PATCH 020/103] Travis build: 1342
    
    ---
     README.md       | 32 ++++++++++++++++++++++++++++++++
     docs/index.html | 13 ++++++++++++-
     2 files changed, 44 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index ba96ed086..08ea3212b 100644
    --- a/README.md
    +++ b/README.md
    @@ -340,6 +340,7 @@ average(1, 2, 3);
     * [`is`](#is)
     * [`isArrayLike`](#isarraylike)
     * [`isBoolean`](#isboolean)
    +* [`isEmpty`](#isempty)
     * [`isFunction`](#isfunction)
     * [`isNil`](#isnil)
     * [`isNull`](#isnull)
    @@ -5629,6 +5630,37 @@ isBoolean(false); // true
     
    [⬆ Back to top](#table-of-contents) +### isEmpty + +Returns true if the a value is an empty object, collection, map or set, has no enumerable properties or is any type that is not considered a collection. + +Check if the provided value is `null` or if its `length` is equal to `0`. + +```js +const isEmpty = val => val == null || !(Object.keys(val) || val).length; +``` + +
    +Examples + +```js +isEmpty(new Map()); // true +isEmpty(new Set()); // true +isEmpty([]); // true +isEmpty({}); // true +isEmpty(''); // true +isEmpty([1, 2]); // false +isEmpty({ a: 1, b: 2 }); // false +isEmpty('text'); // false +isEmpty(123); // true - type is not considered a collection +isEmpty(true); // true - type is not considered a collection +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### isFunction Checks if the given argument is a function. diff --git a/docs/index.html b/docs/index.html index 35079591d..aaa8b4fb8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -1300,6 +1300,17 @@ Foo.prototype📋 Copy to clipboard

    isBoolean

    Checks if the given argument is a native boolean element.

    Use typeof to check if a value is classified as a boolean primitive.

    const isBoolean = val => typeof val === 'boolean';
     
    isBoolean(null); // false
     isBoolean(false); // true
    +

    isEmpty

    Returns true if the a value is an empty object, collection, map or set, has no enumerable properties or is any type that is not considered a collection.

    Check if the provided value is null or if its length is equal to 0.

    const isEmpty = val => val == null || !(Object.keys(val) || val).length;
    +
    isEmpty(new Map()); // true
    +isEmpty(new Set()); // true
    +isEmpty([]); // true
    +isEmpty({}); // true
    +isEmpty(''); // true
    +isEmpty([1, 2]); // false
    +isEmpty({ a: 1, b: 2 }); // false
    +isEmpty('text'); // false
    +isEmpty(123); // true - type is not considered a collection
    +isEmpty(true); // true - type is not considered a collection
     

    isFunction

    Checks if the given argument is a function.

    Use typeof to check if a value is classified as a function primitive.

    const isFunction = val => typeof val === 'function';
     
    isFunction('x'); // false
     isFunction(x => x); // true
    
    From 11a4872cf0685725d8f92760b62da877639fe6de Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 19:30:03 +0200
    Subject: [PATCH 021/103] Add isObjectLike.md
    
    ---
     snippets/isObjectLike.md | 16 ++++++++++++++++
     tag_database             |  1 +
     2 files changed, 17 insertions(+)
     create mode 100644 snippets/isObjectLike.md
    
    diff --git a/snippets/isObjectLike.md b/snippets/isObjectLike.md
    new file mode 100644
    index 000000000..969fdecd4
    --- /dev/null
    +++ b/snippets/isObjectLike.md
    @@ -0,0 +1,16 @@
    +### isObjectLike
    +
    +Checks if a value is object-like.
    +
    +Check if the provided value is not `null` and its `typeof` is equal to `'object'`.
    +
    +```js
    +const isObjectLike = val => val !== null && typeof val === 'object';
    +```
    +
    +```js
    +isObjectLike({}); // true
    +isObjectLike([1, 2, 3]); // true
    +isObjectLike(x => x); // false
    +isObjectLike(null); // false
    +```
    diff --git a/tag_database b/tag_database
    index df181e65a..0673b023a 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -101,6 +101,7 @@ isNil:type
     isNull:type
     isNumber:type,math
     isObject:type,object
    +isObjectLike:type,object
     isPlainObject:type,object
     isPrime:math
     isPrimitive:type,function,array,string
    
    From 9e29f8858c187851df1cf45fc72eb6882c309f8b Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 17:31:33 +0000
    Subject: [PATCH 022/103] Travis build: 1344
    
    ---
     README.md       | 26 ++++++++++++++++++++++++++
     docs/index.html |  7 ++++++-
     2 files changed, 32 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index 08ea3212b..af92350ed 100644
    --- a/README.md
    +++ b/README.md
    @@ -346,6 +346,7 @@ average(1, 2, 3);
     * [`isNull`](#isnull)
     * [`isNumber`](#isnumber)
     * [`isObject`](#isobject)
    +* [`isObjectLike`](#isobjectlike)
     * [`isPlainObject`](#isplainobject)
     * [`isPrimitive`](#isprimitive)
     * [`isPromiseLike`](#ispromiselike)
    @@ -5780,6 +5781,31 @@ isObject(true); // false
     
    [⬆ Back to top](#table-of-contents) +### isObjectLike + +Checks if a value is object-like. + +Check if the provided value is not `null` and its `typeof` is equal to `'object'`. + +```js +const isObjectLike = val => val !== null && typeof val === 'object'; +``` + +
    +Examples + +```js +isObjectLike({}); // true +isObjectLike([1, 2, 3]); // true +isObjectLike(x => x); // false +isObjectLike(null); // false +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### isPlainObject Checks if the provided value is an bbject created by the Object constructor. diff --git a/docs/index.html b/docs/index.html index aaa8b4fb8..147944c6e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -1329,6 +1329,11 @@ Foo.prototypeisObject({ a: 1 }); // true
     isObject({}); // true
     isObject(true); // false
    +

    isObjectLike

    Checks if a value is object-like.

    Check if the provided value is not null and its typeof is equal to 'object'.

    const isObjectLike = val => val !== null && typeof val === 'object';
    +
    isObjectLike({}); // true
    +isObjectLike([1, 2, 3]); // true
    +isObjectLike(x => x); // false
    +isObjectLike(null); // false
     

    isPlainObject

    Checks if the provided value is an bbject created by the Object constructor.

    Check if the provided value is truthy, use typeof to check if it is an object and Object.constructor to make sure the constructor is equal to Object.

    const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;
     
    isPlainObject({ a: 1 }); // true
     isPlainObject(new Map()); // false
    
    From 577f49086503b1c56d0d80d0449538255d6b81fa Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 20:17:32 +0200
    Subject: [PATCH 023/103] Add matches, matchesWith
    
    ---
     snippets/matches.md     | 17 +++++++++++++++++
     snippets/matchesWith.md | 21 +++++++++++++++++++++
     tag_database            |  2 ++
     3 files changed, 40 insertions(+)
     create mode 100644 snippets/matches.md
     create mode 100644 snippets/matchesWith.md
    
    diff --git a/snippets/matches.md b/snippets/matches.md
    new file mode 100644
    index 000000000..1be130fb0
    --- /dev/null
    +++ b/snippets/matches.md
    @@ -0,0 +1,17 @@
    +### matches
    +
    +Compares two objects to determine if the first one contains equivalent property values to the second one.
    +
    +Use `Object.keys(source)` to get all the keys of the second object, then `Array.every()`, `Object.hasOwnProperty()` and strict comparison to determine if all keys exist in the first object and have the same values.
    +
    +```js
    +const matches = (obj, source) =>
    +  Object.keys(source).every(
    +    key => obj.hasOwnProperty(key) && obj[key] === source[key]
    +  );
    +```
    +
    +```js
    +matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }) // true
    +matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }) // false
    +```
    diff --git a/snippets/matchesWith.md b/snippets/matchesWith.md
    new file mode 100644
    index 000000000..e3777e780
    --- /dev/null
    +++ b/snippets/matchesWith.md
    @@ -0,0 +1,21 @@
    +### matchesWith
    +
    +Compares two objects to determine if the first one contains equivalent property values to the second one, based on a provided function.
    +
    +Use `Object.keys(source)` to get all the keys of the second object, then `Array.every()`, `Object.hasOwnProperty()` and the provided function to determine if all keys exist in the first object and have equivalent values.
    +If no function is provided, the values will be compared using the equality operator.
    +
    +```js
    +const matchesWith = (obj, source, fn) =>
    +  Object.keys(source).every(
    +    key =>
    +      obj.hasOwnProperty(key) && fn
    +        ? fn(obj[key], source[key], key, obj, source)
    +        : obj[key] == source[key]
    +  );
    +```
    +
    +```js
    +const isGreeting = val => /^h(?:i|ello)$/.test(val);
    +matchesWith({ greeting: 'hello' }, { greeting: 'hi' }, (oV, sV) => isGreeting(oV) && isGreeting(sV)); // true
    +```
    diff --git a/tag_database b/tag_database
    index 0673b023a..13ab2ef68 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -124,6 +124,8 @@ mapKeys:object,function
     mapObject:array,object
     mapValues:object,function
     mask:string,utility,regexp
    +matches:object,type
    +matchesWith:object,type,function
     maxBy:math,array,function
     maxN:array,math
     median:math,array
    
    From 667b8716214897b821c74eb0ca020e321760cf97 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 18:18:38 +0000
    Subject: [PATCH 024/103] Travis build: 1346
    
    ---
     README.md               | 60 +++++++++++++++++++++++++++++++++++++++++
     docs/index.html         | 19 ++++++++++++-
     snippets/matches.md     |  8 +++---
     snippets/matchesWith.md |  6 ++++-
     4 files changed, 86 insertions(+), 7 deletions(-)
    
    diff --git a/README.md b/README.md
    index af92350ed..4996266d6 100644
    --- a/README.md
    +++ b/README.md
    @@ -284,6 +284,8 @@ average(1, 2, 3);
     * [`lowercaseKeys`](#lowercasekeys)
     * [`mapKeys`](#mapkeys)
     * [`mapValues`](#mapvalues)
    +* [`matches`](#matches)
    +* [`matchesWith`](#matcheswith)
     * [`merge`](#merge)
     * [`objectFromPairs`](#objectfrompairs)
     * [`objectToPairs`](#objecttopairs)
    @@ -4533,6 +4535,64 @@ mapValues(users, u => u.age); // { fred: 40, pebbles: 1 }
     
    [⬆ Back to top](#table-of-contents) +### matches + +Compares two objects to determine if the first one contains equivalent property values to the second one. + +Use `Object.keys(source)` to get all the keys of the second object, then `Array.every()`, `Object.hasOwnProperty()` and strict comparison to determine if all keys exist in the first object and have the same values. + +```js +const matches = (obj, source) => + Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); +``` + +
    +Examples + +```js +matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }); // true +matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }); // false +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### matchesWith + +Compares two objects to determine if the first one contains equivalent property values to the second one, based on a provided function. + +Use `Object.keys(source)` to get all the keys of the second object, then `Array.every()`, `Object.hasOwnProperty()` and the provided function to determine if all keys exist in the first object and have equivalent values. +If no function is provided, the values will be compared using the equality operator. + +```js +const matchesWith = (obj, source, fn) => + Object.keys(source).every( + key => + obj.hasOwnProperty(key) && fn + ? fn(obj[key], source[key], key, obj, source) + : obj[key] == source[key] + ); +``` + +
    +Examples + +```js +const isGreeting = val => /^h(?:i|ello)$/.test(val); +matchesWith( + { greeting: 'hello' }, + { greeting: 'hi' }, + (oV, sV) => isGreeting(oV) && isGreeting(sV) +); // true +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### merge Creates a new object from the combination of two or more objects. diff --git a/docs/index.html b/docs/index.html index 147944c6e..ecf29f79d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -1031,6 +1031,23 @@ Foo.prototype: { user: 'pebbles', age: 1 }
     };
     mapValues(users, u => u.age); // { fred: 40, pebbles: 1 }
    +

    matches

    Compares two objects to determine if the first one contains equivalent property values to the second one.

    Use Object.keys(source) to get all the keys of the second object, then Array.every(), Object.hasOwnProperty() and strict comparison to determine if all keys exist in the first object and have the same values.

    const matches = (obj, source) =>
    +  Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]);
    +
    matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }); // true
    +matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }); // false
    +

    matchesWith

    Compares two objects to determine if the first one contains equivalent property values to the second one, based on a provided function.

    Use Object.keys(source) to get all the keys of the second object, then Array.every(), Object.hasOwnProperty() and the provided function to determine if all keys exist in the first object and have equivalent values. If no function is provided, the values will be compared using the equality operator.

    const matchesWith = (obj, source, fn) =>
    +  Object.keys(source).every(
    +    key =>
    +      obj.hasOwnProperty(key) && fn
    +        ? fn(obj[key], source[key], key, obj, source)
    +        : obj[key] == source[key]
    +  );
    +
    const isGreeting = val => /^h(?:i|ello)$/.test(val);
    +matchesWith(
    +  { greeting: 'hello' },
    +  { greeting: 'hi' },
    +  (oV, sV) => isGreeting(oV) && isGreeting(sV)
    +); // true
     

    merge

    Creates a new object from the combination of two or more objects.

    Use Array.reduce() combined with Object.keys(obj) to iterate over all objects and keys. Use hasOwnProperty() and Array.concat() to append values for keys existing in multiple objects.

    const merge = (...objs) =>
       [...objs].reduce(
         (acc, obj) =>
    diff --git a/snippets/matches.md b/snippets/matches.md
    index 1be130fb0..47610d3d8 100644
    --- a/snippets/matches.md
    +++ b/snippets/matches.md
    @@ -6,12 +6,10 @@ Use `Object.keys(source)` to get all the keys of the second object, then `Array.
     
     ```js
     const matches = (obj, source) =>
    -  Object.keys(source).every(
    -    key => obj.hasOwnProperty(key) && obj[key] === source[key]
    -  );
    +  Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]);
     ```
     
     ```js
    -matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }) // true
    -matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }) // false
    +matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }); // true
    +matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }); // false
     ```
    diff --git a/snippets/matchesWith.md b/snippets/matchesWith.md
    index e3777e780..a04814191 100644
    --- a/snippets/matchesWith.md
    +++ b/snippets/matchesWith.md
    @@ -17,5 +17,9 @@ const matchesWith = (obj, source, fn) =>
     
     ```js
     const isGreeting = val => /^h(?:i|ello)$/.test(val);
    -matchesWith({ greeting: 'hello' }, { greeting: 'hi' }, (oV, sV) => isGreeting(oV) && isGreeting(sV)); // true
    +matchesWith(
    +  { greeting: 'hello' },
    +  { greeting: 'hi' },
    +  (oV, sV) => isGreeting(oV) && isGreeting(sV)
    +); // true
     ```
    
    From 18171a093c0f7219c0a3fe2b27e11bf9e86b2a4e Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 20:32:17 +0200
    Subject: [PATCH 025/103] Travis broken, test
    
    ---
     tag_database | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tag_database b/tag_database
    index 13ab2ef68..ac660d49a 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -125,7 +125,7 @@ mapObject:array,object
     mapValues:object,function
     mask:string,utility,regexp
     matches:object,type
    -matchesWith:object,type,function
    +matchesWith:object,type,function 
     maxBy:math,array,function
     maxN:array,math
     median:math,array
    
    From 705d42c0fe8f31103ca7a3d339292964f133530f Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 18:33:34 +0000
    Subject: [PATCH 026/103] Travis build: 1348
    
    ---
     tag_database | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tag_database b/tag_database
    index ac660d49a..13ab2ef68 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -125,7 +125,7 @@ mapObject:array,object
     mapValues:object,function
     mask:string,utility,regexp
     matches:object,type
    -matchesWith:object,type,function 
    +matchesWith:object,type,function
     maxBy:math,array,function
     maxN:array,math
     median:math,array
    
    From 2883a77110e8966c0075d80c8bce9db794f5f33d Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 20:48:46 +0200
    Subject: [PATCH 027/103] Add deepClone.md
    
    ---
     snippets/deepClone.md | 25 +++++++++++++++++++++++++
     tag_database          |  3 ++-
     2 files changed, 27 insertions(+), 1 deletion(-)
     create mode 100644 snippets/deepClone.md
    
    diff --git a/snippets/deepClone.md b/snippets/deepClone.md
    new file mode 100644
    index 000000000..360505318
    --- /dev/null
    +++ b/snippets/deepClone.md
    @@ -0,0 +1,25 @@
    +### deepClone
    +
    +Creates a deep clone of an object.
    +
    +Use recursion.
    +Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original.
    +Use `Object.keys()` and `Array.forEach()` to determine which key-value pairs need to be deep cloned.
    +
    +```js
    +const deepClone = obj => {
    +  let clone = Object.assign({}, obj);
    +  Object.keys(clone).forEach(
    +    key =>
    +      (clone[key] = typeof obj[key] === 'object'
    +        ? deepClone(obj[key])
    +        : obj[key])
    +  );
    +  return clone;
    +};
    +```
    +
    +```js
    +const a = { foo: 'bar', obj: { a: 1, b: 2 } };
    +const b = deepClone(a); // a !== b, a.obj !== b.obj
    +```
    diff --git a/tag_database b/tag_database
    index ac660d49a..a929e397c 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -27,6 +27,7 @@ createEventHub:browser,event,advanced
     currentURL:browser,url
     curry:function,recursion
     decapitalize:string,array
    +deepClone:object,recursion
     deepFlatten:array,recursion
     defaults:object
     defer:function
    @@ -125,7 +126,7 @@ mapObject:array,object
     mapValues:object,function
     mask:string,utility,regexp
     matches:object,type
    -matchesWith:object,type,function 
    +matchesWith:object,type,function
     maxBy:math,array,function
     maxN:array,math
     median:math,array
    
    From 86ea29955c21e79d9a18d497bd79c992d772622e Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 18:50:30 +0000
    Subject: [PATCH 028/103] Travis build: 1350
    
    ---
     README.md             | 32 ++++++++++++++++++++++++++++++++
     docs/index.html       | 13 +++++++++++--
     snippets/deepClone.md |  5 +----
     3 files changed, 44 insertions(+), 6 deletions(-)
    
    diff --git a/README.md b/README.md
    index 4996266d6..365063973 100644
    --- a/README.md
    +++ b/README.md
    @@ -272,6 +272,7 @@ average(1, 2, 3);
     
    View contents +* [`deepClone`](#deepclone) * [`defaults`](#defaults) * [`equals`](#equals-) * [`findKey`](#findkey) @@ -4191,6 +4192,37 @@ UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc' --- ## 🗃️ Object +### deepClone + +Creates a deep clone of an object. + +Use recursion. +Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original. +Use `Object.keys()` and `Array.forEach()` to determine which key-value pairs need to be deep cloned. + +```js +const deepClone = obj => { + let clone = Object.assign({}, obj); + Object.keys(clone).forEach( + key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key]) + ); + return clone; +}; +``` + +
    +Examples + +```js +const a = { foo: 'bar', obj: { a: 1, b: 2 } }; +const b = deepClone(a); // a !== b, a.obj !== b.obj +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### defaults Assigns default values for all properties in an object that are `undefined`. diff --git a/docs/index.html b/docs/index.html index ecf29f79d..2e0a86db1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -936,7 +936,16 @@ console.log<
         (c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
       );
     
    UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
    -

    Object

    defaults

    Assigns default values for all properties in an object that are undefined.

    Use Object.assign() to create a new empty object and copy the original one to maintain key order, use Array.reverse() and the spread operator ... to combine the default values from left to right, finally use obj again to overwrite properties that originally had a value.

    const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
    +

    Object

    deepClone

    Creates a deep clone of an object.

    Use recursion. Use Object.assign() and an empty object ({}) to create a shallow clone of the original. Use Object.keys() and Array.forEach() to determine which key-value pairs need to be deep cloned.

    const deepClone = obj => {
    +  let clone = Object.assign({}, obj);
    +  Object.keys(clone).forEach(
    +    key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
    +  );
    +  return clone;
    +};
    +
    const a = { foo: 'bar', obj: { a: 1, b: 2 } };
    +const b = deepClone(a); // a !== b, a.obj !== b.obj
    +

    defaults

    Assigns default values for all properties in an object that are undefined.

    Use Object.assign() to create a new empty object and copy the original one to maintain key order, use Array.reverse() and the spread operator ... to combine the default values from left to right, finally use obj again to overwrite properties that originally had a value.

    const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
     
    defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }); // { a: 1, b: 2 }
     

    equalsadvanced

    Performs a deep comparison between two values to determine if they are equivalent.

    Check if the two values are identical, if they are both Date objects with the same time, using Date.getTime() or if they are both non-object values with an equivalent value (strict comparison). Check if only one value is null or undefined or if their prototypes differ. If none of the above conditions are met, use Object.keys() to check if both values have the same number of keys, then use Array.every() to check if every key in the first value exists in the second one and if they are equivalent by calling this method recursively.

    const equals = (a, b) => {
       if (a === b) return true;
    diff --git a/snippets/deepClone.md b/snippets/deepClone.md
    index 360505318..fe2af84eb 100644
    --- a/snippets/deepClone.md
    +++ b/snippets/deepClone.md
    @@ -10,10 +10,7 @@ Use `Object.keys()` and `Array.forEach()` to determine which key-value pairs nee
     const deepClone = obj => {
       let clone = Object.assign({}, obj);
       Object.keys(clone).forEach(
    -    key =>
    -      (clone[key] = typeof obj[key] === 'object'
    -        ? deepClone(obj[key])
    -        : obj[key])
    +    key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
       );
       return clone;
     };
    
    From bb001766231654b9db91773926a1035ac82cef3b Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 20:54:12 +0200
    Subject: [PATCH 029/103] Add castArray
    
    ---
     snippets/castArray.md | 14 ++++++++++++++
     tag_database          |  1 +
     2 files changed, 15 insertions(+)
     create mode 100644 snippets/castArray.md
    
    diff --git a/snippets/castArray.md b/snippets/castArray.md
    new file mode 100644
    index 000000000..dc6d97c77
    --- /dev/null
    +++ b/snippets/castArray.md
    @@ -0,0 +1,14 @@
    +### castArray
    +
    +Casts the provided value as an array if it's not one.
    +
    +Use `Array.isArray()` to determine if `val` is an array and return it as-is or encapsulated in an array accordingly.
    +
    +```js
    +const castArray = val => Array.isArray(val) ? val : [val];
    +```
    +
    +```js
    +castArray('foo'); // ['foo']
    +castArray([1]); // [1]
    +```
    diff --git a/tag_database b/tag_database
    index a929e397c..dbaec5875 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -9,6 +9,7 @@ byteSize:string
     call:adapter,function
     capitalize:string,array
     capitalizeEveryWord:string,regexp
    +castArray:utility,array,type
     chainAsync:function
     chunk:array
     clampNumber:math
    
    From 2d8a4021d19adc11075047e02f1330e823e1d522 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 18:55:36 +0000
    Subject: [PATCH 030/103] Travis build: 1352
    
    ---
     README.md             | 24 ++++++++++++++++++++++++
     docs/index.html       |  7 +++++--
     snippets/castArray.md |  2 +-
     3 files changed, 30 insertions(+), 3 deletions(-)
    
    diff --git a/README.md b/README.md
    index 365063973..ed61b94d0 100644
    --- a/README.md
    +++ b/README.md
    @@ -365,6 +365,7 @@ average(1, 2, 3);
     
    View contents +* [`castArray`](#castarray) * [`cloneRegExp`](#cloneregexp) * [`coalesce`](#coalesce) * [`coalesceFactory`](#coalescefactory) @@ -6080,6 +6081,29 @@ isValidJSON(null); // true --- ## 🔧 Utility +### castArray + +Casts the provided value as an array if it's not one. + +Use `Array.isArray()` to determine if `val` is an array and return it as-is or encapsulated in an array accordingly. + +```js +const castArray = val => (Array.isArray(val) ? val : [val]); +``` + +
    +Examples + +```js +castArray('foo'); // ['foo'] +castArray([1]); // [1] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### cloneRegExp Clones a regular expression. diff --git a/docs/index.html b/docs/index.html index 2e0a86db1..a1945a1c7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -1398,7 +1398,10 @@ Foo.prototypeShow examples
    isValidJSON('{"name":"Adam","age":20}'); // true
     isValidJSON('{"name":"Adam",age:"20"}'); // false
     isValidJSON(null); // true
    -

    Utility

    cloneRegExp

    Clones a regular expression.

    Use new RegExp(), RegExp.source and RegExp.flags to clone the given regular expression.

    const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags);
    +

    Utility

    castArray

    Casts the provided value as an array if it's not one.

    Use Array.isArray() to determine if val is an array and return it as-is or encapsulated in an array accordingly.

    const castArray = val => (Array.isArray(val) ? val : [val]);
    +
    castArray('foo'); // ['foo']
    +castArray([1]); // [1]
    +

    cloneRegExp

    Clones a regular expression.

    Use new RegExp(), RegExp.source and RegExp.flags to clone the given regular expression.

    const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags);
     
    const regExp = /lorem ipsum/gi;
     const regExp2 = cloneRegExp(regExp); // /lorem ipsum/gi
     

    coalesce

    Returns the first non-null/undefined argument.

    Use Array.find() to return the first non null/undefined argument.

    const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
    diff --git a/snippets/castArray.md b/snippets/castArray.md
    index dc6d97c77..67f5206ce 100644
    --- a/snippets/castArray.md
    +++ b/snippets/castArray.md
    @@ -5,7 +5,7 @@ Casts the provided value as an array if it's not one.
     Use `Array.isArray()` to determine if `val` is an array and return it as-is or encapsulated in an array accordingly.
     
     ```js
    -const castArray = val => Array.isArray(val) ? val : [val];
    +const castArray = val => (Array.isArray(val) ? val : [val]);
     ```
     
     ```js
    
    From 5fe8aa0be77694738be70b32dcc8604198273502 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 21:02:17 +0200
    Subject: [PATCH 031/103] Add over
    
    ---
     snippets/over.md | 14 ++++++++++++++
     tag_database     |  1 +
     2 files changed, 15 insertions(+)
     create mode 100644 snippets/over.md
    
    diff --git a/snippets/over.md b/snippets/over.md
    new file mode 100644
    index 000000000..ed2a1fedc
    --- /dev/null
    +++ b/snippets/over.md
    @@ -0,0 +1,14 @@
    +### over
    +
    +Creates a function that invokes each provided function with the arguments it receives and returns the results.
    +
    +Use `Array.map()` and `Function.apply()` to apply each function to the given arguments.
    +
    +```js
    +const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args));
    +```
    +
    +```js
    +const minMax = over(Math.min, Math.max);
    +minMax(1,2,3,4,5); // [1,5]
    +```
    diff --git a/tag_database b/tag_database
    index dbaec5875..8d46a58d6 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -147,6 +147,7 @@ on:browser,event
     once:function
     onUserInputChange:browser,event,advanced
     orderBy:object,array
    +over:adapter,function
     palindrome:string
     parseCookie:utility,string
     partition:array,object,function
    
    From 1c4cffc0214f1c1df9f8d12642269c5074bf65e3 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 19:03:54 +0000
    Subject: [PATCH 032/103] Travis build: 1354
    
    ---
     README.md        | 24 ++++++++++++++++++++++++
     docs/index.html  |  5 ++++-
     snippets/over.md |  2 +-
     3 files changed, 29 insertions(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index ed61b94d0..3917284fe 100644
    --- a/README.md
    +++ b/README.md
    @@ -80,6 +80,7 @@ average(1, 2, 3);
     * [`call`](#call)
     * [`collectInto`](#collectinto)
     * [`flip`](#flip)
    +* [`over`](#over)
     * [`pipeFunctions`](#pipefunctions)
     * [`promisify`](#promisify)
     * [`spreadOver`](#spreadover)
    @@ -472,6 +473,29 @@ Object.assign(b, a); // == b
     
    [⬆ Back to top](#table-of-contents) +### over + +Creates a function that invokes each provided function with the arguments it receives and returns the results. + +Use `Array.map()` and `Function.apply()` to apply each function to the given arguments. + +```js +const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args)); +``` + +
    +Examples + +```js +const minMax = over(Math.min, Math.max); +minMax(1, 2, 3, 4, 5); // [1,5] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### pipeFunctions Performs left-to-right function composition. diff --git a/docs/index.html b/docs/index.html index a1945a1c7..110f8eb3c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -72,6 +72,9 @@ Promise.reso
     mergePerson(b); // == b
     b = {};
     Object.assign(b, a); // == b
    +

    over

    Creates a function that invokes each provided function with the arguments it receives and returns the results.

    Use Array.map() and Function.apply() to apply each function to the given arguments.

    const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args));
    +
    const minMax = over(Math.min, Math.max);
    +minMax(1, 2, 3, 4, 5); // [1,5]
     

    pipeFunctions

    Performs left-to-right function composition.

    Use Array.reduce() with the spread operator (...) to perform left-to-right function composition. The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.

    const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
     
    const add5 = x => x + 5;
     const multiply = (x, y) => x * y;
    diff --git a/snippets/over.md b/snippets/over.md
    index ed2a1fedc..31ab12963 100644
    --- a/snippets/over.md
    +++ b/snippets/over.md
    @@ -10,5 +10,5 @@ const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args));
     
     ```js
     const minMax = over(Math.min, Math.max);
    -minMax(1,2,3,4,5); // [1,5]
    +minMax(1, 2, 3, 4, 5); // [1,5]
     ```
    
    From bac4e5d9c174ed82a16f2bb4b5d848679e5ebb56 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 21:27:37 +0200
    Subject: [PATCH 033/103] Add nthArgument
    
    ---
     snippets/nthArg.md | 17 +++++++++++++++++
     tag_database       |  1 +
     2 files changed, 18 insertions(+)
     create mode 100644 snippets/nthArg.md
    
    diff --git a/snippets/nthArg.md b/snippets/nthArg.md
    new file mode 100644
    index 000000000..c94224326
    --- /dev/null
    +++ b/snippets/nthArg.md
    @@ -0,0 +1,17 @@
    +### nthArg
    +
    +Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned.
    +
    +Use `Array.slice()` to get the desired argument at index `n`.
    +
    +```js
    +const nthArg = n => (...args) => args.slice(n)[0];
    +```
    +
    +```js
    +const third = nthArg(2);
    +third(1,2,3); // 3
    +third(1,2); // undefined
    +const last = nthArg(-1);
    +last(1,2,3,4,5); // 5
    +```
    diff --git a/tag_database b/tag_database
    index 8d46a58d6..10dace2a4 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -136,6 +136,7 @@ merge:object,array
     minBy:math,array,function
     minN:array,math
     negate:function
    +nthArg:utility,function
     nthElement:array
     objectFromPairs:object,array
     objectToPairs:object,array
    
    From 6d8b3c325c0fe1d97a29277e5e0f67cbac0a12f8 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 19:28:55 +0000
    Subject: [PATCH 034/103] Travis build: 1356
    
    ---
     README.md          | 27 +++++++++++++++++++++++++++
     docs/index.html    |  8 +++++++-
     snippets/nthArg.md |  6 +++---
     3 files changed, 37 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index 3917284fe..d93865803 100644
    --- a/README.md
    +++ b/README.md
    @@ -375,6 +375,7 @@ average(1, 2, 3);
     * [`hexToRGB`](#hextorgb-)
     * [`httpGet`](#httpget)
     * [`httpPost`](#httppost)
    +* [`nthArg`](#ntharg)
     * [`parseCookie`](#parsecookie)
     * [`prettyBytes`](#prettybytes)
     * [`randomHexColorCode`](#randomhexcolorcode)
    @@ -6396,6 +6397,32 @@ Logs: {
     
    [⬆ Back to top](#table-of-contents) +### nthArg + +Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned. + +Use `Array.slice()` to get the desired argument at index `n`. + +```js +const nthArg = n => (...args) => args.slice(n)[0]; +``` + +
    +Examples + +```js +const third = nthArg(2); +third(1, 2, 3); // 3 +third(1, 2); // undefined +const last = nthArg(-1); +last(1, 2, 3, 4, 5); // 5 +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### parseCookie Parse an HTTP Cookie header string and return an object of all cookie name-value pairs. diff --git a/docs/index.html b/docs/index.html index 110f8eb3c..8c64efc76 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -1502,6 +1502,12 @@ Logs: {
       "id": 101
     }
     */
    +

    nthArg

    Creates a function that gets the argument at index n. If n is negative, the nth argument from the end is returned.

    Use Array.slice() to get the desired argument at index n.

    const nthArg = n => (...args) => args.slice(n)[0];
    +
    const third = nthArg(2);
    +third(1, 2, 3); // 3
    +third(1, 2); // undefined
    +const last = nthArg(-1);
    +last(1, 2, 3, 4, 5); // 5
     

    parseCookie

    Parse an HTTP Cookie header string and return an object of all cookie name-value pairs.

    Use String.split(';') to separate key-value pairs from each other. Use Array.map() and String.split('=') to separate keys from values in each pair. Use Array.reduce() and decodeURIComponent() to create an object with all key-value pairs.

    const parseCookie = str =>
       str
         .split(';')
    diff --git a/snippets/nthArg.md b/snippets/nthArg.md
    index c94224326..159975b89 100644
    --- a/snippets/nthArg.md
    +++ b/snippets/nthArg.md
    @@ -10,8 +10,8 @@ const nthArg = n => (...args) => args.slice(n)[0];
     
     ```js
     const third = nthArg(2);
    -third(1,2,3); // 3
    -third(1,2); // undefined
    +third(1, 2, 3); // 3
    +third(1, 2); // undefined
     const last = nthArg(-1);
    -last(1,2,3,4,5); // 5
    +last(1, 2, 3, 4, 5); // 5
     ```
    
    From 7a0b8b1aaa8f95cb6c959379ce869c1d63334f57 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 20:11:51 +0000
    Subject: [PATCH 035/103] Travis build: 1358 [cron]
    
    ---
     dist/_30s.es5.js                        | 137 ++++++++++++++++++++----
     dist/_30s.es5.min.js                    |   2 +-
     dist/_30s.esm.js                        |  63 ++++++++++-
     dist/_30s.js                            |  63 ++++++++++-
     dist/_30s.min.js                        |   2 +-
     test/castArray/castArray.js             |   2 +
     test/castArray/castArray.test.js        |  13 +++
     test/deepClone/deepClone.js             |   8 ++
     test/deepClone/deepClone.test.js        |  13 +++
     test/findKey/findKey.js                 |   2 +
     test/findKey/findKey.test.js            |  13 +++
     test/findLastKey/findLastKey.js         |   5 +
     test/findLastKey/findLastKey.test.js    |  13 +++
     test/invertKeyValues/invertKeyValues.js |   6 +-
     test/isEmpty/isEmpty.js                 |   2 +
     test/isEmpty/isEmpty.test.js            |  13 +++
     test/isObjectLike/isObjectLike.js       |   2 +
     test/isObjectLike/isObjectLike.test.js  |  13 +++
     test/matches/matches.js                 |   3 +
     test/matches/matches.test.js            |  13 +++
     test/matchesWith/matchesWith.js         |   8 ++
     test/matchesWith/matchesWith.test.js    |  13 +++
     test/nthArg/nthArg.js                   |   2 +
     test/nthArg/nthArg.test.js              |  13 +++
     test/over/over.js                       |   2 +
     test/over/over.test.js                  |  13 +++
     test/testlog                            |  74 ++++++++++++-
     test/tomorrow/tomorrow.js               |   8 +-
     test/zipWith/zipWith.js                 |  11 ++
     test/zipWith/zipWith.test.js            |  13 +++
     30 files changed, 509 insertions(+), 36 deletions(-)
     create mode 100644 test/castArray/castArray.js
     create mode 100644 test/castArray/castArray.test.js
     create mode 100644 test/deepClone/deepClone.js
     create mode 100644 test/deepClone/deepClone.test.js
     create mode 100644 test/findKey/findKey.js
     create mode 100644 test/findKey/findKey.test.js
     create mode 100644 test/findLastKey/findLastKey.js
     create mode 100644 test/findLastKey/findLastKey.test.js
     create mode 100644 test/isEmpty/isEmpty.js
     create mode 100644 test/isEmpty/isEmpty.test.js
     create mode 100644 test/isObjectLike/isObjectLike.js
     create mode 100644 test/isObjectLike/isObjectLike.test.js
     create mode 100644 test/matches/matches.js
     create mode 100644 test/matches/matches.test.js
     create mode 100644 test/matchesWith/matchesWith.js
     create mode 100644 test/matchesWith/matchesWith.test.js
     create mode 100644 test/nthArg/nthArg.js
     create mode 100644 test/nthArg/nthArg.test.js
     create mode 100644 test/over/over.js
     create mode 100644 test/over/over.test.js
     create mode 100644 test/zipWith/zipWith.js
     create mode 100644 test/zipWith/zipWith.test.js
    
    diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js
    index 426068879..738d54353 100644
    --- a/dist/_30s.es5.js
    +++ b/dist/_30s.es5.js
    @@ -110,6 +110,10 @@ var capitalizeEveryWord = function capitalizeEveryWord(str) {
       });
     };
     
    +var castArray = function castArray(val) {
    +  return Array.isArray(val) ? val : [val];
    +};
    +
     var chainAsync = function chainAsync(fns) {
       var curr = 0;
       var next = function next() {
    @@ -286,6 +290,16 @@ var decapitalize = function decapitalize(_ref) {
       return first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join(''));
     };
     
    +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +
    +var deepClone = function deepClone(obj) {
    +  var clone = Object.assign({}, obj);
    +  Object.keys(clone).forEach(function (key) {
    +    return clone[key] = _typeof(obj[key]) === 'object' ? deepClone(obj[key]) : obj[key];
    +  });
    +  return clone;
    +};
    +
     function _toConsumableArray(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 deepFlatten = function deepFlatten(arr) {
    @@ -414,12 +428,12 @@ var elo = function elo(_ref) {
       return ratings;
     };
     
    -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var equals = function equals(a, b) {
       if (a === b) return true;
       if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
    -  if (!a || !b || (typeof a === 'undefined' ? 'undefined' : _typeof(a)) != 'object' && (typeof b === 'undefined' ? 'undefined' : _typeof(b)) !== 'object') return a === b;
    +  if (!a || !b || (typeof a === 'undefined' ? 'undefined' : _typeof$1(a)) != 'object' && (typeof b === 'undefined' ? 'undefined' : _typeof$1(b)) !== 'object') return a === b;
       if (a === null || a === undefined || b === null || b === undefined) return false;
       if (a.prototype !== b.prototype) return false;
       var keys = Object.keys(a);
    @@ -475,10 +489,22 @@ var filterNonUnique = function filterNonUnique(arr) {
       });
     };
     
    +var findKey = function findKey(obj, fn) {
    +  return Object.keys(obj).find(function (key) {
    +    return fn(obj[key], key, obj);
    +  });
    +};
    +
     var findLast = function findLast(arr, fn) {
       return arr.filter(fn).slice(-1);
     };
     
    +var findLastKey = function findLastKey(obj, fn) {
    +  return Object.keys(obj).reverse().find(function (key) {
    +    return fn(obj[key], key, obj);
    +  });
    +};
    +
     var flatten = function flatten(arr) {
       var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
       return depth != 1 ? arr.reduce(function (a, v) {
    @@ -768,9 +794,11 @@ var intersection = function intersection(a, b) {
       });
     };
     
    -var invertKeyValues = function invertKeyValues(obj) {
    +var invertKeyValues = function invertKeyValues(obj, fn) {
       return Object.keys(obj).reduce(function (acc, key) {
    -    acc[obj[key]] = key;
    +    var val = fn ? fn(obj[key]) : obj[key];
    +    acc[val] = acc[val] || [];
    +    acc[val].push(key);
         return acc;
       }, {});
     };
    @@ -802,6 +830,10 @@ var isDivisible = function isDivisible(dividend, divisor) {
       return dividend % divisor === 0;
     };
     
    +var isEmpty = function isEmpty(val) {
    +  return val == null || !(Object.keys(val) || val).length;
    +};
    +
     var isEven = function isEven(num) {
       return num % 2 === 0;
     };
    @@ -830,10 +862,16 @@ var isObject = function isObject(obj) {
       return obj === Object(obj);
     };
     
    -var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +
    +var isObjectLike = function isObjectLike(val) {
    +  return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof$2(val)) === 'object';
    +};
    +
    +var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var isPlainObject = function isPlainObject(val) {
    -  return !!val && (typeof val === 'undefined' ? 'undefined' : _typeof$1(val)) === 'object' && val.constructor === Object;
    +  return !!val && (typeof val === 'undefined' ? 'undefined' : _typeof$3(val)) === 'object' && val.constructor === Object;
     };
     
     var isPrime = function isPrime(num) {
    @@ -843,16 +881,16 @@ var isPrime = function isPrime(num) {
       }return num >= 2;
     };
     
    -var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$4 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var isPrimitive = function isPrimitive(val) {
    -  return !['object', 'function'].includes(typeof val === 'undefined' ? 'undefined' : _typeof$2(val)) || val === null;
    +  return !['object', 'function'].includes(typeof val === 'undefined' ? 'undefined' : _typeof$4(val)) || val === null;
     };
     
    -var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var isPromiseLike = function isPromiseLike(obj) {
    -  return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof$3(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
    +  return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof$5(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
     };
     
     var _slicedToArray$1 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
    @@ -894,10 +932,10 @@ var isString = function isString(val) {
       return typeof val === 'string';
     };
     
    -var _typeof$4 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$6 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var isSymbol = function isSymbol(val) {
    -  return (typeof val === 'undefined' ? 'undefined' : _typeof$4(val)) === 'symbol';
    +  return (typeof val === 'undefined' ? 'undefined' : _typeof$6(val)) === 'symbol';
     };
     
     var isTravisCI = function isTravisCI() {
    @@ -1006,6 +1044,18 @@ var mask = function mask(cc) {
       return ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num);
     };
     
    +var matches = function matches(obj, source) {
    +  return Object.keys(source).every(function (key) {
    +    return obj.hasOwnProperty(key) && obj[key] === source[key];
    +  });
    +};
    +
    +var matchesWith = function matchesWith(obj, source, fn) {
    +  return Object.keys(source).every(function (key) {
    +    return obj.hasOwnProperty(key) && fn ? fn(obj[key], source[key], key, obj, source) : obj[key] == source[key];
    +  });
    +};
    +
     function _toConsumableArray$6(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 maxBy = function maxBy(arr, fn) {
    @@ -1078,6 +1128,16 @@ var negate = function negate(func) {
       };
     };
     
    +var nthArg = function nthArg(n) {
    +  return function () {
    +    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    +      args[_key] = arguments[_key];
    +    }
    +
    +    return args.slice(n)[0];
    +  };
    +};
    +
     var nthElement = function nthElement(arr) {
       var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
       return (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0];
    @@ -1191,6 +1251,22 @@ var orderBy = function orderBy(arr, props, orders) {
       });
     };
     
    +var over = function over() {
    +  for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
    +    fns[_key] = arguments[_key];
    +  }
    +
    +  return function () {
    +    for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    +      args[_key2] = arguments[_key2];
    +    }
    +
    +    return fns.map(function (fn) {
    +      return fn.apply(null, args);
    +    });
    +  };
    +};
    +
     var palindrome = function palindrome(str) {
       var s = str.toLowerCase().replace(/[\W_]/g, '');
       return s === s.split('').reverse().join('');
    @@ -1244,7 +1320,7 @@ var pipeFunctions = function pipeFunctions() {
       });
     };
     
    -var _typeof$5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$7 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var pluralize = function pluralize(val, word) {
       var plural = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : word + 's';
    @@ -1253,7 +1329,7 @@ var pluralize = function pluralize(val, word) {
         var plural = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : word + 's';
         return [1, -1].includes(Number(num)) ? word : plural;
       };
    -  if ((typeof val === 'undefined' ? 'undefined' : _typeof$5(val)) === 'object') return function (num, word) {
    +  if ((typeof val === 'undefined' ? 'undefined' : _typeof$7(val)) === 'object') return function (num, word) {
         return _pluralize(num, word, val[word]);
       };
       return _pluralize(val, word, plural);
    @@ -1513,10 +1589,10 @@ var similarity = function similarity(arr, values) {
       });
     };
     
    -var _typeof$6 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
    +var _typeof$8 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     
     var size = function size(val) {
    -  return Array.isArray(val) ? val.length : val && (typeof val === 'undefined' ? 'undefined' : _typeof$6(val)) === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0;
    +  return Array.isArray(val) ? val.length : val && (typeof val === 'undefined' ? 'undefined' : _typeof$8(val)) === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0;
     };
     
     var sleep = function sleep(ms) {
    @@ -1668,7 +1744,9 @@ var toggleClass = function toggleClass(el, className) {
     };
     
     var tomorrow = function tomorrow() {
    -  return new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
    +  var t = new Date();
    +  t.setDate(t.getDate() + 1);
    +  return t.getFullYear() + '-' + String(t.getMonth() + 1).padStart(2, '0') + '-' + String(t.getDate()).padStart(2, '0');
     };
     
     var transform = function transform(obj, fn, acc) {
    @@ -1763,7 +1841,30 @@ var zipObject = function zipObject(props, values) {
       }, {});
     };
     
    -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, atob: atob, average: average, averageBy: averageBy, bottomVisible: bottomVisible, btoa: btoa, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collectInto: collectInto, colorize: colorize, compact: compact, compose: compose, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepFlatten: deepFlatten, defaults: defaults, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, dropElements: dropElements, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, equals: equals, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, filterNonUnique: filterNonUnique, findLast: findLast, 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, invertKeyValues: invertKeyValues, is: is, isAbsoluteURL: isAbsoluteURL, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEven: isEven, isFunction: isFunction, isLowerCase: isLowerCase, isNil: isNil, isNull: isNull, isNumber: isNumber, isObject: isObject, 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, maxBy: maxBy, maxN: maxN, median: median, memoize: memoize, merge: merge, minBy: minBy, minN: minN, negate: negate, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, observeMutations: observeMutations, off: off, omit: omit, omitBy: omitBy, on: on, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, palindrome: palindrome, parseCookie: parseCookie, 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, 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, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, uniqueElements: uniqueElements, untildify: untildify, validateNumber: validateNumber, without: without, words: words, yesNo: yesNo, zip: zip, zipObject: zipObject };
    +function _toConsumableArray$19(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 zipWith = function zipWith() {
    +  for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) {
    +    arrays[_key] = arguments[_key];
    +  }
    +
    +  var length = arrays.length;
    +  var fn = length > 1 ? arrays[length - 1] : undefined;
    +  fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined;
    +  var maxLength = Math.max.apply(Math, _toConsumableArray$19(arrays.map(function (x) {
    +    return x.length;
    +  })));
    +  var result = Array.from({ length: maxLength }).map(function (_, i) {
    +    return Array.from({ length: arrays.length }, function (_, k) {
    +      return arrays[k][i];
    +    });
    +  });
    +  return fn ? result.map(function (arr) {
    +    return fn.apply(undefined, _toConsumableArray$19(arr));
    +  }) : result;
    +};
    +
    +var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, atob: atob, average: average, averageBy: averageBy, 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, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, dropElements: dropElements, 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, 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, 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, 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, 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, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, uniqueElements: uniqueElements, untildify: untildify, validateNumber: validateNumber, without: without, words: words, 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 e5ac2d95d..3a418a18d 100644
    --- a/dist/_30s.es5.min.js
    +++ b/dist/_30s.es5.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';function a(a){return Array.isArray(a)?a:Array.from(a)}function b(a){return Array.isArray(a)?a:Array.from(a)}function c(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b>a/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(a){return(a^G.randomBytes(1)[0]&15>>a/4).toString(16)})},anagrams:function a(b){return 2>=b.length?2===b.length?[b,b[1]+b[0]]:[b]:b.split('').reduce(function(c,d,e){return c.concat(a(b.slice(0,e)+b.slice(e+1)).map(function(a){return d+a}))},[])},arrayToHtmlList:function(a,b){return a.map(function(a){return document.querySelector('#'+b).innerHTML+='
  • '+a+'
  • '})},atob:function(a){return new Buffer(a,'base64').toString('binary')},average:function(){for(var a=arguments.length,b=Array(a),c=0;c=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(a){return new Buffer(a,'binary').toString('base64')},byteSize:function(a){return new Blob([a]).size},call:function(a){for(var b=arguments.length,c=Array(1'"]/g,function(a){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[a]||a})},escapeRegExp:function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(a,b){return a.filter(function(a,c){return c%b==b-1})},extendHex:function(a){return'#'+a.slice(a.startsWith('#')?1:0).split('').map(function(a){return a+a}).join('')},factorial:function a(b){return 0>b?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=b?1:b*a(b-1)},fibonacci:function(a){return Array.from({length:a}).reduce(function(a,b,c){return a.concat(1a&&(a=-a);var b={day:A(a/8.64e7),hour:A(a/3.6e6)%24,minute:A(a/6e4)%60,second:A(a/1e3)%60,millisecond:A(a)%1e3};return Object.entries(b).filter(function(a){return 0!==a[1]}).map(function(a){return a[1]+' '+(1===a[1]?a[0]:a[0]+'s')}).join(', ')},fromCamelCase:function(a){var b=1>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?', '+(255&c):'')+')'},hide:function(){for(var a=arguments.length,b=Array(a),c=0;cc&&(c=b),null==c?0<=a&&a=b&&aa[1]?-1:1,d=!0,e=!1;try{for(var f,g=a.entries()[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){var h=f.value,j=N(h,2),k=j[0],i=j[1];if(k===a.length-1)return c;if(0<(i-a[k+1])*c)return 0}}catch(a){e=!0,b=a}finally{try{!d&&g.return&&g.return()}finally{if(e)throw b}}},isString:function(a){return'string'==typeof a},isSymbol:function(a){return'symbol'===('undefined'==typeof a?'undefined':O(a))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(a){return a===void 0},isUpperCase:function(a){return a===a.toUpperCase()},isValidJSON:function(a){try{return JSON.parse(a),!0}catch(a){return!1}},join:function(a){var b=1e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',function(){'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:function(a){var b=!1;return function(){if(!b){b=!0;for(var c=arguments.length,d=Array(c),e=0;ej?1:iMath.abs(a))return a+(c?' ':'')+d[0];var e=C(A(Math.log10(0>a?-a:a)/3),d.length-1),f=+((0>a?-a:a)/B(1e3,e)).toPrecision(b);return(0>a?'-':'')+f+(c?' ':'')+d[e]},primes:function(a){var b=Array.from({length:a-1}).map(function(a,b){return b+2}),c=A(z(a)),d=Array.from({length:c-1}).map(function(a,b){return b+2});return d.forEach(function(a){return b=b.filter(function(b){return 0!=b%a||b==a})}),b},promisify:function(a){return function(){for(var b=arguments.length,c=Array(b),d=0;da[a.length-1],d=a.findIndex(function(a){return c?b>=a:b<=a});return-1===d?a.length:d},splitLines:function(a){return a.split(/\r?\n/)},spreadOver:function(a){return function(b){return a.apply(void 0,t(b))}},standardDeviation:function(a){var b=1b?a.slice(0,3',"'":'\'',""":'"'}[a]||a})},union:function(c,a){return Array.from(new Set([].concat(v(c),v(a))))},uniqueElements:function(a){return[].concat(w(new Set(a)))},untildify:function(a){return a.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},validateNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&+a==a},without:function(a){for(var b=arguments.length,c=Array(1>a/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(a){return(a^H.randomBytes(1)[0]&15>>a/4).toString(16)})},anagrams:function a(b){return 2>=b.length?2===b.length?[b,b[1]+b[0]]:[b]:b.split('').reduce(function(c,d,e){return c.concat(a(b.slice(0,e)+b.slice(e+1)).map(function(a){return d+a}))},[])},arrayToHtmlList:function(a,b){return a.map(function(a){return document.querySelector('#'+b).innerHTML+='
  • '+a+'
  • '})},atob:function(a){return new Buffer(a,'base64').toString('binary')},average:function(){for(var a=arguments.length,b=Array(a),c=0;c=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(a){return new Buffer(a,'binary').toString('base64')},byteSize:function(a){return new Blob([a]).size},call:function(a){for(var b=arguments.length,c=Array(1'"]/g,function(a){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[a]||a})},escapeRegExp:function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(a,b){return a.filter(function(a,c){return c%b==b-1})},extendHex:function(a){return'#'+a.slice(a.startsWith('#')?1:0).split('').map(function(a){return a+a}).join('')},factorial:function a(b){return 0>b?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=b?1:b*a(b-1)},fibonacci:function(a){return Array.from({length:a}).reduce(function(a,b,c){return a.concat(1a&&(a=-a);var b={day:B(a/8.64e7),hour:B(a/3.6e6)%24,minute:B(a/6e4)%60,second:B(a/1e3)%60,millisecond:B(a)%1e3};return Object.entries(b).filter(function(a){return 0!==a[1]}).map(function(a){return a[1]+' '+(1===a[1]?a[0]:a[0]+'s')}).join(', ')},fromCamelCase:function(a){var b=1>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?', '+(255&c):'')+')'},hide:function(){for(var a=arguments.length,b=Array(a),c=0;cc&&(c=b),null==c?0<=a&&a=b&&aa[1]?-1:1,d=!0,e=!1;try{for(var f,g=a.entries()[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){var h=f.value,j=Q(h,2),k=j[0],i=j[1];if(k===a.length-1)return c;if(0<(i-a[k+1])*c)return 0}}catch(a){e=!0,b=a}finally{try{!d&&g.return&&g.return()}finally{if(e)throw b}}},isString:function(a){return'string'==typeof a},isSymbol:function(a){return'symbol'===('undefined'==typeof a?'undefined':R(a))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(a){return a===void 0},isUpperCase:function(a){return a===a.toUpperCase()},isValidJSON:function(a){try{return JSON.parse(a),!0}catch(a){return!1}},join:function(a){var b=1e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',function(){'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:function(a){var b=!1;return function(){if(!b){b=!0;for(var c=arguments.length,d=Array(c),e=0;ej?1:iMath.abs(a))return a+(c?' ':'')+d[0];var e=D(B(Math.log10(0>a?-a:a)/3),d.length-1),f=+((0>a?-a:a)/C(1e3,e)).toPrecision(b);return(0>a?'-':'')+f+(c?' ':'')+d[e]},primes:function(a){var b=Array.from({length:a-1}).map(function(a,b){return b+2}),c=B(A(a)),d=Array.from({length:c-1}).map(function(a,b){return b+2});return d.forEach(function(a){return b=b.filter(function(b){return 0!=b%a||b==a})}),b},promisify:function(a){return function(){for(var b=arguments.length,c=Array(b),d=0;da[a.length-1],d=a.findIndex(function(a){return c?b>=a:b<=a});return-1===d?a.length:d},splitLines:function(a){return a.split(/\r?\n/)},spreadOver:function(a){return function(b){return a.apply(void 0,t(b))}},standardDeviation:function(a){var b=1b?a.slice(0,3',"'":'\'',""":'"'}[a]||a})},union:function(c,a){return Array.from(new Set([].concat(v(c),v(a))))},uniqueElements:function(a){return[].concat(w(new Set(a)))},untildify:function(a){return a.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},validateNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&+a==a},without:function(a){for(var b=arguments.length,c=Array(1 const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase()); +const castArray = val => (Array.isArray(val) ? val : [val]); + const chainAsync = fns => { let curr = 0; const next = () => fns[curr++](next); @@ -161,6 +163,14 @@ const curry = (fn, arity = fn.length, ...args) => const decapitalize = ([first, ...rest], upperRest = false) => first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join('')); +const deepClone = obj => { + let clone = Object.assign({}, obj); + Object.keys(clone).forEach( + key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key]) + ); + return clone; +}; + const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); @@ -269,8 +279,15 @@ const fibonacci = n => const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i)); +const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); + const findLast = (arr, fn) => arr.filter(fn).slice(-1); +const findLastKey = (obj, fn) => + Object.keys(obj) + .reverse() + .find(key => fn(obj[key], key, obj)); + const flatten = (arr, depth = 1) => depth != 1 ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), []) @@ -470,9 +487,11 @@ const intersection = (a, b) => { return a.filter(x => s.has(x)); }; -const invertKeyValues = obj => +const invertKeyValues = (obj, fn) => Object.keys(obj).reduce((acc, key) => { - acc[obj[key]] = key; + const val = fn ? fn(obj[key]) : obj[key]; + acc[val] = acc[val] || []; + acc[val].push(key); return acc; }, {}); @@ -492,6 +511,8 @@ const isBoolean = val => typeof val === 'boolean'; const isDivisible = (dividend, divisor) => dividend % divisor === 0; +const isEmpty = val => val == null || !(Object.keys(val) || val).length; + const isEven = num => num % 2 === 0; const isFunction = val => typeof val === 'function'; @@ -506,6 +527,8 @@ const isNumber = val => typeof val === 'number'; const isObject = obj => obj === Object(obj); +const isObjectLike = val => val !== null && typeof val === 'object'; + const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; const isPrime = num => { @@ -602,6 +625,17 @@ const mapValues = (obj, fn) => const mask = (cc, num = 4, mask = '*') => ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num); +const matches = (obj, source) => + Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); + +const matchesWith = (obj, source, fn) => + Object.keys(source).every( + key => + obj.hasOwnProperty(key) && fn + ? fn(obj[key], source[key], key, obj, source) + : obj[key] == source[key] + ); + const maxBy = (arr, fn) => Math.max(...arr.map(typeof fn === 'function' ? fn : val => val[fn])); const maxN = (arr, n = 1) => [...arr].sort((a, b) => b - a).slice(0, n); @@ -637,6 +671,8 @@ const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); const negate = func => (...args) => !func(...args); +const nthArg = n => (...args) => args.slice(n)[0]; + const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0]; const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {}); @@ -715,6 +751,8 @@ const orderBy = (arr, props, orders) => }, 0) ); +const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args)); + const palindrome = str => { const s = str.toLowerCase().replace(/[\W_]/g, ''); return ( @@ -1022,7 +1060,13 @@ const toSnakeCase = str => const toggleClass = (el, className) => el.classList.toggle(className); -const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; +const tomorrow = () => { + let t = new Date(); + t.setDate(t.getDate() + 1); + return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String( + t.getDate() + ).padStart(2, '0')}`; +}; const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc); @@ -1069,6 +1113,17 @@ const zip = (...arrays) => { const zipObject = (props, values) => props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} +const zipWith = (...arrays) => { + const length = arrays.length; + let fn = length > 1 ? arrays[length - 1] : undefined; + fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; + const maxLength = Math.max(...arrays.map(x => x.length)); + const result = Array.from({ length: maxLength }).map((_, i) => { + return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); + }); + return fn ? result.map(arr => fn(...arr)) : result; +}; + +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,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,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,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,zipWith,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index 473666768..913418804 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -68,6 +68,8 @@ const capitalize = ([first, ...rest], lowerRest = false) => const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase()); +const castArray = val => (Array.isArray(val) ? val : [val]); + const chainAsync = fns => { let curr = 0; const next = () => fns[curr++](next); @@ -167,6 +169,14 @@ const curry = (fn, arity = fn.length, ...args) => const decapitalize = ([first, ...rest], upperRest = false) => first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join('')); +const deepClone = obj => { + let clone = Object.assign({}, obj); + Object.keys(clone).forEach( + key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key]) + ); + return clone; +}; + const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); @@ -275,8 +285,15 @@ const fibonacci = n => const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i)); +const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); + const findLast = (arr, fn) => arr.filter(fn).slice(-1); +const findLastKey = (obj, fn) => + Object.keys(obj) + .reverse() + .find(key => fn(obj[key], key, obj)); + const flatten = (arr, depth = 1) => depth != 1 ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), []) @@ -476,9 +493,11 @@ const intersection = (a, b) => { return a.filter(x => s.has(x)); }; -const invertKeyValues = obj => +const invertKeyValues = (obj, fn) => Object.keys(obj).reduce((acc, key) => { - acc[obj[key]] = key; + const val = fn ? fn(obj[key]) : obj[key]; + acc[val] = acc[val] || []; + acc[val].push(key); return acc; }, {}); @@ -498,6 +517,8 @@ const isBoolean = val => typeof val === 'boolean'; const isDivisible = (dividend, divisor) => dividend % divisor === 0; +const isEmpty = val => val == null || !(Object.keys(val) || val).length; + const isEven = num => num % 2 === 0; const isFunction = val => typeof val === 'function'; @@ -512,6 +533,8 @@ const isNumber = val => typeof val === 'number'; const isObject = obj => obj === Object(obj); +const isObjectLike = val => val !== null && typeof val === 'object'; + const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; const isPrime = num => { @@ -608,6 +631,17 @@ const mapValues = (obj, fn) => const mask = (cc, num = 4, mask = '*') => ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num); +const matches = (obj, source) => + Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); + +const matchesWith = (obj, source, fn) => + Object.keys(source).every( + key => + obj.hasOwnProperty(key) && fn + ? fn(obj[key], source[key], key, obj, source) + : obj[key] == source[key] + ); + const maxBy = (arr, fn) => Math.max(...arr.map(typeof fn === 'function' ? fn : val => val[fn])); const maxN = (arr, n = 1) => [...arr].sort((a, b) => b - a).slice(0, n); @@ -643,6 +677,8 @@ const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); const negate = func => (...args) => !func(...args); +const nthArg = n => (...args) => args.slice(n)[0]; + const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0]; const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {}); @@ -721,6 +757,8 @@ const orderBy = (arr, props, orders) => }, 0) ); +const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args)); + const palindrome = str => { const s = str.toLowerCase().replace(/[\W_]/g, ''); return ( @@ -1028,7 +1066,13 @@ const toSnakeCase = str => const toggleClass = (el, className) => el.classList.toggle(className); -const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; +const tomorrow = () => { + let t = new Date(); + t.setDate(t.getDate() + 1); + return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String( + t.getDate() + ).padStart(2, '0')}`; +}; const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc); @@ -1075,7 +1119,18 @@ const zip = (...arrays) => { const zipObject = (props, values) => props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,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,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,} +const zipWith = (...arrays) => { + const length = arrays.length; + let fn = length > 1 ? arrays[length - 1] : undefined; + fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; + const maxLength = Math.max(...arrays.map(x => x.length)); + const result = Array.from({ length: maxLength }).map((_, i) => { + return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); + }); + return fn ? result.map(arr => fn(...arr)) : result; +}; + +var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,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,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,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,zipWith,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index a9c1d840e..d10cf7959 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)=>[].concat(...a.map((a)=>Array.isArray(a)?l(a):a)),m=([...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)=>n(c[a],d[a]))},o=(a)=>0>a?(()=>{throw new TypeError('Negative numbers are not allowed!')})():1>=a?1:a*o(a-1),p=(a,b=1)=>1==b?a.reduce((b,a)=>b.concat(a),[]):a.reduce((c,a)=>c.concat(Array.isArray(a)?p(a,b-1):a),[]),q=(...a)=>{const c=(a,b)=>b?q(b,a%b):a;return[...a].reduce((d,a)=>c(d,a))},r='undefined'!=typeof require&&require('crypto'),s='undefined'!=typeof require&&require('fs'),t=()=>{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}
  • `),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,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()),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))),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('')),deepFlatten:l,defaults:(a,...b)=>Object.assign({},a,...b.reverse(),a),defer:(a,...b)=>setTimeout(a,1,...b),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))},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),dropElements:(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:o,fibonacci:(a)=>Array.from({length:a}).reduce((a,b,c)=>a.concat(1a.filter((b)=>a.indexOf(b)===a.lastIndexOf(b)),findLast:(a,b)=>a.filter(b).slice(-1),flatten:p,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:q,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(r.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))},invertKeyValues:(a)=>Object.keys(a).reduce((b,c)=>(b[a[c]]=c,b),{}),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,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),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),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),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{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),{}),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)=>s.readFileSync(a).toString('UTF8').split('\n'),redirect:(a,b=!0)=>b?window.location.href=a:window.location.replace(a),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:t,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},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))]},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},toCamelCase:(a)=>{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:()=>new Date(new Date().getTime()+8.64e7).toISOString().split('T')[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]),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),union:(c,a)=>Array.from(new Set([...c,...a])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),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),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),{})}}); +(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}
  • `),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,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))),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),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))},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),dropElements:(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),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))},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),{}),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),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},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))]},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},toCamelCase:(a)=>{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]),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),union:(c,a)=>Array.from(new Set([...c,...a])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),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),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/castArray/castArray.js b/test/castArray/castArray.js new file mode 100644 index 000000000..83816cde7 --- /dev/null +++ b/test/castArray/castArray.js @@ -0,0 +1,2 @@ +const castArray = val => (Array.isArray(val) ? val : [val]); + module.exports = castArray \ No newline at end of file diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js new file mode 100644 index 000000000..59d5d7c28 --- /dev/null +++ b/test/castArray/castArray.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const castArray = require('./castArray.js'); + +test('Testing castArray', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof castArray === 'function', 'castArray is a Function'); + //t.deepEqual(castArray(args..), 'Expected'); + //t.equal(castArray(args..), 'Expected'); + //t.false(castArray(args..), 'Expected'); + //t.throws(castArray(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/deepClone/deepClone.js b/test/deepClone/deepClone.js new file mode 100644 index 000000000..dd6573dab --- /dev/null +++ b/test/deepClone/deepClone.js @@ -0,0 +1,8 @@ +const deepClone = obj => { +let clone = Object.assign({}, obj); +Object.keys(clone).forEach( +key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key]) +); +return clone; +}; + module.exports = deepClone \ No newline at end of file diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js new file mode 100644 index 000000000..a94eabcda --- /dev/null +++ b/test/deepClone/deepClone.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const deepClone = require('./deepClone.js'); + +test('Testing deepClone', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof deepClone === 'function', 'deepClone is a Function'); + //t.deepEqual(deepClone(args..), 'Expected'); + //t.equal(deepClone(args..), 'Expected'); + //t.false(deepClone(args..), 'Expected'); + //t.throws(deepClone(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/findKey/findKey.js b/test/findKey/findKey.js new file mode 100644 index 000000000..b97dc0b7f --- /dev/null +++ b/test/findKey/findKey.js @@ -0,0 +1,2 @@ +const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); + module.exports = findKey \ No newline at end of file diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js new file mode 100644 index 000000000..f70d57f32 --- /dev/null +++ b/test/findKey/findKey.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const findKey = require('./findKey.js'); + +test('Testing findKey', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof findKey === 'function', 'findKey is a Function'); + //t.deepEqual(findKey(args..), 'Expected'); + //t.equal(findKey(args..), 'Expected'); + //t.false(findKey(args..), 'Expected'); + //t.throws(findKey(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/findLastKey/findLastKey.js b/test/findLastKey/findLastKey.js new file mode 100644 index 000000000..0484b644c --- /dev/null +++ b/test/findLastKey/findLastKey.js @@ -0,0 +1,5 @@ +const findLastKey = (obj, fn) => +Object.keys(obj) +.reverse() +.find(key => fn(obj[key], key, obj)); + module.exports = findLastKey \ No newline at end of file diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js new file mode 100644 index 000000000..b2fa57478 --- /dev/null +++ b/test/findLastKey/findLastKey.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const findLastKey = require('./findLastKey.js'); + +test('Testing findLastKey', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof findLastKey === 'function', 'findLastKey is a Function'); + //t.deepEqual(findLastKey(args..), 'Expected'); + //t.equal(findLastKey(args..), 'Expected'); + //t.false(findLastKey(args..), 'Expected'); + //t.throws(findLastKey(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/invertKeyValues/invertKeyValues.js b/test/invertKeyValues/invertKeyValues.js index bbb96740f..93ef7c7a2 100644 --- a/test/invertKeyValues/invertKeyValues.js +++ b/test/invertKeyValues/invertKeyValues.js @@ -1,6 +1,8 @@ -const invertKeyValues = obj => +const invertKeyValues = (obj, fn) => Object.keys(obj).reduce((acc, key) => { -acc[obj[key]] = key; +const val = fn ? fn(obj[key]) : obj[key]; +acc[val] = acc[val] || []; +acc[val].push(key); return acc; }, {}); module.exports = invertKeyValues \ No newline at end of file diff --git a/test/isEmpty/isEmpty.js b/test/isEmpty/isEmpty.js new file mode 100644 index 000000000..10e93f435 --- /dev/null +++ b/test/isEmpty/isEmpty.js @@ -0,0 +1,2 @@ +const isEmpty = val => val == null || !(Object.keys(val) || val).length; + module.exports = isEmpty \ No newline at end of file diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js new file mode 100644 index 000000000..bc457c018 --- /dev/null +++ b/test/isEmpty/isEmpty.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const isEmpty = require('./isEmpty.js'); + +test('Testing isEmpty', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof isEmpty === 'function', 'isEmpty is a Function'); + //t.deepEqual(isEmpty(args..), 'Expected'); + //t.equal(isEmpty(args..), 'Expected'); + //t.false(isEmpty(args..), 'Expected'); + //t.throws(isEmpty(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/isObjectLike/isObjectLike.js b/test/isObjectLike/isObjectLike.js new file mode 100644 index 000000000..17073de4c --- /dev/null +++ b/test/isObjectLike/isObjectLike.js @@ -0,0 +1,2 @@ +const isObjectLike = val => val !== null && typeof val === 'object'; + module.exports = isObjectLike \ No newline at end of file diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js new file mode 100644 index 000000000..48f3a5c72 --- /dev/null +++ b/test/isObjectLike/isObjectLike.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const isObjectLike = require('./isObjectLike.js'); + +test('Testing isObjectLike', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof isObjectLike === 'function', 'isObjectLike is a Function'); + //t.deepEqual(isObjectLike(args..), 'Expected'); + //t.equal(isObjectLike(args..), 'Expected'); + //t.false(isObjectLike(args..), 'Expected'); + //t.throws(isObjectLike(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/matches/matches.js b/test/matches/matches.js new file mode 100644 index 000000000..21412bb9b --- /dev/null +++ b/test/matches/matches.js @@ -0,0 +1,3 @@ +const matches = (obj, source) => +Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); + module.exports = matches \ No newline at end of file diff --git a/test/matches/matches.test.js b/test/matches/matches.test.js new file mode 100644 index 000000000..8bf340a59 --- /dev/null +++ b/test/matches/matches.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const matches = require('./matches.js'); + +test('Testing matches', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof matches === 'function', 'matches is a Function'); + //t.deepEqual(matches(args..), 'Expected'); + //t.equal(matches(args..), 'Expected'); + //t.false(matches(args..), 'Expected'); + //t.throws(matches(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/matchesWith/matchesWith.js b/test/matchesWith/matchesWith.js new file mode 100644 index 000000000..09b61f457 --- /dev/null +++ b/test/matchesWith/matchesWith.js @@ -0,0 +1,8 @@ +const matchesWith = (obj, source, fn) => +Object.keys(source).every( +key => +obj.hasOwnProperty(key) && fn +? fn(obj[key], source[key], key, obj, source) +: obj[key] == source[key] +); + module.exports = matchesWith \ No newline at end of file diff --git a/test/matchesWith/matchesWith.test.js b/test/matchesWith/matchesWith.test.js new file mode 100644 index 000000000..0faa74a62 --- /dev/null +++ b/test/matchesWith/matchesWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const matchesWith = require('./matchesWith.js'); + +test('Testing matchesWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof matchesWith === 'function', 'matchesWith is a Function'); + //t.deepEqual(matchesWith(args..), 'Expected'); + //t.equal(matchesWith(args..), 'Expected'); + //t.false(matchesWith(args..), 'Expected'); + //t.throws(matchesWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/nthArg/nthArg.js b/test/nthArg/nthArg.js new file mode 100644 index 000000000..4a2ca5f0a --- /dev/null +++ b/test/nthArg/nthArg.js @@ -0,0 +1,2 @@ +const nthArg = n => (...args) => args.slice(n)[0]; + module.exports = nthArg \ No newline at end of file diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js new file mode 100644 index 000000000..626789aa5 --- /dev/null +++ b/test/nthArg/nthArg.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const nthArg = require('./nthArg.js'); + +test('Testing nthArg', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof nthArg === 'function', 'nthArg is a Function'); + //t.deepEqual(nthArg(args..), 'Expected'); + //t.equal(nthArg(args..), 'Expected'); + //t.false(nthArg(args..), 'Expected'); + //t.throws(nthArg(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/over/over.js b/test/over/over.js new file mode 100644 index 000000000..557bbd8d3 --- /dev/null +++ b/test/over/over.js @@ -0,0 +1,2 @@ +const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args)); + module.exports = over \ No newline at end of file diff --git a/test/over/over.test.js b/test/over/over.test.js new file mode 100644 index 000000000..1f2ecada6 --- /dev/null +++ b/test/over/over.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const over = require('./over.js'); + +test('Testing over', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof over === 'function', 'over is a Function'); + //t.deepEqual(over(args..), 'Expected'); + //t.equal(over(args..), 'Expected'); + //t.false(over(args..), 'Expected'); + //t.throws(over(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 24e508045..a393f7a85 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) +Test log for: Tue Jan 23 2018 20:11:47 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -98,6 +98,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ capitalizeEveryWord is a Function ✔ Capitalizes the first letter of every word in a string + Testing castArray + + ✔ castArray is a Function + Testing chainAsync ✔ chainAsync is a Function @@ -200,6 +204,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ decapitalize is a Function + Testing deepClone + + ✔ deepClone is a Function + Testing deepFlatten ✔ deepFlatten is a Function @@ -320,10 +328,18 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ 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 findLastKey + + ✔ findLastKey is a Function + Testing flatten ✔ flatten is a Function @@ -528,7 +544,17 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) Testing invertKeyValues ✔ invertKeyValues is a Function - ✔ Inverts the key-value pairs of an object + + ✖ Inverts the key-value pairs of an object + ------------------------------------------- + operator: deepEqual + expected: |- + { 20: 'age', John: 'name' } + actual: |- + { 20: [ 'age' ], John: [ 'name' ] } + at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/invertKeyValues/invertKeyValues.test.js:8:4) + stack: |- + Testing is @@ -570,6 +596,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ isDivisible is a Function ✔ The number 6 is divisible by 3 + Testing isEmpty + + ✔ isEmpty is a Function + Testing isEven ✔ isEven is a Function @@ -617,6 +647,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ isObject({ a:1 }) is a object ✔ isObject(true) is not a object + Testing isObjectLike + + ✔ isObjectLike is a Function + Testing isPlainObject ✔ isPlainObject is a Function @@ -769,6 +803,14 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ 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 @@ -808,6 +850,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ negate is a Function ✔ Negates a predicate function + Testing nthArg + + ✔ nthArg is a Function + Testing nthElement ✔ nthElement is a Function @@ -858,6 +904,10 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ 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 @@ -1296,9 +1346,23 @@ Test log for: Mon Jan 22 2018 20:11:29 GMT+0000 (UTC) ✔ zipObject(string) throws an error ✔ zipObject(test, string) throws an error + Testing zipWith - total: 563 - passing: 563 - duration: 314ms + ✔ zipWith is a Function + + Failed Tests: There was 1 failure + + Testing invertKeyValues + + ✖ Inverts the key-value pairs of an object + + + total: 574 + passing: 573 + failing: 1 + duration: 440ms + + +undefined \ No newline at end of file diff --git a/test/tomorrow/tomorrow.js b/test/tomorrow/tomorrow.js index 5f70ab9af..4e3ee9776 100644 --- a/test/tomorrow/tomorrow.js +++ b/test/tomorrow/tomorrow.js @@ -1,2 +1,8 @@ -const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; +const tomorrow = () => { +let t = new Date(); +t.setDate(t.getDate() + 1); +return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String( +t.getDate() +).padStart(2, '0')}`; +}; module.exports = tomorrow \ No newline at end of file diff --git a/test/zipWith/zipWith.js b/test/zipWith/zipWith.js new file mode 100644 index 000000000..7c0336738 --- /dev/null +++ b/test/zipWith/zipWith.js @@ -0,0 +1,11 @@ +const zipWith = (...arrays) => { +const length = arrays.length; +let fn = length > 1 ? arrays[length - 1] : undefined; +fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined; +const maxLength = Math.max(...arrays.map(x => x.length)); +const result = Array.from({ length: maxLength }).map((_, i) => { +return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); +}); +return fn ? result.map(arr => fn(...arr)) : result; +}; + module.exports = zipWith \ No newline at end of file diff --git a/test/zipWith/zipWith.test.js b/test/zipWith/zipWith.test.js new file mode 100644 index 000000000..382c59776 --- /dev/null +++ b/test/zipWith/zipWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const zipWith = require('./zipWith.js'); + +test('Testing zipWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof zipWith === 'function', 'zipWith is a Function'); + //t.deepEqual(zipWith(args..), 'Expected'); + //t.equal(zipWith(args..), 'Expected'); + //t.false(zipWith(args..), 'Expected'); + //t.throws(zipWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file From 4b4619439c96b44952ae1875dd17c2f56b2f1814 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 23 Jan 2018 22:12:56 +0200 Subject: [PATCH 036/103] Add composeRight --- snippets/composeRight.md | 17 +++++++++++++++++ tag_database | 1 + 2 files changed, 18 insertions(+) create mode 100644 snippets/composeRight.md diff --git a/snippets/composeRight.md b/snippets/composeRight.md new file mode 100644 index 000000000..94e77aa1e --- /dev/null +++ b/snippets/composeRight.md @@ -0,0 +1,17 @@ +### composeRight + +Performs left-to-right function composition. + +Use `Array.reduce()` to perform left-to-right function composition. +The first (leftmost) function can accept one or more arguments; the remaining functions must be unary. + +```js +const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); +``` + +```js +const add = (x,y) => x + y; +const square = x => x * x; +const addAndSquare = composeRight(add, square); +addAndSquare(1, 2); // 9 +``` diff --git a/tag_database b/tag_database index 10dace2a4..b8afea8ab 100644 --- a/tag_database +++ b/tag_database @@ -20,6 +20,7 @@ collectInto:adapter,function,array colorize:node,utility,string compact:array compose:function +composeRight:function copyToClipboard:browser,string,advanced countBy:array,object countOccurrences:array From c4a78512b27898fa97614b4f3165252aebd8d585 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Tue, 23 Jan 2018 20:14:21 +0000 Subject: [PATCH 037/103] Travis build: 1360 --- README.md | 27 +++++++++++++++++++++++++++ docs/index.html | 7 ++++++- snippets/composeRight.md | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d93865803..88f0d8464 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ average(1, 2, 3); * [`chainAsync`](#chainasync) * [`compose`](#compose) +* [`composeRight`](#composeright) * [`curry`](#curry) * [`defer`](#defer) * [`functionName`](#functionname) @@ -2845,6 +2846,32 @@ multiplyAndAdd5(5, 2); // 15
    [⬆ Back to top](#table-of-contents) +### composeRight + +Performs left-to-right function composition. + +Use `Array.reduce()` to perform left-to-right function composition. +The first (leftmost) function can accept one or more arguments; the remaining functions must be unary. + +```js +const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); +``` + +
    +Examples + +```js +const add = (x, y) => x + y; +const square = x => x * x; +const addAndSquare = composeRight(add, square); +addAndSquare(1, 2); // 9 +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### curry Curries a function. diff --git a/docs/index.html b/docs/index.html index 8c64efc76..0f12043c8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -635,6 +635,11 @@ document.bodyconst multiply = (x, y) => x * y;
     const multiplyAndAdd5 = compose(add5, multiply);
     multiplyAndAdd5(5, 2); // 15
    +

    composeRight

    Performs left-to-right function composition.

    Use Array.reduce() to perform left-to-right function composition. The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.

    const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
    +
    const add = (x, y) => x + y;
    +const square = x => x * x;
    +const addAndSquare = composeRight(add, square);
    +addAndSquare(1, 2); // 9
     

    curry

    Curries a function.

    Use recursion. If the number of provided arguments (args) is sufficient, call the passed function fn. Otherwise, return a curried function fn that expects the rest of the arguments. If you want to curry a function that accepts a variable number of arguments (a variadic function, e.g. Math.min()), you can optionally pass the number of arguments to the second parameter arity.

    const curry = (fn, arity = fn.length, ...args) =>
       arity <= args.length ? fn(...args) : curry.bind(null, fn, arity, ...args);
     
    curry(Math.pow)(2)(10); // 1024
    diff --git a/snippets/composeRight.md b/snippets/composeRight.md
    index 94e77aa1e..88deb7355 100644
    --- a/snippets/composeRight.md
    +++ b/snippets/composeRight.md
    @@ -10,7 +10,7 @@ const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))
     ```
     
     ```js
    -const add = (x,y) => x + y;
    +const add = (x, y) => x + y;
     const square = x => x * x;
     const addAndSquare = composeRight(add, square);
     addAndSquare(1, 2); // 9
    
    From 50c77d836cfd266d6e49b9f8dd7eb2f9ecafdb88 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Tue, 23 Jan 2018 22:19:28 +0200
    Subject: [PATCH 038/103] Fix broken snippet breaking the builder
    
    ---
     snippets/omitBy.md | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/snippets/omitBy.md b/snippets/omitBy.md
    index 5a4928ebc..81ac1fc45 100644
    --- a/snippets/omitBy.md
    +++ b/snippets/omitBy.md
    @@ -14,3 +14,4 @@ const omitBy = (obj, fn) =>
     
     ```js
     omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number'); // { b: '2' }
    +```
    
    From bab4fab02f828100480e0dde80368d6ae2e6a18f Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Tue, 23 Jan 2018 20:21:03 +0000
    Subject: [PATCH 039/103] Travis build: 1362
    
    ---
     README.md | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/README.md b/README.md
    index 88f0d8464..1a50c8ec0 100644
    --- a/README.md
    +++ b/README.md
    @@ -4807,6 +4807,7 @@ const omitBy = (obj, fn) =>
     
     ```js
     omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number'); // { b: '2' }
    +```
     
     
    From 6e54017d5d8bf038eb381e5b66b80ecf26941646 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 24 Jan 2018 11:49:03 +0200 Subject: [PATCH 040/103] Add differenceBy --- snippets/differenceBy.md | 17 +++++++++++++++++ tag_database | 1 + 2 files changed, 18 insertions(+) create mode 100644 snippets/differenceBy.md diff --git a/snippets/differenceBy.md b/snippets/differenceBy.md new file mode 100644 index 000000000..626ba7cdc --- /dev/null +++ b/snippets/differenceBy.md @@ -0,0 +1,17 @@ +### differenceBy + +Returns the difference between two arrays, after applying the provided function to each array element of both. + +Create a `Set` by applying `fn` to each element in `b`, then use `Array.filter()` in combination with `fn` on `a` to only keep values not contained in the previously created set. + +```js +const differenceBy = (a, b, fn) => { + const s = new Set(b.map(v => fn(v))); + return a.filter(x => !s.has(fn(x))); +}; +``` + +```js +differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [1.2] +differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x); // [ { x: 2 } ] +``` diff --git a/tag_database b/tag_database index b8afea8ab..231cf9379 100644 --- a/tag_database +++ b/tag_database @@ -35,6 +35,7 @@ defaults:object defer:function detectDeviceType:browser difference:array,math +differenceBy:array,function differenceWith:array,function digitize:math,array distance:math From 1f5b3d16ea9bc3ffa96a6e52c2de2cb80d2960a7 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 24 Jan 2018 09:50:52 +0000 Subject: [PATCH 041/103] Travis build: 1364 --- README.md | 27 +++++++++++++++++++++++++++ docs/index.html | 8 +++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a50c8ec0..d0be53894 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ average(1, 2, 3); * [`countOccurrences`](#countoccurrences) * [`deepFlatten`](#deepflatten) * [`difference`](#difference) +* [`differenceBy`](#differenceby) * [`differenceWith`](#differencewith) * [`dropElements`](#dropelements) * [`dropRight`](#dropright) @@ -726,6 +727,32 @@ difference([1, 2, 3], [1, 2, 4]); // [3]
    [⬆ Back to top](#table-of-contents) +### differenceBy + +Returns the difference between two arrays, after applying the provided function to each array element of both. + +Create a `Set` by applying `fn` to each element in `b`, then use `Array.filter()` in combination with `fn` on `a` to only keep values not contained in the previously created set. + +```js +const differenceBy = (a, b, fn) => { + const s = new Set(b.map(v => fn(v))); + return a.filter(x => !s.has(fn(x))); +}; +``` + +
    +Examples + +```js +differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [1.2] +differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x); // [ { x: 2 } ] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### differenceWith Filters out all values from an array for which the comparator function does not return `true`. diff --git a/docs/index.html b/docs/index.html index 0f12043c8..054980965 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -112,6 +112,12 @@ Object.assig
       return a.filter(x => !s.has(x));
     };
     
    difference([1, 2, 3], [1, 2, 4]); // [3]
    +

    differenceBy

    Returns the difference between two arrays, after applying the provided function to each array element of both.

    Create a Set by applying fn to each element in b, then use Array.filter() in combination with fn on a to only keep values not contained in the previously created set.

    const differenceBy = (a, b, fn) => {
    +  const s = new Set(b.map(v => fn(v)));
    +  return a.filter(x => !s.has(fn(x)));
    +};
    +
    differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [1.2]
    +differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x); // [ { x: 2 } ]
     

    differenceWith

    Filters out all values from an array for which the comparator function does not return true.

    Use Array.filter() and Array.findIndex() to find the appropriate values.

    const differenceWith = (arr, val, comp) => arr.filter(a => val.findIndex(b => comp(a, b)) === -1);
     
    differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2]
     

    dropElements

    Removes elements in an array until the passed function returns true. Returns the remaining elements in the array.

    Loop through the array, using Array.slice() to drop the first element of the array until the returned value from the function is true. Returns the remaining elements.

    const dropElements = (arr, func) => {
    
    From d6957c67fef53113025e6d8152c40718f780dd99 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 11:59:02 +0200
    Subject: [PATCH 042/103] Add symmetricDifferenceBy, symmetricDifferenceWith
    
    ---
     snippets/symmetricDifferenceBy.md   | 17 +++++++++++++++++
     snippets/symmetricDifferenceWith.md | 16 ++++++++++++++++
     tag_database                        |  2 ++
     3 files changed, 35 insertions(+)
     create mode 100644 snippets/symmetricDifferenceBy.md
     create mode 100644 snippets/symmetricDifferenceWith.md
    
    diff --git a/snippets/symmetricDifferenceBy.md b/snippets/symmetricDifferenceBy.md
    new file mode 100644
    index 000000000..250eeaa03
    --- /dev/null
    +++ b/snippets/symmetricDifferenceBy.md
    @@ -0,0 +1,17 @@
    +### symmetricDifferenceBy
    +
    +Returns the symmetric difference between two arrays, after applying the provided function to each array element of both.
    +
    +Create a `Set` by applying `fn` to each array's elements, then use `Array.filter()` on each of them to only keep values not contained in the other.
    +
    +```js
    +const symmetricDifferenceBy = (a, b, fn) => {
    +  const sA = new Set(a.map(v => fn(v))),
    +    sB = new Set(b.map(v => fn(v)));
    +  return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))];
    +};
    +```
    +
    +```js
    +symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [ 1.2, 3.4 ]
    +```
    diff --git a/snippets/symmetricDifferenceWith.md b/snippets/symmetricDifferenceWith.md
    new file mode 100644
    index 000000000..67d081ccd
    --- /dev/null
    +++ b/snippets/symmetricDifferenceWith.md
    @@ -0,0 +1,16 @@
    +### symmetricDifferenceWith
    +
    +Returns the symmetric difference between two arrays, using a provided function as a comparator.
    +
    +Use `Array.filter()` and `Array.findIndex()` to find the appropriate values.
    +
    +```js
    +const symmetricDifferenceWith = (arr, val, comp) => [
    +  ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1),
    +  ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1),
    +];
    +```
    +
    +```js
    +symmetricDifferenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 3.9]
    +```
    diff --git a/tag_database b/tag_database
    index 231cf9379..58c4f00fc 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -200,6 +200,8 @@ sum:math,array
     sumBy:math,array,function
     sumPower:math
     symmetricDifference:array,math
    +symmetricDifferenceBy:array,function
    +symmetricDifferenceWith:array,function
     tail:array
     take:array
     takeRight:array
    
    From 96477cc692ace14ed8702d7a7014c226c3c583bc Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 10:01:27 +0000
    Subject: [PATCH 043/103] Travis build: 1366
    
    ---
     README.md                           | 57 +++++++++++++++++++++++++++++
     docs/index.html                     | 17 ++++++++-
     snippets/symmetricDifferenceWith.md |  8 +++-
     3 files changed, 79 insertions(+), 3 deletions(-)
    
    diff --git a/README.md b/README.md
    index d0be53894..ab8d611dd 100644
    --- a/README.md
    +++ b/README.md
    @@ -136,6 +136,8 @@ average(1, 2, 3);
     * [`similarity`](#similarity)
     * [`sortedIndex`](#sortedindex)
     * [`symmetricDifference`](#symmetricdifference)
    +* [`symmetricDifferenceBy`](#symmetricdifferenceby)
    +* [`symmetricDifferenceWith`](#symmetricdifferencewith)
     * [`tail`](#tail)
     * [`take`](#take)
     * [`takeRight`](#takeright)
    @@ -1744,6 +1746,61 @@ symmetricDifference([1, 2, 3], [1, 2, 4]); // [3,4]
     
    [⬆ Back to top](#table-of-contents) +### symmetricDifferenceBy + +Returns the symmetric difference between two arrays, after applying the provided function to each array element of both. + +Create a `Set` by applying `fn` to each array's elements, then use `Array.filter()` on each of them to only keep values not contained in the other. + +```js +const symmetricDifferenceBy = (a, b, fn) => { + const sA = new Set(a.map(v => fn(v))), + sB = new Set(b.map(v => fn(v))); + return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))]; +}; +``` + +
    +Examples + +```js +symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [ 1.2, 3.4 ] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### symmetricDifferenceWith + +Returns the symmetric difference between two arrays, using a provided function as a comparator. + +Use `Array.filter()` and `Array.findIndex()` to find the appropriate values. + +```js +const symmetricDifferenceWith = (arr, val, comp) => [ + ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1), + ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1) +]; +``` + +
    +Examples + +```js +symmetricDifferenceWith( + [1, 1.2, 1.5, 3, 0], + [1.9, 3, 0, 3.9], + (a, b) => Math.round(a) === Math.round(b) +); // [1, 1.2, 3.9] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### tail Returns all elements in an array except for the first one. diff --git a/docs/index.html b/docs/index.html index 054980965..815e5ed87 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -335,6 +335,21 @@ Object.assig
       return [...a.filter(x => !sB.has(x)), ...b.filter(x => !sA.has(x))];
     };
     
    symmetricDifference([1, 2, 3], [1, 2, 4]); // [3,4]
    +

    symmetricDifferenceBy

    Returns the symmetric difference between two arrays, after applying the provided function to each array element of both.

    Create a Set by applying fn to each array's elements, then use Array.filter() on each of them to only keep values not contained in the other.

    const symmetricDifferenceBy = (a, b, fn) => {
    +  const sA = new Set(a.map(v => fn(v))),
    +    sB = new Set(b.map(v => fn(v)));
    +  return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))];
    +};
    +
    symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [ 1.2, 3.4 ]
    +

    symmetricDifferenceWith

    Returns the symmetric difference between two arrays, using a provided function as a comparator.

    Use Array.filter() and Array.findIndex() to find the appropriate values.

    const symmetricDifferenceWith = (arr, val, comp) => [
    +  ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1),
    +  ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1)
    +];
    +
    symmetricDifferenceWith(
    +  [1, 1.2, 1.5, 3, 0],
    +  [1.9, 3, 0, 3.9],
    +  (a, b) => Math.round(a) === Math.round(b)
    +); // [1, 1.2, 3.9]
     

    tail

    Returns all elements in an array except for the first one.

    Return Array.slice(1) if the array's length is more than 1, otherwise, return the whole array.

    const tail = arr => (arr.length > 1 ? arr.slice(1) : arr);
     
    tail([1, 2, 3]); // [2,3]
     tail([1]); // [1]
    diff --git a/snippets/symmetricDifferenceWith.md b/snippets/symmetricDifferenceWith.md
    index 67d081ccd..5eab574fa 100644
    --- a/snippets/symmetricDifferenceWith.md
    +++ b/snippets/symmetricDifferenceWith.md
    @@ -7,10 +7,14 @@ Use `Array.filter()` and `Array.findIndex()` to find the appropriate values.
     ```js
     const symmetricDifferenceWith = (arr, val, comp) => [
       ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1),
    -  ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1),
    +  ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1)
     ];
     ```
     
     ```js
    -symmetricDifferenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 3.9]
    +symmetricDifferenceWith(
    +  [1, 1.2, 1.5, 3, 0],
    +  [1.9, 3, 0, 3.9],
    +  (a, b) => Math.round(a) === Math.round(b)
    +); // [1, 1.2, 3.9]
     ```
    
    From 2eb3c4af6a28444cf7faffa8f817ec1a52b8ade2 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 12:19:41 +0200
    Subject: [PATCH 044/103] Add unionWith, unionBy
    
    ---
     snippets/unionBy.md   | 18 ++++++++++++++++++
     snippets/unionWith.md | 16 ++++++++++++++++
     tag_database          |  2 ++
     3 files changed, 36 insertions(+)
     create mode 100644 snippets/unionBy.md
     create mode 100644 snippets/unionWith.md
    
    diff --git a/snippets/unionBy.md b/snippets/unionBy.md
    new file mode 100644
    index 000000000..3680c6d1c
    --- /dev/null
    +++ b/snippets/unionBy.md
    @@ -0,0 +1,18 @@
    +### unionBy
    +
    +Returns every element that exists in any of the two arrays once, after applying the provided function to each array element of both.
    +
    +Create a `Set` by applying all `fn` to all values of `a`.
    +Create a `Set` from `a` and all elements in `b` whose value, after applying `fn` does not match a value in the previously created set.
    +Return the last set converted to an array.
    +
    +```js
    +const unionBy = (a, b, fn) => {
    +  const s = new Set(a.map(v => fn(v)));
    +  return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))]));
    +};
    +```
    +
    +```js
    +unionBy([2.1], [1.2, 2.3], Math.floor); // [2.1, 1.2]
    +```
    diff --git a/snippets/unionWith.md b/snippets/unionWith.md
    new file mode 100644
    index 000000000..dbfee938b
    --- /dev/null
    +++ b/snippets/unionWith.md
    @@ -0,0 +1,16 @@
    +### unionWith
    +
    +Returns every element that exists in any of the two arrays once, using a provided comparator function.
    +
    +Create a `Set` with all values of `a` and values in `b` for which the comparator finds no matches in `a`, using `Array.findIndex()`.
    +
    +```js
    +const unionWith = (a, b, comp) =>
    +  Array.from(
    +    new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])
    +  );
    +```
    +
    +```js
    +unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 1.5, 3, 0, 3.9]
    +```
    diff --git a/tag_database b/tag_database
    index 58c4f00fc..13ccb8adb 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -219,6 +219,8 @@ truncateString:string
     truthCheckCollection:object,logic,array
     unescapeHTML:string,browser
     union:array,math
    +unionBy:array,function
    +unionWith:array,function
     uniqueElements:array
     untildify:node,string
     URLJoin:string,utility,regexp
    
    From 87e1cbdcbdf579577da12b5b085524738153c7f6 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 10:21:11 +0000
    Subject: [PATCH 045/103] Travis build: 1368
    
    ---
     README.md             | 52 +++++++++++++++++++++++++++++++++++++++++++
     docs/index.html       | 10 ++++++++-
     snippets/unionWith.md |  4 +---
     3 files changed, 62 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index ab8d611dd..1c9c073c1 100644
    --- a/README.md
    +++ b/README.md
    @@ -142,6 +142,8 @@ average(1, 2, 3);
     * [`take`](#take)
     * [`takeRight`](#takeright)
     * [`union`](#union)
    +* [`unionBy`](#unionby)
    +* [`unionWith`](#unionwith)
     * [`uniqueElements`](#uniqueelements)
     * [`without`](#without)
     * [`zip`](#zip)
    @@ -1892,6 +1894,56 @@ union([1, 2, 3], [4, 3, 2]); // [1,2,3,4]
     
    [⬆ Back to top](#table-of-contents) +### unionBy + +Returns every element that exists in any of the two arrays once, after applying the provided function to each array element of both. + +Create a `Set` by applying all `fn` to all values of `a`. +Create a `Set` from `a` and all elements in `b` whose value, after applying `fn` does not match a value in the previously created set. +Return the last set converted to an array. + +```js +const unionBy = (a, b, fn) => { + const s = new Set(a.map(v => fn(v))); + return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))])); +}; +``` + +
    +Examples + +```js +unionBy([2.1], [1.2, 2.3], Math.floor); // [2.1, 1.2] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### unionWith + +Returns every element that exists in any of the two arrays once, using a provided comparator function. + +Create a `Set` with all values of `a` and values in `b` for which the comparator finds no matches in `a`, using `Array.findIndex()`. + +```js +const unionWith = (a, b, comp) => + Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])); +``` + +
    +Examples + +```js +unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 1.5, 3, 0, 3.9] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### uniqueElements Returns all unique values of an array. diff --git a/docs/index.html b/docs/index.html index 815e5ed87..e54e5312d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -361,6 +361,14 @@ Object.assig
     takeRight([1, 2, 3]); // [3]
     

    union

    Returns every element that exists in any of the two arrays once.

    Create a Set with all values of a and b and convert to an array.

    const union = (a, b) => Array.from(new Set([...a, ...b]));
     
    union([1, 2, 3], [4, 3, 2]); // [1,2,3,4]
    +

    unionBy

    Returns every element that exists in any of the two arrays once, after applying the provided function to each array element of both.

    Create a Set by applying all fn to all values of a. Create a Set from a and all elements in b whose value, after applying fn does not match a value in the previously created set. Return the last set converted to an array.

    const unionBy = (a, b, fn) => {
    +  const s = new Set(a.map(v => fn(v)));
    +  return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))]));
    +};
    +
    unionBy([2.1], [1.2, 2.3], Math.floor); // [2.1, 1.2]
    +

    unionWith

    Returns every element that exists in any of the two arrays once, using a provided comparator function.

    Create a Set with all values of a and values in b for which the comparator finds no matches in a, using Array.findIndex().

    const unionWith = (a, b, comp) =>
    +  Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)]));
    +
    unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 1.5, 3, 0, 3.9]
     

    uniqueElements

    Returns all unique values of an array.

    Use ES6 Set and the ...rest operator to discard all duplicated values.

    const uniqueElements = arr => [...new Set(arr)];
     
    uniqueElements([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5]
     

    without

    Filters out the elements of an array, that have one of the specified values.

    Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

    (For a snippet that mutates the original array see pull)

    const without = (arr, ...args) => arr.filter(v => !args.includes(v));
    diff --git a/snippets/unionWith.md b/snippets/unionWith.md
    index dbfee938b..0243a12aa 100644
    --- a/snippets/unionWith.md
    +++ b/snippets/unionWith.md
    @@ -6,9 +6,7 @@ Create a `Set` with all values of `a` and values in `b` for which the comparator
     
     ```js
     const unionWith = (a, b, comp) =>
    -  Array.from(
    -    new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])
    -  );
    +  Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)]));
     ```
     
     ```js
    
    From f16c0ee8bb6998685a95b98eafa5d8bd6e814067 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 12:35:25 +0200
    Subject: [PATCH 046/103] Add unzip
    
    ---
     snippets/unzip.md | 21 +++++++++++++++++++++
     tag_database      |  1 +
     2 files changed, 22 insertions(+)
     create mode 100644 snippets/unzip.md
    
    diff --git a/snippets/unzip.md b/snippets/unzip.md
    new file mode 100644
    index 000000000..9c01f9285
    --- /dev/null
    +++ b/snippets/unzip.md
    @@ -0,0 +1,21 @@
    +### unzip
    +
    +Creates an array of arrays, ungrouping the elements in an array produced by [zip](#zip).
    +
    +Use `Math.max.apply()` to get the longest subarray in the array, `Array.map()` to make each element an array.
    +Use `Array.reduce()` and `Array.forEach()` to map grouped values to individual arrays.
    +
    +```js
    +const unzip = arr =>
    +  arr.reduce(
    +    (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
    +    Array.from({
    +      length: Math.max(...arr.map(x => x.length)),
    +    }).map(x => [])
    +  );
    +```
    +
    +```js
    +unzip([['a', 1, true], ['b', 2, false]]); //[['a', 'b'], [1, 2], [true, false]]
    +unzip([['a', 1, true], ['b', 2]]); //[['a', 'b'], [1, 2], [true]]
    +```
    diff --git a/tag_database b/tag_database
    index 13ccb8adb..f774897cb 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -223,6 +223,7 @@ unionBy:array,function
     unionWith:array,function
     uniqueElements:array
     untildify:node,string
    +unzip:array
     URLJoin:string,utility,regexp
     UUIDGeneratorBrowser:browser,utility,random
     UUIDGeneratorNode:node,utility,random
    
    From d0885d1322ed18c3fc916e01c17ea3214725d4b6 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 10:37:02 +0000
    Subject: [PATCH 047/103] Travis build: 1370
    
    ---
     README.md         | 31 +++++++++++++++++++++++++++++++
     docs/index.html   | 11 ++++++++++-
     snippets/unzip.md |  2 +-
     3 files changed, 42 insertions(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index 1c9c073c1..d5dd00baf 100644
    --- a/README.md
    +++ b/README.md
    @@ -145,6 +145,7 @@ average(1, 2, 3);
     * [`unionBy`](#unionby)
     * [`unionWith`](#unionwith)
     * [`uniqueElements`](#uniqueelements)
    +* [`unzip`](#unzip)
     * [`without`](#without)
     * [`zip`](#zip)
     * [`zipObject`](#zipobject)
    @@ -1966,6 +1967,36 @@ uniqueElements([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5]
     
    [⬆ Back to top](#table-of-contents) +### unzip + +Creates an array of arrays, ungrouping the elements in an array produced by [zip](#zip). + +Use `Math.max.apply()` to get the longest subarray in the array, `Array.map()` to make each element an array. +Use `Array.reduce()` and `Array.forEach()` to map grouped values to individual arrays. + +```js +const unzip = arr => + arr.reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ); +``` + +
    +Examples + +```js +unzip([['a', 1, true], ['b', 2, false]]); //[['a', 'b'], [1, 2], [true, false]] +unzip([['a', 1, true], ['b', 2]]); //[['a', 'b'], [1, 2], [true]] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### without Filters out the elements of an array, that have one of the specified values. diff --git a/docs/index.html b/docs/index.html index e54e5312d..5fd0d8992 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -371,6 +371,15 @@ Object.assig
     
    unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2, 1.5, 3, 0, 3.9]
     

    uniqueElements

    Returns all unique values of an array.

    Use ES6 Set and the ...rest operator to discard all duplicated values.

    const uniqueElements = arr => [...new Set(arr)];
     
    uniqueElements([1, 2, 2, 3, 4, 4, 5]); // [1,2,3,4,5]
    +

    unzip

    Creates an array of arrays, ungrouping the elements in an array produced by zip.

    Use Math.max.apply() to get the longest subarray in the array, Array.map() to make each element an array. Use Array.reduce() and Array.forEach() to map grouped values to individual arrays.

    const unzip = arr =>
    +  arr.reduce(
    +    (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
    +    Array.from({
    +      length: Math.max(...arr.map(x => x.length))
    +    }).map(x => [])
    +  );
    +
    unzip([['a', 1, true], ['b', 2, false]]); //[['a', 'b'], [1, 2], [true, false]]
    +unzip([['a', 1, true], ['b', 2]]); //[['a', 'b'], [1, 2], [true]]
     

    without

    Filters out the elements of an array, that have one of the specified values.

    Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

    (For a snippet that mutates the original array see pull)

    const without = (arr, ...args) => arr.filter(v => !args.includes(v));
     
    without([2, 1, 2, 3], 1, 2); // [3]
     

    zip

    Creates an array of elements, grouped based on the position in the original arrays.

    Use Math.max.apply() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found.

    const zip = (...arrays) => {
    diff --git a/snippets/unzip.md b/snippets/unzip.md
    index 9c01f9285..96503871e 100644
    --- a/snippets/unzip.md
    +++ b/snippets/unzip.md
    @@ -10,7 +10,7 @@ const unzip = arr =>
       arr.reduce(
         (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
         Array.from({
    -      length: Math.max(...arr.map(x => x.length)),
    +      length: Math.max(...arr.map(x => x.length))
         }).map(x => [])
       );
     ```
    
    From 165ad6b0944fedbb330065caa3679c491a7fa4ec Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 12:44:16 +0200
    Subject: [PATCH 048/103] Add unzipWith
    
    ---
     snippets/unzipWith.md | 23 +++++++++++++++++++++++
     tag_database          |  1 +
     2 files changed, 24 insertions(+)
     create mode 100644 snippets/unzipWith.md
    
    diff --git a/snippets/unzipWith.md b/snippets/unzipWith.md
    new file mode 100644
    index 000000000..75314d0b8
    --- /dev/null
    +++ b/snippets/unzipWith.md
    @@ -0,0 +1,23 @@
    +### unzipWith
    +
    +Creates an array of elements, ungrouping the elements in an array produced by [zip](#zip) and applying the provided function.
    +
    +Use `Math.max.apply()` to get the longest subarray in the array, `Array.map()` to make each element an array.
    +Use `Array.reduce()` and `Array.forEach()` to map grouped values to individual arrays.
    +Use `Array.map()` and the spread operator (`...`) to apply `fn` to each individual group of elements.
    +
    +```js
    +const unzipWith = (arr, fn) =>
    +  arr
    +    .reduce(
    +      (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
    +      Array.from({
    +        length: Math.max(...arr.map(x => x.length)),
    +      }).map(x => [])
    +    )
    +    .map(val => fn(...val));
    +```
    +
    +```js
    +unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)); // [3, 30, 300]
    +```
    diff --git a/tag_database b/tag_database
    index f774897cb..a4eac6748 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -224,6 +224,7 @@ unionWith:array,function
     uniqueElements:array
     untildify:node,string
     unzip:array
    +unzipWith:array,function,advanced
     URLJoin:string,utility,regexp
     UUIDGeneratorBrowser:browser,utility,random
     UUIDGeneratorNode:node,utility,random
    
    From 8284160fa986668ab12ecc7b49a6b95200824cbb Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 10:45:29 +0000
    Subject: [PATCH 049/103] Travis build: 1372
    
    ---
     README.md             | 33 +++++++++++++++++++++++++++++++++
     docs/index.html       | 12 +++++++++++-
     snippets/unzipWith.md |  2 +-
     3 files changed, 45 insertions(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index d5dd00baf..9e5bd5721 100644
    --- a/README.md
    +++ b/README.md
    @@ -146,6 +146,7 @@ average(1, 2, 3);
     * [`unionWith`](#unionwith)
     * [`uniqueElements`](#uniqueelements)
     * [`unzip`](#unzip)
    +* [`unzipWith`](#unzipwith-)
     * [`without`](#without)
     * [`zip`](#zip)
     * [`zipObject`](#zipobject)
    @@ -1997,6 +1998,38 @@ unzip([['a', 1, true], ['b', 2]]); //[['a', 'b'], [1, 2], [true]]
     
    [⬆ Back to top](#table-of-contents) +### unzipWith ![advanced](/advanced.svg) + +Creates an array of elements, ungrouping the elements in an array produced by [zip](#zip) and applying the provided function. + +Use `Math.max.apply()` to get the longest subarray in the array, `Array.map()` to make each element an array. +Use `Array.reduce()` and `Array.forEach()` to map grouped values to individual arrays. +Use `Array.map()` and the spread operator (`...`) to apply `fn` to each individual group of elements. + +```js +const unzipWith = (arr, fn) => + arr + .reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ) + .map(val => fn(...val)); +``` + +
    +Examples + +```js +unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)); // [3, 30, 300] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### without Filters out the elements of an array, that have one of the specified values. diff --git a/docs/index.html b/docs/index.html index 5fd0d8992..8180284a3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -380,6 +380,16 @@ Object.assig
       );
     
    unzip([['a', 1, true], ['b', 2, false]]); //[['a', 'b'], [1, 2], [true, false]]
     unzip([['a', 1, true], ['b', 2]]); //[['a', 'b'], [1, 2], [true]]
    +

    unzipWithadvanced

    Creates an array of elements, ungrouping the elements in an array produced by zip and applying the provided function.

    Use Math.max.apply() to get the longest subarray in the array, Array.map() to make each element an array. Use Array.reduce() and Array.forEach() to map grouped values to individual arrays. Use Array.map() and the spread operator (...) to apply fn to each individual group of elements.

    const unzipWith = (arr, fn) =>
    +  arr
    +    .reduce(
    +      (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
    +      Array.from({
    +        length: Math.max(...arr.map(x => x.length))
    +      }).map(x => [])
    +    )
    +    .map(val => fn(...val));
    +
    unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)); // [3, 30, 300]
     

    without

    Filters out the elements of an array, that have one of the specified values.

    Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

    (For a snippet that mutates the original array see pull)

    const without = (arr, ...args) => arr.filter(v => !args.includes(v));
     
    without([2, 1, 2, 3], 1, 2); // [3]
     

    zip

    Creates an array of elements, grouped based on the position in the original arrays.

    Use Math.max.apply() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found.

    const zip = (...arrays) => {
    diff --git a/snippets/unzipWith.md b/snippets/unzipWith.md
    index 75314d0b8..c474a2e84 100644
    --- a/snippets/unzipWith.md
    +++ b/snippets/unzipWith.md
    @@ -12,7 +12,7 @@ const unzipWith = (arr, fn) =>
         .reduce(
           (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc),
           Array.from({
    -        length: Math.max(...arr.map(x => x.length)),
    +        length: Math.max(...arr.map(x => x.length))
           }).map(x => [])
         )
         .map(val => fn(...val));
    
    From b4cf3b4b4e4cf454872f98be2757e979cfe9246d Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 12:53:18 +0200
    Subject: [PATCH 050/103] Add intersectionBy, intersectionWith
    
    ---
     snippets/intersectionBy.md   | 16 ++++++++++++++++
     snippets/intersectionWith.md | 14 ++++++++++++++
     tag_database                 |  2 ++
     3 files changed, 32 insertions(+)
     create mode 100644 snippets/intersectionBy.md
     create mode 100644 snippets/intersectionWith.md
    
    diff --git a/snippets/intersectionBy.md b/snippets/intersectionBy.md
    new file mode 100644
    index 000000000..3f28a78be
    --- /dev/null
    +++ b/snippets/intersectionBy.md
    @@ -0,0 +1,16 @@
    +### intersectionBy
    +
    +Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both.
    +
    +Create a `Set` by applying `fn` to all elements in `b`, then use `Array.filter()` on `a` to only keep elements, which produce values contained in `b` when `fn` is applied to them.
    +
    +```js
    +const intersectionBy = (a, b, fn) => {
    +  const s = new Set(b.map(x => fn(x)));
    +  return a.filter(x => s.has(fn(x)));
    +};
    +```
    +
    +```js
    +intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [2.1]
    +```
    diff --git a/snippets/intersectionWith.md b/snippets/intersectionWith.md
    new file mode 100644
    index 000000000..ae5483c47
    --- /dev/null
    +++ b/snippets/intersectionWith.md
    @@ -0,0 +1,14 @@
    +### intersectionWith
    +
    +Returns a list of elements that exist in both arrays, using a provided comparator function.
    +
    +Use `Array.filter()` and `Array.findIndex()` in combination with the provided comparator to determine intersecting values.
    +
    +```js
    +const intersectionWith = (a, b, comp) =>
    +  a.filter(x => b.findIndex(y => comp(x, y)) !== -1);
    +```
    +
    +```js
    +intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1.5, 3, 0]
    +```
    diff --git a/tag_database b/tag_database
    index a4eac6748..78f14816c 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -91,6 +91,8 @@ initializeArrayWithRangeRight:array,math
     initializeArrayWithValues:array,math
     inRange:math
     intersection:array,math
    +intersectionBy:array,function
    +intersectionWith:array,function
     invertKeyValues:object,function
     is:type,array,regexp
     isAbsoluteURL:string,utility,browser,url
    
    From 929c07aabe089c637ca6b0d446f4f059fe52da01 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 10:54:56 +0000
    Subject: [PATCH 051/103] Travis build: 1374
    
    ---
     README.md                    | 49 ++++++++++++++++++++++++++++++++++++
     docs/index.html              |  9 ++++++-
     snippets/intersectionWith.md |  3 +--
     3 files changed, 58 insertions(+), 3 deletions(-)
    
    diff --git a/README.md b/README.md
    index 9e5bd5721..078ad19d4 100644
    --- a/README.md
    +++ b/README.md
    @@ -116,6 +116,8 @@ average(1, 2, 3);
     * [`initializeArrayWithRangeRight`](#initializearraywithrangeright)
     * [`initializeArrayWithValues`](#initializearraywithvalues)
     * [`intersection`](#intersection)
    +* [`intersectionBy`](#intersectionby)
    +* [`intersectionWith`](#intersectionwith)
     * [`isSorted`](#issorted)
     * [`join`](#join)
     * [`last`](#last)
    @@ -1179,6 +1181,53 @@ intersection([1, 2, 3], [4, 3, 2]); // [2,3]
     
    [⬆ Back to top](#table-of-contents) +### intersectionBy + +Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both. + +Create a `Set` by applying `fn` to all elements in `b`, then use `Array.filter()` on `a` to only keep elements, which produce values contained in `b` when `fn` is applied to them. + +```js +const intersectionBy = (a, b, fn) => { + const s = new Set(b.map(x => fn(x))); + return a.filter(x => s.has(fn(x))); +}; +``` + +
    +Examples + +```js +intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [2.1] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### intersectionWith + +Returns a list of elements that exist in both arrays, using a provided comparator function. + +Use `Array.filter()` and `Array.findIndex()` in combination with the provided comparator to determine intersecting values. + +```js +const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1); +``` + +
    +Examples + +```js +intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1.5, 3, 0] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### isSorted Returns `1` if the array is sorted in ascending order, `-1` if it is sorted in descending order or `0` if it is not sorted. diff --git a/docs/index.html b/docs/index.html index 8180284a3..e44691aac 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -187,6 +187,13 @@ Object.assig
       return a.filter(x => s.has(x));
     };
     
    intersection([1, 2, 3], [4, 3, 2]); // [2,3]
    +

    intersectionBy

    Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both.

    Create a Set by applying fn to all elements in b, then use Array.filter() on a to only keep elements, which produce values contained in b when fn is applied to them.

    const intersectionBy = (a, b, fn) => {
    +  const s = new Set(b.map(x => fn(x)));
    +  return a.filter(x => s.has(fn(x)));
    +};
    +
    intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [2.1]
    +

    intersectionWith

    Returns a list of elements that exist in both arrays, using a provided comparator function.

    Use Array.filter() and Array.findIndex() in combination with the provided comparator to determine intersecting values.

    const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1);
    +
    intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1.5, 3, 0]
     

    isSorted

    Returns 1 if the array is sorted in ascending order, -1 if it is sorted in descending order or 0 if it is not sorted.

    Calculate the ordering direction for the first two elements. Use Object.entries() to loop over array objects and compare them in pairs. Return 0 if the direction changes or the direction if the last element is reached.

    const isSorted = arr => {
       const direction = arr[0] > arr[1] ? -1 : 1;
       for (let [i, val] of arr.entries())
    diff --git a/snippets/intersectionWith.md b/snippets/intersectionWith.md
    index ae5483c47..4aa7e0874 100644
    --- a/snippets/intersectionWith.md
    +++ b/snippets/intersectionWith.md
    @@ -5,8 +5,7 @@ Returns a list of elements that exist in both arrays, using a provided comparato
     Use `Array.filter()` and `Array.findIndex()` in combination with the provided comparator to determine intersecting values.
     
     ```js
    -const intersectionWith = (a, b, comp) =>
    -  a.filter(x => b.findIndex(y => comp(x, y)) !== -1);
    +const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1);
     ```
     
     ```js
    
    From ffe73704cd3a755617d276fbc9d6006ab08f93ec Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 13:01:51 +0200
    Subject: [PATCH 052/103] Add findLastIndex, update findLast
    
    ---
     snippets/findLastIndex.md | 18 ++++++++++++++++++
     1 file changed, 18 insertions(+)
     create mode 100644 snippets/findLastIndex.md
    
    diff --git a/snippets/findLastIndex.md b/snippets/findLastIndex.md
    new file mode 100644
    index 000000000..70dccd442
    --- /dev/null
    +++ b/snippets/findLastIndex.md
    @@ -0,0 +1,18 @@
    +### findLastIndex
    +
    +Returns the index of the last element for which the provided function returns a truthy value.
    +
    +Use `Array.map()` to map each element to an array with its index and value.
    +Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.slice(-1)` to get the last one.
    +
    +```js
    +const findLastIndex = (arr, fn) =>
    +  arr
    +    .map((val, i) => [i, val])
    +    .filter(val => fn(val[1], val[0], arr))
    +    .slice(-1)[0][0];
    +```
    +
    +```js
    +findLastIndex([1, 2, 3, 4], n => n % 2 === 1); // 2 (index of the value 3)
    +```
    
    From 85cbc34bc4eaa7acc6d3af67022b5c30de2fb383 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 13:02:07 +0200
    Subject: [PATCH 053/103] Add findLastIndex, update findLast
    
    ---
     snippets/findLast.md | 2 +-
     tag_database         | 1 +
     2 files changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/snippets/findLast.md b/snippets/findLast.md
    index 901920049..00263354a 100644
    --- a/snippets/findLast.md
    +++ b/snippets/findLast.md
    @@ -5,7 +5,7 @@ Returns the last element for which the provided function returns a truthy value.
     Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.slice(-1)` to get the last one.
     
     ```js
    -const findLast = (arr, fn) => arr.filter(fn).slice(-1);
    +const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0];
     ```
     
     ```js
    diff --git a/tag_database b/tag_database
    index 78f14816c..b54055999 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -53,6 +53,7 @@ fibonacci:math,array
     filterNonUnique:array
     findKey:object,function
     findLast:array
    +findLastIndex:array,function
     findLastKey:object,function
     flatten:array
     flip:adapter,function
    
    From 2d78e9799e426001be3d3e00898b87b5456aef55 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 11:03:27 +0000
    Subject: [PATCH 054/103] Travis build: 1376
    
    ---
     README.md       | 30 +++++++++++++++++++++++++++++-
     docs/index.html | 10 ++++++++--
     2 files changed, 37 insertions(+), 3 deletions(-)
    
    diff --git a/README.md b/README.md
    index 078ad19d4..d67863f68 100644
    --- a/README.md
    +++ b/README.md
    @@ -105,6 +105,7 @@ average(1, 2, 3);
     * [`everyNth`](#everynth)
     * [`filterNonUnique`](#filternonunique)
     * [`findLast`](#findlast)
    +* [`findLastIndex`](#findlastindex)
     * [`flatten`](#flatten)
     * [`forEachRight`](#foreachright)
     * [`groupBy`](#groupby)
    @@ -884,7 +885,7 @@ Returns the last element for which the provided function returns a truthy value.
     Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.slice(-1)` to get the last one.
     
     ```js
    -const findLast = (arr, fn) => arr.filter(fn).slice(-1);
    +const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0];
     ```
     
     
    @@ -899,6 +900,33 @@ findLast([1, 2, 3, 4], n => n % 2 === 1); // 3
    [⬆ Back to top](#table-of-contents) +### findLastIndex + +Returns the index of the last element for which the provided function returns a truthy value. + +Use `Array.map()` to map each element to an array with its index and value. +Use `Array.filter()` to remove elements for which `fn` returns falsey values, `Array.slice(-1)` to get the last one. + +```js +const findLastIndex = (arr, fn) => + arr + .map((val, i) => [i, val]) + .filter(val => fn(val[1], val[0], arr)) + .slice(-1)[0][0]; +``` + +
    +Examples + +```js +findLastIndex([1, 2, 3, 4], n => n % 2 === 1); // 2 (index of the value 3) +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### flatten Flattens an array up to the specified depth. diff --git a/docs/index.html b/docs/index.html index e44691aac..213aae959 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -133,8 +133,14 @@ Object.assig
     
    everyNth([1, 2, 3, 4, 5, 6], 2); // [ 2, 4, 6 ]
     

    filterNonUnique

    Filters out the non-unique values in an array.

    Use Array.filter() for an array containing only the unique values.

    const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i));
     
    filterNonUnique([1, 2, 2, 3, 4, 4, 5]); // [1,3,5]
    -

    findLast

    Returns the last element for which the provided function returns a truthy value.

    Use Array.filter() to remove elements for which fn returns falsey values, Array.slice(-1) to get the last one.

    const findLast = (arr, fn) => arr.filter(fn).slice(-1);
    +

    findLast

    Returns the last element for which the provided function returns a truthy value.

    Use Array.filter() to remove elements for which fn returns falsey values, Array.slice(-1) to get the last one.

    const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0];
     
    findLast([1, 2, 3, 4], n => n % 2 === 1); // 3
    +

    findLastIndex

    Returns the index of the last element for which the provided function returns a truthy value.

    Use Array.map() to map each element to an array with its index and value. Use Array.filter() to remove elements for which fn returns falsey values, Array.slice(-1) to get the last one.

    const findLastIndex = (arr, fn) =>
    +  arr
    +    .map((val, i) => [i, val])
    +    .filter(val => fn(val[1], val[0], arr))
    +    .slice(-1)[0][0];
    +
    findLastIndex([1, 2, 3, 4], n => n % 2 === 1); // 2 (index of the value 3)
     

    flatten

    Flattens an array up to the specified depth.

    Use recursion, decrementing depth by 1 for each level of depth. Use Array.reduce() and Array.concat() to merge elements or arrays. Base case, for depth equal to 1 stops recursion. Omit the second argument, depth to flatten only to a depth of 1 (single flatten).

    const flatten = (arr, depth = 1) =>
       depth != 1
         ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), [])
    
    From 565243bfb552628681a5a81ee9178eb5af56e99f Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 13:16:47 +0200
    Subject: [PATCH 055/103] Add sortedLastIndex
    
    ---
     snippets/sortedLastIndex.md | 22 ++++++++++++++++++++++
     tag_database                |  1 +
     2 files changed, 23 insertions(+)
     create mode 100644 snippets/sortedLastIndex.md
    
    diff --git a/snippets/sortedLastIndex.md b/snippets/sortedLastIndex.md
    new file mode 100644
    index 000000000..ca6e327ba
    --- /dev/null
    +++ b/snippets/sortedLastIndex.md
    @@ -0,0 +1,22 @@
    +### sortedLastIndex
    +
    +Returns the highest index at which value should be inserted into array in order to maintain its sort order.
    +
    +Check if the array is sorted in descending order (loosely).
    +Use `Array.map()` to map each element to an array with its index and value.
    +Use `Array.filter()` to find all possible positions where the element could be inserted, `Array.slice(-1)` to get the last one.
    +
    +```js
    +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;
    +};
    +```
    +
    +```js
    +sortedLastIndex([10, 20, 30, 30, 40], 30); // 3
    +```
    diff --git a/tag_database b/tag_database
    index b54055999..32328d8a5 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -196,6 +196,7 @@ size:object,array,string
     sleep:function,promise
     sortCharactersInString:string
     sortedIndex:array,math
    +sortedLastIndex:array,math
     splitLines:string
     spreadOver:adapter
     standardDeviation:math,array
    
    From 317d4b4220d8e30660eb7c16a2c916ce40a7183c Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 11:18:36 +0000
    Subject: [PATCH 056/103] Travis build: 1378
    
    ---
     README.md       | 32 ++++++++++++++++++++++++++++++++
     docs/index.html | 11 ++++++++++-
     2 files changed, 42 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index d67863f68..c0e57d210 100644
    --- a/README.md
    +++ b/README.md
    @@ -138,6 +138,7 @@ average(1, 2, 3);
     * [`shuffle`](#shuffle)
     * [`similarity`](#similarity)
     * [`sortedIndex`](#sortedindex)
    +* [`sortedLastIndex`](#sortedlastindex)
     * [`symmetricDifference`](#symmetricdifference)
     * [`symmetricDifferenceBy`](#symmetricdifferenceby)
     * [`symmetricDifferenceWith`](#symmetricdifferencewith)
    @@ -1801,6 +1802,37 @@ sortedIndex([30, 50], 40); // 1
     
    [⬆ Back to top](#table-of-contents) +### sortedLastIndex + +Returns the highest index at which value should be inserted into array in order to maintain its sort order. + +Check if the array is sorted in descending order (loosely). +Use `Array.map()` to map each element to an array with its index and value. +Use `Array.filter()` to find all possible positions where the element could be inserted, `Array.slice(-1)` to get the last one. + +```js +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; +}; +``` + +
    +Examples + +```js +sortedLastIndex([10, 20, 30, 30, 40], 30); // 3 +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### symmetricDifference Returns the symmetric difference between two arrays. diff --git a/docs/index.html b/docs/index.html index 213aae959..f4b41a2a5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -342,6 +342,15 @@ Object.assig
     };
     
    sortedIndex([5, 3, 2, 1], 4); // 1
     sortedIndex([30, 50], 40); // 1
    +

    sortedLastIndex

    Returns the highest index at which value should be inserted into array in order to maintain its sort order.

    Check if the array is sorted in descending order (loosely). Use Array.map() to map each element to an array with its index and value. Use Array.filter() to find all possible positions where the element could be inserted, Array.slice(-1) to get the last one.

    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;
    +};
    +
    sortedLastIndex([10, 20, 30, 30, 40], 30); // 3
     

    symmetricDifference

    Returns the symmetric difference between two arrays.

    Create a Set from each array, then use Array.filter() on each of them to only keep values not contained in the other.

    const symmetricDifference = (a, b) => {
       const sA = new Set(a),
         sB = new Set(b);
    
    From 7f2297496a70187c23a22d8f98513ca634b25fcb Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 13:22:32 +0200
    Subject: [PATCH 057/103] Add unary
    
    ---
     snippets/unary.md | 13 +++++++++++++
     tag_database      |  1 +
     2 files changed, 14 insertions(+)
     create mode 100644 snippets/unary.md
    
    diff --git a/snippets/unary.md b/snippets/unary.md
    new file mode 100644
    index 000000000..51fa353cc
    --- /dev/null
    +++ b/snippets/unary.md
    @@ -0,0 +1,13 @@
    +### unary
    +
    +Creates a function that accepts up to one argument, ignoring any additional arguments.
    +
    +Call the provided function, `fn`, with just the first argument given.
    +
    +```js
    +const unary = fn => val => fn(val);
    +```
    +
    +```js
    +['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
    +```
    diff --git a/tag_database b/tag_database
    index 32328d8a5..e942ec1e5 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -221,6 +221,7 @@ toSnakeCase:string,regexp
     transform:object,array
     truncateString:string
     truthCheckCollection:object,logic,array
    +unary:adaptor,function
     unescapeHTML:string,browser
     union:array,math
     unionBy:array,function
    
    From 5a5f2ccee0d55220edd910e7493ffac4451c8d39 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 11:23:46 +0000
    Subject: [PATCH 058/103] Travis build: 1380
    
    ---
     README.md       | 33 +++++++++++++++++++++++++++++++++
     docs/index.html |  4 +++-
     2 files changed, 36 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index c0e57d210..6adbe5366 100644
    --- a/README.md
    +++ b/README.md
    @@ -87,6 +87,15 @@ average(1, 2, 3);
     
     
    +### Adaptor + +
    +View contents + +* [`unary`](#unary) + +
    + ### 📚 Array
    @@ -586,6 +595,30 @@ arrayMax([1, 2, 3]); // 3
    [⬆ Back to top](#table-of-contents) +--- + ## Adaptor + +### unary + +Creates a function that accepts up to one argument, ignoring any additional arguments. + +Call the provided function, `fn`, with just the first argument given. + +```js +const unary = fn => val => fn(val); +``` + +
    +Examples + +```js +['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + --- ## 📚 Array diff --git a/docs/index.html b/docs/index.html index f4b41a2a5..a621c02f4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -89,6 +89,8 @@ Object.assig
     

    spreadOver

    Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.

    Use closures and the spread operator (...) to map the array of arguments to the inputs of the function.

    const spreadOver = fn => argsArr => fn(...argsArr);
     
    const arrayMax = spreadOver(Math.max);
     arrayMax([1, 2, 3]); // 3
    +

    Adaptor

    unary

    Creates a function that accepts up to one argument, ignoring any additional arguments.

    Call the provided function, fn, with just the first argument given.

    const unary = fn => val => fn(val);
    +
    ['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
     

    Array

    chunk

    Chunks an array into smaller arrays of a specified size.

    Use Array.from() to create a new array, that fits the number of chunks that will be produced. Use Array.slice() to map each element of the new array to a chunk the length of size. If the original array can't be split evenly, the final chunk will contain the remaining elements.

    const chunk = (arr, size) =>
       Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
         arr.slice(i * size, i * size + size)
    
    From d835cf4b40bda5f44845fbc584c4adc38d20bae7 Mon Sep 17 00:00:00 2001
    From: King 
    Date: Wed, 24 Jan 2018 06:24:33 -0500
    Subject: [PATCH 059/103] fix crlf / cr / lf system file ending
    
    ---
     scripts/tdd.js | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/scripts/tdd.js b/scripts/tdd.js
    index bba8e57fd..c51226daf 100644
    --- a/scripts/tdd.js
    +++ b/scripts/tdd.js
    @@ -61,7 +61,7 @@ snippetFiles
                                 .filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]);
     
         // Export template for snippetName.js
    -    const exportFile = `${fileFunction.join('\n')}\n module.exports = ${fileName}`;
    +    const exportFile = `${fileFunction.join('\n')}\nmodule.exports = ${fileName}`.trim();
     
         // Export template for snippetName.test.js which generates a example test & other information
         const exportTest = [
    
    From 737acd870d3498cbd8a271379e9a2bd24e6a980b Mon Sep 17 00:00:00 2001
    From: King 
    Date: Wed, 24 Jan 2018 06:29:38 -0500
    Subject: [PATCH 060/103] ran npm run tester -> logged invertKeyValues test are
     invalid
    
    ---
     test/JSONToDate/JSONToDate.js                 |    2 +-
     test/JSONToFile/JSONToFile.js                 |    2 +-
     test/RGBToHex/RGBToHex.js                     |    2 +-
     test/URLJoin/URLJoin.js                       |    2 +-
     .../UUIDGeneratorBrowser.js                   |    2 +-
     test/UUIDGeneratorNode/UUIDGeneratorNode.js   |    2 +-
     test/anagrams/anagrams.js                     |    2 +-
     test/arrayToHtmlList/arrayToHtmlList.js       |    2 +-
     test/atob/atob.js                             |    2 +-
     test/average/average.js                       |    2 +-
     test/averageBy/averageBy.js                   |    2 +-
     test/binarySearch/binarySearch.js             |    2 +-
     test/bottomVisible/bottomVisible.js           |    2 +-
     test/btoa/btoa.js                             |    2 +-
     test/byteSize/byteSize.js                     |    2 +-
     test/call/call.js                             |    2 +-
     test/capitalize/capitalize.js                 |    2 +-
     .../capitalizeEveryWord.js                    |    2 +-
     test/castArray/castArray.js                   |    2 +-
     test/chainAsync/chainAsync.js                 |    2 +-
     test/chunk/chunk.js                           |    2 +-
     test/clampNumber/clampNumber.js               |    2 +-
     test/cleanObj/cleanObj.js                     |    2 +-
     test/cloneRegExp/cloneRegExp.js               |    2 +-
     test/coalesce/coalesce.js                     |    2 +-
     test/coalesceFactory/coalesceFactory.js       |    2 +-
     test/collatz/collatz.js                       |    2 +-
     test/collectInto/collectInto.js               |    2 +-
     test/colorize/colorize.js                     |    2 +-
     test/compact/compact.js                       |    2 +-
     test/compose/compose.js                       |    2 +-
     test/composeRight/composeRight.js             |    2 +
     test/composeRight/composeRight.test.js        |   13 +
     test/copyToClipboard/copyToClipboard.js       |    2 +-
     test/countBy/countBy.js                       |    2 +-
     test/countOccurrences/countOccurrences.js     |    2 +-
     test/countVowels/countVowels.js               |    2 +-
     test/createElement/createElement.js           |    2 +-
     test/createEventHub/createEventHub.js         |    2 +-
     test/currentURL/currentURL.js                 |    2 +-
     test/curry/curry.js                           |    2 +-
     test/decapitalize/decapitalize.js             |    2 +-
     test/deepClone/deepClone.js                   |    2 +-
     test/deepFlatten/deepFlatten.js               |    2 +-
     test/defaults/defaults.js                     |    2 +-
     test/defer/defer.js                           |    2 +-
     test/detectDeviceType/detectDeviceType.js     |    2 +-
     test/difference/difference.js                 |    2 +-
     test/differenceBy/differenceBy.js             |    5 +
     test/differenceBy/differenceBy.test.js        |   13 +
     test/differenceWith/differenceWith.js         |    2 +-
     test/digitize/digitize.js                     |    2 +-
     test/distance/distance.js                     |    2 +-
     test/dropElements/dropElements.js             |    2 +-
     test/dropRight/dropRight.js                   |    2 +-
     .../elementIsVisibleInViewport.js             |    2 +-
     test/elo/elo.js                               |    2 +-
     test/equals/equals.js                         |    2 +-
     test/escapeHTML/escapeHTML.js                 |    2 +-
     test/escapeRegExp/escapeRegExp.js             |    2 +-
     test/everyNth/everyNth.js                     |    2 +-
     test/extendHex/extendHex.js                   |    2 +-
     test/factorial/factorial.js                   |    2 +-
     test/factors/factors.js                       |    2 +-
     test/fibonacci/fibonacci.js                   |    2 +-
     .../fibonacciCountUntilNum.js                 |    2 +-
     test/fibonacciUntilNum/fibonacciUntilNum.js   |    2 +-
     test/filterNonUnique/filterNonUnique.js       |    2 +-
     test/findKey/findKey.js                       |    2 +-
     test/findLast/findLast.js                     |    4 +-
     test/findLastIndex/findLastIndex.js           |    6 +
     test/findLastIndex/findLastIndex.test.js      |   13 +
     test/findLastKey/findLastKey.js               |    2 +-
     test/flatten/flatten.js                       |    2 +-
     test/flip/flip.js                             |    2 +-
     test/forEachRight/forEachRight.js             |    2 +-
     test/forOwn/forOwn.js                         |    2 +-
     test/forOwnRight/forOwnRight.js               |    2 +-
     test/formatDuration/formatDuration.js         |    2 +-
     test/fromCamelCase/fromCamelCase.js           |    2 +-
     test/functionName/functionName.js             |    2 +-
     test/functions/functions.js                   |    2 +-
     test/gcd/gcd.js                               |    2 +-
     .../geometricProgression.js                   |    2 +-
     test/get/get.js                               |    2 +-
     .../getDaysDiffBetweenDates.js                |    2 +-
     test/getScrollPosition/getScrollPosition.js   |    2 +-
     test/getStyle/getStyle.js                     |    2 +-
     test/getType/getType.js                       |    2 +-
     test/getURLParameters/getURLParameters.js     |    2 +-
     test/groupBy/groupBy.js                       |    2 +-
     test/hammingDistance/hammingDistance.js       |    2 +-
     test/hasClass/hasClass.js                     |    2 +-
     test/hasFlags/hasFlags.js                     |    2 +-
     test/hashBrowser/hashBrowser.js               |    2 +-
     test/hashNode/hashNode.js                     |    2 +-
     test/head/head.js                             |    2 +-
     test/hexToRGB/hexToRGB.js                     |    2 +-
     test/hide/hide.js                             |    2 +-
     test/howManyTimes/howManyTimes.js             |    2 +-
     test/httpDelete/httpDelete.js                 |    2 +-
     test/httpGet/httpGet.js                       |    2 +-
     test/httpPost/httpPost.js                     |    2 +-
     test/httpPut/httpPut.js                       |    2 +-
     test/httpsRedirect/httpsRedirect.js           |    2 +-
     test/inRange/inRange.js                       |    2 +-
     test/indexOfAll/indexOfAll.js                 |    2 +-
     test/initial/initial.js                       |    2 +-
     test/initialize2DArray/initialize2DArray.js   |    2 +-
     .../initializeArrayWithRange.js               |    2 +-
     .../initializeArrayWithRangeRight.js          |    2 +-
     .../initializeArrayWithValues.js              |    2 +-
     test/intersection/intersection.js             |    2 +-
     test/intersectionBy/intersectionBy.js         |    5 +
     test/intersectionBy/intersectionBy.test.js    |   13 +
     test/intersectionWith/intersectionWith.js     |    2 +
     .../intersectionWith/intersectionWith.test.js |   13 +
     test/invertKeyValues/invertKeyValues.js       |    2 +-
     test/is/is.js                                 |    2 +-
     test/isAbsoluteURL/isAbsoluteURL.js           |    2 +-
     test/isArmstrongNumber/isArmstrongNumber.js   |    2 +-
     test/isArrayLike/isArrayLike.js               |    2 +-
     test/isBoolean/isBoolean.js                   |    2 +-
     test/isDivisible/isDivisible.js               |    2 +-
     test/isEmpty/isEmpty.js                       |    2 +-
     test/isEven/isEven.js                         |    2 +-
     test/isFunction/isFunction.js                 |    2 +-
     test/isLowerCase/isLowerCase.js               |    2 +-
     test/isNil/isNil.js                           |    2 +-
     test/isNull/isNull.js                         |    2 +-
     test/isNumber/isNumber.js                     |    2 +-
     test/isObject/isObject.js                     |    2 +-
     test/isObjectLike/isObjectLike.js             |    2 +-
     test/isPlainObject/isPlainObject.js           |    2 +-
     test/isPrime/isPrime.js                       |    2 +-
     test/isPrimitive/isPrimitive.js               |    2 +-
     test/isPromiseLike/isPromiseLike.js           |    2 +-
     test/isSorted/isSorted.js                     |    2 +-
     test/isString/isString.js                     |    2 +-
     test/isSymbol/isSymbol.js                     |    2 +-
     test/isTravisCI/isTravisCI.js                 |    2 +-
     test/isUndefined/isUndefined.js               |    2 +-
     test/isUpperCase/isUpperCase.js               |    2 +-
     test/isValidJSON/isValidJSON.js               |    2 +-
     test/join/join.js                             |    2 +-
     test/last/last.js                             |    2 +-
     test/lcm/lcm.js                               |    2 +-
     test/longestItem/longestItem.js               |    2 +-
     test/lowercaseKeys/lowercaseKeys.js           |    2 +-
     test/luhnCheck/luhnCheck.js                   |    2 +-
     test/mapKeys/mapKeys.js                       |    2 +-
     test/mapObject/mapObject.js                   |    2 +-
     test/mapValues/mapValues.js                   |    2 +-
     test/mask/mask.js                             |    2 +-
     test/matches/matches.js                       |    2 +-
     test/matchesWith/matchesWith.js               |    2 +-
     test/maxBy/maxBy.js                           |    2 +-
     test/maxN/maxN.js                             |    2 +-
     test/median/median.js                         |    2 +-
     test/memoize/memoize.js                       |    2 +-
     test/merge/merge.js                           |    2 +-
     test/minBy/minBy.js                           |    2 +-
     test/minN/minN.js                             |    2 +-
     test/negate/negate.js                         |    2 +-
     test/nthArg/nthArg.js                         |    2 +-
     test/nthElement/nthElement.js                 |    2 +-
     test/objectFromPairs/objectFromPairs.js       |    2 +-
     test/objectToPairs/objectToPairs.js           |    2 +-
     test/observeMutations/observeMutations.js     |    2 +-
     test/off/off.js                               |    2 +-
     test/omit/omit.js                             |    2 +-
     test/omitBy/omitBy.js                         |    2 +-
     test/on/on.js                                 |    2 +-
     test/onUserInputChange/onUserInputChange.js   |    2 +-
     test/once/once.js                             |    2 +-
     test/orderBy/orderBy.js                       |    2 +-
     test/over/over.js                             |    2 +-
     test/palindrome/palindrome.js                 |    2 +-
     test/parseCookie/parseCookie.js               |    2 +-
     test/partition/partition.js                   |    2 +-
     test/percentile/percentile.js                 |    2 +-
     test/pick/pick.js                             |    2 +-
     test/pickBy/pickBy.js                         |    2 +-
     test/pipeFunctions/pipeFunctions.js           |    2 +-
     test/pluralize/pluralize.js                   |    2 +-
     test/powerset/powerset.js                     |    2 +-
     test/prettyBytes/prettyBytes.js               |    2 +-
     test/primes/primes.js                         |    2 +-
     test/promisify/promisify.js                   |    2 +-
     test/pull/pull.js                             |    2 +-
     test/pullAtIndex/pullAtIndex.js               |    2 +-
     test/pullAtValue/pullAtValue.js               |    2 +-
     test/quickSort/quickSort.js                   |    2 +-
     test/randomHexColorCode/randomHexColorCode.js |    2 +-
     .../randomIntArrayInRange.js                  |    2 +-
     .../randomIntegerInRange.js                   |    2 +-
     .../randomNumberInRange.js                    |    2 +-
     test/readFileLines/readFileLines.js           |    2 +-
     test/redirect/redirect.js                     |    2 +-
     test/reducedFilter/reducedFilter.js           |    2 +-
     test/remove/remove.js                         |    2 +-
     test/removeVowels/removeVowels.js             |    2 +-
     test/reverseString/reverseString.js           |    2 +-
     test/round/round.js                           |    2 +-
     test/runAsync/runAsync.js                     |    2 +-
     .../runPromisesInSeries.js                    |    2 +-
     test/sample/sample.js                         |    2 +-
     test/sampleSize/sampleSize.js                 |    2 +-
     test/scrollToTop/scrollToTop.js               |    2 +-
     test/sdbm/sdbm.js                             |    2 +-
     test/serializeCookie/serializeCookie.js       |    2 +-
     test/setStyle/setStyle.js                     |    2 +-
     test/shallowClone/shallowClone.js             |    2 +-
     test/show/show.js                             |    2 +-
     test/shuffle/shuffle.js                       |    2 +-
     test/similarity/similarity.js                 |    2 +-
     test/size/size.js                             |    2 +-
     test/sleep/sleep.js                           |    2 +-
     test/solveRPN/solveRPN.js                     |    2 +-
     .../sortCharactersInString.js                 |    2 +-
     test/sortedIndex/sortedIndex.js               |    2 +-
     test/sortedLastIndex/sortedLastIndex.js       |    9 +
     test/sortedLastIndex/sortedLastIndex.test.js  |   13 +
     test/speechSynthesis/speechSynthesis.js       |    2 +-
     test/splitLines/splitLines.js                 |    2 +-
     test/spreadOver/spreadOver.js                 |    2 +-
     test/standardDeviation/standardDeviation.js   |    2 +-
     test/sum/sum.js                               |    2 +-
     test/sumBy/sumBy.js                           |    2 +-
     test/sumPower/sumPower.js                     |    2 +-
     .../symmetricDifference.js                    |    2 +-
     .../symmetricDifferenceBy.js                  |    6 +
     .../symmetricDifferenceBy.test.js             |   13 +
     .../symmetricDifferenceWith.js                |    5 +
     .../symmetricDifferenceWith.test.js           |   13 +
     test/tail/tail.js                             |    2 +-
     test/take/take.js                             |    2 +-
     test/takeRight/takeRight.js                   |    2 +-
     test/testlog                                  | 1299 +++++++++--------
     test/timeTaken/timeTaken.js                   |    2 +-
     test/toCamelCase/toCamelCase.js               |    2 +-
     test/toDecimalMark/toDecimalMark.js           |    2 +-
     test/toKebabCase/toKebabCase.js               |    2 +-
     test/toOrdinalSuffix/toOrdinalSuffix.js       |    2 +-
     test/toSafeInteger/toSafeInteger.js           |    2 +-
     test/toSnakeCase/toSnakeCase.js               |    2 +-
     test/toggleClass/toggleClass.js               |    2 +-
     test/tomorrow/tomorrow.js                     |    2 +-
     test/transform/transform.js                   |    2 +-
     test/truncateString/truncateString.js         |    2 +-
     .../truthCheckCollection.js                   |    2 +-
     test/unescapeHTML/unescapeHTML.js             |    2 +-
     test/union/union.js                           |    2 +-
     test/unionBy/unionBy.js                       |    5 +
     test/unionBy/unionBy.test.js                  |   13 +
     test/unionWith/unionWith.js                   |    3 +
     test/unionWith/unionWith.test.js              |   13 +
     test/uniqueElements/uniqueElements.js         |    2 +-
     test/untildify/untildify.js                   |    2 +-
     test/unzip/unzip.js                           |    8 +
     test/unzip/unzip.test.js                      |   13 +
     test/unzipWith/unzipWith.js                   |   10 +
     test/unzipWith/unzipWith.test.js              |   13 +
     test/validateNumber/validateNumber.js         |    2 +-
     test/without/without.js                       |    2 +-
     test/words/words.js                           |    2 +-
     test/yesNo/yesNo.js                           |    2 +-
     test/zip/zip.js                               |    2 +-
     test/zipObject/zipObject.js                   |    2 +-
     test/zipWith/zipWith.js                       |    2 +-
     270 files changed, 1141 insertions(+), 872 deletions(-)
     create mode 100644 test/composeRight/composeRight.js
     create mode 100644 test/composeRight/composeRight.test.js
     create mode 100644 test/differenceBy/differenceBy.js
     create mode 100644 test/differenceBy/differenceBy.test.js
     create mode 100644 test/findLastIndex/findLastIndex.js
     create mode 100644 test/findLastIndex/findLastIndex.test.js
     create mode 100644 test/intersectionBy/intersectionBy.js
     create mode 100644 test/intersectionBy/intersectionBy.test.js
     create mode 100644 test/intersectionWith/intersectionWith.js
     create mode 100644 test/intersectionWith/intersectionWith.test.js
     create mode 100644 test/sortedLastIndex/sortedLastIndex.js
     create mode 100644 test/sortedLastIndex/sortedLastIndex.test.js
     create mode 100644 test/symmetricDifferenceBy/symmetricDifferenceBy.js
     create mode 100644 test/symmetricDifferenceBy/symmetricDifferenceBy.test.js
     create mode 100644 test/symmetricDifferenceWith/symmetricDifferenceWith.js
     create mode 100644 test/symmetricDifferenceWith/symmetricDifferenceWith.test.js
     create mode 100644 test/unionBy/unionBy.js
     create mode 100644 test/unionBy/unionBy.test.js
     create mode 100644 test/unionWith/unionWith.js
     create mode 100644 test/unionWith/unionWith.test.js
     create mode 100644 test/unzip/unzip.js
     create mode 100644 test/unzip/unzip.test.js
     create mode 100644 test/unzipWith/unzipWith.js
     create mode 100644 test/unzipWith/unzipWith.test.js
    
    diff --git a/test/JSONToDate/JSONToDate.js b/test/JSONToDate/JSONToDate.js
    index b22d17b2c..658c2f6fc 100644
    --- a/test/JSONToDate/JSONToDate.js
    +++ b/test/JSONToDate/JSONToDate.js
    @@ -2,4 +2,4 @@ const JSONToDate = arr => {
     const dt = new Date(parseInt(arr.toString().substr(6)));
     return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
     };
    - module.exports = JSONToDate
    \ No newline at end of file
    +module.exports = JSONToDate
    \ No newline at end of file
    diff --git a/test/JSONToFile/JSONToFile.js b/test/JSONToFile/JSONToFile.js
    index 695fd5ecd..450fe0d35 100644
    --- a/test/JSONToFile/JSONToFile.js
    +++ b/test/JSONToFile/JSONToFile.js
    @@ -1,4 +1,4 @@
     const fs = require('fs');
     const JSONToFile = (obj, filename) =>
     fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
    - module.exports = JSONToFile
    \ No newline at end of file
    +module.exports = JSONToFile
    \ No newline at end of file
    diff --git a/test/RGBToHex/RGBToHex.js b/test/RGBToHex/RGBToHex.js
    index 1caaf7cd4..4e84c450b 100644
    --- a/test/RGBToHex/RGBToHex.js
    +++ b/test/RGBToHex/RGBToHex.js
    @@ -1,2 +1,2 @@
     const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
    - module.exports = RGBToHex
    \ No newline at end of file
    +module.exports = RGBToHex
    \ No newline at end of file
    diff --git a/test/URLJoin/URLJoin.js b/test/URLJoin/URLJoin.js
    index 0ba1bad9a..ccff1cb75 100644
    --- a/test/URLJoin/URLJoin.js
    +++ b/test/URLJoin/URLJoin.js
    @@ -7,4 +7,4 @@ args
     .replace(/\/(\?|&|#[^!])/g, '$1')
     .replace(/\?/g, '&')
     .replace('&', '?');
    - module.exports = URLJoin
    \ No newline at end of file
    +module.exports = URLJoin
    \ No newline at end of file
    diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js
    index 78f421fef..bdd30d1f1 100644
    --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js
    +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js
    @@ -2,4 +2,4 @@ const UUIDGeneratorBrowser = () =>
     ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
     (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
     );
    - module.exports = UUIDGeneratorBrowser
    \ No newline at end of file
    +module.exports = UUIDGeneratorBrowser
    \ No newline at end of file
    diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.js
    index 956d887c3..46afbd090 100644
    --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.js
    +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.js
    @@ -3,4 +3,4 @@ const UUIDGeneratorNode = () =>
     ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
     (c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
     );
    - module.exports = UUIDGeneratorNode
    \ No newline at end of file
    +module.exports = UUIDGeneratorNode
    \ No newline at end of file
    diff --git a/test/anagrams/anagrams.js b/test/anagrams/anagrams.js
    index 2b31ca520..32a1b62ae 100644
    --- a/test/anagrams/anagrams.js
    +++ b/test/anagrams/anagrams.js
    @@ -8,4 +8,4 @@ acc.concat(anagrams(str.slice(0, i) + str.slice(i + 1)).map(val => letter + val)
     []
     );
     };
    - module.exports = anagrams
    \ No newline at end of file
    +module.exports = anagrams
    \ No newline at end of file
    diff --git a/test/arrayToHtmlList/arrayToHtmlList.js b/test/arrayToHtmlList/arrayToHtmlList.js
    index e85f273e7..ae6fed9c2 100644
    --- a/test/arrayToHtmlList/arrayToHtmlList.js
    +++ b/test/arrayToHtmlList/arrayToHtmlList.js
    @@ -1,3 +1,3 @@
     const arrayToHtmlList = (arr, listID) =>
     arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); - module.exports = arrayToHtmlList \ No newline at end of file +module.exports = arrayToHtmlList \ No newline at end of file diff --git a/test/atob/atob.js b/test/atob/atob.js index 74b526ccd..fc39b89f8 100644 --- a/test/atob/atob.js +++ b/test/atob/atob.js @@ -1,2 +1,2 @@ const atob = str => new Buffer(str, 'base64').toString('binary'); - module.exports = atob \ No newline at end of file +module.exports = atob \ No newline at end of file diff --git a/test/average/average.js b/test/average/average.js index 4f414ff98..57c11529f 100644 --- a/test/average/average.js +++ b/test/average/average.js @@ -1,2 +1,2 @@ const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length; - module.exports = average \ No newline at end of file +module.exports = average \ No newline at end of file diff --git a/test/averageBy/averageBy.js b/test/averageBy/averageBy.js index 5e8bb3a27..fc38bc749 100644 --- a/test/averageBy/averageBy.js +++ b/test/averageBy/averageBy.js @@ -1,4 +1,4 @@ const averageBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0) / arr.length; - module.exports = averageBy \ No newline at end of file +module.exports = averageBy \ No newline at end of file diff --git a/test/binarySearch/binarySearch.js b/test/binarySearch/binarySearch.js index b34d667bf..484a20638 100644 --- a/test/binarySearch/binarySearch.js +++ b/test/binarySearch/binarySearch.js @@ -5,4 +5,4 @@ if (arr[mid] > val) return binarySearch(arr, val, start, mid - 1); if (arr[mid] < val) return binarySearch(arr, val, mid + 1, end); return mid; } - module.exports = binarySearch \ No newline at end of file +module.exports = binarySearch \ No newline at end of file diff --git a/test/bottomVisible/bottomVisible.js b/test/bottomVisible/bottomVisible.js index abf32b046..68c5f357c 100644 --- a/test/bottomVisible/bottomVisible.js +++ b/test/bottomVisible/bottomVisible.js @@ -1,4 +1,4 @@ const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); - module.exports = bottomVisible \ No newline at end of file +module.exports = bottomVisible \ No newline at end of file diff --git a/test/btoa/btoa.js b/test/btoa/btoa.js index 4393d4d67..af14ade08 100644 --- a/test/btoa/btoa.js +++ b/test/btoa/btoa.js @@ -1,2 +1,2 @@ const btoa = str => new Buffer(str, 'binary').toString('base64'); - module.exports = btoa \ No newline at end of file +module.exports = btoa \ No newline at end of file diff --git a/test/byteSize/byteSize.js b/test/byteSize/byteSize.js index 74a857863..e9ef3735a 100644 --- a/test/byteSize/byteSize.js +++ b/test/byteSize/byteSize.js @@ -1,2 +1,2 @@ const byteSize = str => new Blob([str]).size; - module.exports = byteSize \ No newline at end of file +module.exports = byteSize \ No newline at end of file diff --git a/test/call/call.js b/test/call/call.js index 660de98a8..bcb7f341b 100644 --- a/test/call/call.js +++ b/test/call/call.js @@ -1,2 +1,2 @@ const call = (key, ...args) => context => context[key](...args); - module.exports = call \ No newline at end of file +module.exports = call \ No newline at end of file diff --git a/test/capitalize/capitalize.js b/test/capitalize/capitalize.js index edd95c811..bc1710773 100644 --- a/test/capitalize/capitalize.js +++ b/test/capitalize/capitalize.js @@ -1,3 +1,3 @@ const capitalize = ([first, ...rest], lowerRest = false) => first.toUpperCase() + (lowerRest ? rest.join('').toLowerCase() : rest.join('')); - module.exports = capitalize \ No newline at end of file +module.exports = capitalize \ No newline at end of file diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.js b/test/capitalizeEveryWord/capitalizeEveryWord.js index 2bec22dcf..28a8f6d0b 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.js @@ -1,2 +1,2 @@ const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperCase()); - module.exports = capitalizeEveryWord \ No newline at end of file +module.exports = capitalizeEveryWord \ No newline at end of file diff --git a/test/castArray/castArray.js b/test/castArray/castArray.js index 83816cde7..963203b1f 100644 --- a/test/castArray/castArray.js +++ b/test/castArray/castArray.js @@ -1,2 +1,2 @@ const castArray = val => (Array.isArray(val) ? val : [val]); - module.exports = castArray \ No newline at end of file +module.exports = castArray \ No newline at end of file diff --git a/test/chainAsync/chainAsync.js b/test/chainAsync/chainAsync.js index 4454d477d..8322779ad 100644 --- a/test/chainAsync/chainAsync.js +++ b/test/chainAsync/chainAsync.js @@ -3,4 +3,4 @@ let curr = 0; const next = () => fns[curr++](next); next(); }; - module.exports = chainAsync \ No newline at end of file +module.exports = chainAsync \ No newline at end of file diff --git a/test/chunk/chunk.js b/test/chunk/chunk.js index 6b27e7f1c..39ffc5d71 100644 --- a/test/chunk/chunk.js +++ b/test/chunk/chunk.js @@ -2,4 +2,4 @@ const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size) ); - module.exports = chunk \ No newline at end of file +module.exports = chunk \ No newline at end of file diff --git a/test/clampNumber/clampNumber.js b/test/clampNumber/clampNumber.js index 5033a0372..ecd804f73 100644 --- a/test/clampNumber/clampNumber.js +++ b/test/clampNumber/clampNumber.js @@ -1,2 +1,2 @@ const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b)); - module.exports = clampNumber \ No newline at end of file +module.exports = clampNumber \ No newline at end of file diff --git a/test/cleanObj/cleanObj.js b/test/cleanObj/cleanObj.js index 16f414bec..d3dfc14d3 100644 --- a/test/cleanObj/cleanObj.js +++ b/test/cleanObj/cleanObj.js @@ -8,4 +8,4 @@ delete obj[key]; }); return obj; }; - module.exports = cleanObj \ No newline at end of file +module.exports = cleanObj \ No newline at end of file diff --git a/test/cloneRegExp/cloneRegExp.js b/test/cloneRegExp/cloneRegExp.js index 41d81e621..d0fdb3953 100644 --- a/test/cloneRegExp/cloneRegExp.js +++ b/test/cloneRegExp/cloneRegExp.js @@ -1,2 +1,2 @@ const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags); - module.exports = cloneRegExp \ No newline at end of file +module.exports = cloneRegExp \ No newline at end of file diff --git a/test/coalesce/coalesce.js b/test/coalesce/coalesce.js index 6147c753e..839e85f10 100644 --- a/test/coalesce/coalesce.js +++ b/test/coalesce/coalesce.js @@ -1,2 +1,2 @@ const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_)); - module.exports = coalesce \ No newline at end of file +module.exports = coalesce \ No newline at end of file diff --git a/test/coalesceFactory/coalesceFactory.js b/test/coalesceFactory/coalesceFactory.js index 808d4c517..356ab50bb 100644 --- a/test/coalesceFactory/coalesceFactory.js +++ b/test/coalesceFactory/coalesceFactory.js @@ -1,2 +1,2 @@ const coalesceFactory = valid => (...args) => args.find(valid); - module.exports = coalesceFactory \ No newline at end of file +module.exports = coalesceFactory \ No newline at end of file diff --git a/test/collatz/collatz.js b/test/collatz/collatz.js index 90f826b59..a5ea21085 100644 --- a/test/collatz/collatz.js +++ b/test/collatz/collatz.js @@ -1,2 +1,2 @@ const collatz = n => (n % 2 == 0 ? n / 2 : 3 * n + 1); - module.exports = collatz \ No newline at end of file +module.exports = collatz \ No newline at end of file diff --git a/test/collectInto/collectInto.js b/test/collectInto/collectInto.js index d8873dcec..829b8844b 100644 --- a/test/collectInto/collectInto.js +++ b/test/collectInto/collectInto.js @@ -1,2 +1,2 @@ const collectInto = fn => (...args) => fn(args); - module.exports = collectInto \ No newline at end of file +module.exports = collectInto \ No newline at end of file diff --git a/test/colorize/colorize.js b/test/colorize/colorize.js index 47c88dd49..63e7f7d29 100644 --- a/test/colorize/colorize.js +++ b/test/colorize/colorize.js @@ -16,4 +16,4 @@ bgMagenta: `\x1b[45m${args.join(' ')}\x1b[0m`, bgCyan: `\x1b[46m${args.join(' ')}\x1b[0m`, bgWhite: `\x1b[47m${args.join(' ')}\x1b[0m` }); - module.exports = colorize \ No newline at end of file +module.exports = colorize \ No newline at end of file diff --git a/test/compact/compact.js b/test/compact/compact.js index da480df6b..24866fe96 100644 --- a/test/compact/compact.js +++ b/test/compact/compact.js @@ -1,2 +1,2 @@ const compact = arr => arr.filter(Boolean); - module.exports = compact \ No newline at end of file +module.exports = compact \ No newline at end of file diff --git a/test/compose/compose.js b/test/compose/compose.js index ec5564b31..b4e352b0b 100644 --- a/test/compose/compose.js +++ b/test/compose/compose.js @@ -1,2 +1,2 @@ const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))); - module.exports = compose \ No newline at end of file +module.exports = compose \ No newline at end of file diff --git a/test/composeRight/composeRight.js b/test/composeRight/composeRight.js new file mode 100644 index 000000000..3e17a2b91 --- /dev/null +++ b/test/composeRight/composeRight.js @@ -0,0 +1,2 @@ +const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); +module.exports = composeRight \ No newline at end of file diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js new file mode 100644 index 000000000..c96397e9f --- /dev/null +++ b/test/composeRight/composeRight.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const composeRight = require('./composeRight.js'); + +test('Testing composeRight', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof composeRight === 'function', 'composeRight is a Function'); + //t.deepEqual(composeRight(args..), 'Expected'); + //t.equal(composeRight(args..), 'Expected'); + //t.false(composeRight(args..), 'Expected'); + //t.throws(composeRight(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/copyToClipboard/copyToClipboard.js b/test/copyToClipboard/copyToClipboard.js index c1a18c196..5af7138b6 100644 --- a/test/copyToClipboard/copyToClipboard.js +++ b/test/copyToClipboard/copyToClipboard.js @@ -15,4 +15,4 @@ document.getSelection().removeAllRanges(); document.getSelection().addRange(selected); } }; - module.exports = copyToClipboard \ No newline at end of file +module.exports = copyToClipboard \ No newline at end of file diff --git a/test/countBy/countBy.js b/test/countBy/countBy.js index dc5aea920..fdd3f3f92 100644 --- a/test/countBy/countBy.js +++ b/test/countBy/countBy.js @@ -3,4 +3,4 @@ arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => acc[val] = (acc[val] || 0) + 1; return acc; }, {}); - module.exports = countBy \ No newline at end of file +module.exports = countBy \ No newline at end of file diff --git a/test/countOccurrences/countOccurrences.js b/test/countOccurrences/countOccurrences.js index cb03497f6..bc76c8bc3 100644 --- a/test/countOccurrences/countOccurrences.js +++ b/test/countOccurrences/countOccurrences.js @@ -1,2 +1,2 @@ const countOccurrences = (arr, val) => arr.reduce((a, v) => (v === val ? a + 1 : a + 0), 0); - module.exports = countOccurrences \ No newline at end of file +module.exports = countOccurrences \ No newline at end of file diff --git a/test/countVowels/countVowels.js b/test/countVowels/countVowels.js index 62194dc8b..cf9730c41 100644 --- a/test/countVowels/countVowels.js +++ b/test/countVowels/countVowels.js @@ -1,2 +1,2 @@ const countVowels = str => (str.match(/[aeiou]/gi) || []).length; - module.exports = countVowels \ No newline at end of file +module.exports = countVowels \ No newline at end of file diff --git a/test/createElement/createElement.js b/test/createElement/createElement.js index 8786e0056..a9d6062e8 100644 --- a/test/createElement/createElement.js +++ b/test/createElement/createElement.js @@ -3,4 +3,4 @@ const el = document.createElement('div'); el.innerHTML = str; return el.firstElementChild; }; - module.exports = createElement \ No newline at end of file +module.exports = createElement \ No newline at end of file diff --git a/test/createEventHub/createEventHub.js b/test/createEventHub/createEventHub.js index 6b85e5613..82a792026 100644 --- a/test/createEventHub/createEventHub.js +++ b/test/createEventHub/createEventHub.js @@ -12,4 +12,4 @@ const i = (this.hub[event] || []).findIndex(h => h === handler); if (i > -1) this.hub[event].splice(i, 1); } }); - module.exports = createEventHub \ No newline at end of file +module.exports = createEventHub \ No newline at end of file diff --git a/test/currentURL/currentURL.js b/test/currentURL/currentURL.js index e7f2b6885..47c9e8867 100644 --- a/test/currentURL/currentURL.js +++ b/test/currentURL/currentURL.js @@ -1,2 +1,2 @@ const currentURL = () => window.location.href; - module.exports = currentURL \ No newline at end of file +module.exports = currentURL \ No newline at end of file diff --git a/test/curry/curry.js b/test/curry/curry.js index d0109e427..ca08777f9 100644 --- a/test/curry/curry.js +++ b/test/curry/curry.js @@ -1,3 +1,3 @@ const curry = (fn, arity = fn.length, ...args) => arity <= args.length ? fn(...args) : curry.bind(null, fn, arity, ...args); - module.exports = curry \ No newline at end of file +module.exports = curry \ No newline at end of file diff --git a/test/decapitalize/decapitalize.js b/test/decapitalize/decapitalize.js index c42322649..b27279ebc 100644 --- a/test/decapitalize/decapitalize.js +++ b/test/decapitalize/decapitalize.js @@ -1,3 +1,3 @@ const decapitalize = ([first, ...rest], upperRest = false) => first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join('')); - module.exports = decapitalize \ No newline at end of file +module.exports = decapitalize \ No newline at end of file diff --git a/test/deepClone/deepClone.js b/test/deepClone/deepClone.js index dd6573dab..fdb424f30 100644 --- a/test/deepClone/deepClone.js +++ b/test/deepClone/deepClone.js @@ -5,4 +5,4 @@ key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[ke ); return clone; }; - module.exports = deepClone \ No newline at end of file +module.exports = deepClone \ No newline at end of file diff --git a/test/deepFlatten/deepFlatten.js b/test/deepFlatten/deepFlatten.js index f6e7cc6d6..7b6736558 100644 --- a/test/deepFlatten/deepFlatten.js +++ b/test/deepFlatten/deepFlatten.js @@ -1,2 +1,2 @@ const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); - module.exports = deepFlatten \ No newline at end of file +module.exports = deepFlatten \ No newline at end of file diff --git a/test/defaults/defaults.js b/test/defaults/defaults.js index 39e951cab..bb66f6cc1 100644 --- a/test/defaults/defaults.js +++ b/test/defaults/defaults.js @@ -1,2 +1,2 @@ const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); - module.exports = defaults \ No newline at end of file +module.exports = defaults \ No newline at end of file diff --git a/test/defer/defer.js b/test/defer/defer.js index f5562f3c7..fd555a267 100644 --- a/test/defer/defer.js +++ b/test/defer/defer.js @@ -1,2 +1,2 @@ const defer = (fn, ...args) => setTimeout(fn, 1, ...args); - module.exports = defer \ No newline at end of file +module.exports = defer \ No newline at end of file diff --git a/test/detectDeviceType/detectDeviceType.js b/test/detectDeviceType/detectDeviceType.js index d66cb7429..e2d834fd0 100644 --- a/test/detectDeviceType/detectDeviceType.js +++ b/test/detectDeviceType/detectDeviceType.js @@ -2,4 +2,4 @@ const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop'; - module.exports = detectDeviceType \ No newline at end of file +module.exports = detectDeviceType \ No newline at end of file diff --git a/test/difference/difference.js b/test/difference/difference.js index 48fa645c5..3a2642b5b 100644 --- a/test/difference/difference.js +++ b/test/difference/difference.js @@ -2,4 +2,4 @@ const difference = (a, b) => { const s = new Set(b); return a.filter(x => !s.has(x)); }; - module.exports = difference \ No newline at end of file +module.exports = difference \ No newline at end of file diff --git a/test/differenceBy/differenceBy.js b/test/differenceBy/differenceBy.js new file mode 100644 index 000000000..84e5548bb --- /dev/null +++ b/test/differenceBy/differenceBy.js @@ -0,0 +1,5 @@ +const differenceBy = (a, b, fn) => { +const s = new Set(b.map(v => fn(v))); +return a.filter(x => !s.has(fn(x))); +}; +module.exports = differenceBy \ No newline at end of file diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js new file mode 100644 index 000000000..d4be8a710 --- /dev/null +++ b/test/differenceBy/differenceBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const differenceBy = require('./differenceBy.js'); + +test('Testing differenceBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof differenceBy === 'function', 'differenceBy is a Function'); + //t.deepEqual(differenceBy(args..), 'Expected'); + //t.equal(differenceBy(args..), 'Expected'); + //t.false(differenceBy(args..), 'Expected'); + //t.throws(differenceBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/differenceWith/differenceWith.js b/test/differenceWith/differenceWith.js index 2d173c9c3..83db305b1 100644 --- a/test/differenceWith/differenceWith.js +++ b/test/differenceWith/differenceWith.js @@ -1,2 +1,2 @@ const differenceWith = (arr, val, comp) => arr.filter(a => val.findIndex(b => comp(a, b)) === -1); - module.exports = differenceWith \ No newline at end of file +module.exports = differenceWith \ No newline at end of file diff --git a/test/digitize/digitize.js b/test/digitize/digitize.js index d34c01e6a..b6324fe65 100644 --- a/test/digitize/digitize.js +++ b/test/digitize/digitize.js @@ -1,2 +1,2 @@ const digitize = n => [...`${n}`].map(i => parseInt(i)); - module.exports = digitize \ No newline at end of file +module.exports = digitize \ No newline at end of file diff --git a/test/distance/distance.js b/test/distance/distance.js index 426517fd3..fdcbc4f15 100644 --- a/test/distance/distance.js +++ b/test/distance/distance.js @@ -1,2 +1,2 @@ const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); - module.exports = distance \ No newline at end of file +module.exports = distance \ No newline at end of file diff --git a/test/dropElements/dropElements.js b/test/dropElements/dropElements.js index 6484de16d..bb87783f9 100644 --- a/test/dropElements/dropElements.js +++ b/test/dropElements/dropElements.js @@ -2,4 +2,4 @@ const dropElements = (arr, func) => { while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1); return arr; }; - module.exports = dropElements \ No newline at end of file +module.exports = dropElements \ No newline at end of file diff --git a/test/dropRight/dropRight.js b/test/dropRight/dropRight.js index 8e89e36b4..6e5e6725b 100644 --- a/test/dropRight/dropRight.js +++ b/test/dropRight/dropRight.js @@ -1,2 +1,2 @@ const dropRight = (arr, n = 1) => arr.slice(0, -n); - module.exports = dropRight \ No newline at end of file +module.exports = dropRight \ No newline at end of file diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js index 1925c72cd..e8033fcfa 100644 --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js @@ -6,4 +6,4 @@ return partiallyVisible ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) : top >= 0 && left >= 0 && bottom <= innerHeight && right <= innerWidth; }; - module.exports = elementIsVisibleInViewport \ No newline at end of file +module.exports = elementIsVisibleInViewport \ No newline at end of file diff --git a/test/elo/elo.js b/test/elo/elo.js index 812ee1af1..19952b6b2 100644 --- a/test/elo/elo.js +++ b/test/elo/elo.js @@ -16,4 +16,4 @@ j++; } return ratings; }; - module.exports = elo \ No newline at end of file +module.exports = elo \ No newline at end of file diff --git a/test/equals/equals.js b/test/equals/equals.js index f418aa5cd..d9959f799 100644 --- a/test/equals/equals.js +++ b/test/equals/equals.js @@ -8,4 +8,4 @@ let keys = Object.keys(a); if (keys.length !== Object.keys(b).length) return false; return keys.every(k => equals(a[k], b[k])); }; - module.exports = equals \ No newline at end of file +module.exports = equals \ No newline at end of file diff --git a/test/escapeHTML/escapeHTML.js b/test/escapeHTML/escapeHTML.js index 94cb8e7fe..f1d9c874c 100644 --- a/test/escapeHTML/escapeHTML.js +++ b/test/escapeHTML/escapeHTML.js @@ -10,4 +10,4 @@ tag => '"': '"' }[tag] || tag) ); - module.exports = escapeHTML \ No newline at end of file +module.exports = escapeHTML \ No newline at end of file diff --git a/test/escapeRegExp/escapeRegExp.js b/test/escapeRegExp/escapeRegExp.js index 9164cc532..cfd2d03bf 100644 --- a/test/escapeRegExp/escapeRegExp.js +++ b/test/escapeRegExp/escapeRegExp.js @@ -1,2 +1,2 @@ const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - module.exports = escapeRegExp \ No newline at end of file +module.exports = escapeRegExp \ No newline at end of file diff --git a/test/everyNth/everyNth.js b/test/everyNth/everyNth.js index 723c4f5ca..12285c8f0 100644 --- a/test/everyNth/everyNth.js +++ b/test/everyNth/everyNth.js @@ -1,2 +1,2 @@ const everyNth = (arr, nth) => arr.filter((e, i) => i % nth === nth - 1); - module.exports = everyNth \ No newline at end of file +module.exports = everyNth \ No newline at end of file diff --git a/test/extendHex/extendHex.js b/test/extendHex/extendHex.js index 6e1b6d535..fe39c39fa 100644 --- a/test/extendHex/extendHex.js +++ b/test/extendHex/extendHex.js @@ -5,4 +5,4 @@ shortHex .split('') .map(x => x + x) .join(''); - module.exports = extendHex \ No newline at end of file +module.exports = extendHex \ No newline at end of file diff --git a/test/factorial/factorial.js b/test/factorial/factorial.js index 928826dea..b09e3ab26 100644 --- a/test/factorial/factorial.js +++ b/test/factorial/factorial.js @@ -4,4 +4,4 @@ n < 0 throw new TypeError('Negative numbers are not allowed!'); })() : n <= 1 ? 1 : n * factorial(n - 1); - module.exports = factorial \ No newline at end of file +module.exports = factorial \ No newline at end of file diff --git a/test/factors/factors.js b/test/factors/factors.js index b34e1ded4..d0d789e83 100644 --- a/test/factors/factors.js +++ b/test/factors/factors.js @@ -17,4 +17,4 @@ return acc; }, []); return primes ? array.filter(isPrime) : array; }; - module.exports = factors \ No newline at end of file +module.exports = factors \ No newline at end of file diff --git a/test/fibonacci/fibonacci.js b/test/fibonacci/fibonacci.js index c6dbaf313..2fe873dc3 100644 --- a/test/fibonacci/fibonacci.js +++ b/test/fibonacci/fibonacci.js @@ -3,4 +3,4 @@ Array.from({ length: n }).reduce( (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), [] ); - module.exports = fibonacci \ No newline at end of file +module.exports = fibonacci \ No newline at end of file diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js index a23fab23b..7746208c2 100644 --- a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js +++ b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js @@ -1,3 +1,3 @@ const fibonacciCountUntilNum = num => Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2)); - module.exports = fibonacciCountUntilNum \ No newline at end of file +module.exports = fibonacciCountUntilNum \ No newline at end of file diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.js b/test/fibonacciUntilNum/fibonacciUntilNum.js index 9f5a4ac32..649bd6e25 100644 --- a/test/fibonacciUntilNum/fibonacciUntilNum.js +++ b/test/fibonacciUntilNum/fibonacciUntilNum.js @@ -5,4 +5,4 @@ return Array.from({ length: n }).reduce( [] ); }; - module.exports = fibonacciUntilNum \ No newline at end of file +module.exports = fibonacciUntilNum \ No newline at end of file diff --git a/test/filterNonUnique/filterNonUnique.js b/test/filterNonUnique/filterNonUnique.js index 712cf074e..30a039b67 100644 --- a/test/filterNonUnique/filterNonUnique.js +++ b/test/filterNonUnique/filterNonUnique.js @@ -1,2 +1,2 @@ const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexOf(i)); - module.exports = filterNonUnique \ No newline at end of file +module.exports = filterNonUnique \ No newline at end of file diff --git a/test/findKey/findKey.js b/test/findKey/findKey.js index b97dc0b7f..66a5edc1c 100644 --- a/test/findKey/findKey.js +++ b/test/findKey/findKey.js @@ -1,2 +1,2 @@ const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); - module.exports = findKey \ No newline at end of file +module.exports = findKey \ No newline at end of file diff --git a/test/findLast/findLast.js b/test/findLast/findLast.js index 00daa5d5d..1586a1b46 100644 --- a/test/findLast/findLast.js +++ b/test/findLast/findLast.js @@ -1,2 +1,2 @@ -const findLast = (arr, fn) => arr.filter(fn).slice(-1); - module.exports = findLast \ No newline at end of file +const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0]; +module.exports = findLast \ No newline at end of file diff --git a/test/findLastIndex/findLastIndex.js b/test/findLastIndex/findLastIndex.js new file mode 100644 index 000000000..378a0e244 --- /dev/null +++ b/test/findLastIndex/findLastIndex.js @@ -0,0 +1,6 @@ +const findLastIndex = (arr, fn) => +arr +.map((val, i) => [i, val]) +.filter(val => fn(val[1], val[0], arr)) +.slice(-1)[0][0]; +module.exports = findLastIndex \ No newline at end of file diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js new file mode 100644 index 000000000..c0bf93814 --- /dev/null +++ b/test/findLastIndex/findLastIndex.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const findLastIndex = require('./findLastIndex.js'); + +test('Testing findLastIndex', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof findLastIndex === 'function', 'findLastIndex is a Function'); + //t.deepEqual(findLastIndex(args..), 'Expected'); + //t.equal(findLastIndex(args..), 'Expected'); + //t.false(findLastIndex(args..), 'Expected'); + //t.throws(findLastIndex(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/findLastKey/findLastKey.js b/test/findLastKey/findLastKey.js index 0484b644c..0033cf1e8 100644 --- a/test/findLastKey/findLastKey.js +++ b/test/findLastKey/findLastKey.js @@ -2,4 +2,4 @@ const findLastKey = (obj, fn) => Object.keys(obj) .reverse() .find(key => fn(obj[key], key, obj)); - module.exports = findLastKey \ No newline at end of file +module.exports = findLastKey \ No newline at end of file diff --git a/test/flatten/flatten.js b/test/flatten/flatten.js index 027441ea1..6563b70fd 100644 --- a/test/flatten/flatten.js +++ b/test/flatten/flatten.js @@ -2,4 +2,4 @@ const flatten = (arr, depth = 1) => depth != 1 ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), []) : arr.reduce((a, v) => a.concat(v), []); - module.exports = flatten \ No newline at end of file +module.exports = flatten \ No newline at end of file diff --git a/test/flip/flip.js b/test/flip/flip.js index 1c3e94247..79d2e19e6 100644 --- a/test/flip/flip.js +++ b/test/flip/flip.js @@ -1,2 +1,2 @@ const flip = fn => (first, ...rest) => fn(...rest, first); - module.exports = flip \ No newline at end of file +module.exports = flip \ No newline at end of file diff --git a/test/forEachRight/forEachRight.js b/test/forEachRight/forEachRight.js index a6e0f7a9e..f23c83b8f 100644 --- a/test/forEachRight/forEachRight.js +++ b/test/forEachRight/forEachRight.js @@ -3,4 +3,4 @@ arr .slice(0) .reverse() .forEach(callback); - module.exports = forEachRight \ No newline at end of file +module.exports = forEachRight \ No newline at end of file diff --git a/test/forOwn/forOwn.js b/test/forOwn/forOwn.js index de8b06fcc..52fdf433b 100644 --- a/test/forOwn/forOwn.js +++ b/test/forOwn/forOwn.js @@ -1,2 +1,2 @@ const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj)); - module.exports = forOwn \ No newline at end of file +module.exports = forOwn \ No newline at end of file diff --git a/test/forOwnRight/forOwnRight.js b/test/forOwnRight/forOwnRight.js index a74205dca..c29f23464 100644 --- a/test/forOwnRight/forOwnRight.js +++ b/test/forOwnRight/forOwnRight.js @@ -2,4 +2,4 @@ const forOwnRight = (obj, fn) => Object.keys(obj) .reverse() .forEach(key => fn(obj[key], key, obj)); - module.exports = forOwnRight \ No newline at end of file +module.exports = forOwnRight \ No newline at end of file diff --git a/test/formatDuration/formatDuration.js b/test/formatDuration/formatDuration.js index ae1075e92..ed0d60595 100644 --- a/test/formatDuration/formatDuration.js +++ b/test/formatDuration/formatDuration.js @@ -12,4 +12,4 @@ return Object.entries(time) .map(val => val[1] + ' ' + (val[1] !== 1 ? val[0] + 's' : val[0])) .join(', '); }; - module.exports = formatDuration \ No newline at end of file +module.exports = formatDuration \ No newline at end of file diff --git a/test/fromCamelCase/fromCamelCase.js b/test/fromCamelCase/fromCamelCase.js index 10c6fac30..3538c0f2e 100644 --- a/test/fromCamelCase/fromCamelCase.js +++ b/test/fromCamelCase/fromCamelCase.js @@ -3,4 +3,4 @@ str .replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2') .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2') .toLowerCase(); - module.exports = fromCamelCase \ No newline at end of file +module.exports = fromCamelCase \ No newline at end of file diff --git a/test/functionName/functionName.js b/test/functionName/functionName.js index 2181fe74a..ffca87364 100644 --- a/test/functionName/functionName.js +++ b/test/functionName/functionName.js @@ -1,2 +1,2 @@ const functionName = fn => (console.debug(fn.name), fn); - module.exports = functionName \ No newline at end of file +module.exports = functionName \ No newline at end of file diff --git a/test/functions/functions.js b/test/functions/functions.js index 7a451527d..93e11a78a 100644 --- a/test/functions/functions.js +++ b/test/functions/functions.js @@ -3,4 +3,4 @@ const functions = (obj, inherited = false) => ? [...Object.keys(obj), ...Object.keys(Object.getPrototypeOf(obj))] : Object.keys(obj) ).filter(key => typeof obj[key] === 'function'); - module.exports = functions \ No newline at end of file +module.exports = functions \ No newline at end of file diff --git a/test/gcd/gcd.js b/test/gcd/gcd.js index 201d996ae..877cd3763 100644 --- a/test/gcd/gcd.js +++ b/test/gcd/gcd.js @@ -2,4 +2,4 @@ const gcd = (...arr) => { const _gcd = (x, y) => (!y ? x : gcd(y, x % y)); return [...arr].reduce((a, b) => _gcd(a, b)); }; - module.exports = gcd \ No newline at end of file +module.exports = gcd \ No newline at end of file diff --git a/test/geometricProgression/geometricProgression.js b/test/geometricProgression/geometricProgression.js index c42691c59..afaeaf136 100644 --- a/test/geometricProgression/geometricProgression.js +++ b/test/geometricProgression/geometricProgression.js @@ -2,4 +2,4 @@ const geometricProgression = (end, start = 1, step = 2) => Array.from({ length: Math.floor(Math.log(end / start) / Math.log(step)) + 1 }).map( (v, i) => start * step ** i ); - module.exports = geometricProgression \ No newline at end of file +module.exports = geometricProgression \ No newline at end of file diff --git a/test/get/get.js b/test/get/get.js index b83862c51..568160c84 100644 --- a/test/get/get.js +++ b/test/get/get.js @@ -6,4 +6,4 @@ s .filter(t => t !== '') .reduce((prev, cur) => prev && prev[cur], from) ); - module.exports = get \ No newline at end of file +module.exports = get \ No newline at end of file diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js index e2157f0d3..899f75ae4 100644 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js @@ -1,3 +1,3 @@ const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24); - module.exports = getDaysDiffBetweenDates \ No newline at end of file +module.exports = getDaysDiffBetweenDates \ No newline at end of file diff --git a/test/getScrollPosition/getScrollPosition.js b/test/getScrollPosition/getScrollPosition.js index 4d3e12a62..a5fa12a18 100644 --- a/test/getScrollPosition/getScrollPosition.js +++ b/test/getScrollPosition/getScrollPosition.js @@ -2,4 +2,4 @@ const getScrollPosition = (el = window) => ({ x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft, y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop }); - module.exports = getScrollPosition \ No newline at end of file +module.exports = getScrollPosition \ No newline at end of file diff --git a/test/getStyle/getStyle.js b/test/getStyle/getStyle.js index 6df1c1394..6303f0993 100644 --- a/test/getStyle/getStyle.js +++ b/test/getStyle/getStyle.js @@ -1,2 +1,2 @@ const getStyle = (el, ruleName) => getComputedStyle(el)[ruleName]; - module.exports = getStyle \ No newline at end of file +module.exports = getStyle \ No newline at end of file diff --git a/test/getType/getType.js b/test/getType/getType.js index 02973563b..8c9f93a75 100644 --- a/test/getType/getType.js +++ b/test/getType/getType.js @@ -1,3 +1,3 @@ const getType = v => v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name.toLowerCase(); - module.exports = getType \ No newline at end of file +module.exports = getType \ No newline at end of file diff --git a/test/getURLParameters/getURLParameters.js b/test/getURLParameters/getURLParameters.js index 029711f48..622c99769 100644 --- a/test/getURLParameters/getURLParameters.js +++ b/test/getURLParameters/getURLParameters.js @@ -2,4 +2,4 @@ const getURLParameters = url => url .match(/([^?=&]+)(=([^&]*))/g) .reduce((a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a), {}); - module.exports = getURLParameters \ No newline at end of file +module.exports = getURLParameters \ No newline at end of file diff --git a/test/groupBy/groupBy.js b/test/groupBy/groupBy.js index f1083e4fe..25bb573d9 100644 --- a/test/groupBy/groupBy.js +++ b/test/groupBy/groupBy.js @@ -3,4 +3,4 @@ arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => acc[val] = (acc[val] || []).concat(arr[i]); return acc; }, {}); - module.exports = groupBy \ No newline at end of file +module.exports = groupBy \ No newline at end of file diff --git a/test/hammingDistance/hammingDistance.js b/test/hammingDistance/hammingDistance.js index e6e4c81e0..356304ed4 100644 --- a/test/hammingDistance/hammingDistance.js +++ b/test/hammingDistance/hammingDistance.js @@ -1,2 +1,2 @@ const hammingDistance = (num1, num2) => ((num1 ^ num2).toString(2).match(/1/g) || '').length; - module.exports = hammingDistance \ No newline at end of file +module.exports = hammingDistance \ No newline at end of file diff --git a/test/hasClass/hasClass.js b/test/hasClass/hasClass.js index 8f6f09234..c14590500 100644 --- a/test/hasClass/hasClass.js +++ b/test/hasClass/hasClass.js @@ -1,2 +1,2 @@ const hasClass = (el, className) => el.classList.contains(className); - module.exports = hasClass \ No newline at end of file +module.exports = hasClass \ No newline at end of file diff --git a/test/hasFlags/hasFlags.js b/test/hasFlags/hasFlags.js index c0312e5fc..9b8740692 100644 --- a/test/hasFlags/hasFlags.js +++ b/test/hasFlags/hasFlags.js @@ -1,3 +1,3 @@ const hasFlags = (...flags) => flags.every(flag => process.argv.includes(/^-{1,2}/.test(flag) ? flag : '--' + flag)); - module.exports = hasFlags \ No newline at end of file +module.exports = hasFlags \ No newline at end of file diff --git a/test/hashBrowser/hashBrowser.js b/test/hashBrowser/hashBrowser.js index 59db15021..ea13e46a2 100644 --- a/test/hashBrowser/hashBrowser.js +++ b/test/hashBrowser/hashBrowser.js @@ -6,4 +6,4 @@ for (let i = 0; i < view.byteLength; i += 4) hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8)); return hexes.join(''); }); - module.exports = hashBrowser \ No newline at end of file +module.exports = hashBrowser \ No newline at end of file diff --git a/test/hashNode/hashNode.js b/test/hashNode/hashNode.js index e6124fe5d..9041dec36 100644 --- a/test/hashNode/hashNode.js +++ b/test/hashNode/hashNode.js @@ -12,4 +12,4 @@ crypto 0 ) ); - module.exports = hashNode \ No newline at end of file +module.exports = hashNode \ No newline at end of file diff --git a/test/head/head.js b/test/head/head.js index 0c4e9eb90..bf2039dd0 100644 --- a/test/head/head.js +++ b/test/head/head.js @@ -1,2 +1,2 @@ const head = arr => arr[0]; - module.exports = head \ No newline at end of file +module.exports = head \ No newline at end of file diff --git a/test/hexToRGB/hexToRGB.js b/test/hexToRGB/hexToRGB.js index 090ec2a35..516050b8a 100644 --- a/test/hexToRGB/hexToRGB.js +++ b/test/hexToRGB/hexToRGB.js @@ -17,4 +17,4 @@ return ( ')' ); }; - module.exports = hexToRGB \ No newline at end of file +module.exports = hexToRGB \ No newline at end of file diff --git a/test/hide/hide.js b/test/hide/hide.js index 56bc848c9..d16add1ce 100644 --- a/test/hide/hide.js +++ b/test/hide/hide.js @@ -1,2 +1,2 @@ const hide = (...el) => [...el].forEach(e => (e.style.display = 'none')); - module.exports = hide \ No newline at end of file +module.exports = hide \ No newline at end of file diff --git a/test/howManyTimes/howManyTimes.js b/test/howManyTimes/howManyTimes.js index 85d57b0d5..51313c194 100644 --- a/test/howManyTimes/howManyTimes.js +++ b/test/howManyTimes/howManyTimes.js @@ -8,4 +8,4 @@ num = num / divisor; } return i; }; - module.exports = howManyTimes \ No newline at end of file +module.exports = howManyTimes \ No newline at end of file diff --git a/test/httpDelete/httpDelete.js b/test/httpDelete/httpDelete.js index 8a3ff97e6..0892b1819 100644 --- a/test/httpDelete/httpDelete.js +++ b/test/httpDelete/httpDelete.js @@ -5,4 +5,4 @@ request.onload = () => callback(request); request.onerror = () => err(request); request.send(); }; - module.exports = httpDelete \ No newline at end of file +module.exports = httpDelete \ No newline at end of file diff --git a/test/httpGet/httpGet.js b/test/httpGet/httpGet.js index 04564234a..413049085 100644 --- a/test/httpGet/httpGet.js +++ b/test/httpGet/httpGet.js @@ -5,4 +5,4 @@ request.onload = () => callback(request.responseText); request.onerror = () => err(request); request.send(); }; - module.exports = httpGet \ No newline at end of file +module.exports = httpGet \ No newline at end of file diff --git a/test/httpPost/httpPost.js b/test/httpPost/httpPost.js index bb7345f83..e81331645 100644 --- a/test/httpPost/httpPost.js +++ b/test/httpPost/httpPost.js @@ -6,4 +6,4 @@ request.onload = () => callback(request.responseText); request.onerror = () => err(request); request.send(data); }; - module.exports = httpPost \ No newline at end of file +module.exports = httpPost \ No newline at end of file diff --git a/test/httpPut/httpPut.js b/test/httpPut/httpPut.js index fba715694..71a0f79d9 100644 --- a/test/httpPut/httpPut.js +++ b/test/httpPut/httpPut.js @@ -6,4 +6,4 @@ request.onload = () => callback(request); request.onerror = () => err(request); request.send(data); }; - module.exports = httpPut \ No newline at end of file +module.exports = httpPut \ No newline at end of file diff --git a/test/httpsRedirect/httpsRedirect.js b/test/httpsRedirect/httpsRedirect.js index 832563f07..c1e3d2c5a 100644 --- a/test/httpsRedirect/httpsRedirect.js +++ b/test/httpsRedirect/httpsRedirect.js @@ -1,4 +1,4 @@ const httpsRedirect = () => { if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); }; - module.exports = httpsRedirect \ No newline at end of file +module.exports = httpsRedirect \ No newline at end of file diff --git a/test/inRange/inRange.js b/test/inRange/inRange.js index f0f16154b..8eaa567cf 100644 --- a/test/inRange/inRange.js +++ b/test/inRange/inRange.js @@ -2,4 +2,4 @@ const inRange = (n, start, end = null) => { if (end && start > end) end = [start, (start = end)][0]; return end == null ? n >= 0 && n < start : n >= start && n < end; }; - module.exports = inRange \ No newline at end of file +module.exports = inRange \ No newline at end of file diff --git a/test/indexOfAll/indexOfAll.js b/test/indexOfAll/indexOfAll.js index 8eebcf8a4..e99be6004 100644 --- a/test/indexOfAll/indexOfAll.js +++ b/test/indexOfAll/indexOfAll.js @@ -3,4 +3,4 @@ const indices = []; arr.forEach((el, i) => el === val && indices.push(i)); return indices; }; - module.exports = indexOfAll \ No newline at end of file +module.exports = indexOfAll \ No newline at end of file diff --git a/test/initial/initial.js b/test/initial/initial.js index 66869d7d1..c7ed44b13 100644 --- a/test/initial/initial.js +++ b/test/initial/initial.js @@ -1,2 +1,2 @@ const initial = arr => arr.slice(0, -1); - module.exports = initial \ No newline at end of file +module.exports = initial \ No newline at end of file diff --git a/test/initialize2DArray/initialize2DArray.js b/test/initialize2DArray/initialize2DArray.js index b8a85fd93..00b71e6af 100644 --- a/test/initialize2DArray/initialize2DArray.js +++ b/test/initialize2DArray/initialize2DArray.js @@ -1,3 +1,3 @@ const initialize2DArray = (w, h, val = null) => Array.from({ length: h }).map(() => Array.from({ length: w }).fill(val)); - module.exports = initialize2DArray \ No newline at end of file +module.exports = initialize2DArray \ No newline at end of file diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.js b/test/initializeArrayWithRange/initializeArrayWithRange.js index 2b875d6b9..11132582e 100644 --- a/test/initializeArrayWithRange/initializeArrayWithRange.js +++ b/test/initializeArrayWithRange/initializeArrayWithRange.js @@ -1,3 +1,3 @@ const initializeArrayWithRange = (end, start = 0, step = 1) => Array.from({ length: Math.ceil((end + 1 - start) / step) }).map((v, i) => i * step + start); - module.exports = initializeArrayWithRange \ No newline at end of file +module.exports = initializeArrayWithRange \ No newline at end of file diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js index 957361046..478a73f2c 100644 --- a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js +++ b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js @@ -2,4 +2,4 @@ const initializeArrayWithRangeRight = (end, start = 0, step = 1) => Array.from({ length: Math.ceil((end + 1 - start) / step) }).map( (v, i, arr) => (arr.length - i - 1) * step + start ); - module.exports = initializeArrayWithRangeRight \ No newline at end of file +module.exports = initializeArrayWithRangeRight \ No newline at end of file diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.js b/test/initializeArrayWithValues/initializeArrayWithValues.js index a9e77c805..32e55933a 100644 --- a/test/initializeArrayWithValues/initializeArrayWithValues.js +++ b/test/initializeArrayWithValues/initializeArrayWithValues.js @@ -1,2 +1,2 @@ const initializeArrayWithValues = (n, val = 0) => Array(n).fill(val); - module.exports = initializeArrayWithValues \ No newline at end of file +module.exports = initializeArrayWithValues \ No newline at end of file diff --git a/test/intersection/intersection.js b/test/intersection/intersection.js index b547b9136..c637ae88f 100644 --- a/test/intersection/intersection.js +++ b/test/intersection/intersection.js @@ -2,4 +2,4 @@ const intersection = (a, b) => { const s = new Set(b); return a.filter(x => s.has(x)); }; - module.exports = intersection \ No newline at end of file +module.exports = intersection \ No newline at end of file diff --git a/test/intersectionBy/intersectionBy.js b/test/intersectionBy/intersectionBy.js new file mode 100644 index 000000000..78b3549c5 --- /dev/null +++ b/test/intersectionBy/intersectionBy.js @@ -0,0 +1,5 @@ +const intersectionBy = (a, b, fn) => { +const s = new Set(b.map(x => fn(x))); +return a.filter(x => s.has(fn(x))); +}; +module.exports = intersectionBy \ No newline at end of file diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js new file mode 100644 index 000000000..e4c5af9b0 --- /dev/null +++ b/test/intersectionBy/intersectionBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const intersectionBy = require('./intersectionBy.js'); + +test('Testing intersectionBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof intersectionBy === 'function', 'intersectionBy is a Function'); + //t.deepEqual(intersectionBy(args..), 'Expected'); + //t.equal(intersectionBy(args..), 'Expected'); + //t.false(intersectionBy(args..), 'Expected'); + //t.throws(intersectionBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/intersectionWith/intersectionWith.js b/test/intersectionWith/intersectionWith.js new file mode 100644 index 000000000..4d01fb1a9 --- /dev/null +++ b/test/intersectionWith/intersectionWith.js @@ -0,0 +1,2 @@ +const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1); +module.exports = intersectionWith \ No newline at end of file diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js new file mode 100644 index 000000000..12501f66a --- /dev/null +++ b/test/intersectionWith/intersectionWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const intersectionWith = require('./intersectionWith.js'); + +test('Testing intersectionWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof intersectionWith === 'function', 'intersectionWith is a Function'); + //t.deepEqual(intersectionWith(args..), 'Expected'); + //t.equal(intersectionWith(args..), 'Expected'); + //t.false(intersectionWith(args..), 'Expected'); + //t.throws(intersectionWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/invertKeyValues/invertKeyValues.js b/test/invertKeyValues/invertKeyValues.js index 93ef7c7a2..0b2b5f35b 100644 --- a/test/invertKeyValues/invertKeyValues.js +++ b/test/invertKeyValues/invertKeyValues.js @@ -5,4 +5,4 @@ acc[val] = acc[val] || []; acc[val].push(key); return acc; }, {}); - module.exports = invertKeyValues \ No newline at end of file +module.exports = invertKeyValues \ No newline at end of file diff --git a/test/is/is.js b/test/is/is.js index 829c5d16e..59035ba79 100644 --- a/test/is/is.js +++ b/test/is/is.js @@ -1,2 +1,2 @@ const is = (type, val) => val instanceof type; - module.exports = is \ No newline at end of file +module.exports = is \ No newline at end of file diff --git a/test/isAbsoluteURL/isAbsoluteURL.js b/test/isAbsoluteURL/isAbsoluteURL.js index fcfb3e490..31accb72d 100644 --- a/test/isAbsoluteURL/isAbsoluteURL.js +++ b/test/isAbsoluteURL/isAbsoluteURL.js @@ -1,2 +1,2 @@ const isAbsoluteURL = str => /^[a-z][a-z0-9+.-]*:/.test(str); - module.exports = isAbsoluteURL \ No newline at end of file +module.exports = isAbsoluteURL \ No newline at end of file diff --git a/test/isArmstrongNumber/isArmstrongNumber.js b/test/isArmstrongNumber/isArmstrongNumber.js index dbbb3bc7f..e71055d5d 100644 --- a/test/isArmstrongNumber/isArmstrongNumber.js +++ b/test/isArmstrongNumber/isArmstrongNumber.js @@ -2,4 +2,4 @@ const isArmstrongNumber = digits => (arr => arr.reduce((a, d) => a + parseInt(d) ** arr.length, 0) == digits)( (digits + '').split('') ); - module.exports = isArmstrongNumber \ No newline at end of file +module.exports = isArmstrongNumber \ No newline at end of file diff --git a/test/isArrayLike/isArrayLike.js b/test/isArrayLike/isArrayLike.js index ce5a35eb5..4930908ec 100644 --- a/test/isArrayLike/isArrayLike.js +++ b/test/isArrayLike/isArrayLike.js @@ -5,4 +5,4 @@ return [...val], true; return false; } }; - module.exports = isArrayLike \ No newline at end of file +module.exports = isArrayLike \ No newline at end of file diff --git a/test/isBoolean/isBoolean.js b/test/isBoolean/isBoolean.js index 96d35cc5b..1ae8e4c9c 100644 --- a/test/isBoolean/isBoolean.js +++ b/test/isBoolean/isBoolean.js @@ -1,2 +1,2 @@ const isBoolean = val => typeof val === 'boolean'; - module.exports = isBoolean \ No newline at end of file +module.exports = isBoolean \ No newline at end of file diff --git a/test/isDivisible/isDivisible.js b/test/isDivisible/isDivisible.js index cb4cf5ace..a0f9d226d 100644 --- a/test/isDivisible/isDivisible.js +++ b/test/isDivisible/isDivisible.js @@ -1,2 +1,2 @@ const isDivisible = (dividend, divisor) => dividend % divisor === 0; - module.exports = isDivisible \ No newline at end of file +module.exports = isDivisible \ No newline at end of file diff --git a/test/isEmpty/isEmpty.js b/test/isEmpty/isEmpty.js index 10e93f435..189bdf0fd 100644 --- a/test/isEmpty/isEmpty.js +++ b/test/isEmpty/isEmpty.js @@ -1,2 +1,2 @@ const isEmpty = val => val == null || !(Object.keys(val) || val).length; - module.exports = isEmpty \ No newline at end of file +module.exports = isEmpty \ No newline at end of file diff --git a/test/isEven/isEven.js b/test/isEven/isEven.js index 255ea706e..6807815ad 100644 --- a/test/isEven/isEven.js +++ b/test/isEven/isEven.js @@ -1,2 +1,2 @@ const isEven = num => num % 2 === 0; - module.exports = isEven \ No newline at end of file +module.exports = isEven \ No newline at end of file diff --git a/test/isFunction/isFunction.js b/test/isFunction/isFunction.js index c7879e596..2afc19f96 100644 --- a/test/isFunction/isFunction.js +++ b/test/isFunction/isFunction.js @@ -1,2 +1,2 @@ const isFunction = val => typeof val === 'function'; - module.exports = isFunction \ No newline at end of file +module.exports = isFunction \ No newline at end of file diff --git a/test/isLowerCase/isLowerCase.js b/test/isLowerCase/isLowerCase.js index 2eb3496a3..b717cbc36 100644 --- a/test/isLowerCase/isLowerCase.js +++ b/test/isLowerCase/isLowerCase.js @@ -1,2 +1,2 @@ const isLowerCase = str => str === str.toLowerCase(); - module.exports = isLowerCase \ No newline at end of file +module.exports = isLowerCase \ No newline at end of file diff --git a/test/isNil/isNil.js b/test/isNil/isNil.js index f7a372152..aed4ee641 100644 --- a/test/isNil/isNil.js +++ b/test/isNil/isNil.js @@ -1,2 +1,2 @@ const isNil = val => val === undefined || val === null; - module.exports = isNil \ No newline at end of file +module.exports = isNil \ No newline at end of file diff --git a/test/isNull/isNull.js b/test/isNull/isNull.js index 89d25db2d..a741e6a67 100644 --- a/test/isNull/isNull.js +++ b/test/isNull/isNull.js @@ -1,2 +1,2 @@ const isNull = val => val === null; - module.exports = isNull \ No newline at end of file +module.exports = isNull \ No newline at end of file diff --git a/test/isNumber/isNumber.js b/test/isNumber/isNumber.js index 49ada847c..89c9390bf 100644 --- a/test/isNumber/isNumber.js +++ b/test/isNumber/isNumber.js @@ -1,2 +1,2 @@ const isNumber = val => typeof val === 'number'; - module.exports = isNumber \ No newline at end of file +module.exports = isNumber \ No newline at end of file diff --git a/test/isObject/isObject.js b/test/isObject/isObject.js index e6b532d48..087cedddd 100644 --- a/test/isObject/isObject.js +++ b/test/isObject/isObject.js @@ -1,2 +1,2 @@ const isObject = obj => obj === Object(obj); - module.exports = isObject \ No newline at end of file +module.exports = isObject \ No newline at end of file diff --git a/test/isObjectLike/isObjectLike.js b/test/isObjectLike/isObjectLike.js index 17073de4c..c7088e7ad 100644 --- a/test/isObjectLike/isObjectLike.js +++ b/test/isObjectLike/isObjectLike.js @@ -1,2 +1,2 @@ const isObjectLike = val => val !== null && typeof val === 'object'; - module.exports = isObjectLike \ No newline at end of file +module.exports = isObjectLike \ No newline at end of file diff --git a/test/isPlainObject/isPlainObject.js b/test/isPlainObject/isPlainObject.js index d740bf7c9..3e85aaf92 100644 --- a/test/isPlainObject/isPlainObject.js +++ b/test/isPlainObject/isPlainObject.js @@ -1,2 +1,2 @@ const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object; - module.exports = isPlainObject \ No newline at end of file +module.exports = isPlainObject \ No newline at end of file diff --git a/test/isPrime/isPrime.js b/test/isPrime/isPrime.js index 227aae1d4..3691324d3 100644 --- a/test/isPrime/isPrime.js +++ b/test/isPrime/isPrime.js @@ -3,4 +3,4 @@ const boundary = Math.floor(Math.sqrt(num)); for (var i = 2; i <= boundary; i++) if (num % i == 0) return false; return num >= 2; }; - module.exports = isPrime \ No newline at end of file +module.exports = isPrime \ No newline at end of file diff --git a/test/isPrimitive/isPrimitive.js b/test/isPrimitive/isPrimitive.js index 45a2bc136..46c9a0568 100644 --- a/test/isPrimitive/isPrimitive.js +++ b/test/isPrimitive/isPrimitive.js @@ -1,2 +1,2 @@ const isPrimitive = val => !['object', 'function'].includes(typeof val) || val === null; - module.exports = isPrimitive \ No newline at end of file +module.exports = isPrimitive \ No newline at end of file diff --git a/test/isPromiseLike/isPromiseLike.js b/test/isPromiseLike/isPromiseLike.js index a25cb7b37..736b6ced9 100644 --- a/test/isPromiseLike/isPromiseLike.js +++ b/test/isPromiseLike/isPromiseLike.js @@ -2,4 +2,4 @@ const isPromiseLike = obj => obj !== null && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; - module.exports = isPromiseLike \ No newline at end of file +module.exports = isPromiseLike \ No newline at end of file diff --git a/test/isSorted/isSorted.js b/test/isSorted/isSorted.js index 51f645c54..c80495eb6 100644 --- a/test/isSorted/isSorted.js +++ b/test/isSorted/isSorted.js @@ -4,4 +4,4 @@ for (let [i, val] of arr.entries()) if (i === arr.length - 1) return direction; else if ((val - arr[i + 1]) * direction > 0) return 0; }; - module.exports = isSorted \ No newline at end of file +module.exports = isSorted \ No newline at end of file diff --git a/test/isString/isString.js b/test/isString/isString.js index 4d866cf60..2ca94c27d 100644 --- a/test/isString/isString.js +++ b/test/isString/isString.js @@ -1,2 +1,2 @@ const isString = val => typeof val === 'string'; - module.exports = isString \ No newline at end of file +module.exports = isString \ No newline at end of file diff --git a/test/isSymbol/isSymbol.js b/test/isSymbol/isSymbol.js index cf18ba27d..f9956e85b 100644 --- a/test/isSymbol/isSymbol.js +++ b/test/isSymbol/isSymbol.js @@ -1,2 +1,2 @@ const isSymbol = val => typeof val === 'symbol'; - module.exports = isSymbol \ No newline at end of file +module.exports = isSymbol \ No newline at end of file diff --git a/test/isTravisCI/isTravisCI.js b/test/isTravisCI/isTravisCI.js index 19a9125c6..9dcc7e8c3 100644 --- a/test/isTravisCI/isTravisCI.js +++ b/test/isTravisCI/isTravisCI.js @@ -1,2 +1,2 @@ const isTravisCI = () => 'TRAVIS' in process.env && 'CI' in process.env; - module.exports = isTravisCI \ No newline at end of file +module.exports = isTravisCI \ No newline at end of file diff --git a/test/isUndefined/isUndefined.js b/test/isUndefined/isUndefined.js index fa0f75d88..7eb3f9b03 100644 --- a/test/isUndefined/isUndefined.js +++ b/test/isUndefined/isUndefined.js @@ -1,2 +1,2 @@ const isUndefined = val => val === undefined; - module.exports = isUndefined \ No newline at end of file +module.exports = isUndefined \ No newline at end of file diff --git a/test/isUpperCase/isUpperCase.js b/test/isUpperCase/isUpperCase.js index 319409a0b..9f255968e 100644 --- a/test/isUpperCase/isUpperCase.js +++ b/test/isUpperCase/isUpperCase.js @@ -1,2 +1,2 @@ const isUpperCase = str => str === str.toUpperCase(); - module.exports = isUpperCase \ No newline at end of file +module.exports = isUpperCase \ No newline at end of file diff --git a/test/isValidJSON/isValidJSON.js b/test/isValidJSON/isValidJSON.js index c18f03a49..b06d5538c 100644 --- a/test/isValidJSON/isValidJSON.js +++ b/test/isValidJSON/isValidJSON.js @@ -6,4 +6,4 @@ return true; return false; } }; - module.exports = isValidJSON \ No newline at end of file +module.exports = isValidJSON \ No newline at end of file diff --git a/test/join/join.js b/test/join/join.js index 0d24968e8..7fc8e49f7 100644 --- a/test/join/join.js +++ b/test/join/join.js @@ -6,4 +6,4 @@ i == arr.length - 2 : i == arr.length - 1 ? acc + val : acc + val + separator, '' ); - module.exports = join \ No newline at end of file +module.exports = join \ No newline at end of file diff --git a/test/last/last.js b/test/last/last.js index 294839092..322078184 100644 --- a/test/last/last.js +++ b/test/last/last.js @@ -1,2 +1,2 @@ const last = arr => arr[arr.length - 1]; - module.exports = last \ No newline at end of file +module.exports = last \ No newline at end of file diff --git a/test/lcm/lcm.js b/test/lcm/lcm.js index fd197ae0c..871e8bdb9 100644 --- a/test/lcm/lcm.js +++ b/test/lcm/lcm.js @@ -3,4 +3,4 @@ const gcd = (x, y) => (!y ? x : gcd(y, x % y)); const _lcm = (x, y) => x * y / gcd(x, y); return [...arr].reduce((a, b) => _lcm(a, b)); }; - module.exports = lcm \ No newline at end of file +module.exports = lcm \ No newline at end of file diff --git a/test/longestItem/longestItem.js b/test/longestItem/longestItem.js index 2df777176..9d1e5c007 100644 --- a/test/longestItem/longestItem.js +++ b/test/longestItem/longestItem.js @@ -1,2 +1,2 @@ const longestItem = (...vals) => [...vals].sort((a, b) => b.length - a.length)[0]; - module.exports = longestItem \ No newline at end of file +module.exports = longestItem \ No newline at end of file diff --git a/test/lowercaseKeys/lowercaseKeys.js b/test/lowercaseKeys/lowercaseKeys.js index 34abc71ff..5fafc126c 100644 --- a/test/lowercaseKeys/lowercaseKeys.js +++ b/test/lowercaseKeys/lowercaseKeys.js @@ -3,4 +3,4 @@ Object.keys(obj).reduce((acc, key) => { acc[key.toLowerCase()] = obj[key]; return acc; }, {}); - module.exports = lowercaseKeys \ No newline at end of file +module.exports = lowercaseKeys \ No newline at end of file diff --git a/test/luhnCheck/luhnCheck.js b/test/luhnCheck/luhnCheck.js index 240a8b0a3..b8742e21d 100644 --- a/test/luhnCheck/luhnCheck.js +++ b/test/luhnCheck/luhnCheck.js @@ -8,4 +8,4 @@ let sum = arr.reduce((acc, val, i) => (i % 2 !== 0 ? acc + val : acc + (val * 2) sum += lastDigit; return sum % 10 === 0; }; - module.exports = luhnCheck \ No newline at end of file +module.exports = luhnCheck \ No newline at end of file diff --git a/test/mapKeys/mapKeys.js b/test/mapKeys/mapKeys.js index 6d53b64c7..a1ca80202 100644 --- a/test/mapKeys/mapKeys.js +++ b/test/mapKeys/mapKeys.js @@ -3,4 +3,4 @@ Object.keys(obj).reduce((acc, k) => { acc[fn(obj[k], k, obj)] = obj[k]; return acc; }, {}); - module.exports = mapKeys \ No newline at end of file +module.exports = mapKeys \ No newline at end of file diff --git a/test/mapObject/mapObject.js b/test/mapObject/mapObject.js index 821847f1b..5bb4603c9 100644 --- a/test/mapObject/mapObject.js +++ b/test/mapObject/mapObject.js @@ -2,4 +2,4 @@ const mapObject = (arr, fn) => (a => ( (a = [arr, arr.map(fn)]), a[0].reduce((acc, val, ind) => ((acc[val] = a[1][ind]), acc), {}) ))(); - module.exports = mapObject \ No newline at end of file +module.exports = mapObject \ No newline at end of file diff --git a/test/mapValues/mapValues.js b/test/mapValues/mapValues.js index bebb7700e..89f62920a 100644 --- a/test/mapValues/mapValues.js +++ b/test/mapValues/mapValues.js @@ -3,4 +3,4 @@ Object.keys(obj).reduce((acc, k) => { acc[k] = fn(obj[k], k, obj); return acc; }, {}); - module.exports = mapValues \ No newline at end of file +module.exports = mapValues \ No newline at end of file diff --git a/test/mask/mask.js b/test/mask/mask.js index fab75a1ea..8f725dea7 100644 --- a/test/mask/mask.js +++ b/test/mask/mask.js @@ -1,3 +1,3 @@ const mask = (cc, num = 4, mask = '*') => ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num); - module.exports = mask \ No newline at end of file +module.exports = mask \ No newline at end of file diff --git a/test/matches/matches.js b/test/matches/matches.js index 21412bb9b..4c774e710 100644 --- a/test/matches/matches.js +++ b/test/matches/matches.js @@ -1,3 +1,3 @@ const matches = (obj, source) => Object.keys(source).every(key => obj.hasOwnProperty(key) && obj[key] === source[key]); - module.exports = matches \ No newline at end of file +module.exports = matches \ No newline at end of file diff --git a/test/matchesWith/matchesWith.js b/test/matchesWith/matchesWith.js index 09b61f457..0b9ae8d96 100644 --- a/test/matchesWith/matchesWith.js +++ b/test/matchesWith/matchesWith.js @@ -5,4 +5,4 @@ obj.hasOwnProperty(key) && fn ? fn(obj[key], source[key], key, obj, source) : obj[key] == source[key] ); - module.exports = matchesWith \ No newline at end of file +module.exports = matchesWith \ No newline at end of file diff --git a/test/maxBy/maxBy.js b/test/maxBy/maxBy.js index 66cbfe8f6..68292b944 100644 --- a/test/maxBy/maxBy.js +++ b/test/maxBy/maxBy.js @@ -1,2 +1,2 @@ const maxBy = (arr, fn) => Math.max(...arr.map(typeof fn === 'function' ? fn : val => val[fn])); - module.exports = maxBy \ No newline at end of file +module.exports = maxBy \ No newline at end of file diff --git a/test/maxN/maxN.js b/test/maxN/maxN.js index d7da949d0..2883c00cc 100644 --- a/test/maxN/maxN.js +++ b/test/maxN/maxN.js @@ -1,2 +1,2 @@ const maxN = (arr, n = 1) => [...arr].sort((a, b) => b - a).slice(0, n); - module.exports = maxN \ No newline at end of file +module.exports = maxN \ No newline at end of file diff --git a/test/median/median.js b/test/median/median.js index 59f6c6641..63b0b2bdc 100644 --- a/test/median/median.js +++ b/test/median/median.js @@ -3,4 +3,4 @@ const mid = Math.floor(arr.length / 2), nums = [...arr].sort((a, b) => a - b); return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2; }; - module.exports = median \ No newline at end of file +module.exports = median \ No newline at end of file diff --git a/test/memoize/memoize.js b/test/memoize/memoize.js index 6f7ebc106..f95372c10 100644 --- a/test/memoize/memoize.js +++ b/test/memoize/memoize.js @@ -6,4 +6,4 @@ return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && c cached.cache = cache; return cached; }; - module.exports = memoize \ No newline at end of file +module.exports = memoize \ No newline at end of file diff --git a/test/merge/merge.js b/test/merge/merge.js index bc9774fb4..5a816f96f 100644 --- a/test/merge/merge.js +++ b/test/merge/merge.js @@ -7,4 +7,4 @@ return acc; }, {}), {} ); - module.exports = merge \ No newline at end of file +module.exports = merge \ No newline at end of file diff --git a/test/minBy/minBy.js b/test/minBy/minBy.js index 135bbecb3..c5a3505dd 100644 --- a/test/minBy/minBy.js +++ b/test/minBy/minBy.js @@ -1,2 +1,2 @@ const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : val => val[fn])); - module.exports = minBy \ No newline at end of file +module.exports = minBy \ No newline at end of file diff --git a/test/minN/minN.js b/test/minN/minN.js index 18b052d21..1a6974e9e 100644 --- a/test/minN/minN.js +++ b/test/minN/minN.js @@ -1,2 +1,2 @@ const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); - module.exports = minN \ No newline at end of file +module.exports = minN \ No newline at end of file diff --git a/test/negate/negate.js b/test/negate/negate.js index 65a7033e3..228a224f0 100644 --- a/test/negate/negate.js +++ b/test/negate/negate.js @@ -1,2 +1,2 @@ const negate = func => (...args) => !func(...args); - module.exports = negate \ No newline at end of file +module.exports = negate \ No newline at end of file diff --git a/test/nthArg/nthArg.js b/test/nthArg/nthArg.js index 4a2ca5f0a..a43475e8a 100644 --- a/test/nthArg/nthArg.js +++ b/test/nthArg/nthArg.js @@ -1,2 +1,2 @@ const nthArg = n => (...args) => args.slice(n)[0]; - module.exports = nthArg \ No newline at end of file +module.exports = nthArg \ No newline at end of file diff --git a/test/nthElement/nthElement.js b/test/nthElement/nthElement.js index 0fb6ce650..2e88831c1 100644 --- a/test/nthElement/nthElement.js +++ b/test/nthElement/nthElement.js @@ -1,2 +1,2 @@ const nthElement = (arr, n = 0) => (n > 0 ? arr.slice(n, n + 1) : arr.slice(n))[0]; - module.exports = nthElement \ No newline at end of file +module.exports = nthElement \ No newline at end of file diff --git a/test/objectFromPairs/objectFromPairs.js b/test/objectFromPairs/objectFromPairs.js index 2114c882f..a51048410 100644 --- a/test/objectFromPairs/objectFromPairs.js +++ b/test/objectFromPairs/objectFromPairs.js @@ -1,2 +1,2 @@ const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); - module.exports = objectFromPairs \ No newline at end of file +module.exports = objectFromPairs \ No newline at end of file diff --git a/test/objectToPairs/objectToPairs.js b/test/objectToPairs/objectToPairs.js index 0f06a0cbe..1f09bf226 100644 --- a/test/objectToPairs/objectToPairs.js +++ b/test/objectToPairs/objectToPairs.js @@ -1,2 +1,2 @@ const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]); - module.exports = objectToPairs \ No newline at end of file +module.exports = objectToPairs \ No newline at end of file diff --git a/test/observeMutations/observeMutations.js b/test/observeMutations/observeMutations.js index 065f7fff3..ab05e3fef 100644 --- a/test/observeMutations/observeMutations.js +++ b/test/observeMutations/observeMutations.js @@ -16,4 +16,4 @@ options ); return observer; }; - module.exports = observeMutations \ No newline at end of file +module.exports = observeMutations \ No newline at end of file diff --git a/test/off/off.js b/test/off/off.js index 94c2aa43d..fb19a0434 100644 --- a/test/off/off.js +++ b/test/off/off.js @@ -1,2 +1,2 @@ const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts); - module.exports = off \ No newline at end of file +module.exports = off \ No newline at end of file diff --git a/test/omit/omit.js b/test/omit/omit.js index 9c695ba28..3963ed455 100644 --- a/test/omit/omit.js +++ b/test/omit/omit.js @@ -2,4 +2,4 @@ const omit = (obj, arr) => Object.keys(obj) .filter(k => !arr.includes(k)) .reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); - module.exports = omit \ No newline at end of file +module.exports = omit \ No newline at end of file diff --git a/test/omitBy/omitBy.js b/test/omitBy/omitBy.js index d3cbc009a..3beabf15d 100644 --- a/test/omitBy/omitBy.js +++ b/test/omitBy/omitBy.js @@ -2,4 +2,4 @@ const omitBy = (obj, fn) => Object.keys(obj) .filter(k => !fn(obj[k], k)) .reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); - module.exports = omitBy \ No newline at end of file +module.exports = omitBy \ No newline at end of file diff --git a/test/on/on.js b/test/on/on.js index 12c958ab5..a8f53f65c 100644 --- a/test/on/on.js +++ b/test/on/on.js @@ -3,4 +3,4 @@ const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e); el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false); if (opts.target) return delegatorFn; }; - module.exports = on \ No newline at end of file +module.exports = on \ No newline at end of file diff --git a/test/onUserInputChange/onUserInputChange.js b/test/onUserInputChange/onUserInputChange.js index 13cd2b44f..1850c9dec 100644 --- a/test/onUserInputChange/onUserInputChange.js +++ b/test/onUserInputChange/onUserInputChange.js @@ -12,4 +12,4 @@ if (type === 'touch') return; (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler); }); }; - module.exports = onUserInputChange \ No newline at end of file +module.exports = onUserInputChange \ No newline at end of file diff --git a/test/once/once.js b/test/once/once.js index 36225aa17..35f512e35 100644 --- a/test/once/once.js +++ b/test/once/once.js @@ -6,4 +6,4 @@ called = true; return fn.apply(this, args); }; }; - module.exports = once \ No newline at end of file +module.exports = once \ No newline at end of file diff --git a/test/orderBy/orderBy.js b/test/orderBy/orderBy.js index e7db465e5..ae7f113c7 100644 --- a/test/orderBy/orderBy.js +++ b/test/orderBy/orderBy.js @@ -8,4 +8,4 @@ acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0; return acc; }, 0) ); - module.exports = orderBy \ No newline at end of file +module.exports = orderBy \ No newline at end of file diff --git a/test/over/over.js b/test/over/over.js index 557bbd8d3..5a972c2f7 100644 --- a/test/over/over.js +++ b/test/over/over.js @@ -1,2 +1,2 @@ const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args)); - module.exports = over \ No newline at end of file +module.exports = over \ No newline at end of file diff --git a/test/palindrome/palindrome.js b/test/palindrome/palindrome.js index 59557dcd3..1b17b4023 100644 --- a/test/palindrome/palindrome.js +++ b/test/palindrome/palindrome.js @@ -8,4 +8,4 @@ s .join('') ); }; - module.exports = palindrome \ No newline at end of file +module.exports = palindrome \ No newline at end of file diff --git a/test/parseCookie/parseCookie.js b/test/parseCookie/parseCookie.js index 20dcb1039..63656448c 100644 --- a/test/parseCookie/parseCookie.js +++ b/test/parseCookie/parseCookie.js @@ -6,4 +6,4 @@ str acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim()); return acc; }, {}); - module.exports = parseCookie \ No newline at end of file +module.exports = parseCookie \ No newline at end of file diff --git a/test/partition/partition.js b/test/partition/partition.js index 9acd0309f..3e03d4e52 100644 --- a/test/partition/partition.js +++ b/test/partition/partition.js @@ -6,4 +6,4 @@ return acc; }, [[], []] ); - module.exports = partition \ No newline at end of file +module.exports = partition \ No newline at end of file diff --git a/test/percentile/percentile.js b/test/percentile/percentile.js index b345bb0d8..45e69c0a6 100644 --- a/test/percentile/percentile.js +++ b/test/percentile/percentile.js @@ -1,3 +1,3 @@ const percentile = (arr, val) => 100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0) / arr.length; - module.exports = percentile \ No newline at end of file +module.exports = percentile \ No newline at end of file diff --git a/test/pick/pick.js b/test/pick/pick.js index 465a5373a..649a25a9b 100644 --- a/test/pick/pick.js +++ b/test/pick/pick.js @@ -1,3 +1,3 @@ const pick = (obj, arr) => arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {}); - module.exports = pick \ No newline at end of file +module.exports = pick \ No newline at end of file diff --git a/test/pickBy/pickBy.js b/test/pickBy/pickBy.js index 8ecc72551..f8671e0bb 100644 --- a/test/pickBy/pickBy.js +++ b/test/pickBy/pickBy.js @@ -2,4 +2,4 @@ const pickBy = (obj, fn) => Object.keys(obj) .filter(k => fn(obj[k], k)) .reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); - module.exports = pickBy \ No newline at end of file +module.exports = pickBy \ No newline at end of file diff --git a/test/pipeFunctions/pipeFunctions.js b/test/pipeFunctions/pipeFunctions.js index ea4ac5fb1..46b2ec419 100644 --- a/test/pipeFunctions/pipeFunctions.js +++ b/test/pipeFunctions/pipeFunctions.js @@ -1,2 +1,2 @@ const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); - module.exports = pipeFunctions \ No newline at end of file +module.exports = pipeFunctions \ No newline at end of file diff --git a/test/pluralize/pluralize.js b/test/pluralize/pluralize.js index df86b72dd..7e1c477c9 100644 --- a/test/pluralize/pluralize.js +++ b/test/pluralize/pluralize.js @@ -4,4 +4,4 @@ const _pluralize = (num, word, plural = word + 's') => if (typeof val === 'object') return (num, word) => _pluralize(num, word, val[word]); return _pluralize(val, word, plural); }; - module.exports = pluralize \ No newline at end of file +module.exports = pluralize \ No newline at end of file diff --git a/test/powerset/powerset.js b/test/powerset/powerset.js index 0e71c52b1..0804d4c0b 100644 --- a/test/powerset/powerset.js +++ b/test/powerset/powerset.js @@ -1,2 +1,2 @@ const powerset = arr => arr.reduce((a, v) => a.concat(a.map(r => [v].concat(r))), [[]]); - module.exports = powerset \ No newline at end of file +module.exports = powerset \ No newline at end of file diff --git a/test/prettyBytes/prettyBytes.js b/test/prettyBytes/prettyBytes.js index dc5d0a5a1..110b723ce 100644 --- a/test/prettyBytes/prettyBytes.js +++ b/test/prettyBytes/prettyBytes.js @@ -5,4 +5,4 @@ const exponent = Math.min(Math.floor(Math.log10(num < 0 ? -num : num) / 3), UNIT const n = Number(((num < 0 ? -num : num) / 1000 ** exponent).toPrecision(precision)); return (num < 0 ? '-' : '') + n + (addSpace ? ' ' : '') + UNITS[exponent]; }; - module.exports = prettyBytes \ No newline at end of file +module.exports = prettyBytes \ No newline at end of file diff --git a/test/primes/primes.js b/test/primes/primes.js index 3ac251eed..a7a67a86a 100644 --- a/test/primes/primes.js +++ b/test/primes/primes.js @@ -5,4 +5,4 @@ numsTillSqroot = Array.from({ length: sqroot - 1 }).map((x, i) => i + 2); numsTillSqroot.forEach(x => (arr = arr.filter(y => y % x !== 0 || y == x))); return arr; }; - module.exports = primes \ No newline at end of file +module.exports = primes \ No newline at end of file diff --git a/test/promisify/promisify.js b/test/promisify/promisify.js index a642e309e..c41f99772 100644 --- a/test/promisify/promisify.js +++ b/test/promisify/promisify.js @@ -2,4 +2,4 @@ const promisify = func => (...args) => new Promise((resolve, reject) => func(...args, (err, result) => (err ? reject(err) : resolve(result))) ); - module.exports = promisify \ No newline at end of file +module.exports = promisify \ No newline at end of file diff --git a/test/pull/pull.js b/test/pull/pull.js index 08e191399..3b526fd6a 100644 --- a/test/pull/pull.js +++ b/test/pull/pull.js @@ -4,4 +4,4 @@ let pulled = arr.filter((v, i) => !argState.includes(v)); arr.length = 0; pulled.forEach(v => arr.push(v)); }; - module.exports = pull \ No newline at end of file +module.exports = pull \ No newline at end of file diff --git a/test/pullAtIndex/pullAtIndex.js b/test/pullAtIndex/pullAtIndex.js index 965071754..f85941a9b 100644 --- a/test/pullAtIndex/pullAtIndex.js +++ b/test/pullAtIndex/pullAtIndex.js @@ -7,4 +7,4 @@ arr.length = 0; pulled.forEach(v => arr.push(v)); return removed; }; - module.exports = pullAtIndex \ No newline at end of file +module.exports = pullAtIndex \ No newline at end of file diff --git a/test/pullAtValue/pullAtValue.js b/test/pullAtValue/pullAtValue.js index db317da51..5750b4b82 100644 --- a/test/pullAtValue/pullAtValue.js +++ b/test/pullAtValue/pullAtValue.js @@ -6,4 +6,4 @@ arr.length = 0; mutateTo.forEach(v => arr.push(v)); return removed; }; - module.exports = pullAtValue \ No newline at end of file +module.exports = pullAtValue \ No newline at end of file diff --git a/test/quickSort/quickSort.js b/test/quickSort/quickSort.js index 06075d924..3b17b2f89 100644 --- a/test/quickSort/quickSort.js +++ b/test/quickSort/quickSort.js @@ -6,4 +6,4 @@ isNaN(n) n, ...quickSort(nums.filter(v => (!desc ? v > n : v <= n)), desc) ]; - module.exports = quickSort \ No newline at end of file +module.exports = quickSort \ No newline at end of file diff --git a/test/randomHexColorCode/randomHexColorCode.js b/test/randomHexColorCode/randomHexColorCode.js index ae49ab185..4ff05e1f9 100644 --- a/test/randomHexColorCode/randomHexColorCode.js +++ b/test/randomHexColorCode/randomHexColorCode.js @@ -2,4 +2,4 @@ const randomHexColorCode = () => { let n = ((Math.random() * 0xfffff) | 0).toString(16); return '#' + (n.length !== 6 ? ((Math.random() * 0xf) | 0).toString(16) + n : n); }; - module.exports = randomHexColorCode \ No newline at end of file +module.exports = randomHexColorCode \ No newline at end of file diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.js b/test/randomIntArrayInRange/randomIntArrayInRange.js index 74c999acc..8136f6f4c 100644 --- a/test/randomIntArrayInRange/randomIntArrayInRange.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.js @@ -1,3 +1,3 @@ const randomIntArrayInRange = (min, max, n = 1) => Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min); - module.exports = randomIntArrayInRange \ No newline at end of file +module.exports = randomIntArrayInRange \ No newline at end of file diff --git a/test/randomIntegerInRange/randomIntegerInRange.js b/test/randomIntegerInRange/randomIntegerInRange.js index 7c6ad38db..2031f2c76 100644 --- a/test/randomIntegerInRange/randomIntegerInRange.js +++ b/test/randomIntegerInRange/randomIntegerInRange.js @@ -1,2 +1,2 @@ const randomIntegerInRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; - module.exports = randomIntegerInRange \ No newline at end of file +module.exports = randomIntegerInRange \ No newline at end of file diff --git a/test/randomNumberInRange/randomNumberInRange.js b/test/randomNumberInRange/randomNumberInRange.js index 15a6d3169..db50d7486 100644 --- a/test/randomNumberInRange/randomNumberInRange.js +++ b/test/randomNumberInRange/randomNumberInRange.js @@ -1,2 +1,2 @@ const randomNumberInRange = (min, max) => Math.random() * (max - min) + min; - module.exports = randomNumberInRange \ No newline at end of file +module.exports = randomNumberInRange \ No newline at end of file diff --git a/test/readFileLines/readFileLines.js b/test/readFileLines/readFileLines.js index 8e7db19aa..fc286c8eb 100644 --- a/test/readFileLines/readFileLines.js +++ b/test/readFileLines/readFileLines.js @@ -4,4 +4,4 @@ fs .readFileSync(filename) .toString('UTF8') .split('\n'); - module.exports = readFileLines \ No newline at end of file +module.exports = readFileLines \ No newline at end of file diff --git a/test/redirect/redirect.js b/test/redirect/redirect.js index f7cecfd2b..7959a5f01 100644 --- a/test/redirect/redirect.js +++ b/test/redirect/redirect.js @@ -1,3 +1,3 @@ const redirect = (url, asLink = true) => asLink ? (window.location.href = url) : window.location.replace(url); - module.exports = redirect \ No newline at end of file +module.exports = redirect \ No newline at end of file diff --git a/test/reducedFilter/reducedFilter.js b/test/reducedFilter/reducedFilter.js index 778c6179f..6e4662f37 100644 --- a/test/reducedFilter/reducedFilter.js +++ b/test/reducedFilter/reducedFilter.js @@ -5,4 +5,4 @@ acc[key] = el[key]; return acc; }, {}) ); - module.exports = reducedFilter \ No newline at end of file +module.exports = reducedFilter \ No newline at end of file diff --git a/test/remove/remove.js b/test/remove/remove.js index 75afb01bc..9132f4290 100644 --- a/test/remove/remove.js +++ b/test/remove/remove.js @@ -5,4 +5,4 @@ arr.splice(arr.indexOf(val), 1); return acc.concat(val); }, []) : []; - module.exports = remove \ No newline at end of file +module.exports = remove \ No newline at end of file diff --git a/test/removeVowels/removeVowels.js b/test/removeVowels/removeVowels.js index 770f01b90..8f9fd62bf 100644 --- a/test/removeVowels/removeVowels.js +++ b/test/removeVowels/removeVowels.js @@ -1,2 +1,2 @@ const removeVowels = (str, repl = '') => str.replace(/[aeiou]/gi,repl); - module.exports = removeVowels \ No newline at end of file +module.exports = removeVowels \ No newline at end of file diff --git a/test/reverseString/reverseString.js b/test/reverseString/reverseString.js index b5abbf1d5..1b98ef6c1 100644 --- a/test/reverseString/reverseString.js +++ b/test/reverseString/reverseString.js @@ -1,2 +1,2 @@ const reverseString = str => [...str].reverse().join(''); - module.exports = reverseString \ No newline at end of file +module.exports = reverseString \ No newline at end of file diff --git a/test/round/round.js b/test/round/round.js index 778e00441..2f86eb4d9 100644 --- a/test/round/round.js +++ b/test/round/round.js @@ -1,2 +1,2 @@ const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); - module.exports = round \ No newline at end of file +module.exports = round \ No newline at end of file diff --git a/test/runAsync/runAsync.js b/test/runAsync/runAsync.js index 1778fde70..c5cc4c1a3 100644 --- a/test/runAsync/runAsync.js +++ b/test/runAsync/runAsync.js @@ -14,4 +14,4 @@ rej(err), worker.terminate(); }; }); }; - module.exports = runAsync \ No newline at end of file +module.exports = runAsync \ No newline at end of file diff --git a/test/runPromisesInSeries/runPromisesInSeries.js b/test/runPromisesInSeries/runPromisesInSeries.js index ced59e23e..8ce9536f2 100644 --- a/test/runPromisesInSeries/runPromisesInSeries.js +++ b/test/runPromisesInSeries/runPromisesInSeries.js @@ -1,2 +1,2 @@ const runPromisesInSeries = ps => ps.reduce((p, next) => p.then(next), Promise.resolve()); - module.exports = runPromisesInSeries \ No newline at end of file +module.exports = runPromisesInSeries \ No newline at end of file diff --git a/test/sample/sample.js b/test/sample/sample.js index 992949efe..b230d5b89 100644 --- a/test/sample/sample.js +++ b/test/sample/sample.js @@ -1,2 +1,2 @@ const sample = arr => arr[Math.floor(Math.random() * arr.length)]; - module.exports = sample \ No newline at end of file +module.exports = sample \ No newline at end of file diff --git a/test/sampleSize/sampleSize.js b/test/sampleSize/sampleSize.js index 231810f54..dba6acd68 100644 --- a/test/sampleSize/sampleSize.js +++ b/test/sampleSize/sampleSize.js @@ -6,4 +6,4 @@ const i = Math.floor(Math.random() * m--); } return arr.slice(0, n); }; - module.exports = sampleSize \ No newline at end of file +module.exports = sampleSize \ No newline at end of file diff --git a/test/scrollToTop/scrollToTop.js b/test/scrollToTop/scrollToTop.js index d45b2a44e..b99155274 100644 --- a/test/scrollToTop/scrollToTop.js +++ b/test/scrollToTop/scrollToTop.js @@ -5,4 +5,4 @@ window.requestAnimationFrame(scrollToTop); window.scrollTo(0, c - c / 8); } }; - module.exports = scrollToTop \ No newline at end of file +module.exports = scrollToTop \ No newline at end of file diff --git a/test/sdbm/sdbm.js b/test/sdbm/sdbm.js index ff9012a7f..43f750617 100644 --- a/test/sdbm/sdbm.js +++ b/test/sdbm/sdbm.js @@ -6,4 +6,4 @@ return arr.reduce( 0 ); }; - module.exports = sdbm \ No newline at end of file +module.exports = sdbm \ No newline at end of file diff --git a/test/serializeCookie/serializeCookie.js b/test/serializeCookie/serializeCookie.js index ed4f462a7..62c174699 100644 --- a/test/serializeCookie/serializeCookie.js +++ b/test/serializeCookie/serializeCookie.js @@ -1,2 +1,2 @@ const serializeCookie = (name, val) => `${encodeURIComponent(name)}=${encodeURIComponent(val)}`; - module.exports = serializeCookie \ No newline at end of file +module.exports = serializeCookie \ No newline at end of file diff --git a/test/setStyle/setStyle.js b/test/setStyle/setStyle.js index 71db449eb..49574a009 100644 --- a/test/setStyle/setStyle.js +++ b/test/setStyle/setStyle.js @@ -1,2 +1,2 @@ const setStyle = (el, ruleName, val) => (el.style[ruleName] = val); - module.exports = setStyle \ No newline at end of file +module.exports = setStyle \ No newline at end of file diff --git a/test/shallowClone/shallowClone.js b/test/shallowClone/shallowClone.js index 8247d3f8e..a502e8a17 100644 --- a/test/shallowClone/shallowClone.js +++ b/test/shallowClone/shallowClone.js @@ -1,2 +1,2 @@ const shallowClone = obj => Object.assign({}, obj); - module.exports = shallowClone \ No newline at end of file +module.exports = shallowClone \ No newline at end of file diff --git a/test/show/show.js b/test/show/show.js index db22eab4f..f48b74226 100644 --- a/test/show/show.js +++ b/test/show/show.js @@ -1,2 +1,2 @@ const show = (...el) => [...el].forEach(e => (e.style.display = '')); - module.exports = show \ No newline at end of file +module.exports = show \ No newline at end of file diff --git a/test/shuffle/shuffle.js b/test/shuffle/shuffle.js index d2d3980ee..6f17df997 100644 --- a/test/shuffle/shuffle.js +++ b/test/shuffle/shuffle.js @@ -6,4 +6,4 @@ const i = Math.floor(Math.random() * m--); } return arr; }; - module.exports = shuffle \ No newline at end of file +module.exports = shuffle \ No newline at end of file diff --git a/test/similarity/similarity.js b/test/similarity/similarity.js index 3a3cc41e5..e1c53bfa6 100644 --- a/test/similarity/similarity.js +++ b/test/similarity/similarity.js @@ -1,2 +1,2 @@ const similarity = (arr, values) => arr.filter(v => values.includes(v)); - module.exports = similarity \ No newline at end of file +module.exports = similarity \ No newline at end of file diff --git a/test/size/size.js b/test/size/size.js index 639c8351f..55bb37d0d 100644 --- a/test/size/size.js +++ b/test/size/size.js @@ -4,4 +4,4 @@ Array.isArray(val) : val && typeof val === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0; - module.exports = size \ No newline at end of file +module.exports = size \ No newline at end of file diff --git a/test/sleep/sleep.js b/test/sleep/sleep.js index 4cfc9e189..ac53ad307 100644 --- a/test/sleep/sleep.js +++ b/test/sleep/sleep.js @@ -1,2 +1,2 @@ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); - module.exports = sleep \ No newline at end of file +module.exports = sleep \ No newline at end of file diff --git a/test/solveRPN/solveRPN.js b/test/solveRPN/solveRPN.js index 43e3d509a..57e7ecc41 100644 --- a/test/solveRPN/solveRPN.js +++ b/test/solveRPN/solveRPN.js @@ -26,4 +26,4 @@ throw `${symbol} is not a recognized symbol`; if (stack.length === 1) return stack.pop(); else throw `${rpn} is not a proper RPN. Please check it and try again`; }; - module.exports = solveRPN \ No newline at end of file +module.exports = solveRPN \ No newline at end of file diff --git a/test/sortCharactersInString/sortCharactersInString.js b/test/sortCharactersInString/sortCharactersInString.js index 74e6f2811..b8bcbef82 100644 --- a/test/sortCharactersInString/sortCharactersInString.js +++ b/test/sortCharactersInString/sortCharactersInString.js @@ -1,2 +1,2 @@ const sortCharactersInString = str => [...str].sort((a, b) => a.localeCompare(b)).join(''); - module.exports = sortCharactersInString \ No newline at end of file +module.exports = sortCharactersInString \ No newline at end of file diff --git a/test/sortedIndex/sortedIndex.js b/test/sortedIndex/sortedIndex.js index b4eb24061..c181d53ca 100644 --- a/test/sortedIndex/sortedIndex.js +++ b/test/sortedIndex/sortedIndex.js @@ -3,4 +3,4 @@ const isDescending = arr[0] > arr[arr.length - 1]; const index = arr.findIndex(el => (isDescending ? n >= el : n <= el)); return index === -1 ? arr.length : index; }; - module.exports = sortedIndex \ No newline at end of file +module.exports = sortedIndex \ No newline at end of file diff --git a/test/sortedLastIndex/sortedLastIndex.js b/test/sortedLastIndex/sortedLastIndex.js new file mode 100644 index 000000000..eaee796a5 --- /dev/null +++ b/test/sortedLastIndex/sortedLastIndex.js @@ -0,0 +1,9 @@ +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; +}; +module.exports = sortedLastIndex \ No newline at end of file diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js new file mode 100644 index 000000000..daad01738 --- /dev/null +++ b/test/sortedLastIndex/sortedLastIndex.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const sortedLastIndex = require('./sortedLastIndex.js'); + +test('Testing sortedLastIndex', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof sortedLastIndex === 'function', 'sortedLastIndex is a Function'); + //t.deepEqual(sortedLastIndex(args..), 'Expected'); + //t.equal(sortedLastIndex(args..), 'Expected'); + //t.false(sortedLastIndex(args..), 'Expected'); + //t.throws(sortedLastIndex(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/speechSynthesis/speechSynthesis.js b/test/speechSynthesis/speechSynthesis.js index eff6d4ce7..633cb5e41 100644 --- a/test/speechSynthesis/speechSynthesis.js +++ b/test/speechSynthesis/speechSynthesis.js @@ -3,4 +3,4 @@ const msg = new SpeechSynthesisUtterance(message); msg.voice = window.speechSynthesis.getVoices()[0]; window.speechSynthesis.speak(msg); }; - module.exports = speechSynthesis \ No newline at end of file +module.exports = speechSynthesis \ No newline at end of file diff --git a/test/splitLines/splitLines.js b/test/splitLines/splitLines.js index b112b6e0f..2d675dbc6 100644 --- a/test/splitLines/splitLines.js +++ b/test/splitLines/splitLines.js @@ -1,2 +1,2 @@ const splitLines = str => str.split(/\r?\n/); - module.exports = splitLines \ No newline at end of file +module.exports = splitLines \ No newline at end of file diff --git a/test/spreadOver/spreadOver.js b/test/spreadOver/spreadOver.js index 0048bff7f..5f2274140 100644 --- a/test/spreadOver/spreadOver.js +++ b/test/spreadOver/spreadOver.js @@ -1,2 +1,2 @@ const spreadOver = fn => argsArr => fn(...argsArr); - module.exports = spreadOver \ No newline at end of file +module.exports = spreadOver \ No newline at end of file diff --git a/test/standardDeviation/standardDeviation.js b/test/standardDeviation/standardDeviation.js index e9a033e68..249125b88 100644 --- a/test/standardDeviation/standardDeviation.js +++ b/test/standardDeviation/standardDeviation.js @@ -5,4 +5,4 @@ arr.reduce((acc, val) => acc.concat((val - mean) ** 2), []).reduce((acc, val) => (arr.length - (usePopulation ? 0 : 1)) ); }; - module.exports = standardDeviation \ No newline at end of file +module.exports = standardDeviation \ No newline at end of file diff --git a/test/sum/sum.js b/test/sum/sum.js index 22db1d186..27ba3fe25 100644 --- a/test/sum/sum.js +++ b/test/sum/sum.js @@ -1,2 +1,2 @@ const sum = (...arr) => [...arr].reduce((acc, val) => acc + val, 0); - module.exports = sum \ No newline at end of file +module.exports = sum \ No newline at end of file diff --git a/test/sumBy/sumBy.js b/test/sumBy/sumBy.js index 4c499baf5..c78200a47 100644 --- a/test/sumBy/sumBy.js +++ b/test/sumBy/sumBy.js @@ -1,3 +1,3 @@ const sumBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0); - module.exports = sumBy \ No newline at end of file +module.exports = sumBy \ No newline at end of file diff --git a/test/sumPower/sumPower.js b/test/sumPower/sumPower.js index 51b80ab57..a739bad0c 100644 --- a/test/sumPower/sumPower.js +++ b/test/sumPower/sumPower.js @@ -3,4 +3,4 @@ Array(end + 1 - start) .fill(0) .map((x, i) => (i + start) ** power) .reduce((a, b) => a + b, 0); - module.exports = sumPower \ No newline at end of file +module.exports = sumPower \ No newline at end of file diff --git a/test/symmetricDifference/symmetricDifference.js b/test/symmetricDifference/symmetricDifference.js index 862698500..5f2f4fe9a 100644 --- a/test/symmetricDifference/symmetricDifference.js +++ b/test/symmetricDifference/symmetricDifference.js @@ -3,4 +3,4 @@ const sA = new Set(a), sB = new Set(b); return [...a.filter(x => !sB.has(x)), ...b.filter(x => !sA.has(x))]; }; - module.exports = symmetricDifference \ No newline at end of file +module.exports = symmetricDifference \ No newline at end of file diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.js new file mode 100644 index 000000000..5ffe62578 --- /dev/null +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.js @@ -0,0 +1,6 @@ +const symmetricDifferenceBy = (a, b, fn) => { +const sA = new Set(a.map(v => fn(v))), +sB = new Set(b.map(v => fn(v))); +return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))]; +}; +module.exports = symmetricDifferenceBy \ No newline at end of file diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js new file mode 100644 index 000000000..ef7eb6a0e --- /dev/null +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); + +test('Testing symmetricDifferenceBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof symmetricDifferenceBy === 'function', 'symmetricDifferenceBy is a Function'); + //t.deepEqual(symmetricDifferenceBy(args..), 'Expected'); + //t.equal(symmetricDifferenceBy(args..), 'Expected'); + //t.false(symmetricDifferenceBy(args..), 'Expected'); + //t.throws(symmetricDifferenceBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.js new file mode 100644 index 000000000..0f58ea86a --- /dev/null +++ b/test/symmetricDifferenceWith/symmetricDifferenceWith.js @@ -0,0 +1,5 @@ +const symmetricDifferenceWith = (arr, val, comp) => [ +...arr.filter(a => val.findIndex(b => comp(a, b)) === -1), +...val.filter(a => arr.findIndex(b => comp(a, b)) === -1) +]; +module.exports = symmetricDifferenceWith \ No newline at end of file diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js new file mode 100644 index 000000000..bad9c3621 --- /dev/null +++ b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); + +test('Testing symmetricDifferenceWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof symmetricDifferenceWith === 'function', 'symmetricDifferenceWith is a Function'); + //t.deepEqual(symmetricDifferenceWith(args..), 'Expected'); + //t.equal(symmetricDifferenceWith(args..), 'Expected'); + //t.false(symmetricDifferenceWith(args..), 'Expected'); + //t.throws(symmetricDifferenceWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/tail/tail.js b/test/tail/tail.js index 4a32f24a3..a13eb8836 100644 --- a/test/tail/tail.js +++ b/test/tail/tail.js @@ -1,2 +1,2 @@ const tail = arr => (arr.length > 1 ? arr.slice(1) : arr); - module.exports = tail \ No newline at end of file +module.exports = tail \ No newline at end of file diff --git a/test/take/take.js b/test/take/take.js index a5b82b446..4bb5d6a19 100644 --- a/test/take/take.js +++ b/test/take/take.js @@ -1,2 +1,2 @@ const take = (arr, n = 1) => arr.slice(0, n); - module.exports = take \ No newline at end of file +module.exports = take \ No newline at end of file diff --git a/test/takeRight/takeRight.js b/test/takeRight/takeRight.js index b5bcef3d6..14bf346c8 100644 --- a/test/takeRight/takeRight.js +++ b/test/takeRight/takeRight.js @@ -1,2 +1,2 @@ const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length); - module.exports = takeRight \ No newline at end of file +module.exports = takeRight \ No newline at end of file diff --git a/test/testlog b/test/testlog index a393f7a85..3ea9fa418 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1354 +1,1401 @@ -Test log for: Tue Jan 23 2018 20:11:47 GMT+0000 (UTC) +Test log for: Wed Jan 24 2018 06:26:20 GMT-0500 (Eastern Standard Time) -> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code +> 30-seconds-of-code@0.0.1 test C:\Users\King David\Desktop\github-repo\30-seconds-of-code > tape test/**/*.test.js | tap-spec - Testing JSONToDate - - ✔ JSONToDate is a Function - - Testing JSONToFile - - ✔ JSONToFile is a Function - - Testing README - - ✔ README is a Function - - Testing RGBToHex - - ✔ RGBToHex is a Function - ✔ Converts the values of RGB components to a color code. - - 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 anagrams - ✔ anagrams is a Function - ✔ Generates all anagrams of a string + √ anagrams is a Function + √ Generates all anagrams of a string Testing arrayToHtmlList - ✔ arrayToHtmlList is a Function + √ arrayToHtmlList is a Function Testing atob - ✔ atob is a Function + √ atob is a Function 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 + √ 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 + √ averageBy is a Function Testing binarySearch - ✔ binarySearch is a Function + √ binarySearch is a Function Testing bottomVisible - ✔ bottomVisible is a Function + √ bottomVisible is a Function Testing btoa - ✔ btoa is a Function + √ btoa is a Function Testing byteSize - ✔ byteSize is a Function + √ byteSize is a Function Testing call - ✔ call is a Function + √ call is a Function Testing capitalize - ✔ capitalize is a Function - ✔ Capitalizes the first letter of a string - ✔ Capitalizes the first letter of a string + √ 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 + √ capitalizeEveryWord is a Function + √ Capitalizes the first letter of every word in a string Testing castArray - ✔ castArray is a Function + √ castArray is a Function Testing chainAsync - ✔ chainAsync is a Function + √ 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 + √ 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 + √ 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 + √ cleanObj is a Function + √ Removes any properties except the ones specified from a JSON object Testing cloneRegExp - ✔ cloneRegExp is a Function + √ cloneRegExp is a Function Testing coalesce - ✔ coalesce is a Function - ✔ Returns the first non-null/undefined argument + √ coalesce is a Function + √ Returns the first non-null/undefined argument Testing coalesceFactory - ✔ coalesceFactory is a Function - ✔ Returns a customized coalesce function + √ coalesceFactory is a Function + √ Returns a customized coalesce function Testing collatz - ✔ collatz is a Function + √ collatz is a Function Testing collectInto - ✔ collectInto is a Function + √ collectInto is a Function Testing colorize - ✔ colorize is a Function + √ colorize is a Function Testing compact - ✔ compact is a Function - ✔ Removes falsey values from an array + √ compact is a Function + √ Removes falsey values from an array Testing compose - ✔ compose is a Function - ✔ Performs right-to-left function composition + √ compose is a Function + √ Performs right-to-left function composition + + Testing composeRight + + √ composeRight is a Function Testing copyToClipboard - ✔ copyToClipboard is a Function + √ copyToClipboard is a Function Testing countBy - ✔ countBy is a Function + √ countBy is a Function Testing countOccurrences - ✔ countOccurrences is a Function - ✔ Counts the occurrences of a value in an array + √ countOccurrences is a Function + √ Counts the occurrences of a value in an array Testing countVowels - ✔ countVowels is a Function + √ countVowels is a Function Testing createElement - ✔ createElement is a Function + √ createElement is a Function Testing createEventHub - ✔ createEventHub is a Function + √ createEventHub is a Function Testing currentURL - ✔ currentURL is a Function + √ currentURL is a Function Testing curry - ✔ curry is a Function - ✔ curries a Math.pow - ✔ curries a Math.min + √ curry is a Function + √ curries a Math.pow + √ curries a Math.min Testing decapitalize - ✔ decapitalize is a Function + √ decapitalize is a Function Testing deepClone - ✔ deepClone is a Function + √ deepClone is a Function Testing deepFlatten - ✔ deepFlatten is a Function - ✔ Deep flattens an array + √ deepFlatten is a Function + √ Deep flattens an array Testing defaults - ✔ defaults is a Function + √ defaults is a Function Testing defer - ✔ defer is a Function + √ defer is a Function Testing detectDeviceType - ✔ detectDeviceType is a Function + √ detectDeviceType is a Function Testing difference - ✔ difference is a Function - ✔ Returns the difference between two arrays + √ 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 + √ 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 + √ digitize is a Function + √ Converts a number to an array of digits Testing distance - ✔ distance is a Function + √ distance is a Function Testing dropElements - ✔ dropElements is a Function - ✔ Removes elements in an array until the passed function returns true + √ dropElements 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 + √ 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 + √ elementIsVisibleInViewport is a Function Testing elo - ✔ elo is a Function - ✔ Standard 1v1s - ✔ should be equivalent - ✔ 4 player FFA, all same rank + √ 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. + √ 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 + √ 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 + √ 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 + √ 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 + √ 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 + √ 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 + √ factors is a Function Testing fibonacci - ✔ fibonacci is a Function - ✔ Generates an array, containing the Fibonacci sequence + √ fibonacci is a Function + √ Generates an array, containing the Fibonacci sequence Testing fibonacciCountUntilNum - ✔ fibonacciCountUntilNum is a Function + √ fibonacciCountUntilNum is a Function Testing fibonacciUntilNum - ✔ fibonacciUntilNum is a Function + √ fibonacciUntilNum is a Function Testing filterNonUnique - ✔ filterNonUnique is a Function - ✔ Filters out the non-unique values in an array + √ filterNonUnique is a Function + √ Filters out the non-unique values in an array Testing findKey - ✔ findKey is a Function + √ findKey is a Function Testing findLast - ✔ findLast is a Function + √ findLast is a Function + + Testing findLastIndex + + √ findLastIndex is a Function Testing findLastKey - ✔ findLastKey is a Function + √ findLastKey is a Function Testing flatten - ✔ flatten is a Function - ✔ Flattens an array - ✔ Flattens an array + √ flatten is a Function + √ Flattens an array + √ Flattens an array Testing flip - ✔ flip is a Function + √ flip is a Function Testing forEachRight - ✔ forEachRight is a Function - - Testing forOwn - - ✔ forOwn is a Function - - Testing forOwnRight - - ✔ forOwnRight is a Function + √ 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 + √ 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 + √ 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 + √ functionName is a Function Testing functions - ✔ functions is a Function + √ 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 + √ 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 + √ 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. + √ 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 + √ getDaysDiffBetweenDates is a Function + √ Returns the difference in days between two dates Testing getScrollPosition - ✔ getScrollPosition is a Function + √ getScrollPosition is a Function Testing getStyle - ✔ getStyle is a Function + √ getStyle is a Function Testing getType - ✔ getType is a Function - ✔ Returns the native type of a value + √ 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 + √ 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 + √ 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 + √ hammingDistance is a Function + √ retuns hamming disance between 2 values Testing hasClass - ✔ hasClass is a Function + √ hasClass is a Function Testing hasFlags - ✔ hasFlags is a Function + √ hasFlags is a Function Testing hashBrowser - ✔ hashBrowser is a Function + √ hashBrowser is a Function Testing hashNode - ✔ hashNode is a Function + √ 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 + √ 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 + √ 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 + √ hide is a Function Testing howManyTimes - ✔ howManyTimes is a Function + √ howManyTimes is a Function Testing httpDelete - ✔ httpDelete is a Function + √ httpDelete is a Function Testing httpGet - ✔ httpGet is a Function + √ httpGet is a Function Testing httpPost - ✔ httpPost is a Function + √ httpPost is a Function Testing httpPut - ✔ httpPut is a Function + √ httpPut is a Function Testing httpsRedirect - ✔ httpsRedirect is a Function - - 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 + √ 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 + √ 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 + √ 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 + √ 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 + √ initializeArrayWithRange is a Function + √ Initializes an array containing the numbers in the specified range Testing initializeArrayWithRangeRight - ✔ initializeArrayWithRangeRight is a Function + √ initializeArrayWithRangeRight is a Function Testing initializeArrayWithValues - ✔ initializeArrayWithValues is a Function - ✔ Initializes and fills an array with the specified values + √ 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 + √ 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 is a Function - ✖ Inverts the key-value pairs of an object + × Inverts the key-value pairs of an object ------------------------------------------- operator: deepEqual expected: |- { 20: 'age', John: 'name' } actual: |- { 20: [ 'age' ], John: [ 'name' ] } - at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/invertKeyValues/invertKeyValues.test.js:8:4) stack: |- Testing is - ✔ is is a Function + √ is is a Function 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 + √ 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 + √ isArmstrongNumber is a Function Testing isArray - ✔ isArray is a Function - ✔ passed value is an array - ✔ passed value is not an array + √ isArray is a Function + √ passed value is an array + √ passed value is not an array Testing isArrayBuffer - ✔ isArrayBuffer is a Function + √ isArrayBuffer is a Function Testing isArrayLike - ✔ isArrayLike is a Function + √ isArrayLike is a Function Testing isBoolean - ✔ isBoolean is a Function - ✔ passed value is not a boolean - ✔ passed value is not a boolean + √ 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 + √ isDivisible is a Function + √ The number 6 is divisible by 3 Testing isEmpty - ✔ isEmpty is a Function + √ isEmpty is a Function Testing isEven - ✔ isEven is a Function - ✔ 4 is even number - ✔ undefined + √ 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 + √ 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 + √ 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 + √ isMap is a Function Testing isNil - ✔ isNil is a Function + √ isNil is a Function Testing isNull - ✔ isNull is a Function - ✔ passed argument is a null - ✔ passed argument is a null + √ 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 + √ 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 + √ 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 + √ isObjectLike is a Function Testing isPlainObject - ✔ isPlainObject is a Function + √ isPlainObject is a Function Testing isPrime - ✔ isPrime is a Function - ✔ passed number is a prime + √ 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 + √ 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 + √ isPromiseLike is a Function Testing isRegExp - ✔ isRegExp is a Function + √ isRegExp is a Function Testing isSet - ✔ isSet is a Function + √ 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 + √ 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 + √ 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 + √ isSymbol is a Function + √ Checks if the given argument is a symbol Testing isTravisCI - ✔ isTravisCI is a Function + √ isTravisCI is a Function Testing isTypedArray - ✔ isTypedArray is a Function + √ isTypedArray is a Function Testing isUndefined - ✔ isUndefined is a Function + √ 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 + √ 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 + √ 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 + √ isWeakMap is a Function Testing isWeakSet - ✔ isWeakSet is a Function + √ 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 + √ 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 + √ 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. + √ 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 + √ longestItem is a Function + √ Returns the longest object Testing lowercaseKeys - ✔ lowercaseKeys is a Function + √ lowercaseKeys is a Function Testing luhnCheck - ✔ luhnCheck is a Function - ✔ validates identification number - ✔ validates identification number - ✔ validates identification number + √ luhnCheck is a Function + √ validates identification number + √ validates identification number + √ validates identification number Testing mapKeys - ✔ mapKeys is a Function + √ mapKeys is a Function Testing mapObject - ✔ mapObject is a Function - ✔ Maps the values of an array to an object using a function + √ mapObject is a Function + √ Maps the values of an array to an object using a function Testing mapValues - ✔ mapValues is a Function + √ 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 + √ 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 + √ matches is a Function Testing matchesWith - ✔ matchesWith is a Function + √ matchesWith is a Function Testing maxBy - ✔ maxBy is a Function + √ maxBy is a Function Testing maxN - ✔ maxN is a Function - ✔ Returns the n maximum elements from the provided array - ✔ Returns the n maximum elements from the provided array + √ 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 + √ 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 + √ memoize is a Function Testing merge - ✔ merge is a Function + √ merge is a Function Testing minBy - ✔ minBy is a Function + √ minBy is a Function Testing minN - ✔ minN is a Function - ✔ Returns the n minimum elements from the provided array - ✔ Returns the n minimum elements from the provided array + √ 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 + √ negate is a Function + √ Negates a predicate function Testing nthArg - ✔ nthArg is a Function + √ nthArg is a Function Testing nthElement - ✔ nthElement is a Function - ✔ Returns the nth element of an array. - ✔ Returns the nth element of an array. + √ 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. + √ 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. + √ objectToPairs is a Function + √ Creates an array of key-value pair arrays from an object. Testing observeMutations - ✔ observeMutations is a Function + √ observeMutations is a Function Testing off - ✔ off is a Function + √ off is a Function Testing omit - ✔ omit is a Function + √ omit is a Function Testing omitBy - ✔ omitBy is a Function + √ omitBy is a Function Testing on - ✔ on is a Function - - Testing onUserInputChange - - ✔ onUserInputChange is a Function + √ on is a Function Testing once - ✔ once is a Function + √ 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. + √ 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 + √ over is a Function Testing palindrome - ✔ palindrome is a Function - ✔ Given string is a palindrome - ✔ Given string is not a palindrome + √ palindrome is a Function + √ Given string is a palindrome + √ Given string is not a palindrome Testing parseCookie - ✔ parseCookie is a Function + √ parseCookie 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. + √ 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. + √ 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. + √ pick is a Function + √ Picks the key-value pairs corresponding to the given keys from an object. Testing pickBy - ✔ pickBy is a Function + √ pickBy is a Function Testing pipeFunctions - ✔ pipeFunctions is a Function + √ pipeFunctions is a Function Testing pluralize - ✔ pluralize is a Function + √ pluralize is a Function Testing powerset - ✔ powerset is a Function - ✔ Returns the powerset of a given array of numbers. + √ 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. + √ 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. + √ primes is a Function + √ Generates primes up to a given number, using the Sieve of Eratosthenes. Testing promisify - ✔ promisify is a Function + √ promisify is a Function Testing pull - ✔ pull is a Function + √ pull is a Function Testing pullAtIndex - ✔ pullAtIndex is a Function + √ pullAtIndex is a Function Testing pullAtValue - ✔ pullAtValue is a Function + √ 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 + √ 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 + √ randomHexColorCode is a Function Testing randomIntArrayInRange - ✔ randomIntArrayInRange is a Function + √ randomIntArrayInRange is a Function Testing randomIntegerInRange - ✔ randomIntegerInRange is a Function + √ randomIntegerInRange is a Function Testing randomNumberInRange - ✔ randomNumberInRange is a Function + √ randomNumberInRange is a Function Testing readFileLines - ✔ readFileLines is a Function + √ readFileLines is a Function + + Testing README + + √ README is a Function Testing redirect - ✔ redirect is a Function + √ 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. + √ reducedFilter is a Function + √ Filter an array of objects based on a condition while also filtering out unspecified keys. Testing remove - ✔ remove is a Function - ✔ Removes elements from an array for which the given function returns false + √ remove is a Function + √ Removes elements from an array for which the given function returns false Testing removeVowels - ✔ removeVowels is a Function + √ removeVowels is a Function Testing reverseString - ✔ reverseString is a Function - ✔ Reverses a string. + √ 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. + √ round is a Function + √ Rounds a number to a specified amount of digits. Testing runAsync - ✔ runAsync is a Function + √ runAsync is a Function Testing runPromisesInSeries - ✔ runPromisesInSeries is a Function + √ runPromisesInSeries is a Function Testing sample - ✔ sample is a Function + √ sample is a Function Testing sampleSize - ✔ sampleSize is a Function + √ sampleSize is a Function Testing scrollToTop - ✔ scrollToTop is a Function + √ scrollToTop is a Function Testing sdbm - ✔ sdbm is a Function - ✔ Hashes the input string into a whole number. + √ sdbm is a Function + √ Hashes the input string into a whole number. Testing serializeCookie - ✔ serializeCookie is a Function + √ serializeCookie is a Function Testing setStyle - ✔ setStyle is a Function + √ setStyle is a Function Testing shallowClone - ✔ shallowClone is a Function + √ shallowClone is a Function Testing show - ✔ show is a Function + √ show is a Function Testing shuffle - ✔ shuffle is a Function + √ shuffle is a Function Testing similarity - ✔ similarity is a Function - ✔ Returns an array of elements that appear in both arrays. + √ 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. + √ size is a Function + √ Get size of arrays, objects or strings. + √ Get size of arrays, objects or strings. Testing sleep - ✔ sleep is a Function + √ sleep is a Function Testing solveRPN - ✔ solveRPN is a Function + √ solveRPN is a Function Testing sortCharactersInString - ✔ sortCharactersInString is a Function - ✔ Alphabetically sorts the characters in a string. + √ 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. + √ 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 + √ speechSynthesis is a Function Testing splitLines - ✔ splitLines is a Function - ✔ Splits a multiline string into an array of lines. + √ 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. + √ 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 + √ 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. + √ sum is a Function + √ Returns the sum of two or more numbers/arrays. Testing sumBy - ✔ sumBy is a Function + √ 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 + √ 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. + √ 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 + √ 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. + √ 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 + √ 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 timeTaken - ✔ timeTaken is a Function + √ 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 + √ 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 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 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 + √ toDecimalMark is a Function + √ convert a float-point arithmetic to the Decimal mark form Testing toggleClass - ✔ toggleClass is a Function + √ 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 + √ 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 + √ transform is a Function Testing truncateString - ✔ truncateString is a Function - ✔ Truncates a "boomerang" up to a specified length. + √ 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 + √ truthCheckCollection is a Function + √ second argument is truthy on all elements of a collection Testing unescapeHTML - ✔ unescapeHTML is a Function - ✔ Unescapes escaped HTML characters. + √ unescapeHTML is a Function + √ Unescapes escaped HTML characters. Testing union - ✔ union is a Function - ✔ Returns every element that exists in any of the two arrays once + √ 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 + √ uniqueElements is a Function + √ Returns all unique values of an array Testing untildify - ✔ untildify is a Function + √ untildify is a Function + + Testing unzip + + √ unzip is a Function + + Testing unzipWith + + √ unzipWith is a Function + + 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 + √ 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 + √ 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 + √ 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 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 + √ 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 + √ 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 + √ 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 + √ zipWith is a Function @@ -1356,13 +1403,13 @@ Test log for: Tue Jan 23 2018 20:11:47 GMT+0000 (UTC) Testing invertKeyValues - ✖ Inverts the key-value pairs of an object + × Inverts the key-value pairs of an object - total: 574 - passing: 573 + total: 586 + passing: 585 failing: 1 - duration: 440ms + duration: 521ms undefined \ No newline at end of file diff --git a/test/timeTaken/timeTaken.js b/test/timeTaken/timeTaken.js index ae31b01a2..59d0def76 100644 --- a/test/timeTaken/timeTaken.js +++ b/test/timeTaken/timeTaken.js @@ -4,4 +4,4 @@ const r = callback(); console.timeEnd('timeTaken'); return r; }; - module.exports = timeTaken \ No newline at end of file +module.exports = timeTaken \ No newline at end of file diff --git a/test/toCamelCase/toCamelCase.js b/test/toCamelCase/toCamelCase.js index 44ee52a34..93d2098c1 100644 --- a/test/toCamelCase/toCamelCase.js +++ b/test/toCamelCase/toCamelCase.js @@ -7,4 +7,4 @@ str .join(''); return s.slice(0, 1).toLowerCase() + s.slice(1); }; - module.exports = toCamelCase \ No newline at end of file +module.exports = toCamelCase \ No newline at end of file diff --git a/test/toDecimalMark/toDecimalMark.js b/test/toDecimalMark/toDecimalMark.js index e7de2e7d9..68b31c094 100644 --- a/test/toDecimalMark/toDecimalMark.js +++ b/test/toDecimalMark/toDecimalMark.js @@ -1,2 +1,2 @@ const toDecimalMark = num => num.toLocaleString('en-US'); - module.exports = toDecimalMark \ No newline at end of file +module.exports = toDecimalMark \ No newline at end of file diff --git a/test/toKebabCase/toKebabCase.js b/test/toKebabCase/toKebabCase.js index 2b313a66d..7a8fef0f6 100644 --- a/test/toKebabCase/toKebabCase.js +++ b/test/toKebabCase/toKebabCase.js @@ -4,4 +4,4 @@ str .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) .map(x => x.toLowerCase()) .join('-'); - module.exports = toKebabCase \ No newline at end of file +module.exports = toKebabCase \ No newline at end of file diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.js b/test/toOrdinalSuffix/toOrdinalSuffix.js index 6afa22b31..0f3d9b25d 100644 --- a/test/toOrdinalSuffix/toOrdinalSuffix.js +++ b/test/toOrdinalSuffix/toOrdinalSuffix.js @@ -8,4 +8,4 @@ return oPattern.includes(digits[0]) && !tPattern.includes(digits[1]) ? int + ordinals[digits[0] - 1] : int + ordinals[3]; }; - module.exports = toOrdinalSuffix \ No newline at end of file +module.exports = toOrdinalSuffix \ No newline at end of file diff --git a/test/toSafeInteger/toSafeInteger.js b/test/toSafeInteger/toSafeInteger.js index 166e465a4..b34b0b0b7 100644 --- a/test/toSafeInteger/toSafeInteger.js +++ b/test/toSafeInteger/toSafeInteger.js @@ -1,3 +1,3 @@ const toSafeInteger = num => Math.round(Math.max(Math.min(num, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER)); - module.exports = toSafeInteger \ No newline at end of file +module.exports = toSafeInteger \ No newline at end of file diff --git a/test/toSnakeCase/toSnakeCase.js b/test/toSnakeCase/toSnakeCase.js index 9fffb9201..4e18c9123 100644 --- a/test/toSnakeCase/toSnakeCase.js +++ b/test/toSnakeCase/toSnakeCase.js @@ -4,4 +4,4 @@ str .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) .map(x => x.toLowerCase()) .join('_'); - module.exports = toSnakeCase \ No newline at end of file +module.exports = toSnakeCase \ No newline at end of file diff --git a/test/toggleClass/toggleClass.js b/test/toggleClass/toggleClass.js index 2ad186b51..90de4b417 100644 --- a/test/toggleClass/toggleClass.js +++ b/test/toggleClass/toggleClass.js @@ -1,2 +1,2 @@ const toggleClass = (el, className) => el.classList.toggle(className); - module.exports = toggleClass \ No newline at end of file +module.exports = toggleClass \ No newline at end of file diff --git a/test/tomorrow/tomorrow.js b/test/tomorrow/tomorrow.js index 4e3ee9776..cb644dc4e 100644 --- a/test/tomorrow/tomorrow.js +++ b/test/tomorrow/tomorrow.js @@ -5,4 +5,4 @@ return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String t.getDate() ).padStart(2, '0')}`; }; - module.exports = tomorrow \ No newline at end of file +module.exports = tomorrow \ No newline at end of file diff --git a/test/transform/transform.js b/test/transform/transform.js index e6f4c6ef8..1232a4a9b 100644 --- a/test/transform/transform.js +++ b/test/transform/transform.js @@ -1,2 +1,2 @@ const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc); - module.exports = transform \ No newline at end of file +module.exports = transform \ No newline at end of file diff --git a/test/truncateString/truncateString.js b/test/truncateString/truncateString.js index 307d0c12b..ef9546701 100644 --- a/test/truncateString/truncateString.js +++ b/test/truncateString/truncateString.js @@ -1,3 +1,3 @@ const truncateString = (str, num) => str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; - module.exports = truncateString \ No newline at end of file +module.exports = truncateString \ No newline at end of file diff --git a/test/truthCheckCollection/truthCheckCollection.js b/test/truthCheckCollection/truthCheckCollection.js index 3841a8dce..8a7ada0b0 100644 --- a/test/truthCheckCollection/truthCheckCollection.js +++ b/test/truthCheckCollection/truthCheckCollection.js @@ -1,2 +1,2 @@ const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]); - module.exports = truthCheckCollection \ No newline at end of file +module.exports = truthCheckCollection \ No newline at end of file diff --git a/test/unescapeHTML/unescapeHTML.js b/test/unescapeHTML/unescapeHTML.js index c4b6c379e..a82099aa1 100644 --- a/test/unescapeHTML/unescapeHTML.js +++ b/test/unescapeHTML/unescapeHTML.js @@ -10,4 +10,4 @@ tag => '"': '"' }[tag] || tag) ); - module.exports = unescapeHTML \ No newline at end of file +module.exports = unescapeHTML \ No newline at end of file diff --git a/test/union/union.js b/test/union/union.js index 1f86c4442..d0b4b52ea 100644 --- a/test/union/union.js +++ b/test/union/union.js @@ -1,2 +1,2 @@ const union = (a, b) => Array.from(new Set([...a, ...b])); - module.exports = union \ No newline at end of file +module.exports = union \ No newline at end of file diff --git a/test/unionBy/unionBy.js b/test/unionBy/unionBy.js new file mode 100644 index 000000000..d4afc4763 --- /dev/null +++ b/test/unionBy/unionBy.js @@ -0,0 +1,5 @@ +const unionBy = (a, b, fn) => { +const s = new Set(a.map(v => fn(v))); +return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))])); +}; +module.exports = unionBy \ No newline at end of file diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js new file mode 100644 index 000000000..8377bbbce --- /dev/null +++ b/test/unionBy/unionBy.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const unionBy = require('./unionBy.js'); + +test('Testing unionBy', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof unionBy === 'function', 'unionBy is a Function'); + //t.deepEqual(unionBy(args..), 'Expected'); + //t.equal(unionBy(args..), 'Expected'); + //t.false(unionBy(args..), 'Expected'); + //t.throws(unionBy(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/unionWith/unionWith.js b/test/unionWith/unionWith.js new file mode 100644 index 000000000..cb1ca174d --- /dev/null +++ b/test/unionWith/unionWith.js @@ -0,0 +1,3 @@ +const unionWith = (a, b, comp) => +Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])); +module.exports = unionWith \ No newline at end of file diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js new file mode 100644 index 000000000..e9df2f1c8 --- /dev/null +++ b/test/unionWith/unionWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const unionWith = require('./unionWith.js'); + +test('Testing unionWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof unionWith === 'function', 'unionWith is a Function'); + //t.deepEqual(unionWith(args..), 'Expected'); + //t.equal(unionWith(args..), 'Expected'); + //t.false(unionWith(args..), 'Expected'); + //t.throws(unionWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/uniqueElements/uniqueElements.js b/test/uniqueElements/uniqueElements.js index 5e5b4315d..feb8e9b74 100644 --- a/test/uniqueElements/uniqueElements.js +++ b/test/uniqueElements/uniqueElements.js @@ -1,2 +1,2 @@ const uniqueElements = arr => [...new Set(arr)]; - module.exports = uniqueElements \ No newline at end of file +module.exports = uniqueElements \ No newline at end of file diff --git a/test/untildify/untildify.js b/test/untildify/untildify.js index a95120fb9..4962b7567 100644 --- a/test/untildify/untildify.js +++ b/test/untildify/untildify.js @@ -1,2 +1,2 @@ const untildify = str => str.replace(/^~($|\/|\\)/, `${require('os').homedir()}$1`); - module.exports = untildify \ No newline at end of file +module.exports = untildify \ No newline at end of file diff --git a/test/unzip/unzip.js b/test/unzip/unzip.js new file mode 100644 index 000000000..4cfe50a93 --- /dev/null +++ b/test/unzip/unzip.js @@ -0,0 +1,8 @@ +const unzip = arr => +arr.reduce( +(acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), +Array.from({ +length: Math.max(...arr.map(x => x.length)) +}).map(x => []) +); +module.exports = unzip \ No newline at end of file diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js new file mode 100644 index 000000000..17efbc0a4 --- /dev/null +++ b/test/unzip/unzip.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const unzip = require('./unzip.js'); + +test('Testing unzip', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof unzip === 'function', 'unzip is a Function'); + //t.deepEqual(unzip(args..), 'Expected'); + //t.equal(unzip(args..), 'Expected'); + //t.false(unzip(args..), 'Expected'); + //t.throws(unzip(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/unzipWith/unzipWith.js b/test/unzipWith/unzipWith.js new file mode 100644 index 000000000..6f1ba0869 --- /dev/null +++ b/test/unzipWith/unzipWith.js @@ -0,0 +1,10 @@ +const unzipWith = (arr, fn) => +arr +.reduce( +(acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), +Array.from({ +length: Math.max(...arr.map(x => x.length)) +}).map(x => []) +) +.map(val => fn(...val)); +module.exports = unzipWith \ No newline at end of file diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js new file mode 100644 index 000000000..09f3d2429 --- /dev/null +++ b/test/unzipWith/unzipWith.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const unzipWith = require('./unzipWith.js'); + +test('Testing unzipWith', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof unzipWith === 'function', 'unzipWith is a Function'); + //t.deepEqual(unzipWith(args..), 'Expected'); + //t.equal(unzipWith(args..), 'Expected'); + //t.false(unzipWith(args..), 'Expected'); + //t.throws(unzipWith(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/validateNumber/validateNumber.js b/test/validateNumber/validateNumber.js index 05e4a8a06..1b03adf29 100644 --- a/test/validateNumber/validateNumber.js +++ b/test/validateNumber/validateNumber.js @@ -1,2 +1,2 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; - module.exports = validateNumber \ No newline at end of file +module.exports = validateNumber \ No newline at end of file diff --git a/test/without/without.js b/test/without/without.js index ffd99a9d3..598b31253 100644 --- a/test/without/without.js +++ b/test/without/without.js @@ -1,2 +1,2 @@ const without = (arr, ...args) => arr.filter(v => !args.includes(v)); - module.exports = without \ No newline at end of file +module.exports = without \ No newline at end of file diff --git a/test/words/words.js b/test/words/words.js index 936b7d6ca..d26c714fa 100644 --- a/test/words/words.js +++ b/test/words/words.js @@ -1,2 +1,2 @@ const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean); - module.exports = words \ No newline at end of file +module.exports = words \ No newline at end of file diff --git a/test/yesNo/yesNo.js b/test/yesNo/yesNo.js index 437338d17..11a2a248a 100644 --- a/test/yesNo/yesNo.js +++ b/test/yesNo/yesNo.js @@ -1,3 +1,3 @@ const yesNo = (val, def = false) => /^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def; - module.exports = yesNo \ No newline at end of file +module.exports = yesNo \ No newline at end of file diff --git a/test/zip/zip.js b/test/zip/zip.js index e248b5de5..60ad9d244 100644 --- a/test/zip/zip.js +++ b/test/zip/zip.js @@ -4,4 +4,4 @@ return Array.from({ length: maxLength }).map((_, i) => { return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); }); }; - module.exports = zip \ No newline at end of file +module.exports = zip \ No newline at end of file diff --git a/test/zipObject/zipObject.js b/test/zipObject/zipObject.js index 7e1f6f633..e077594b4 100644 --- a/test/zipObject/zipObject.js +++ b/test/zipObject/zipObject.js @@ -1,3 +1,3 @@ const zipObject = (props, values) => props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {}); - module.exports = zipObject \ No newline at end of file +module.exports = zipObject \ No newline at end of file diff --git a/test/zipWith/zipWith.js b/test/zipWith/zipWith.js index 7c0336738..39d5d18bb 100644 --- a/test/zipWith/zipWith.js +++ b/test/zipWith/zipWith.js @@ -8,4 +8,4 @@ return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); }); return fn ? result.map(arr => fn(...arr)) : result; }; - module.exports = zipWith \ No newline at end of file +module.exports = zipWith \ No newline at end of file From f92c20a5cff4fac7a8d665b1c8c9fba6ddfb3d3e Mon Sep 17 00:00:00 2001 From: King Date: Wed, 24 Jan 2018 06:30:59 -0500 Subject: [PATCH 061/103] update invertKeyValues with basic proper passing test --- test/invertKeyValues/invertKeyValues.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js index 41c0a4bc0..d51d06314 100644 --- a/test/invertKeyValues/invertKeyValues.test.js +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -5,7 +5,8 @@ test('Testing invertKeyValues', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof invertKeyValues === 'function', 'invertKeyValues is a Function'); - t.deepEqual(invertKeyValues({ name: 'John', age: 20 }), { 20: 'age', John: 'name' }, "Inverts the key-value pairs of an object"); + t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }), { 1: [ 'a', 'c' ], 2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }"); + t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value), { group1: [ 'a', 'c' ], group2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] }"); //t.deepEqual(invertKeyValues(args..), 'Expected'); //t.equal(invertKeyValues(args..), 'Expected'); //t.false(invertKeyValues(args..), 'Expected'); From 9bd8cd6abd16449c12222cf63a721ec93cc017b9 Mon Sep 17 00:00:00 2001 From: King Date: Wed, 24 Jan 2018 06:32:11 -0500 Subject: [PATCH 062/103] ran npm run tester problem fixed and add updated test log --- test/testlog | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/test/testlog b/test/testlog index 3ea9fa418..b864db66f 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Wed Jan 24 2018 06:26:20 GMT-0500 (Eastern Standard Time) +Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time) > 30-seconds-of-code@0.0.1 test C:\Users\King David\Desktop\github-repo\30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -533,16 +533,8 @@ Test log for: Wed Jan 24 2018 06:26:20 GMT-0500 (Eastern Standard Time) Testing invertKeyValues √ invertKeyValues is a Function - - × Inverts the key-value pairs of an object - ------------------------------------------- - operator: deepEqual - expected: |- - { 20: 'age', John: 'name' } - actual: |- - { 20: [ 'age' ], John: [ 'name' ] } - stack: |- - + √ 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 @@ -1398,18 +1390,8 @@ Test log for: Wed Jan 24 2018 06:26:20 GMT-0500 (Eastern Standard Time) √ zipWith is a Function - - Failed Tests: There was 1 failure - - Testing invertKeyValues - - × Inverts the key-value pairs of an object + total: 587 + passing: 587 + duration: 520ms - total: 586 - passing: 585 - failing: 1 - duration: 521ms - - -undefined \ No newline at end of file From 87a650854a654b2c7757bbb6f7a92795cfd0d593 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 24 Jan 2018 13:50:49 +0200 Subject: [PATCH 063/103] Add times --- snippets/times.md | 19 +++++++++++++++++++ tag_database | 1 + 2 files changed, 20 insertions(+) create mode 100644 snippets/times.md diff --git a/snippets/times.md b/snippets/times.md new file mode 100644 index 000000000..433cae185 --- /dev/null +++ b/snippets/times.md @@ -0,0 +1,19 @@ +### times + +Iterates over a callback `n` times + +Use `Function.call()` to call `fn` `n` times or until it returns `false`. +Omit the last argument, `context`, to use an `undefined` object (or the global object in non-strict mode). + +```js +const times = (n, fn, context = undefined) => { + let i = 0; + while (fn.call(context, i) !== false && ++i < n) {} +} +``` + +```js +var output = ''; +times(5, i => output += i); +console.log(output); // 01234 +``` diff --git a/tag_database b/tag_database index e942ec1e5..da3fb5c24 100644 --- a/tag_database +++ b/tag_database @@ -209,6 +209,7 @@ symmetricDifferenceWith:array,function tail:array take:array takeRight:array +times:function timeTaken:utility toCamelCase:string,regexp toDecimalMark:utility,math From 788d625b621cb2f8b91951496aaf0f05bcc53be3 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 24 Jan 2018 11:51:58 +0000 Subject: [PATCH 064/103] Travis build: 1383 --- README.md | 29 +++++++++++++++++++++++++++++ docs/index.html | 9 ++++++++- snippets/times.md | 4 ++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6adbe5366..a197fc793 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,7 @@ average(1, 2, 3); * [`once`](#once) * [`runPromisesInSeries`](#runpromisesinseries) * [`sleep`](#sleep) +* [`times`](#times)
    @@ -3429,6 +3430,34 @@ async function sleepyWork() {
    [⬆ Back to top](#table-of-contents) + +### times + +Iterates over a callback `n` times + +Use `Function.call()` to call `fn` `n` times or until it returns `false`. +Omit the last argument, `context`, to use an `undefined` object (or the global object in non-strict mode). + +```js +const times = (n, fn, context = undefined) => { + let i = 0; + while (fn.call(context, i) !== false && ++i < n) {} +}; +``` + +
    +Examples + +```js +var output = ''; +times(5, i => (output += i)); +console.log(output); // 01234 +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + --- ## ➗ Math diff --git a/docs/index.html b/docs/index.html index a621c02f4..4a19d1625 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    @@ -762,6 +762,13 @@ document.bodyawait sleep(1000);
       console.log('I woke up after 1 second.');
     }
    +

    times

    Iterates over a callback n times

    Use Function.call() to call fn n times or until it returns false. Omit the last argument, context, to use an undefined object (or the global object in non-strict mode).

    const times = (n, fn, context = undefined) => {
    +  let i = 0;
    +  while (fn.call(context, i) !== false && ++i < n) {}
    +};
    +
    var output = '';
    +times(5, i => (output += i));
    +console.log(output); // 01234
     

    Math

    average

    Returns the average of an of two or more numbers.

    Use Array.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

    const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
     
    average(...[1, 2, 3]); // 2
     average(1, 2, 3); // 2
    diff --git a/snippets/times.md b/snippets/times.md
    index 433cae185..2563ff5bc 100644
    --- a/snippets/times.md
    +++ b/snippets/times.md
    @@ -9,11 +9,11 @@ Omit the last argument, `context`, to use an `undefined` object (or the global o
     const times = (n, fn, context = undefined) => {
       let i = 0;
       while (fn.call(context, i) !== false && ++i < n) {}
    -}
    +};
     ```
     
     ```js
     var output = '';
    -times(5, i => output += i);
    +times(5, i => (output += i));
     console.log(output); // 01234
     ```
    
    From a6ef5f72d947498a7c98799340b6c8580cade4e7 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 13:59:54 +0200
    Subject: [PATCH 065/103] Add ary
    
    ---
     snippets/ary.md | 14 ++++++++++++++
     tag_database    |  1 +
     2 files changed, 15 insertions(+)
     create mode 100644 snippets/ary.md
    
    diff --git a/snippets/ary.md b/snippets/ary.md
    new file mode 100644
    index 000000000..5251d72cd
    --- /dev/null
    +++ b/snippets/ary.md
    @@ -0,0 +1,14 @@
    +### ary
    +
    +Creates a function that accepts up to `n` arguments, ignoring any additional arguments.
    +
    +Call the provided function, `fn`, with up to `n` arguments, using `Array.slice(0,n)` and the spread operator (`...`).
    +
    +```js
    +const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +```
    +
    +```js
    +const firstTwoMax = ary(Math.max, 2);
    +[[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
    +```
    diff --git a/tag_database b/tag_database
    index da3fb5c24..3fd6e374f 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -1,5 +1,6 @@
     anagrams:string,recursion
     arrayToHtmlList:browser,array
    +ary:adapter,function
     atob:node,string,utility
     average:math,array
     averageBy:math,array,function
    
    From d2fbff7ddadcf36cdf4ad9c2e8bf3ccfdc396cbb Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 12:02:05 +0000
    Subject: [PATCH 066/103] Travis build: 1385
    
    ---
     README.md       | 24 ++++++++++++++++++++++++
     docs/index.html |  5 ++++-
     2 files changed, 28 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index a197fc793..dae4b557a 100644
    --- a/README.md
    +++ b/README.md
    @@ -77,6 +77,7 @@ average(1, 2, 3);
     
    View contents +* [`ary`](#ary) * [`call`](#call) * [`collectInto`](#collectinto) * [`flip`](#flip) @@ -414,6 +415,29 @@ average(1, 2, 3); --- ## 🔌 Adapter +### ary + +Creates a function that accepts up to `n` arguments, ignoring any additional arguments. + +Call the provided function, `fn`, with up to `n` arguments, using `Array.slice(0,n)` and the spread operator (`...`). + +```js +const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); +``` + +
    +Examples + +```js +const firstTwoMax = ary(Math.max, 2); +[[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### call Given a key and a set of arguments, call them when given a context. Primarily useful in composition. diff --git a/docs/index.html b/docs/index.html index 4a19d1625..db0ed852a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,10 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +
    const firstTwoMax = ary(Math.max, 2);
    +[[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
    +

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
     
    Promise.resolve([1, 2, 3])
       .then(call('map', x => 2 * x))
       .then(console.log); //[ 2, 4, 6 ]
    
    From e501e7170c1cf5c36834e1edc0584186b55faed5 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 14:14:49 +0200
    Subject: [PATCH 067/103] Add bind
    
    ---
     snippets/bind.md | 22 ++++++++++++++++++++++
     tag_database     |  1 +
     2 files changed, 23 insertions(+)
     create mode 100644 snippets/bind.md
    
    diff --git a/snippets/bind.md b/snippets/bind.md
    new file mode 100644
    index 000000000..73e1ab253
    --- /dev/null
    +++ b/snippets/bind.md
    @@ -0,0 +1,22 @@
    +### bind
    +
    +Creates a function that invokes `fn` with a given context, optionally adding any additional supplied parameters to the beginning of the arguments.
    +
    +Return a `function` that uses `Function.apply()` to apply the given `context` to `fn`.
    +Use `Array.concat()` to prepend any additional supplied parameters to the arguments.
    +
    +```js
    +const bind = (fn, context, ...args) =>
    +  function() {
    +    return fn.apply(context, args.concat(...arguments));
    +  };
    +```
    +
    +```js
    +function greet(greeting, punctuation) {
    +  return greeting + ' ' + this.user + punctuation;
    +}
    +const freddy = { 'user': 'fred' };
    +const freddyBound = bind(greet, freddy);
    +console.log(freddyBound('hi','!')); // 'hi fred!'
    +```
    diff --git a/tag_database b/tag_database
    index 3fd6e374f..fd216c710 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -4,6 +4,7 @@ ary:adapter,function
     atob:node,string,utility
     average:math,array
     averageBy:math,array,function
    +bind:function,object
     bottomVisible:browser
     btoa:node,string,utility
     byteSize:string
    
    From 6353f9b51a32732280275f5218d16486b8ed01aa Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 12:16:45 +0000
    Subject: [PATCH 068/103] Travis build: 1387
    
    ---
     README.md        | 32 ++++++++++++++++++++++++++++++++
     docs/index.html  | 14 ++++++++++++--
     snippets/bind.md |  4 ++--
     3 files changed, 46 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index dae4b557a..39697ed58 100644
    --- a/README.md
    +++ b/README.md
    @@ -217,6 +217,7 @@ average(1, 2, 3);
     
    View contents +* [`bind`](#bind) * [`chainAsync`](#chainasync) * [`compose`](#compose) * [`composeRight`](#composeright) @@ -3153,6 +3154,37 @@ tomorrow(); // 2017-12-27 (if current date is 2017-12-26) --- ## 🎛️ Function +### bind + +Creates a function that invokes `fn` with a given context, optionally adding any additional supplied parameters to the beginning of the arguments. + +Return a `function` that uses `Function.apply()` to apply the given `context` to `fn`. +Use `Array.concat()` to prepend any additional supplied parameters to the arguments. + +```js +const bind = (fn, context, ...args) => + function() { + return fn.apply(context, args.concat(...arguments)); + }; +``` + +
    +Examples + +```js +function greet(greeting, punctuation) { + return greeting + ' ' + this.user + punctuation; +} +const freddy = { user: 'fred' }; +const freddyBound = bind(greet, freddy); +console.log(freddyBound('hi', '!')); // 'hi fred!' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### chainAsync Chains asynchronous functions. diff --git a/docs/index.html b/docs/index.html index db0ed852a..708ed4bb5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -691,7 +691,17 @@ document.bodypadStart(2, '0')}`;
     };
     
    tomorrow(); // 2017-12-27 (if current date is 2017-12-26)
    -

    Function

    chainAsync

    Chains asynchronous functions.

    Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

    const chainAsync = fns => {
    +

    Function

    bind

    Creates a function that invokes fn with a given context, optionally adding any additional supplied parameters to the beginning of the arguments.

    Return a function that uses Function.apply() to apply the given context to fn. Use Array.concat() to prepend any additional supplied parameters to the arguments.

    const bind = (fn, context, ...args) =>
    +  function() {
    +    return fn.apply(context, args.concat(...arguments));
    +  };
    +
    function greet(greeting, punctuation) {
    +  return greeting + ' ' + this.user + punctuation;
    +}
    +const freddy = { user: 'fred' };
    +const freddyBound = bind(greet, freddy);
    +console.log(freddyBound('hi', '!')); // 'hi fred!'
    +

    chainAsync

    Chains asynchronous functions.

    Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

    const chainAsync = fns => {
       let curr = 0;
       const next = () => fns[curr++](next);
       next();
    diff --git a/snippets/bind.md b/snippets/bind.md
    index 73e1ab253..c0a9402e2 100644
    --- a/snippets/bind.md
    +++ b/snippets/bind.md
    @@ -16,7 +16,7 @@ const bind = (fn, context, ...args) =>
     function greet(greeting, punctuation) {
       return greeting + ' ' + this.user + punctuation;
     }
    -const freddy = { 'user': 'fred' };
    +const freddy = { user: 'fred' };
     const freddyBound = bind(greet, freddy);
    -console.log(freddyBound('hi','!')); // 'hi fred!'
    +console.log(freddyBound('hi', '!')); // 'hi fred!'
     ```
    
    From f8040881b8a4018e11f2df20292e5f36103d9b26 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 14:22:43 +0200
    Subject: [PATCH 069/103] Add bindKey
    
    ---
     snippets/bindKey.md | 24 ++++++++++++++++++++++++
     tag_database        |  1 +
     2 files changed, 25 insertions(+)
     create mode 100644 snippets/bindKey.md
    
    diff --git a/snippets/bindKey.md b/snippets/bindKey.md
    new file mode 100644
    index 000000000..2ff80f861
    --- /dev/null
    +++ b/snippets/bindKey.md
    @@ -0,0 +1,24 @@
    +### bindKey
    +
    +Creates a function that invokes the method at a given key of an object, optionally adding any additional supplied parameters to the beginning of the arguments.
    +
    +Return a `function` that uses `Function.apply()` to bind `context[fn]` to `context`.
    +Use `Array.concat()` to prepend any additional supplied parameters to the arguments.
    +
    +```js
    +const bindKey = (context, fn, ...args) =>
    +  function() {
    +    return context[fn].apply(context, args.concat(...arguments));
    +  };
    +```
    +
    +```js
    +const freddy = {
    +  user: 'fred',
    +  greet: function(greeting, punctuation) {
    +    return greeting + ' ' + this.user + punctuation;
    +  },
    +};
    +const freddyBound = bindKey(freddy, 'greet');
    +console.log(freddyBound('hi', '!')); // 'hi fred!'
    +```
    diff --git a/tag_database b/tag_database
    index fd216c710..46617cd16 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -5,6 +5,7 @@ atob:node,string,utility
     average:math,array
     averageBy:math,array,function
     bind:function,object
    +bindKey:function,object
     bottomVisible:browser
     btoa:node,string,utility
     byteSize:string
    
    From b643aa805ae9ed190fcdc03e034af833c1976e0d Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 12:24:04 +0000
    Subject: [PATCH 070/103] Travis build: 1389
    
    ---
     README.md           | 34 ++++++++++++++++++++++++++++++++++
     docs/index.html     | 14 +++++++++++++-
     snippets/bindKey.md |  2 +-
     3 files changed, 48 insertions(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index 39697ed58..8adf0c58b 100644
    --- a/README.md
    +++ b/README.md
    @@ -218,6 +218,7 @@ average(1, 2, 3);
     View contents
     
     * [`bind`](#bind)
    +* [`bindKey`](#bindkey)
     * [`chainAsync`](#chainasync)
     * [`compose`](#compose)
     * [`composeRight`](#composeright)
    @@ -3185,6 +3186,39 @@ console.log(freddyBound('hi', '!')); // 'hi fred!'
     
    [⬆ Back to top](#table-of-contents) +### bindKey + +Creates a function that invokes the method at a given key of an object, optionally adding any additional supplied parameters to the beginning of the arguments. + +Return a `function` that uses `Function.apply()` to bind `context[fn]` to `context`. +Use `Array.concat()` to prepend any additional supplied parameters to the arguments. + +```js +const bindKey = (context, fn, ...args) => + function() { + return context[fn].apply(context, args.concat(...arguments)); + }; +``` + +
    +Examples + +```js +const freddy = { + user: 'fred', + greet: function(greeting, punctuation) { + return greeting + ' ' + this.user + punctuation; + } +}; +const freddyBound = bindKey(freddy, 'greet'); +console.log(freddyBound('hi', '!')); // 'hi fred!' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### chainAsync Chains asynchronous functions. diff --git a/docs/index.html b/docs/index.html index 708ed4bb5..9daf0db4e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -701,6 +701,18 @@ document.bodyconst freddy = { user: 'fred' };
     const freddyBound = bind(greet, freddy);
     console.log(freddyBound('hi', '!')); // 'hi fred!'
    +

    bindKey

    Creates a function that invokes the method at a given key of an object, optionally adding any additional supplied parameters to the beginning of the arguments.

    Return a function that uses Function.apply() to bind context[fn] to context. Use Array.concat() to prepend any additional supplied parameters to the arguments.

    const bindKey = (context, fn, ...args) =>
    +  function() {
    +    return context[fn].apply(context, args.concat(...arguments));
    +  };
    +
    const freddy = {
    +  user: 'fred',
    +  greet: function(greeting, punctuation) {
    +    return greeting + ' ' + this.user + punctuation;
    +  }
    +};
    +const freddyBound = bindKey(freddy, 'greet');
    +console.log(freddyBound('hi', '!')); // 'hi fred!'
     

    chainAsync

    Chains asynchronous functions.

    Loop through an array of functions containing asynchronous events, calling next when each asynchronous event has completed.

    const chainAsync = fns => {
       let curr = 0;
       const next = () => fns[curr++](next);
    diff --git a/snippets/bindKey.md b/snippets/bindKey.md
    index 2ff80f861..147ad2ff7 100644
    --- a/snippets/bindKey.md
    +++ b/snippets/bindKey.md
    @@ -17,7 +17,7 @@ const freddy = {
       user: 'fred',
       greet: function(greeting, punctuation) {
         return greeting + ' ' + this.user + punctuation;
    -  },
    +  }
     };
     const freddyBound = bindKey(freddy, 'greet');
     console.log(freddyBound('hi', '!')); // 'hi fred!'
    
    From 42cd69f391b79f6e18009776bb3baad8d46ab6ca Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 14:32:20 +0200
    Subject: [PATCH 071/103] Add delay
    
    ---
     snippets/delay.md | 16 ++++++++++++++++
     tag_database      |  1 +
     2 files changed, 17 insertions(+)
     create mode 100644 snippets/delay.md
    
    diff --git a/snippets/delay.md b/snippets/delay.md
    new file mode 100644
    index 000000000..3735fa065
    --- /dev/null
    +++ b/snippets/delay.md
    @@ -0,0 +1,16 @@
    +### defer
    +
    +Invokes the provided function after `wait` milliseconds.
    +
    +Use `setTimeout()` to delay execution of `fn`.
    +Use the spread (`...`) operator to supply the function with an arbitrary number of arguments.
    +
    +```js
    +const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
    +```
    +
    +```js
    +delay(function(text) {
    +  console.log(text);
    +}, 1000, 'later'); // Logs 'later' after one second.
    +```
    diff --git a/tag_database b/tag_database
    index 46617cd16..fa638b65f 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -36,6 +36,7 @@ deepClone:object,recursion
     deepFlatten:array,recursion
     defaults:object
     defer:function
    +delay:function
     detectDeviceType:browser
     difference:array,math
     differenceBy:array,function
    
    From 2dbba07bfb863c80e6725a534ce33d1d8d4faf38 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 12:34:41 +0000
    Subject: [PATCH 072/103] Travis build: 1391
    
    ---
     README.md         | 30 ++++++++++++++++++++++++++++++
     docs/index.html   | 10 +++++++++-
     snippets/delay.md | 10 +++++++---
     3 files changed, 46 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index 8adf0c58b..8baa1bfdc 100644
    --- a/README.md
    +++ b/README.md
    @@ -224,6 +224,7 @@ average(1, 2, 3);
     * [`composeRight`](#composeright)
     * [`curry`](#curry)
     * [`defer`](#defer)
    +* [`delay`](#delay)
     * [`functionName`](#functionname)
     * [`memoize`](#memoize)
     * [`negate`](#negate)
    @@ -3360,6 +3361,35 @@ defer(longRunningFunction); // Browser will update the HTML then run the functio
     
    [⬆ Back to top](#table-of-contents) +### defer + +Invokes the provided function after `wait` milliseconds. + +Use `setTimeout()` to delay execution of `fn`. +Use the spread (`...`) operator to supply the function with an arbitrary number of arguments. + +```js +const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args); +``` + +
    +Examples + +```js +delay( + function(text) { + console.log(text); + }, + 1000, + 'later' +); // Logs 'later' after one second. +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### functionName Logs the name of a function. diff --git a/docs/index.html b/docs/index.html index 9daf0db4e..609f08592 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -749,6 +749,14 @@ console.log<
     document.querySelector('#someElement').innerHTML = 'Hello';
     longRunningFunction(); //Browser will not update the HTML until this has finished
     defer(longRunningFunction); // Browser will update the HTML then run the function
    +

    defer

    Invokes the provided function after wait milliseconds.

    Use setTimeout() to delay execution of fn. Use the spread (...) operator to supply the function with an arbitrary number of arguments.

    const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
    +
    delay(
    +  function(text) {
    +    console.log(text);
    +  },
    +  1000,
    +  'later'
    +); // Logs 'later' after one second.
     

    functionName

    Logs the name of a function.

    Use console.debug() and the name property of the passed method to log the method's name to the debug channel of the console.

    const functionName = fn => (console.debug(fn.name), fn);
     
    functionName(Math.max); // max (logged in debug channel of console)
     

    memoize

    Returns the memoized (cached) function.

    Create an empty cache by instantiating a new Map object. Return a function which takes a single argument to be supplied to the memoized function by first checking if the function's output for that specific input value is already cached, or store and return it if not. The function keyword must be used in order to allow the memoized function to have its this context changed if necessary. Allow access to the cache by setting it as a property on the returned function.

    const memoize = fn => {
    diff --git a/snippets/delay.md b/snippets/delay.md
    index 3735fa065..09f7c2606 100644
    --- a/snippets/delay.md
    +++ b/snippets/delay.md
    @@ -10,7 +10,11 @@ const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
     ```
     
     ```js
    -delay(function(text) {
    -  console.log(text);
    -}, 1000, 'later'); // Logs 'later' after one second.
    +delay(
    +  function(text) {
    +    console.log(text);
    +  },
    +  1000,
    +  'later'
    +); // Logs 'later' after one second.
     ```
    
    From e4d6368ecbcf672eaf6b9c6e27090bf633393180 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 14:40:16 +0200
    Subject: [PATCH 073/103] Add partial, partialRight
    
    ---
     snippets/partial.md      | 17 +++++++++++++++++
     snippets/partialRight.md | 17 +++++++++++++++++
     tag_database             |  2 ++
     3 files changed, 36 insertions(+)
     create mode 100644 snippets/partial.md
     create mode 100644 snippets/partialRight.md
    
    diff --git a/snippets/partial.md b/snippets/partial.md
    new file mode 100644
    index 000000000..17a53b49e
    --- /dev/null
    +++ b/snippets/partial.md
    @@ -0,0 +1,17 @@
    +### partial
    +
    +Creates a function that invokes `fn` with `partials` prepended to the arguments it receives.
    +
    +Use the spread operator (`...`) to prepend `partials` to the list of arguments of `fn`.
    +
    +```js
    +const partial = (fn, ...partials) => (...args) => fn(...partials, ...args);
    +```
    +
    +```js
    +function greet(greeting, name) {
    +  return greeting + ' ' + name + '!';
    +}
    +const greetHello = partial(greet, 'Hello');
    +greetHello('John'); // 'Hello John!'
    +```
    diff --git a/snippets/partialRight.md b/snippets/partialRight.md
    new file mode 100644
    index 000000000..6b6aa1131
    --- /dev/null
    +++ b/snippets/partialRight.md
    @@ -0,0 +1,17 @@
    +### partialRight
    +
    +Creates a function that invokes `fn` with `partials` appended to the arguments it receives.
    +
    +Use the spread operator (`...`) to append `partials` to the list of arguments of `fn`.
    +
    +```js
    +const partialRight = (fn, ...partials) => (...args) => fn( ...args, ...partials);
    +```
    +
    +```js
    +function greet(greeting, name) {
    +  return greeting + ' ' + name + '!';
    +}
    +const greetJohn = partialRight(greet, 'John');
    +greetJohn('Hello'); // 'Hello John!'
    +```
    diff --git a/tag_database b/tag_database
    index fa638b65f..c34856405 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -160,6 +160,8 @@ orderBy:object,array
     over:adapter,function
     palindrome:string
     parseCookie:utility,string
    +partial:function
    +partialRight:function
     partition:array,object,function
     percentile:math
     pick:object,array
    
    From 8346b359e26dcb306eb13bf08dde88113788f92b Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 12:41:38 +0000
    Subject: [PATCH 074/103] Travis build: 1393
    
    ---
     README.md                | 54 ++++++++++++++++++++++++++++++++++++++++
     docs/index.html          | 14 ++++++++++-
     snippets/partialRight.md |  2 +-
     3 files changed, 68 insertions(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index 8baa1bfdc..ec2ea9f30 100644
    --- a/README.md
    +++ b/README.md
    @@ -229,6 +229,8 @@ average(1, 2, 3);
     * [`memoize`](#memoize)
     * [`negate`](#negate)
     * [`once`](#once)
    +* [`partial`](#partial)
    +* [`partialRight`](#partialright)
     * [`runPromisesInSeries`](#runpromisesinseries)
     * [`sleep`](#sleep)
     * [`times`](#times)
    @@ -3502,6 +3504,58 @@ document.body.addEventListener('click', once(startApp)); // only runs `startApp`
     
    [⬆ Back to top](#table-of-contents) +### partial + +Creates a function that invokes `fn` with `partials` prepended to the arguments it receives. + +Use the spread operator (`...`) to prepend `partials` to the list of arguments of `fn`. + +```js +const partial = (fn, ...partials) => (...args) => fn(...partials, ...args); +``` + +
    +Examples + +```js +function greet(greeting, name) { + return greeting + ' ' + name + '!'; +} +const greetHello = partial(greet, 'Hello'); +greetHello('John'); // 'Hello John!' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + +### partialRight + +Creates a function that invokes `fn` with `partials` appended to the arguments it receives. + +Use the spread operator (`...`) to append `partials` to the list of arguments of `fn`. + +```js +const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials); +``` + +
    +Examples + +```js +function greet(greeting, name) { + return greeting + ' ' + name + '!'; +} +const greetJohn = partialRight(greet, 'John'); +greetJohn('Hello'); // 'Hello John!' +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### runPromisesInSeries Runs an array of promises in series. diff --git a/docs/index.html b/docs/index.html index 609f08592..1a7e18bfc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -786,6 +786,18 @@ console.log<
       console.log(this, event); // document.body, MouseEvent
     };
     document.body.addEventListener('click', once(startApp)); // only runs `startApp` once upon click
    +

    partial

    Creates a function that invokes fn with partials prepended to the arguments it receives.

    Use the spread operator (...) to prepend partials to the list of arguments of fn.

    const partial = (fn, ...partials) => (...args) => fn(...partials, ...args);
    +
    function greet(greeting, name) {
    +  return greeting + ' ' + name + '!';
    +}
    +const greetHello = partial(greet, 'Hello');
    +greetHello('John'); // 'Hello John!'
    +

    partialRight

    Creates a function that invokes fn with partials appended to the arguments it receives.

    Use the spread operator (...) to append partials to the list of arguments of fn.

    const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
    +
    function greet(greeting, name) {
    +  return greeting + ' ' + name + '!';
    +}
    +const greetJohn = partialRight(greet, 'John');
    +greetJohn('Hello'); // 'Hello John!'
     

    runPromisesInSeries

    Runs an array of promises in series.

    Use Array.reduce() to create a promise chain, where each promise returns the next promise when resolved.

    const runPromisesInSeries = ps => ps.reduce((p, next) => p.then(next), Promise.resolve());
     
    const delay = d => new Promise(r => setTimeout(r, d));
     runPromisesInSeries([() => delay(1000), () => delay(2000)]); // Executes each promise sequentially, taking a total of 3 seconds to complete
    diff --git a/snippets/partialRight.md b/snippets/partialRight.md
    index 6b6aa1131..d64f7f1d6 100644
    --- a/snippets/partialRight.md
    +++ b/snippets/partialRight.md
    @@ -5,7 +5,7 @@ Creates a function that invokes `fn` with `partials` appended to the arguments i
     Use the spread operator (`...`) to append `partials` to the list of arguments of `fn`.
     
     ```js
    -const partialRight = (fn, ...partials) => (...args) => fn( ...args, ...partials);
    +const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
     ```
     
     ```js
    
    From fab040658bb21f2eac9f5e288cb8eac8df418891 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 15:55:03 +0200
    Subject: [PATCH 075/103] Add xProd
    
    ---
     snippets/xProd.md | 13 +++++++++++++
     tag_database      |  1 +
     2 files changed, 14 insertions(+)
     create mode 100644 snippets/xProd.md
    
    diff --git a/snippets/xProd.md b/snippets/xProd.md
    new file mode 100644
    index 000000000..332d9f76e
    --- /dev/null
    +++ b/snippets/xProd.md
    @@ -0,0 +1,13 @@
    +### xProd
    +
    +Creates a new array out of the two supplied by creating each possible pair from the arrays.
    +
    +Use `Array.map()` to produce every possible pair from the elements of the two arrays.
    +
    +```js
    +const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +```
    +
    +```js
    +xProd([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
    +```
    diff --git a/tag_database b/tag_database
    index c34856405..dbe4c3043 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -243,6 +243,7 @@ UUIDGeneratorNode:node,utility,random
     validateNumber:utility,math
     without:array
     words:string,regexp
    +xProd:array,math
     yesNo:utility,regexp
     zip:array
     zipObject:array,object
    
    From ea71b1fb0c195718a7239e4e9abce6d5e869d43b Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 13:56:33 +0000
    Subject: [PATCH 076/103] Travis build: 1396
    
    ---
     README.md       | 23 +++++++++++++++++++++++
     docs/index.html |  4 +++-
     2 files changed, 26 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index ec2ea9f30..87b3253ec 100644
    --- a/README.md
    +++ b/README.md
    @@ -162,6 +162,7 @@ average(1, 2, 3);
     * [`unzip`](#unzip)
     * [`unzipWith`](#unzipwith-)
     * [`without`](#without)
    +* [`xProd`](#xprod)
     * [`zip`](#zip)
     * [`zipObject`](#zipobject)
     * [`zipWith`](#zipwith-)
    @@ -2226,6 +2227,28 @@ without([2, 1, 2, 3], 1, 2); // [3]
     
    [⬆ Back to top](#table-of-contents) +### xProd + +Creates a new array out of the two supplied by creating each possible pair from the arrays. + +Use `Array.map()` to produce every possible pair from the elements of the two arrays. + +```js +const xProd = (a, b) => a.map(x => b.map(y => [x, y])); +``` + +
    +Examples + +```js +xProd([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### zip Creates an array of elements, grouped based on the position in the original arrays. diff --git a/docs/index.html b/docs/index.html index 1a7e18bfc..39a9ae8a6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -419,6 +419,8 @@ Object.assig
     
    unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)); // [3, 30, 300]
     

    without

    Filters out the elements of an array, that have one of the specified values.

    Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

    (For a snippet that mutates the original array see pull)

    const without = (arr, ...args) => arr.filter(v => !args.includes(v));
     
    without([2, 1, 2, 3], 1, 2); // [3]
    +

    xProd

    Creates a new array out of the two supplied by creating each possible pair from the arrays.

    Use Array.map() to produce every possible pair from the elements of the two arrays.

    const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +
    xProd([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
     

    zip

    Creates an array of elements, grouped based on the position in the original arrays.

    Use Math.max.apply() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found.

    const zip = (...arrays) => {
       const maxLength = Math.max(...arrays.map(x => x.length));
       return Array.from({ length: maxLength }).map((_, i) => {
    
    From f6b34f01e9a3bb18cf44b7910a375e6ad94cef6d Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 15:57:58 +0200
    Subject: [PATCH 077/103] Fix tag
    
    ---
     tag_database | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tag_database b/tag_database
    index dbe4c3043..c48aed7e1 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -228,7 +228,7 @@ toSnakeCase:string,regexp
     transform:object,array
     truncateString:string
     truthCheckCollection:object,logic,array
    -unary:adaptor,function
    +unary:adapter,function
     unescapeHTML:string,browser
     union:array,math
     unionBy:array,function
    
    From 87acfd680ebfd61ac173b78127967c2fc60f8aef Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 13:59:43 +0000
    Subject: [PATCH 078/103] Travis build: 1398
    
    ---
     README.md       | 10 ----------
     docs/index.html |  4 ++--
     2 files changed, 2 insertions(+), 12 deletions(-)
    
    diff --git a/README.md b/README.md
    index 87b3253ec..93bb6b044 100644
    --- a/README.md
    +++ b/README.md
    @@ -85,14 +85,6 @@ average(1, 2, 3);
     * [`pipeFunctions`](#pipefunctions)
     * [`promisify`](#promisify)
     * [`spreadOver`](#spreadover)
    -
    -
    - -### Adaptor - -
    -View contents - * [`unary`](#unary)
    @@ -626,8 +618,6 @@ arrayMax([1, 2, 3]); // 3
    [⬆ Back to top](#table-of-contents) ---- - ## Adaptor ### unary diff --git a/docs/index.html b/docs/index.html index 39a9ae8a6..55e0a2b47 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -92,7 +92,7 @@ Object.assig
     

    spreadOver

    Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.

    Use closures and the spread operator (...) to map the array of arguments to the inputs of the function.

    const spreadOver = fn => argsArr => fn(...argsArr);
     
    const arrayMax = spreadOver(Math.max);
     arrayMax([1, 2, 3]); // 3
    -

    Adaptor

    unary

    Creates a function that accepts up to one argument, ignoring any additional arguments.

    Call the provided function, fn, with just the first argument given.

    const unary = fn => val => fn(val);
    +

    unary

    Creates a function that accepts up to one argument, ignoring any additional arguments.

    Call the provided function, fn, with just the first argument given.

    const unary = fn => val => fn(val);
     
    ['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
     

    Array

    chunk

    Chunks an array into smaller arrays of a specified size.

    Use Array.from() to create a new array, that fits the number of chunks that will be produced. Use Array.slice() to map each element of the new array to a chunk the length of size. If the original array can't be split evenly, the final chunk will contain the remaining elements.

    const chunk = (arr, size) =>
       Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
    
    From 65465791b4d8ec5522905e369c94802ee337e872 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 16:22:14 +0200
    Subject: [PATCH 079/103] Add unfold
    
    Similar to Ramda's unfold
    ---
     snippets/unfold.md | 20 ++++++++++++++++++++
     tag_database       |  1 +
     2 files changed, 21 insertions(+)
     create mode 100644 snippets/unfold.md
    
    diff --git a/snippets/unfold.md b/snippets/unfold.md
    new file mode 100644
    index 000000000..ff161aa91
    --- /dev/null
    +++ b/snippets/unfold.md
    @@ -0,0 +1,20 @@
    +### unfold
    +
    +Builds an array, using an iterator function and an initial seed value.
    +
    +Use a `while` loop and `Array.push()` to call the function repeatedly until it returns `false`.
    +The iterator function accepts one argument (`seed`) and must always return an array with two elements ([`value`, `nextSeed`]) or `false` to terminate.
    +
    +```js
    +const unfold = (fn, seed) => {
    +  let result = [],
    +    val = [null, seed];
    +  while ((val = fn(val[1]))) result.push(val[0]);
    +  return result;
    +};
    +```
    +
    +```js
    +var f = n => (n > 50 ? false : [-n, n + 10]);
    +unfold(f, 10); // [-10, -20, -30, -40, -50]
    +```
    diff --git a/tag_database b/tag_database
    index c48aed7e1..b5ea61b91 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -230,6 +230,7 @@ truncateString:string
     truthCheckCollection:object,logic,array
     unary:adapter,function
     unescapeHTML:string,browser
    +unfold:function,array
     union:array,math
     unionBy:array,function
     unionWith:array,function
    
    From cf11bd6b31ee997ee50f8df3d3e87a9293c57a07 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 14:24:29 +0000
    Subject: [PATCH 080/103] Travis build: 1400
    
    ---
     README.md       | 30 ++++++++++++++++++++++++++++++
     docs/index.html | 10 +++++++++-
     2 files changed, 39 insertions(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index 93bb6b044..60b481fa2 100644
    --- a/README.md
    +++ b/README.md
    @@ -227,6 +227,7 @@ average(1, 2, 3);
     * [`runPromisesInSeries`](#runpromisesinseries)
     * [`sleep`](#sleep)
     * [`times`](#times)
    +* [`unfold`](#unfold)
     
     
    @@ -3645,6 +3646,35 @@ console.log(output); // 01234
    [⬆ Back to top](#table-of-contents) + +### unfold + +Builds an array, using an iterator function and an initial seed value. + +Use a `while` loop and `Array.push()` to call the function repeatedly until it returns `false`. +The iterator function accepts one argument (`seed`) and must always return an array with two elements ([`value`, `nextSeed`]) or `false` to terminate. + +```js +const unfold = (fn, seed) => { + let result = [], + val = [null, seed]; + while ((val = fn(val[1]))) result.push(val[0]); + return result; +}; +``` + +
    +Examples + +```js +var f = n => (n > 50 ? false : [-n, n + 10]); +unfold(f, 10); // [-10, -20, -30, -40, -50] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + --- ## ➗ Math diff --git a/docs/index.html b/docs/index.html index 55e0a2b47..69426fcb0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -816,6 +816,14 @@ document.bodyShow examples
    var output = '';
     times(5, i => (output += i));
     console.log(output); // 01234
    +

    unfold

    Builds an array, using an iterator function and an initial seed value.

    Use a while loop and Array.push() to call the function repeatedly until it returns false. The iterator function accepts one argument (seed) and must always return an array with two elements ([value, nextSeed]) or false to terminate.

    const unfold = (fn, seed) => {
    +  let result = [],
    +    val = [null, seed];
    +  while ((val = fn(val[1]))) result.push(val[0]);
    +  return result;
    +};
    +
    var f = n => (n > 50 ? false : [-n, n + 10]);
    +unfold(f, 10); // [-10, -20, -30, -40, -50]
     

    Math

    average

    Returns the average of an of two or more numbers.

    Use Array.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

    const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
     
    average(...[1, 2, 3]); // 2
     average(1, 2, 3); // 2
    
    From 646bd79573f7ab8aabb50e18192e8e06b70954a4 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 16:38:08 +0200
    Subject: [PATCH 081/103] Add reduceSuccessive
    
    Similar to Ramda's scan.
    ---
     snippets/reduceSuccessive.md | 16 ++++++++++++++++
     tag_database                 |  1 +
     2 files changed, 17 insertions(+)
     create mode 100644 snippets/reduceSuccessive.md
    
    diff --git a/snippets/reduceSuccessive.md b/snippets/reduceSuccessive.md
    new file mode 100644
    index 000000000..ce7879696
    --- /dev/null
    +++ b/snippets/reduceSuccessive.md
    @@ -0,0 +1,16 @@
    +### reduceSuccessive
    +
    +Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values.
    +
    +Use `Array.reduce()` to apply the given function to the given array, storing each new result.
    +
    +```js
    +const reduceSuccessive = (arr, fn, acc) =>
    +  arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)),res), [
    +    acc,
    +  ]);
    +```
    +
    +```js
    +reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0); // [0, 1, 3, 6, 10, 15, 21]
    +```
    diff --git a/tag_database b/tag_database
    index b5ea61b91..9bd036292 100644
    --- a/tag_database
    +++ b/tag_database
    @@ -182,6 +182,7 @@ randomNumberInRange:math,utility,random
     readFileLines:node,array,string
     redirect:browser,url
     reducedFilter:array
    +reduceSuccessive:array,function
     remove:array
     reverseString:string,array
     RGBToHex:utility
    
    From f738884baf96fa482bee2ac0ab52d953aafe29cb Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 14:39:25 +0000
    Subject: [PATCH 082/103] Travis build: 1402
    
    ---
     README.md                    | 24 ++++++++++++++++++++++++
     docs/index.html              |  5 ++++-
     snippets/reduceSuccessive.md |  4 +---
     3 files changed, 29 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index 60b481fa2..7bf7f2801 100644
    --- a/README.md
    +++ b/README.md
    @@ -134,6 +134,7 @@ average(1, 2, 3);
     * [`pullAtIndex`](#pullatindex)
     * [`pullAtValue`](#pullatvalue)
     * [`reducedFilter`](#reducedfilter)
    +* [`reduceSuccessive`](#reducesuccessive)
     * [`remove`](#remove)
     * [`sample`](#sample)
     * [`sampleSize`](#samplesize)
    @@ -1693,6 +1694,29 @@ reducedFilter(data, ['id', 'name'], item => item.age > 24); // [{ id: 2, name: '
     
    [⬆ Back to top](#table-of-contents) +### reduceSuccessive + +Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values. + +Use `Array.reduce()` to apply the given function to the given array, storing each new result. + +```js +const reduceSuccessive = (arr, fn, acc) => + arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]); +``` + +
    +Examples + +```js +reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0); // [0, 1, 3, 6, 10, 15, 21] +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### remove Removes elements from an array for which the given function returns `false`. diff --git a/docs/index.html b/docs/index.html index 69426fcb0..50aa785be 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -308,6 +308,9 @@ Object.assig
     ];
     
     reducedFilter(data, ['id', 'name'], item => item.age > 24); // [{ id: 2, name: 'mike'}]
    +

    reduceSuccessive

    Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values.

    Use Array.reduce() to apply the given function to the given array, storing each new result.

    const reduceSuccessive = (arr, fn, acc) =>
    +  arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]);
    +
    reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0); // [0, 1, 3, 6, 10, 15, 21]
     

    remove

    Removes elements from an array for which the given function returns false.

    Use Array.filter() to find array elements that return truthy values and Array.reduce() to remove elements using Array.splice(). The func is invoked with three arguments (value, index, array).

    const remove = (arr, func) =>
       Array.isArray(arr)
         ? arr.filter(func).reduce((acc, val) => {
    diff --git a/snippets/reduceSuccessive.md b/snippets/reduceSuccessive.md
    index ce7879696..dc4b154ed 100644
    --- a/snippets/reduceSuccessive.md
    +++ b/snippets/reduceSuccessive.md
    @@ -6,9 +6,7 @@ Use `Array.reduce()` to apply the given function to the given array, storing eac
     
     ```js
     const reduceSuccessive = (arr, fn, acc) =>
    -  arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)),res), [
    -    acc,
    -  ]);
    +  arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]);
     ```
     
     ```js
    
    From 16b0701084cd471143c4e077df629a32afb9c99f Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 16:48:43 +0200
    Subject: [PATCH 083/103] Generated test files for new snippets
    
    ---
     test/ary/ary.js                               |  2 +
     test/ary/ary.test.js                          | 13 +++++
     test/bind/bind.js                             |  5 ++
     test/bind/bind.test.js                        | 13 +++++
     test/bindKey/bindKey.js                       |  5 ++
     test/bindKey/bindKey.test.js                  | 13 +++++
     test/delay/delay.js                           |  2 +
     test/delay/delay.test.js                      | 13 +++++
     test/partial/partial.js                       |  2 +
     test/partial/partial.test.js                  | 13 +++++
     test/partialRight/partialRight.js             |  2 +
     test/partialRight/partialRight.test.js        | 13 +++++
     test/reduceSuccessive/reduceSuccessive.js     |  3 ++
     .../reduceSuccessive/reduceSuccessive.test.js | 13 +++++
     test/testlog                                  | 54 +++++++++++++++++--
     test/times/times.js                           |  5 ++
     test/times/times.test.js                      | 13 +++++
     test/unary/unary.js                           |  2 +
     test/unary/unary.test.js                      | 13 +++++
     test/unfold/unfold.js                         |  7 +++
     test/unfold/unfold.test.js                    | 13 +++++
     test/xProd/xProd.js                           |  2 +
     test/xProd/xProd.test.js                      | 13 +++++
     23 files changed, 229 insertions(+), 5 deletions(-)
     create mode 100644 test/ary/ary.js
     create mode 100644 test/ary/ary.test.js
     create mode 100644 test/bind/bind.js
     create mode 100644 test/bind/bind.test.js
     create mode 100644 test/bindKey/bindKey.js
     create mode 100644 test/bindKey/bindKey.test.js
     create mode 100644 test/delay/delay.js
     create mode 100644 test/delay/delay.test.js
     create mode 100644 test/partial/partial.js
     create mode 100644 test/partial/partial.test.js
     create mode 100644 test/partialRight/partialRight.js
     create mode 100644 test/partialRight/partialRight.test.js
     create mode 100644 test/reduceSuccessive/reduceSuccessive.js
     create mode 100644 test/reduceSuccessive/reduceSuccessive.test.js
     create mode 100644 test/times/times.js
     create mode 100644 test/times/times.test.js
     create mode 100644 test/unary/unary.js
     create mode 100644 test/unary/unary.test.js
     create mode 100644 test/unfold/unfold.js
     create mode 100644 test/unfold/unfold.test.js
     create mode 100644 test/xProd/xProd.js
     create mode 100644 test/xProd/xProd.test.js
    
    diff --git a/test/ary/ary.js b/test/ary/ary.js
    new file mode 100644
    index 000000000..25aa3b39a
    --- /dev/null
    +++ b/test/ary/ary.js
    @@ -0,0 +1,2 @@
    +const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +module.exports = ary
    \ No newline at end of file
    diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js
    new file mode 100644
    index 000000000..d82728ce4
    --- /dev/null
    +++ b/test/ary/ary.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const ary = require('./ary.js');
    +
    +test('Testing ary', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof ary === 'function', 'ary is a Function');
    +	//t.deepEqual(ary(args..), 'Expected');
    +	//t.equal(ary(args..), 'Expected');
    +	//t.false(ary(args..), 'Expected');
    +	//t.throws(ary(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/bind/bind.js b/test/bind/bind.js
    new file mode 100644
    index 000000000..63499a7d0
    --- /dev/null
    +++ b/test/bind/bind.js
    @@ -0,0 +1,5 @@
    +const bind = (fn, context, ...args) =>
    +function() {
    +return fn.apply(context, args.concat(...arguments));
    +};
    +module.exports = bind
    \ No newline at end of file
    diff --git a/test/bind/bind.test.js b/test/bind/bind.test.js
    new file mode 100644
    index 000000000..13df8d07a
    --- /dev/null
    +++ b/test/bind/bind.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const bind = require('./bind.js');
    +
    +test('Testing bind', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof bind === 'function', 'bind is a Function');
    +	//t.deepEqual(bind(args..), 'Expected');
    +	//t.equal(bind(args..), 'Expected');
    +	//t.false(bind(args..), 'Expected');
    +	//t.throws(bind(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/bindKey/bindKey.js b/test/bindKey/bindKey.js
    new file mode 100644
    index 000000000..72d491b73
    --- /dev/null
    +++ b/test/bindKey/bindKey.js
    @@ -0,0 +1,5 @@
    +const bindKey = (context, fn, ...args) =>
    +function() {
    +return context[fn].apply(context, args.concat(...arguments));
    +};
    +module.exports = bindKey
    \ No newline at end of file
    diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js
    new file mode 100644
    index 000000000..91de08165
    --- /dev/null
    +++ b/test/bindKey/bindKey.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const bindKey = require('./bindKey.js');
    +
    +test('Testing bindKey', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof bindKey === 'function', 'bindKey is a Function');
    +	//t.deepEqual(bindKey(args..), 'Expected');
    +	//t.equal(bindKey(args..), 'Expected');
    +	//t.false(bindKey(args..), 'Expected');
    +	//t.throws(bindKey(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/delay/delay.js b/test/delay/delay.js
    new file mode 100644
    index 000000000..2c5f8ef20
    --- /dev/null
    +++ b/test/delay/delay.js
    @@ -0,0 +1,2 @@
    +const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
    +module.exports = delay
    \ No newline at end of file
    diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js
    new file mode 100644
    index 000000000..31c2d875a
    --- /dev/null
    +++ b/test/delay/delay.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const delay = require('./delay.js');
    +
    +test('Testing delay', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof delay === 'function', 'delay is a Function');
    +	//t.deepEqual(delay(args..), 'Expected');
    +	//t.equal(delay(args..), 'Expected');
    +	//t.false(delay(args..), 'Expected');
    +	//t.throws(delay(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/partial/partial.js b/test/partial/partial.js
    new file mode 100644
    index 000000000..c6e9b012a
    --- /dev/null
    +++ b/test/partial/partial.js
    @@ -0,0 +1,2 @@
    +const partial = (fn, ...partials) => (...args) => fn(...partials, ...args);
    +module.exports = partial
    \ No newline at end of file
    diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js
    new file mode 100644
    index 000000000..d8304f016
    --- /dev/null
    +++ b/test/partial/partial.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const partial = require('./partial.js');
    +
    +test('Testing partial', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof partial === 'function', 'partial is a Function');
    +	//t.deepEqual(partial(args..), 'Expected');
    +	//t.equal(partial(args..), 'Expected');
    +	//t.false(partial(args..), 'Expected');
    +	//t.throws(partial(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/partialRight/partialRight.js b/test/partialRight/partialRight.js
    new file mode 100644
    index 000000000..20b89052d
    --- /dev/null
    +++ b/test/partialRight/partialRight.js
    @@ -0,0 +1,2 @@
    +const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
    +module.exports = partialRight
    \ No newline at end of file
    diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js
    new file mode 100644
    index 000000000..749a80244
    --- /dev/null
    +++ b/test/partialRight/partialRight.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const partialRight = require('./partialRight.js');
    +
    +test('Testing partialRight', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof partialRight === 'function', 'partialRight is a Function');
    +	//t.deepEqual(partialRight(args..), 'Expected');
    +	//t.equal(partialRight(args..), 'Expected');
    +	//t.false(partialRight(args..), 'Expected');
    +	//t.throws(partialRight(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/reduceSuccessive/reduceSuccessive.js b/test/reduceSuccessive/reduceSuccessive.js
    new file mode 100644
    index 000000000..67a9d03b3
    --- /dev/null
    +++ b/test/reduceSuccessive/reduceSuccessive.js
    @@ -0,0 +1,3 @@
    +const reduceSuccessive = (arr, fn, acc) =>
    +arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]);
    +module.exports = reduceSuccessive
    \ No newline at end of file
    diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js
    new file mode 100644
    index 000000000..2cd1bc2d5
    --- /dev/null
    +++ b/test/reduceSuccessive/reduceSuccessive.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const reduceSuccessive = require('./reduceSuccessive.js');
    +
    +test('Testing reduceSuccessive', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof reduceSuccessive === 'function', 'reduceSuccessive is a Function');
    +	//t.deepEqual(reduceSuccessive(args..), 'Expected');
    +	//t.equal(reduceSuccessive(args..), 'Expected');
    +	//t.false(reduceSuccessive(args..), 'Expected');
    +	//t.throws(reduceSuccessive(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/testlog b/test/testlog
    index b864db66f..ec65e3ba3 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,6 +1,6 @@
    -Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
    +Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
     
    -> 30-seconds-of-code@0.0.1 test C:\Users\King David\Desktop\github-repo\30-seconds-of-code
    +> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
     
     
    @@ -13,6 +13,10 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
     
         √ arrayToHtmlList is a Function
     
    +  Testing ary
    +
    +    √ ary is a Function
    +
       Testing atob
     
         √ atob is a Function
    @@ -40,6 +44,14 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
     
         √ binarySearch is a Function
     
    +  Testing bind
    +
    +    √ bind is a Function
    +
    +  Testing bindKey
    +
    +    √ bindKey is a Function
    +
       Testing bottomVisible
     
         √ bottomVisible is a Function
    @@ -194,6 +206,10 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
     
         √ defer is a Function
     
    +  Testing delay
    +
    +    √ delay is a Function
    +
       Testing detectDeviceType
     
         √ detectDeviceType is a Function
    @@ -906,6 +922,14 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
     
         √ parseCookie is a Function
     
    +  Testing partial
    +
    +    √ partial is a Function
    +
    +  Testing partialRight
    +
    +    √ partialRight is a Function
    +
       Testing partition
     
         √ partition is a Function
    @@ -1011,6 +1035,10 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
         √ 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 remove
     
         √ remove is a Function
    @@ -1181,6 +1209,10 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
         √ 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
    @@ -1253,11 +1285,19 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
         √ 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
    @@ -1344,6 +1384,10 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
         √ words([]) throws a error
         √ words(1234) throws a error
     
    +  Testing xProd
    +
    +    √ xProd is a Function
    +
       Testing yesNo
     
         √ yesNo is a Function
    @@ -1390,8 +1434,8 @@ Test log for: Wed Jan 24 2018 06:31:13 GMT-0500 (Eastern Standard Time)
         √ zipWith is a Function
     
     
    -  total:     587
    -  passing:   587
    -  duration:  520ms
    +  total:     598
    +  passing:   598
    +  duration:  1.3s
     
     
    diff --git a/test/times/times.js b/test/times/times.js
    new file mode 100644
    index 000000000..8866d35b4
    --- /dev/null
    +++ b/test/times/times.js
    @@ -0,0 +1,5 @@
    +const times = (n, fn, context = undefined) => {
    +let i = 0;
    +while (fn.call(context, i) !== false && ++i < n) {}
    +};
    +module.exports = times
    \ No newline at end of file
    diff --git a/test/times/times.test.js b/test/times/times.test.js
    new file mode 100644
    index 000000000..72b659376
    --- /dev/null
    +++ b/test/times/times.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const times = require('./times.js');
    +
    +test('Testing times', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof times === 'function', 'times is a Function');
    +	//t.deepEqual(times(args..), 'Expected');
    +	//t.equal(times(args..), 'Expected');
    +	//t.false(times(args..), 'Expected');
    +	//t.throws(times(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/unary/unary.js b/test/unary/unary.js
    new file mode 100644
    index 000000000..524eb0113
    --- /dev/null
    +++ b/test/unary/unary.js
    @@ -0,0 +1,2 @@
    +const unary = fn => val => fn(val);
    +module.exports = unary
    \ No newline at end of file
    diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js
    new file mode 100644
    index 000000000..d741e1c39
    --- /dev/null
    +++ b/test/unary/unary.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const unary = require('./unary.js');
    +
    +test('Testing unary', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof unary === 'function', 'unary is a Function');
    +	//t.deepEqual(unary(args..), 'Expected');
    +	//t.equal(unary(args..), 'Expected');
    +	//t.false(unary(args..), 'Expected');
    +	//t.throws(unary(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/unfold/unfold.js b/test/unfold/unfold.js
    new file mode 100644
    index 000000000..499ad0ab6
    --- /dev/null
    +++ b/test/unfold/unfold.js
    @@ -0,0 +1,7 @@
    +const unfold = (fn, seed) => {
    +let result = [],
    +val = [null, seed];
    +while ((val = fn(val[1]))) result.push(val[0]);
    +return result;
    +};
    +module.exports = unfold
    \ No newline at end of file
    diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js
    new file mode 100644
    index 000000000..d13332937
    --- /dev/null
    +++ b/test/unfold/unfold.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const unfold = require('./unfold.js');
    +
    +test('Testing unfold', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof unfold === 'function', 'unfold is a Function');
    +	//t.deepEqual(unfold(args..), 'Expected');
    +	//t.equal(unfold(args..), 'Expected');
    +	//t.false(unfold(args..), 'Expected');
    +	//t.throws(unfold(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    diff --git a/test/xProd/xProd.js b/test/xProd/xProd.js
    new file mode 100644
    index 000000000..07ea52dfa
    --- /dev/null
    +++ b/test/xProd/xProd.js
    @@ -0,0 +1,2 @@
    +const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +module.exports = xProd
    \ No newline at end of file
    diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js
    new file mode 100644
    index 000000000..a164210a2
    --- /dev/null
    +++ b/test/xProd/xProd.test.js
    @@ -0,0 +1,13 @@
    +const test = require('tape');
    +const xProd = require('./xProd.js');
    +
    +test('Testing xProd', (t) => {
    +	//For more information on all the methods supported by tape
    +	//Please go to https://github.com/substack/tape
    +	t.true(typeof xProd === 'function', 'xProd is a Function');
    +	//t.deepEqual(xProd(args..), 'Expected');
    +	//t.equal(xProd(args..), 'Expected');
    +	//t.false(xProd(args..), 'Expected');
    +	//t.throws(xProd(args..), 'Expected');
    +	t.end();
    +});
    \ No newline at end of file
    
    From 449dfdea1cf124ce40b5967bbb56a4b07edfb96a Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 17:17:51 +0200
    Subject: [PATCH 084/103] Added some tests
    
    Also fixed xProd. Tests for xProd, unzipWith, unzip and is.
    ---
     snippets/xProd.md                |  4 ++--
     test/is/is.test.js               | 18 +++++++++++++++++-
     test/testlog                     | 28 ++++++++++++++++++++++++----
     test/unzip/unzip.test.js         |  4 +++-
     test/unzipWith/unzipWith.test.js |  4 ++--
     test/xProd/xProd.js              |  2 +-
     test/xProd/xProd.test.js         |  3 ++-
     7 files changed, 51 insertions(+), 12 deletions(-)
    
    diff --git a/snippets/xProd.md b/snippets/xProd.md
    index 332d9f76e..d5ff74b61 100644
    --- a/snippets/xProd.md
    +++ b/snippets/xProd.md
    @@ -2,10 +2,10 @@
     
     Creates a new array out of the two supplied by creating each possible pair from the arrays.
     
    -Use `Array.map()` to produce every possible pair from the elements of the two arrays.
    +Use `Array.reduce()`, `Array.map()` and `Array.concat()` to produce every possible pair from the elements of the two arrays and save them in an array.
     
     ```js
    -const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +const xProd = (a, b) => a.reduce((acc,x) => acc.concat(b.map(y => [x, y])),[]);
     ```
     
     ```js
    diff --git a/test/is/is.test.js b/test/is/is.test.js
    index 78d7b1e3a..922cc0f8c 100644
    --- a/test/is/is.test.js
    +++ b/test/is/is.test.js
    @@ -5,9 +5,25 @@ test('Testing is', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof is === 'function', 'is is a Function');
    +  t.true(is(Array, [1]), `Works for arrays with data`);
    +  t.true(is(Array, []), `Works for empty arrays`);
    +  t.false(is(Array, {}), `Works for arrays, not objects`);
    +  t.true(is(Object, {}), `Works for objects`);
    +  t.true(is(Map, new Map()), `Works for maps`);
    +  t.true(is(RegExp, /./g), `Works for regular expressions`);
    +  t.true(is(Set, new Set()), `Works for sets`);
    +  t.true(is(WeakMap, new WeakMap()), `Works for weak maps`);
    +  t.true(is(WeakSet, new WeakSet()), `Works for weak sets`);
    +  t.false(is(String, ''), `Works for strings - returns false for primitive`);
    +  t.true(is(String, new String('')), `Works for strings - returns true when using constructor`);
    +  t.false(is(Number, 1), `Works for numbers - returns false for primitive`);
    +  t.true(is(Number, new Number('10')), `Works for numbers - returns true when using constructor`);
    +  t.false(is(Boolean, false), `Works for booleans - returns false for primitive`);
    +  t.true(is(Boolean, new Boolean(false)), `Works for booleans - returns true when using constructor`);
    +  t.true(is(Function, () => null), `Works for functions`);
     	//t.deepEqual(is(args..), 'Expected');
     	//t.equal(is(args..), 'Expected');
     	//t.false(is(args..), 'Expected');
     	//t.throws(is(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/testlog b/test/testlog
    index ec65e3ba3..051197040 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,4 +1,4 @@
    -Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
    +Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
     
     > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
    @@ -555,6 +555,22 @@ Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
       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
     
    @@ -1323,10 +1339,13 @@ Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
       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
     
    @@ -1387,6 +1406,7 @@ Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
       Testing xProd
     
         √ xProd is a Function
    +    √ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
     
       Testing yesNo
     
    @@ -1434,8 +1454,8 @@ Test log for: Wed Jan 24 2018 16:47:50 GMT+0200 (GTB Standard Time)
         √ zipWith is a Function
     
     
    -  total:     598
    -  passing:   598
    -  duration:  1.3s
    +  total:     618
    +  passing:   618
    +  duration:  412ms
     
     
    diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js
    index 17efbc0a4..76be27786 100644
    --- a/test/unzip/unzip.test.js
    +++ b/test/unzip/unzip.test.js
    @@ -5,9 +5,11 @@ test('Testing unzip', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof unzip === 'function', 'unzip is a Function');
    +	t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`);
    +  t.deepEqual(unzip([['a', 1, true], ['b', 2]]), [['a', 'b'], [1, 2], [true]], `unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]`);
     	//t.deepEqual(unzip(args..), 'Expected');
     	//t.equal(unzip(args..), 'Expected');
     	//t.false(unzip(args..), 'Expected');
     	//t.throws(unzip(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js
    index 09f3d2429..8c3cbea6a 100644
    --- a/test/unzipWith/unzipWith.test.js
    +++ b/test/unzipWith/unzipWith.test.js
    @@ -5,9 +5,9 @@ test('Testing unzipWith', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof unzipWith === 'function', 'unzipWith is a Function');
    -	//t.deepEqual(unzipWith(args..), 'Expected');
    +	t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`);
     	//t.equal(unzipWith(args..), 'Expected');
     	//t.false(unzipWith(args..), 'Expected');
     	//t.throws(unzipWith(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/xProd/xProd.js b/test/xProd/xProd.js
    index 07ea52dfa..37b3556a6 100644
    --- a/test/xProd/xProd.js
    +++ b/test/xProd/xProd.js
    @@ -1,2 +1,2 @@
    -const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +const xProd = (a, b) => a.reduce((acc,x) => acc.concat(b.map(y => [x, y])),[]);
     module.exports = xProd
    \ No newline at end of file
    diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js
    index a164210a2..9d650e65c 100644
    --- a/test/xProd/xProd.test.js
    +++ b/test/xProd/xProd.test.js
    @@ -5,9 +5,10 @@ test('Testing xProd', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof xProd === 'function', 'xProd is a Function');
    +  t.deepEqual(xProd([1, 2], ['a', 'b']), [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']], `xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]`);
     	//t.deepEqual(xProd(args..), 'Expected');
     	//t.equal(xProd(args..), 'Expected');
     	//t.false(xProd(args..), 'Expected');
     	//t.throws(xProd(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    
    From 82050234e6948a608e3405c4446ecd52fc3bd714 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 15:19:07 +0000
    Subject: [PATCH 085/103] Travis build: 1405
    
    ---
     README.md         | 4 ++--
     docs/index.html   | 2 +-
     snippets/xProd.md | 2 +-
     3 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index 7bf7f2801..d01778d8b 100644
    --- a/README.md
    +++ b/README.md
    @@ -2246,10 +2246,10 @@ without([2, 1, 2, 3], 1, 2); // [3]
     
     Creates a new array out of the two supplied by creating each possible pair from the arrays.
     
    -Use `Array.map()` to produce every possible pair from the elements of the two arrays.
    +Use `Array.reduce()`, `Array.map()` and `Array.concat()` to produce every possible pair from the elements of the two arrays and save them in an array.
     
     ```js
    -const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []);
     ```
     
     
    diff --git a/docs/index.html b/docs/index.html index 50aa785be..d0b48334e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -422,7 +422,7 @@ Object.assig
    unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)); // [3, 30, 300]
     

    without

    Filters out the elements of an array, that have one of the specified values.

    Use Array.filter() to create an array excluding(using !Array.includes()) all given values.

    (For a snippet that mutates the original array see pull)

    const without = (arr, ...args) => arr.filter(v => !args.includes(v));
     
    without([2, 1, 2, 3], 1, 2); // [3]
    -

    xProd

    Creates a new array out of the two supplied by creating each possible pair from the arrays.

    Use Array.map() to produce every possible pair from the elements of the two arrays.

    const xProd = (a, b) => a.map(x => b.map(y => [x, y]));
    +

    xProd

    Creates a new array out of the two supplied by creating each possible pair from the arrays.

    Use Array.reduce(), Array.map() and Array.concat() to produce every possible pair from the elements of the two arrays and save them in an array.

    const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []);
     
    xProd([1, 2], ['a', 'b']); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
     

    zip

    Creates an array of elements, grouped based on the position in the original arrays.

    Use Math.max.apply() to get the longest array in the arguments. Creates an array with that length as return value and use Array.from() with a map-function to create an array of grouped elements. If lengths of the argument-arrays vary, undefined is used where no value could be found.

    const zip = (...arrays) => {
       const maxLength = Math.max(...arrays.map(x => x.length));
    diff --git a/snippets/xProd.md b/snippets/xProd.md
    index d5ff74b61..df1bd897a 100644
    --- a/snippets/xProd.md
    +++ b/snippets/xProd.md
    @@ -5,7 +5,7 @@ Creates a new array out of the two supplied by creating each possible pair from
     Use `Array.reduce()`, `Array.map()` and `Array.concat()` to produce every possible pair from the elements of the two arrays and save them in an array.
     
     ```js
    -const xProd = (a, b) => a.reduce((acc,x) => acc.concat(b.map(y => [x, y])),[]);
    +const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []);
     ```
     
     ```js
    
    From 47cc6a376abbfd1420e42d67db62aebe09141131 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 17:33:38 +0200
    Subject: [PATCH 086/103] Tests for atob, btoa
    
    ---
     test/atob/atob.test.js |  4 +++-
     test/btoa/btoa.test.js |  3 ++-
     test/testlog           | 11 +++++++----
     3 files changed, 12 insertions(+), 6 deletions(-)
    
    diff --git a/test/atob/atob.test.js b/test/atob/atob.test.js
    index 07862e9a2..b58aaf930 100644
    --- a/test/atob/atob.test.js
    +++ b/test/atob/atob.test.js
    @@ -5,9 +5,11 @@ test('Testing atob', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof atob === 'function', 'atob is a Function');
    +  t.equals(atob('Zm9vYmFy'), 'foobar', 'atob("Zm9vYmFy") equals "foobar"');
    +  t.equals(atob('Z'), '', 'atob("Z") returns ""');
     	//t.deepEqual(atob(args..), 'Expected');
     	//t.equal(atob(args..), 'Expected');
     	//t.false(atob(args..), 'Expected');
     	//t.throws(atob(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js
    index da0e6a5a3..6751d363a 100644
    --- a/test/btoa/btoa.test.js
    +++ b/test/btoa/btoa.test.js
    @@ -5,9 +5,10 @@ test('Testing btoa', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof btoa === 'function', 'btoa is a Function');
    +  t.equals(btoa('foobar'), 'Zm9vYmFy', 'btoa("foobar") equals "Zm9vYmFy"');
     	//t.deepEqual(btoa(args..), 'Expected');
     	//t.equal(btoa(args..), 'Expected');
     	//t.false(btoa(args..), 'Expected');
     	//t.throws(btoa(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/testlog b/test/testlog
    index 051197040..ee7e14e18 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,4 +1,4 @@
    -Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
    +Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
     
     > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
    @@ -20,6 +20,8 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
       Testing atob
     
         √ atob is a Function
    +    √ atob("Zm9vYmFy") equals "foobar"
    +    √ atob("Z") returns ""
     
       Testing average
     
    @@ -59,6 +61,7 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
       Testing btoa
     
         √ btoa is a Function
    +    √ btoa("foobar") equals "Zm9vYmFy"
     
       Testing byteSize
     
    @@ -1454,8 +1457,8 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
         √ zipWith is a Function
     
     
    -  total:     618
    -  passing:   618
    -  duration:  412ms
    +  total:     621
    +  passing:   621
    +  duration:  417ms
     
     
    
    From 79a70885adbd80cb00464561a8cd1aa1313357f1 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 17:38:08 +0200
    Subject: [PATCH 087/103] Tests for averageBy, maxBy, minBy
    
    Fixed examples in minBy
    ---
     snippets/minBy.md                |  4 ++--
     test/averageBy/averageBy.test.js |  4 +++-
     test/maxBy/maxBy.test.js         |  4 +++-
     test/minBy/minBy.test.js         |  4 +++-
     test/testlog                     | 14 ++++++++++----
     test/xProd/xProd.js              |  2 +-
     6 files changed, 22 insertions(+), 10 deletions(-)
    
    diff --git a/snippets/minBy.md b/snippets/minBy.md
    index 594d83f5e..e9d8a53e2 100644
    --- a/snippets/minBy.md
    +++ b/snippets/minBy.md
    @@ -9,6 +9,6 @@ const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : v
     ```
     
     ```js
    -minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 8
    -minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 8
    +minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 2
    +minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 2
     ```
    diff --git a/test/averageBy/averageBy.test.js b/test/averageBy/averageBy.test.js
    index 60675dfb7..f1f83b740 100644
    --- a/test/averageBy/averageBy.test.js
    +++ b/test/averageBy/averageBy.test.js
    @@ -5,9 +5,11 @@ test('Testing averageBy', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof averageBy === 'function', 'averageBy is a Function');
    +  t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 5, 'Produces the right result with a function');
    +  t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 5, 'Produces the right result with a property name');
     	//t.deepEqual(averageBy(args..), 'Expected');
     	//t.equal(averageBy(args..), 'Expected');
     	//t.false(averageBy(args..), 'Expected');
     	//t.throws(averageBy(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js
    index 765bb73ec..1fff2c517 100644
    --- a/test/maxBy/maxBy.test.js
    +++ b/test/maxBy/maxBy.test.js
    @@ -5,9 +5,11 @@ test('Testing maxBy', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof maxBy === 'function', 'maxBy is a Function');
    +  t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 8, 'Produces the right result with a function');
    +  t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 8, 'Produces the right result with a property name');
     	//t.deepEqual(maxBy(args..), 'Expected');
     	//t.equal(maxBy(args..), 'Expected');
     	//t.false(maxBy(args..), 'Expected');
     	//t.throws(maxBy(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/minBy/minBy.test.js b/test/minBy/minBy.test.js
    index 130b2de7e..975fc6232 100644
    --- a/test/minBy/minBy.test.js
    +++ b/test/minBy/minBy.test.js
    @@ -5,9 +5,11 @@ test('Testing minBy', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof minBy === 'function', 'minBy is a Function');
    +  t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 2, 'Produces the right result with a function');
    +  t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 2, 'Produces the right result with a property name');
     	//t.deepEqual(minBy(args..), 'Expected');
     	//t.equal(minBy(args..), 'Expected');
     	//t.false(minBy(args..), 'Expected');
     	//t.throws(minBy(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/testlog b/test/testlog
    index ee7e14e18..3b1c8f3f5 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,4 +1,4 @@
    -Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
    +Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
     
     > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
    @@ -41,6 +41,8 @@ Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
       Testing averageBy
     
         √ averageBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing binarySearch
     
    @@ -837,6 +839,8 @@ Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
       Testing maxBy
     
         √ maxBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing maxN
     
    @@ -861,6 +865,8 @@ Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
       Testing minBy
     
         √ minBy is a Function
    +    √ Produces the right result with a function
    +    √ Produces the right result with a property name
     
       Testing minN
     
    @@ -1457,8 +1463,8 @@ Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
         √ zipWith is a Function
     
     
    -  total:     621
    -  passing:   621
    -  duration:  417ms
    +  total:     627
    +  passing:   627
    +  duration:  419ms
     
     
    diff --git a/test/xProd/xProd.js b/test/xProd/xProd.js
    index 37b3556a6..2b7a126c3 100644
    --- a/test/xProd/xProd.js
    +++ b/test/xProd/xProd.js
    @@ -1,2 +1,2 @@
    -const xProd = (a, b) => a.reduce((acc,x) => acc.concat(b.map(y => [x, y])),[]);
    +const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []);
     module.exports = xProd
    \ No newline at end of file
    
    From 4ee9b2681cb88f13b8abc8cea74d1da965fe5567 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 15:39:36 +0000
    Subject: [PATCH 088/103] Travis build: 1408
    
    ---
     README.md       | 4 ++--
     docs/index.html | 4 ++--
     2 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/README.md b/README.md
    index d01778d8b..16af20a52 100644
    --- a/README.md
    +++ b/README.md
    @@ -4240,8 +4240,8 @@ const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : v
     Examples
     
     ```js
    -minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 8
    -minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 8
    +minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 2
    +minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 2
     ```
     
     
    diff --git a/docs/index.html b/docs/index.html index d0b48334e..35a8033f7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -946,8 +946,8 @@ own individual rating by supplying it as the third argument. };
    median([5, 6, 50, 1, -5]); // 5
     

    minBy

    Returns the minimum value of an array, after mapping each element to a value using the provided function.

    Use Array.map() to map each element to the value returned by fn, Math.min() to get the maximum value.

    const minBy = (arr, fn) => Math.min(...arr.map(typeof fn === 'function' ? fn : val => val[fn]));
    -
    minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 8
    -minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 8
    +
    minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 2
    +minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 2
     

    percentile

    Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.

    Use Array.reduce() to calculate how many numbers are below the value and how many are the same value and apply the percentile formula.

    const percentile = (arr, val) =>
       100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0) / arr.length;
     
    percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6); // 55
    
    From 3e3982a0e4ea28d08813dc28d1700862b8cc31e9 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 17:49:09 +0200
    Subject: [PATCH 089/103] More tests
    
    ---
     test/castArray/castArray.test.js       |  7 ++++++-
     test/cloneRegExp/cloneRegExp.test.js   |  4 +++-
     test/composeRight/composeRight.test.js |  6 +++++-
     test/deepClone/deepClone.test.js       |  6 +++++-
     test/shallowClone/shallowClone.test.js |  6 +++++-
     test/testlog                           | 19 +++++++++++++++----
     6 files changed, 39 insertions(+), 9 deletions(-)
    
    diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js
    index 59d5d7c28..ed251de5a 100644
    --- a/test/castArray/castArray.test.js
    +++ b/test/castArray/castArray.test.js
    @@ -5,9 +5,14 @@ test('Testing castArray', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof castArray === 'function', 'castArray is a Function');
    +  t.deepEqual(castArray(1), [1], 'Works for single values');
    +  t.deepEqual(castArray([1]), [1], 'Works for arrays with one value');
    +  t.deepEqual(castArray([1,2,3]), [1,2,3], 'Works for arrays with multiple value');
    +  t.deepEqual(castArray('test'), ['test'], 'Works for strings');
    +  t.deepEqual(castArray({}), [{}], 'Works for objects');
     	//t.deepEqual(castArray(args..), 'Expected');
     	//t.equal(castArray(args..), 'Expected');
     	//t.false(castArray(args..), 'Expected');
     	//t.throws(castArray(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js
    index 2fb7f7b82..787c47fff 100644
    --- a/test/cloneRegExp/cloneRegExp.test.js
    +++ b/test/cloneRegExp/cloneRegExp.test.js
    @@ -5,9 +5,11 @@ test('Testing cloneRegExp', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof cloneRegExp === 'function', 'cloneRegExp is a Function');
    +  const rgTest = /./g;
    +  t.notEqual(cloneRegExp(rgTest), rgTest, 'Clones regular expressions properly');
     	//t.deepEqual(cloneRegExp(args..), 'Expected');
     	//t.equal(cloneRegExp(args..), 'Expected');
     	//t.false(cloneRegExp(args..), 'Expected');
     	//t.throws(cloneRegExp(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js
    index c96397e9f..be6a1ee90 100644
    --- a/test/composeRight/composeRight.test.js
    +++ b/test/composeRight/composeRight.test.js
    @@ -5,9 +5,13 @@ test('Testing composeRight', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof composeRight === 'function', 'composeRight is a Function');
    +  const add = (x, y) => x + y;
    +  const square = x => x * x;
    +  const addAndSquare = composeRight(add, square);
    +  t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition");
     	//t.deepEqual(composeRight(args..), 'Expected');
     	//t.equal(composeRight(args..), 'Expected');
     	//t.false(composeRight(args..), 'Expected');
     	//t.throws(composeRight(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js
    index a94eabcda..2098a1acf 100644
    --- a/test/deepClone/deepClone.test.js
    +++ b/test/deepClone/deepClone.test.js
    @@ -5,9 +5,13 @@ test('Testing deepClone', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof deepClone === 'function', 'deepClone is a Function');
    +  const a = { foo: 'bar', obj: { a: 1, b: 2 } };
    +  const b = deepClone(a);
    +  t.notEqual(a, b, 'Shallow cloning works');
    +  t.notEqual(a.obj, b.obj, 'Deep cloning works');
     	//t.deepEqual(deepClone(args..), 'Expected');
     	//t.equal(deepClone(args..), 'Expected');
     	//t.false(deepClone(args..), 'Expected');
     	//t.throws(deepClone(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js
    index b62b37998..9f0885344 100644
    --- a/test/shallowClone/shallowClone.test.js
    +++ b/test/shallowClone/shallowClone.test.js
    @@ -5,9 +5,13 @@ test('Testing shallowClone', (t) => {
     	//For more information on all the methods supported by tape
     	//Please go to https://github.com/substack/tape
     	t.true(typeof shallowClone === 'function', 'shallowClone is a Function');
    +  const a = { foo: 'bar', obj: { a: 1, b: 2 } };
    +  const b = shallowClone(a);
    +  t.notEqual(a, b, 'Shallow cloning works');
    +  t.equal(a.obj, b.obj, 'Does not clone deeply');
     	//t.deepEqual(shallowClone(args..), 'Expected');
     	//t.equal(shallowClone(args..), 'Expected');
     	//t.false(shallowClone(args..), 'Expected');
     	//t.throws(shallowClone(args..), 'Expected');
     	t.end();
    -});
    \ No newline at end of file
    +});
    diff --git a/test/testlog b/test/testlog
    index 3b1c8f3f5..cbe9a981c 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,4 +1,4 @@
    -Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
    +Test log for: Wed Jan 24 2018 17:48:46 GMT+0200 (GTB Standard Time)
     
     > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
    @@ -87,6 +87,11 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
       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
     
    @@ -118,6 +123,7 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
       Testing cloneRegExp
     
         √ cloneRegExp is a Function
    +    √ Clones regular expressions properly
     
       Testing coalesce
     
    @@ -154,6 +160,7 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
       Testing composeRight
     
         √ composeRight is a Function
    +    √ Performs left-to-right function composition
     
       Testing copyToClipboard
     
    @@ -197,6 +204,8 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
       Testing deepClone
     
         √ deepClone is a Function
    +    √ Shallow cloning works
    +    √ Deep cloning works
     
       Testing deepFlatten
     
    @@ -1124,6 +1133,8 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
       Testing shallowClone
     
         √ shallowClone is a Function
    +    √ Shallow cloning works
    +    √ Does not clone deeply
     
       Testing show
     
    @@ -1463,8 +1474,8 @@ Test log for: Wed Jan 24 2018 17:37:28 GMT+0200 (GTB Standard Time)
         √ zipWith is a Function
     
     
    -  total:     627
    -  passing:   627
    -  duration:  419ms
    +  total:     638
    +  passing:   638
    +  duration:  418ms
     
     
    
    From 9217979f807b5e3b0ceb6ab054c32902d2c5a95c Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 17:53:36 +0200
    Subject: [PATCH 090/103] Updated testing with proper indentation
    
    Uses two spaces instead of hard tabs.
    ---
     scripts/tdd.js                                | 16 +++----
     test/JSONToDate/JSONToDate.test.js            | 16 +++----
     test/JSONToFile/JSONToFile.test.js            | 16 +++----
     test/README/README.test.js                    | 16 +++----
     test/RGBToHex/RGBToHex.test.js                | 18 ++++----
     test/URLJoin/URLJoin.test.js                  | 16 +++----
     .../UUIDGeneratorBrowser.test.js              | 16 +++----
     .../UUIDGeneratorNode.test.js                 | 16 +++----
     test/anagrams/anagrams.test.js                | 18 ++++----
     test/arrayToHtmlList/arrayToHtmlList.test.js  | 16 +++----
     test/ary/ary.test.js                          | 16 +++----
     test/atob/atob.test.js                        | 16 +++----
     test/average/average.test.js                  | 18 ++++----
     test/averageBy/averageBy.test.js              | 16 +++----
     test/binarySearch/binarySearch.test.js        | 16 +++----
     test/bind/bind.test.js                        | 16 +++----
     test/bindKey/bindKey.test.js                  | 16 +++----
     test/bottomVisible/bottomVisible.test.js      | 16 +++----
     test/btoa/btoa.test.js                        | 16 +++----
     test/byteSize/byteSize.test.js                | 20 ++++-----
     test/call/call.test.js                        | 16 +++----
     test/capitalize/capitalize.test.js            | 20 ++++-----
     .../capitalizeEveryWord.test.js               | 18 ++++----
     test/castArray/castArray.test.js              | 16 +++----
     test/chainAsync/chainAsync.test.js            | 16 +++----
     test/chunk/chunk.test.js                      |  8 ++--
     test/clampNumber/clampNumber.test.js          | 18 ++++----
     test/cleanObj/cleanObj.test.js                | 20 ++++-----
     test/cloneRegExp/cloneRegExp.test.js          | 16 +++----
     test/coalesce/coalesce.test.js                | 18 ++++----
     test/coalesceFactory/coalesceFactory.test.js  | 20 ++++-----
     test/collatz/collatz.test.js                  | 16 +++----
     test/collectInto/collectInto.test.js          | 16 +++----
     test/colorize/colorize.test.js                | 16 +++----
     test/compact/compact.test.js                  | 18 ++++----
     test/compose/compose.test.js                  | 24 +++++------
     test/composeRight/composeRight.test.js        | 16 +++----
     test/copyToClipboard/copyToClipboard.test.js  | 16 +++----
     test/countBy/countBy.test.js                  | 16 +++----
     .../countOccurrences/countOccurrences.test.js | 18 ++++----
     test/countVowels/countVowels.test.js          | 16 +++----
     test/createElement/createElement.test.js      | 16 +++----
     test/createEventHub/createEventHub.test.js    | 16 +++----
     test/currentURL/currentURL.test.js            | 16 +++----
     test/curry/curry.test.js                      | 20 ++++-----
     test/decapitalize/decapitalize.test.js        | 16 +++----
     test/deepClone/deepClone.test.js              | 16 +++----
     test/deepFlatten/deepFlatten.test.js          | 18 ++++----
     test/defaults/defaults.test.js                | 16 +++----
     test/defer/defer.test.js                      | 16 +++----
     test/delay/delay.test.js                      | 16 +++----
     .../detectDeviceType/detectDeviceType.test.js | 16 +++----
     test/difference/difference.test.js            | 18 ++++----
     test/differenceBy/differenceBy.test.js        | 16 +++----
     test/differenceWith/differenceWith.test.js    | 18 ++++----
     test/digitize/digitize.test.js                | 18 ++++----
     test/distance/distance.test.js                | 16 +++----
     test/dropElements/dropElements.test.js        | 18 ++++----
     test/dropRight/dropRight.test.js              | 22 +++++-----
     .../elementIsVisibleInViewport.test.js        | 16 +++----
     test/elo/elo.test.js                          | 22 +++++-----
     test/equals/equals.test.js                    | 16 +++----
     test/escapeHTML/escapeHTML.test.js            | 18 ++++----
     test/escapeRegExp/escapeRegExp.test.js        | 18 ++++----
     test/everyNth/everyNth.test.js                | 18 ++++----
     test/extendHex/extendHex.test.js              | 20 ++++-----
     test/factorial/factorial.test.js              | 26 ++++++------
     test/factors/factors.test.js                  | 16 +++----
     test/fibonacci/fibonacci.test.js              | 18 ++++----
     .../fibonacciCountUntilNum.test.js            | 16 +++----
     .../fibonacciUntilNum.test.js                 | 16 +++----
     test/filterNonUnique/filterNonUnique.test.js  | 18 ++++----
     test/findKey/findKey.test.js                  | 16 +++----
     test/findLast/findLast.test.js                | 16 +++----
     test/findLastIndex/findLastIndex.test.js      | 16 +++----
     test/findLastKey/findLastKey.test.js          | 16 +++----
     test/flatten/flatten.test.js                  | 20 ++++-----
     test/flip/flip.test.js                        | 16 +++----
     test/forEachRight/forEachRight.test.js        | 16 +++----
     test/forOwn/forOwn.test.js                    | 16 +++----
     test/forOwnRight/forOwnRight.test.js          | 16 +++----
     test/formatDuration/formatDuration.test.js    | 20 ++++-----
     test/fromCamelCase/fromCamelCase.test.js      | 22 +++++-----
     test/functionName/functionName.test.js        | 16 +++----
     test/functions/functions.test.js              | 16 +++----
     test/gcd/gcd.test.js                          | 20 ++++-----
     .../geometricProgression.test.js              | 22 +++++-----
     test/get/get.test.js                          | 20 ++++-----
     .../getDaysDiffBetweenDates.test.js           | 18 ++++----
     .../getScrollPosition.test.js                 | 16 +++----
     test/getStyle/getStyle.test.js                | 16 +++----
     test/getType/getType.test.js                  | 18 ++++----
     .../getURLParameters/getURLParameters.test.js | 18 ++++----
     test/groupBy/groupBy.test.js                  | 20 ++++-----
     test/hammingDistance/hammingDistance.test.js  | 18 ++++----
     test/hasClass/hasClass.test.js                | 16 +++----
     test/hasFlags/hasFlags.test.js                | 16 +++----
     test/hashBrowser/hashBrowser.test.js          | 16 +++----
     test/hashNode/hashNode.test.js                | 16 +++----
     test/head/head.test.js                        |  8 ++--
     test/hexToRGB/hexToRGB.test.js                | 22 +++++-----
     test/hide/hide.test.js                        | 16 +++----
     test/howManyTimes/howManyTimes.test.js        | 16 +++----
     test/httpDelete/httpDelete.test.js            | 16 +++----
     test/httpGet/httpGet.test.js                  | 16 +++----
     test/httpPost/httpPost.test.js                | 16 +++----
     test/httpPut/httpPut.test.js                  | 16 +++----
     test/httpsRedirect/httpsRedirect.test.js      | 16 +++----
     test/inRange/inRange.test.js                  | 24 +++++------
     test/indexOfAll/indexOfAll.test.js            | 20 ++++-----
     test/initial/initial.test.js                  | 18 ++++----
     .../initialize2DArray.test.js                 | 18 ++++----
     .../initializeArrayWithRange.test.js          | 18 ++++----
     .../initializeArrayWithRangeRight.test.js     | 16 +++----
     .../initializeArrayWithValues.test.js         | 18 ++++----
     test/intersection/intersection.test.js        | 18 ++++----
     test/intersectionBy/intersectionBy.test.js    | 16 +++----
     .../intersectionWith/intersectionWith.test.js | 16 +++----
     test/invertKeyValues/invertKeyValues.test.js  | 16 +++----
     test/is/is.test.js                            | 16 +++----
     test/isAbsoluteURL/isAbsoluteURL.test.js      | 22 +++++-----
     .../isArmstrongNumber.test.js                 | 16 +++----
     test/isArray/isArray.test.js                  | 18 ++++----
     test/isArrayBuffer/isArrayBuffer.test.js      | 16 +++----
     test/isArrayLike/isArrayLike.test.js          | 16 +++----
     test/isBoolean/isBoolean.test.js              | 20 ++++-----
     test/isDivisible/isDivisible.test.js          | 16 +++----
     test/isEmpty/isEmpty.test.js                  | 16 +++----
     test/isEven/isEven.test.js                    | 16 +++----
     test/isFunction/isFunction.test.js            | 18 ++++----
     test/isLowerCase/isLowerCase.test.js          | 22 +++++-----
     test/isMap/isMap.test.js                      | 16 +++----
     test/isNil/isNil.test.js                      | 16 +++----
     test/isNull/isNull.test.js                    | 20 ++++-----
     test/isNumber/isNumber.test.js                | 20 ++++-----
     test/isObject/isObject.test.js                | 24 +++++------
     test/isObjectLike/isObjectLike.test.js        | 16 +++----
     test/isPlainObject/isPlainObject.test.js      | 16 +++----
     test/isPrime/isPrime.test.js                  | 18 ++++----
     test/isPrimitive/isPrimitive.test.js          | 20 ++++-----
     test/isPromiseLike/isPromiseLike.test.js      | 16 +++----
     test/isRegExp/isRegExp.test.js                | 16 +++----
     test/isSet/isSet.test.js                      | 16 +++----
     test/isSorted/isSorted.test.js                | 20 ++++-----
     test/isString/isString.test.js                | 26 ++++++------
     test/isSymbol/isSymbol.test.js                | 18 ++++----
     test/isTravisCI/isTravisCI.test.js            | 16 +++----
     test/isTypedArray/isTypedArray.test.js        | 16 +++----
     test/isUndefined/isUndefined.test.js          | 16 +++----
     test/isUpperCase/isUpperCase.test.js          | 20 ++++-----
     test/isValidJSON/isValidJSON.test.js          | 22 +++++-----
     test/isWeakMap/isWeakMap.test.js              | 16 +++----
     test/isWeakSet/isWeakSet.test.js              | 16 +++----
     test/join/join.test.js                        | 22 +++++-----
     test/last/last.test.js                        | 10 ++---
     test/lcm/lcm.test.js                          | 20 ++++-----
     test/longestItem/longestItem.test.js          | 18 ++++----
     test/lowercaseKeys/lowercaseKeys.test.js      | 16 +++----
     test/luhnCheck/luhnCheck.test.js              | 22 +++++-----
     test/mapKeys/mapKeys.test.js                  | 16 +++----
     test/mapObject/mapObject.test.js              | 20 ++++-----
     test/mapValues/mapValues.test.js              | 16 +++----
     test/mask/mask.test.js                        | 20 ++++-----
     test/matches/matches.test.js                  | 16 +++----
     test/matchesWith/matchesWith.test.js          | 16 +++----
     test/maxBy/maxBy.test.js                      | 16 +++----
     test/maxN/maxN.test.js                        | 20 ++++-----
     test/median/median.test.js                    | 20 ++++-----
     test/memoize/memoize.test.js                  | 16 +++----
     test/merge/merge.test.js                      | 16 +++----
     test/minBy/minBy.test.js                      | 16 +++----
     test/minN/minN.test.js                        | 18 ++++----
     test/negate/negate.test.js                    | 18 ++++----
     test/nthArg/nthArg.test.js                    | 16 +++----
     test/nthElement/nthElement.test.js            | 20 ++++-----
     test/objectFromPairs/objectFromPairs.test.js  | 18 ++++----
     test/objectToPairs/objectToPairs.test.js      | 18 ++++----
     .../observeMutations/observeMutations.test.js | 16 +++----
     test/off/off.test.js                          | 16 +++----
     test/omit/omit.test.js                        | 16 +++----
     test/omitBy/omitBy.test.js                    | 16 +++----
     test/on/on.test.js                            | 16 +++----
     .../onUserInputChange.test.js                 | 16 +++----
     test/once/once.test.js                        | 16 +++----
     test/orderBy/orderBy.test.js                  | 22 +++++-----
     test/over/over.test.js                        | 16 +++----
     test/palindrome/palindrome.test.js            | 20 ++++-----
     test/parseCookie/parseCookie.test.js          | 16 +++----
     test/partial/partial.test.js                  | 16 +++----
     test/partialRight/partialRight.test.js        | 16 +++----
     test/partition/partition.test.js              | 20 ++++-----
     test/percentile/percentile.test.js            | 18 ++++----
     test/pick/pick.test.js                        | 18 ++++----
     test/pickBy/pickBy.test.js                    | 16 +++----
     test/pipeFunctions/pipeFunctions.test.js      | 16 +++----
     test/pluralize/pluralize.test.js              | 16 +++----
     test/powerset/powerset.test.js                | 18 ++++----
     test/prettyBytes/prettyBytes.test.js          | 22 +++++-----
     test/primes/primes.test.js                    | 18 ++++----
     test/promisify/promisify.test.js              | 16 +++----
     test/pull/pull.test.js                        | 16 +++----
     test/pullAtIndex/pullAtIndex.test.js          | 16 +++----
     test/pullAtValue/pullAtValue.test.js          | 16 +++----
     test/quickSort/quickSort.test.js              | 12 +++---
     .../randomHexColorCode.test.js                | 16 +++----
     .../randomIntArrayInRange.test.js             | 16 +++----
     .../randomIntegerInRange.test.js              | 16 +++----
     .../randomNumberInRange.test.js               | 16 +++----
     test/readFileLines/readFileLines.test.js      | 16 +++----
     test/redirect/redirect.test.js                | 16 +++----
     .../reduceSuccessive/reduceSuccessive.test.js | 16 +++----
     test/reducedFilter/reducedFilter.test.js      | 42 +++++++++----------
     test/remove/remove.test.js                    | 18 ++++----
     test/removeVowels/removeVowels.test.js        | 16 +++----
     test/reverseString/reverseString.test.js      | 18 ++++----
     test/round/round.test.js                      | 16 +++----
     test/runAsync/runAsync.test.js                | 16 +++----
     .../runPromisesInSeries.test.js               | 16 +++----
     test/sample/sample.test.js                    | 16 +++----
     test/sampleSize/sampleSize.test.js            | 16 +++----
     test/scrollToTop/scrollToTop.test.js          | 16 +++----
     test/sdbm/sdbm.test.js                        | 18 ++++----
     test/serializeCookie/serializeCookie.test.js  | 16 +++----
     test/setStyle/setStyle.test.js                | 16 +++----
     test/shallowClone/shallowClone.test.js        | 16 +++----
     test/show/show.test.js                        | 16 +++----
     test/shuffle/shuffle.test.js                  | 16 +++----
     test/similarity/similarity.test.js            | 14 +++----
     test/size/size.test.js                        | 22 +++++-----
     test/sleep/sleep.test.js                      | 16 +++----
     test/solveRPN/solveRPN.test.js                | 16 +++----
     .../sortCharactersInString.test.js            | 18 ++++----
     test/sortedIndex/sortedIndex.test.js          | 20 ++++-----
     test/sortedLastIndex/sortedLastIndex.test.js  | 16 +++----
     test/speechSynthesis/speechSynthesis.test.js  | 16 +++----
     test/splitLines/splitLines.test.js            | 18 ++++----
     test/spreadOver/spreadOver.test.js            | 20 ++++-----
     .../standardDeviation.test.js                 | 20 ++++-----
     test/sum/sum.test.js                          | 18 ++++----
     test/sumBy/sumBy.test.js                      | 16 +++----
     test/sumPower/sumPower.test.js                | 22 +++++-----
     .../symmetricDifference.test.js               | 18 ++++----
     .../symmetricDifferenceBy.test.js             | 16 +++----
     .../symmetricDifferenceWith.test.js           | 16 +++----
     test/tail/tail.test.js                        | 20 ++++-----
     test/take/take.test.js                        | 20 ++++-----
     test/takeRight/takeRight.test.js              | 20 ++++-----
     test/testlog                                  |  4 +-
     test/timeTaken/timeTaken.test.js              | 16 +++----
     test/times/times.test.js                      | 16 +++----
     test/toCamelCase/toCamelCase.test.js          | 24 +++++------
     test/toDecimalMark/toDecimalMark.test.js      | 18 ++++----
     test/toKebabCase/toKebabCase.test.js          | 24 +++++------
     test/toOrdinalSuffix/toOrdinalSuffix.test.js  | 26 ++++++------
     test/toSafeInteger/toSafeInteger.test.js      | 26 ++++++------
     test/toSnakeCase/toSnakeCase.test.js          | 24 +++++------
     test/toggleClass/toggleClass.test.js          | 16 +++----
     test/tomorrow/tomorrow.test.js                | 16 +++----
     test/transform/transform.test.js              | 16 +++----
     test/truncateString/truncateString.test.js    | 16 +++----
     .../truthCheckCollection.test.js              | 18 ++++----
     test/unary/unary.test.js                      | 16 +++----
     test/unescapeHTML/unescapeHTML.test.js        | 18 ++++----
     test/unfold/unfold.test.js                    | 16 +++----
     test/union/union.test.js                      | 18 ++++----
     test/unionBy/unionBy.test.js                  | 16 +++----
     test/unionWith/unionWith.test.js              | 16 +++----
     test/uniqueElements/uniqueElements.test.js    | 18 ++++----
     test/untildify/untildify.test.js              | 16 +++----
     test/unzip/unzip.test.js                      | 18 ++++----
     test/unzipWith/unzipWith.test.js              | 16 +++----
     test/validateNumber/validateNumber.test.js    | 32 +++++++-------
     test/without/without.test.js                  | 26 ++++++------
     test/words/words.test.js                      | 26 ++++++------
     test/xProd/xProd.test.js                      | 16 +++----
     test/yesNo/yesNo.test.js                      | 32 +++++++-------
     test/zip/zip.test.js                          | 24 +++++------
     test/zipObject/zipObject.test.js              | 26 ++++++------
     test/zipWith/zipWith.test.js                  | 16 +++----
     279 files changed, 2463 insertions(+), 2463 deletions(-)
    
    diff --git a/scripts/tdd.js b/scripts/tdd.js
    index c51226daf..71e55df85 100644
    --- a/scripts/tdd.js
    +++ b/scripts/tdd.js
    @@ -23,7 +23,7 @@ const snippetFiles = [];
     
     const snippetFilesActive = fs.readdirSync(SNIPPETS_ACTIVE, 'utf8').map(fileName => fileName.slice(0, -3));
     const snippetFilesArchive = fs.readdirSync(SNIPPETS_ARCHIVE, 'utf8')
    -                              .filter(fileName => !fileName.includes('README')) // -> Filters out main README.md file in Archieve which isn't a snippet 
    +                              .filter(fileName => !fileName.includes('README')) // -> Filters out main README.md file in Archieve which isn't a snippet
                                   .map(fileName => fileName.slice(0, -3));
     
     snippetFiles.push(...snippetFilesActive);
    @@ -68,13 +68,13 @@ snippetFiles
           `const test = require('tape');`,
           `const ${fileName} = require('./${fileName}.js');`,
           `\ntest('Testing ${fileName}', (t) => {`,
    -      `\t//For more information on all the methods supported by tape\n\t//Please go to https://github.com/substack/tape`,
    -      `\tt.true(typeof ${fileName} === 'function', '${fileName} is a Function');`,
    -      `\t//t.deepEqual(${fileName}(args..), 'Expected');`,
    -      `\t//t.equal(${fileName}(args..), 'Expected');`,
    -      `\t//t.false(${fileName}(args..), 'Expected');`,
    -      `\t//t.throws(${fileName}(args..), 'Expected');`,
    -      `\tt.end();`,
    +      `  //For more information on all the methods supported by tape\n  //Please go to https://github.com/substack/tape`,
    +      `  t.true(typeof ${fileName} === 'function', '${fileName} is a Function');`,
    +      `  //t.deepEqual(${fileName}(args..), 'Expected');`,
    +      `  //t.equal(${fileName}(args..), 'Expected');`,
    +      `  //t.false(${fileName}(args..), 'Expected');`,
    +      `  //t.throws(${fileName}(args..), 'Expected');`,
    +      `  t.end();`,
           `});`
         ].join('\n');
     
    diff --git a/test/JSONToDate/JSONToDate.test.js b/test/JSONToDate/JSONToDate.test.js
    index 9636880ac..1e2a7a57b 100644
    --- a/test/JSONToDate/JSONToDate.test.js
    +++ b/test/JSONToDate/JSONToDate.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const JSONToDate = require('./JSONToDate.js');
     
     test('Testing JSONToDate', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof JSONToDate === 'function', 'JSONToDate is a Function');
    -	//t.deepEqual(JSONToDate(args..), 'Expected');
    -	//t.equal(JSONToDate(args..), 'Expected');
    -	//t.false(JSONToDate(args..), 'Expected');
    -	//t.throws(JSONToDate(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof JSONToDate === 'function', 'JSONToDate is a Function');
    +  //t.deepEqual(JSONToDate(args..), 'Expected');
    +  //t.equal(JSONToDate(args..), 'Expected');
    +  //t.false(JSONToDate(args..), 'Expected');
    +  //t.throws(JSONToDate(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js
    index 7dbfeaf94..47bccf60b 100644
    --- a/test/JSONToFile/JSONToFile.test.js
    +++ b/test/JSONToFile/JSONToFile.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const JSONToFile = require('./JSONToFile.js');
     
     test('Testing JSONToFile', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof JSONToFile === 'function', 'JSONToFile is a Function');
    -	//t.deepEqual(JSONToFile(args..), 'Expected');
    -	//t.equal(JSONToFile(args..), 'Expected');
    -	//t.false(JSONToFile(args..), 'Expected');
    -	//t.throws(JSONToFile(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof JSONToFile === 'function', 'JSONToFile is a Function');
    +  //t.deepEqual(JSONToFile(args..), 'Expected');
    +  //t.equal(JSONToFile(args..), 'Expected');
    +  //t.false(JSONToFile(args..), 'Expected');
    +  //t.throws(JSONToFile(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/README/README.test.js b/test/README/README.test.js
    index bfbab3850..7ae30976a 100644
    --- a/test/README/README.test.js
    +++ b/test/README/README.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const README = require('./README.js');
     
     test('Testing README', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof README === 'function', 'README is a Function');
    -	//t.deepEqual(README(args..), 'Expected');
    -	//t.equal(README(args..), 'Expected');
    -	//t.false(README(args..), 'Expected');
    -	//t.throws(README(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof README === 'function', 'README is a Function');
    +  //t.deepEqual(README(args..), 'Expected');
    +  //t.equal(README(args..), 'Expected');
    +  //t.false(README(args..), 'Expected');
    +  //t.throws(README(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js
    index 4407ff564..277d6575c 100644
    --- a/test/RGBToHex/RGBToHex.test.js
    +++ b/test/RGBToHex/RGBToHex.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const RGBToHex = require('./RGBToHex.js');
     
     test('Testing RGBToHex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof RGBToHex === 'function', 'RGBToHex is a Function');
    -	t.equal(RGBToHex(255, 165, 1), 'ffa501', "Converts the values of RGB components to a color code.");
    -	//t.deepEqual(RGBToHex(args..), 'Expected');
    -	//t.equal(RGBToHex(args..), 'Expected');
    -	//t.false(RGBToHex(args..), 'Expected');
    -	//t.throws(RGBToHex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof RGBToHex === 'function', 'RGBToHex is a Function');
    +  t.equal(RGBToHex(255, 165, 1), 'ffa501', "Converts the values of RGB components to a color code.");
    +  //t.deepEqual(RGBToHex(args..), 'Expected');
    +  //t.equal(RGBToHex(args..), 'Expected');
    +  //t.false(RGBToHex(args..), 'Expected');
    +  //t.throws(RGBToHex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/URLJoin/URLJoin.test.js b/test/URLJoin/URLJoin.test.js
    index 17f567d39..70d0d09a6 100644
    --- a/test/URLJoin/URLJoin.test.js
    +++ b/test/URLJoin/URLJoin.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const URLJoin = require('./URLJoin.js');
     
     test('Testing URLJoin', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof URLJoin === 'function', 'URLJoin is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof URLJoin === 'function', 'URLJoin is a Function');
       t.equal(URLJoin('http://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo'), 'http://www.google.com/a/b/cd?foo=123&bar=foo', 'Returns proper URL');
       t.equal(URLJoin('file://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo'), 'file:///www.google.com/a/b/cd?foo=123&bar=foo', 'Returns proper URL');
    -	//t.deepEqual(URLJoin(args..), 'Expected');
    -	//t.equal(URLJoin(args..), 'Expected');
    -	//t.false(URLJoin(args..), 'Expected');
    -	//t.throws(URLJoin(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(URLJoin(args..), 'Expected');
    +  //t.equal(URLJoin(args..), 'Expected');
    +  //t.false(URLJoin(args..), 'Expected');
    +  //t.throws(URLJoin(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js
    index d6f5407a4..bb868d1e8 100644
    --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js
    +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js');
     
     test('Testing UUIDGeneratorBrowser', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof UUIDGeneratorBrowser === 'function', 'UUIDGeneratorBrowser is a Function');
    -	//t.deepEqual(UUIDGeneratorBrowser(args..), 'Expected');
    -	//t.equal(UUIDGeneratorBrowser(args..), 'Expected');
    -	//t.false(UUIDGeneratorBrowser(args..), 'Expected');
    -	//t.throws(UUIDGeneratorBrowser(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof UUIDGeneratorBrowser === 'function', 'UUIDGeneratorBrowser is a Function');
    +  //t.deepEqual(UUIDGeneratorBrowser(args..), 'Expected');
    +  //t.equal(UUIDGeneratorBrowser(args..), 'Expected');
    +  //t.false(UUIDGeneratorBrowser(args..), 'Expected');
    +  //t.throws(UUIDGeneratorBrowser(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js
    index 44b7040e1..bedb41340 100644
    --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js
    +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const UUIDGeneratorNode = require('./UUIDGeneratorNode.js');
     
     test('Testing UUIDGeneratorNode', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof UUIDGeneratorNode === 'function', 'UUIDGeneratorNode is a Function');
    -	//t.deepEqual(UUIDGeneratorNode(args..), 'Expected');
    -	//t.equal(UUIDGeneratorNode(args..), 'Expected');
    -	//t.false(UUIDGeneratorNode(args..), 'Expected');
    -	//t.throws(UUIDGeneratorNode(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof UUIDGeneratorNode === 'function', 'UUIDGeneratorNode is a Function');
    +  //t.deepEqual(UUIDGeneratorNode(args..), 'Expected');
    +  //t.equal(UUIDGeneratorNode(args..), 'Expected');
    +  //t.false(UUIDGeneratorNode(args..), 'Expected');
    +  //t.throws(UUIDGeneratorNode(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/anagrams/anagrams.test.js b/test/anagrams/anagrams.test.js
    index 8368a91a8..4318f4c46 100644
    --- a/test/anagrams/anagrams.test.js
    +++ b/test/anagrams/anagrams.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const anagrams = require('./anagrams.js');
     
     test('Testing anagrams', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof anagrams === 'function', 'anagrams is a Function');
    -	t.deepEqual(anagrams('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all anagrams of a string");
    -	//t.deepEqual(anagrams(args..), 'Expected');
    -	//t.equal(anagrams(args..), 'Expected');
    -	//t.false(anagrams(args..), 'Expected');
    -	//t.throws(anagrams(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof anagrams === 'function', 'anagrams is a Function');
    +  t.deepEqual(anagrams('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all anagrams of a string");
    +  //t.deepEqual(anagrams(args..), 'Expected');
    +  //t.equal(anagrams(args..), 'Expected');
    +  //t.false(anagrams(args..), 'Expected');
    +  //t.throws(anagrams(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/arrayToHtmlList/arrayToHtmlList.test.js b/test/arrayToHtmlList/arrayToHtmlList.test.js
    index b4a4b036b..1f8885778 100644
    --- a/test/arrayToHtmlList/arrayToHtmlList.test.js
    +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const arrayToHtmlList = require('./arrayToHtmlList.js');
     
     test('Testing arrayToHtmlList', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function');
    -	//t.deepEqual(arrayToHtmlList(args..), 'Expected');
    -	//t.equal(arrayToHtmlList(args..), 'Expected');
    -	//t.false(arrayToHtmlList(args..), 'Expected');
    -	//t.throws(arrayToHtmlList(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function');
    +  //t.deepEqual(arrayToHtmlList(args..), 'Expected');
    +  //t.equal(arrayToHtmlList(args..), 'Expected');
    +  //t.false(arrayToHtmlList(args..), 'Expected');
    +  //t.throws(arrayToHtmlList(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js
    index d82728ce4..445b40618 100644
    --- a/test/ary/ary.test.js
    +++ b/test/ary/ary.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const ary = require('./ary.js');
     
     test('Testing ary', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof ary === 'function', 'ary is a Function');
    -	//t.deepEqual(ary(args..), 'Expected');
    -	//t.equal(ary(args..), 'Expected');
    -	//t.false(ary(args..), 'Expected');
    -	//t.throws(ary(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof ary === 'function', 'ary is a Function');
    +  //t.deepEqual(ary(args..), 'Expected');
    +  //t.equal(ary(args..), 'Expected');
    +  //t.false(ary(args..), 'Expected');
    +  //t.throws(ary(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/atob/atob.test.js b/test/atob/atob.test.js
    index b58aaf930..32e3567d5 100644
    --- a/test/atob/atob.test.js
    +++ b/test/atob/atob.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const atob = require('./atob.js');
     
     test('Testing atob', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof atob === 'function', 'atob is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof atob === 'function', 'atob is a Function');
       t.equals(atob('Zm9vYmFy'), 'foobar', 'atob("Zm9vYmFy") equals "foobar"');
       t.equals(atob('Z'), '', 'atob("Z") returns ""');
    -	//t.deepEqual(atob(args..), 'Expected');
    -	//t.equal(atob(args..), 'Expected');
    -	//t.false(atob(args..), 'Expected');
    -	//t.throws(atob(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(atob(args..), 'Expected');
    +  //t.equal(atob(args..), 'Expected');
    +  //t.false(atob(args..), 'Expected');
    +  //t.throws(atob(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/average/average.test.js b/test/average/average.test.js
    index c38a2ee5c..dff7df5a7 100644
    --- a/test/average/average.test.js
    +++ b/test/average/average.test.js
    @@ -2,23 +2,23 @@ const test = require('tape');
     const average = require('./average.js');
     
     test('Testing average', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
       t.true(typeof average === 'function', 'average is a Function');
       t.true(average(true) === 1, 'average(true) returns 0');
       t.true(average(false) === 0, 'average(false) returns 1');
       t.equal(average(9, 1), 5, 'average(9, 1) returns 5');
    -	t.equal(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631), 32163.909090909092, 'average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 ');
    -	t.equal(average(1, 2, 3), 2, 'average(1, 2, 3) returns 2');
    +  t.equal(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631), 32163.909090909092, 'average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 ');
    +  t.equal(average(1, 2, 3), 2, 'average(1, 2, 3) returns 2');
       t.equal(average(null), 0, 'average(null) returns 0');
    -	t.true(isNaN(average(undefined)), 'average(1, 2, 3) returns NaN');
    -	t.true(isNaN(average('String')), 'average(String) returns NaN');
    -	t.true(isNaN(average({ a: 123})), 'average({ a: 123}) returns NaN');
    -	t.true(isNaN(average([undefined, 0, 'string'])), 'average([undefined, 0, string]) returns NaN');
    +  t.true(isNaN(average(undefined)), 'average(1, 2, 3) returns NaN');
    +  t.true(isNaN(average('String')), 'average(String) returns NaN');
    +  t.true(isNaN(average({ a: 123})), 'average({ a: 123}) returns NaN');
    +  t.true(isNaN(average([undefined, 0, 'string'])), 'average([undefined, 0, string]) returns NaN');
     
       let start = new Date().getTime();
       average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631);
       let end = new Date().getTime();  
       t.true((end - start) < 2000, 'head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run');
    -	t.end();
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/averageBy/averageBy.test.js b/test/averageBy/averageBy.test.js
    index f1f83b740..7c3fabe16 100644
    --- a/test/averageBy/averageBy.test.js
    +++ b/test/averageBy/averageBy.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const averageBy = require('./averageBy.js');
     
     test('Testing averageBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof averageBy === 'function', 'averageBy is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof averageBy === 'function', 'averageBy is a Function');
       t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 5, 'Produces the right result with a function');
       t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 5, 'Produces the right result with a property name');
    -	//t.deepEqual(averageBy(args..), 'Expected');
    -	//t.equal(averageBy(args..), 'Expected');
    -	//t.false(averageBy(args..), 'Expected');
    -	//t.throws(averageBy(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(averageBy(args..), 'Expected');
    +  //t.equal(averageBy(args..), 'Expected');
    +  //t.false(averageBy(args..), 'Expected');
    +  //t.throws(averageBy(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/binarySearch/binarySearch.test.js b/test/binarySearch/binarySearch.test.js
    index 754a31ad6..a98fc8e90 100644
    --- a/test/binarySearch/binarySearch.test.js
    +++ b/test/binarySearch/binarySearch.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const binarySearch = require('./binarySearch.js');
     
     test('Testing binarySearch', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof binarySearch === 'function', 'binarySearch is a Function');
    -	//t.deepEqual(binarySearch(args..), 'Expected');
    -	//t.equal(binarySearch(args..), 'Expected');
    -	//t.false(binarySearch(args..), 'Expected');
    -	//t.throws(binarySearch(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof binarySearch === 'function', 'binarySearch is a Function');
    +  //t.deepEqual(binarySearch(args..), 'Expected');
    +  //t.equal(binarySearch(args..), 'Expected');
    +  //t.false(binarySearch(args..), 'Expected');
    +  //t.throws(binarySearch(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/bind/bind.test.js b/test/bind/bind.test.js
    index 13df8d07a..6ad403682 100644
    --- a/test/bind/bind.test.js
    +++ b/test/bind/bind.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const bind = require('./bind.js');
     
     test('Testing bind', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof bind === 'function', 'bind is a Function');
    -	//t.deepEqual(bind(args..), 'Expected');
    -	//t.equal(bind(args..), 'Expected');
    -	//t.false(bind(args..), 'Expected');
    -	//t.throws(bind(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof bind === 'function', 'bind is a Function');
    +  //t.deepEqual(bind(args..), 'Expected');
    +  //t.equal(bind(args..), 'Expected');
    +  //t.false(bind(args..), 'Expected');
    +  //t.throws(bind(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js
    index 91de08165..36619ebcd 100644
    --- a/test/bindKey/bindKey.test.js
    +++ b/test/bindKey/bindKey.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const bindKey = require('./bindKey.js');
     
     test('Testing bindKey', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof bindKey === 'function', 'bindKey is a Function');
    -	//t.deepEqual(bindKey(args..), 'Expected');
    -	//t.equal(bindKey(args..), 'Expected');
    -	//t.false(bindKey(args..), 'Expected');
    -	//t.throws(bindKey(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof bindKey === 'function', 'bindKey is a Function');
    +  //t.deepEqual(bindKey(args..), 'Expected');
    +  //t.equal(bindKey(args..), 'Expected');
    +  //t.false(bindKey(args..), 'Expected');
    +  //t.throws(bindKey(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/bottomVisible/bottomVisible.test.js b/test/bottomVisible/bottomVisible.test.js
    index be6f6871b..1c8eae4be 100644
    --- a/test/bottomVisible/bottomVisible.test.js
    +++ b/test/bottomVisible/bottomVisible.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const bottomVisible = require('./bottomVisible.js');
     
     test('Testing bottomVisible', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof bottomVisible === 'function', 'bottomVisible is a Function');
    -	//t.deepEqual(bottomVisible(args..), 'Expected');
    -	//t.equal(bottomVisible(args..), 'Expected');
    -	//t.false(bottomVisible(args..), 'Expected');
    -	//t.throws(bottomVisible(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof bottomVisible === 'function', 'bottomVisible is a Function');
    +  //t.deepEqual(bottomVisible(args..), 'Expected');
    +  //t.equal(bottomVisible(args..), 'Expected');
    +  //t.false(bottomVisible(args..), 'Expected');
    +  //t.throws(bottomVisible(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js
    index 6751d363a..85690e99b 100644
    --- a/test/btoa/btoa.test.js
    +++ b/test/btoa/btoa.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const btoa = require('./btoa.js');
     
     test('Testing btoa', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof btoa === 'function', 'btoa is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof btoa === 'function', 'btoa is a Function');
       t.equals(btoa('foobar'), 'Zm9vYmFy', 'btoa("foobar") equals "Zm9vYmFy"');
    -	//t.deepEqual(btoa(args..), 'Expected');
    -	//t.equal(btoa(args..), 'Expected');
    -	//t.false(btoa(args..), 'Expected');
    -	//t.throws(btoa(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(btoa(args..), 'Expected');
    +  //t.equal(btoa(args..), 'Expected');
    +  //t.false(btoa(args..), 'Expected');
    +  //t.throws(btoa(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/byteSize/byteSize.test.js b/test/byteSize/byteSize.test.js
    index bac20ac38..32718fada 100644
    --- a/test/byteSize/byteSize.test.js
    +++ b/test/byteSize/byteSize.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const byteSize = require('./byteSize.js');
     
     test('Testing byteSize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof byteSize === 'function', 'byteSize is a Function');
    -	// Works only in browser
    -	// t.equal(byteSize('Hello World'), 11, "Returns the length of a string in bytes");
    -	//t.deepEqual(byteSize(args..), 'Expected');
    -	//t.equal(byteSize(args..), 'Expected');
    -	//t.false(byteSize(args..), 'Expected');
    -	//t.throws(byteSize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof byteSize === 'function', 'byteSize is a Function');
    +  // Works only in browser
    +  // t.equal(byteSize('Hello World'), 11, "Returns the length of a string in bytes");
    +  //t.deepEqual(byteSize(args..), 'Expected');
    +  //t.equal(byteSize(args..), 'Expected');
    +  //t.false(byteSize(args..), 'Expected');
    +  //t.throws(byteSize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/call/call.test.js b/test/call/call.test.js
    index f01b61ab1..ba15d452e 100644
    --- a/test/call/call.test.js
    +++ b/test/call/call.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const call = require('./call.js');
     
     test('Testing call', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof call === 'function', 'call is a Function');
    -	//t.deepEqual(call(args..), 'Expected');
    -	//t.equal(call(args..), 'Expected');
    -	//t.false(call(args..), 'Expected');
    -	//t.throws(call(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof call === 'function', 'call is a Function');
    +  //t.deepEqual(call(args..), 'Expected');
    +  //t.equal(call(args..), 'Expected');
    +  //t.false(call(args..), 'Expected');
    +  //t.throws(call(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/capitalize/capitalize.test.js b/test/capitalize/capitalize.test.js
    index fb8505cfc..75073b934 100644
    --- a/test/capitalize/capitalize.test.js
    +++ b/test/capitalize/capitalize.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const capitalize = require('./capitalize.js');
     
     test('Testing capitalize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof capitalize === 'function', 'capitalize is a Function');
    -	t.equal(capitalize('fooBar'), 'FooBar', "Capitalizes the first letter of a string");
    -	t.equal(capitalize('fooBar', true), 'Foobar', "Capitalizes the first letter of a string");
    -	//t.deepEqual(capitalize(args..), 'Expected');
    -	//t.equal(capitalize(args..), 'Expected');
    -	//t.false(capitalize(args..), 'Expected');
    -	//t.throws(capitalize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof capitalize === 'function', 'capitalize is a Function');
    +  t.equal(capitalize('fooBar'), 'FooBar', "Capitalizes the first letter of a string");
    +  t.equal(capitalize('fooBar', true), 'Foobar', "Capitalizes the first letter of a string");
    +  //t.deepEqual(capitalize(args..), 'Expected');
    +  //t.equal(capitalize(args..), 'Expected');
    +  //t.false(capitalize(args..), 'Expected');
    +  //t.throws(capitalize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.test.js b/test/capitalizeEveryWord/capitalizeEveryWord.test.js
    index 783b84631..c4cfc2d54 100644
    --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js
    +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const capitalizeEveryWord = require('./capitalizeEveryWord.js');
     
     test('Testing capitalizeEveryWord', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof capitalizeEveryWord === 'function', 'capitalizeEveryWord is a Function');
    -	t.equal(capitalizeEveryWord('hello world!'), 'Hello World!', "Capitalizes the first letter of every word in a string");
    -	//t.deepEqual(capitalizeEveryWord(args..), 'Expected');
    -	//t.equal(capitalizeEveryWord(args..), 'Expected');
    -	//t.false(capitalizeEveryWord(args..), 'Expected');
    -	//t.throws(capitalizeEveryWord(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof capitalizeEveryWord === 'function', 'capitalizeEveryWord is a Function');
    +  t.equal(capitalizeEveryWord('hello world!'), 'Hello World!', "Capitalizes the first letter of every word in a string");
    +  //t.deepEqual(capitalizeEveryWord(args..), 'Expected');
    +  //t.equal(capitalizeEveryWord(args..), 'Expected');
    +  //t.false(capitalizeEveryWord(args..), 'Expected');
    +  //t.throws(capitalizeEveryWord(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js
    index ed251de5a..a0961a491 100644
    --- a/test/castArray/castArray.test.js
    +++ b/test/castArray/castArray.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const castArray = require('./castArray.js');
     
     test('Testing castArray', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof castArray === 'function', 'castArray is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof castArray === 'function', 'castArray is a Function');
       t.deepEqual(castArray(1), [1], 'Works for single values');
       t.deepEqual(castArray([1]), [1], 'Works for arrays with one value');
       t.deepEqual(castArray([1,2,3]), [1,2,3], 'Works for arrays with multiple value');
       t.deepEqual(castArray('test'), ['test'], 'Works for strings');
       t.deepEqual(castArray({}), [{}], 'Works for objects');
    -	//t.deepEqual(castArray(args..), 'Expected');
    -	//t.equal(castArray(args..), 'Expected');
    -	//t.false(castArray(args..), 'Expected');
    -	//t.throws(castArray(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(castArray(args..), 'Expected');
    +  //t.equal(castArray(args..), 'Expected');
    +  //t.false(castArray(args..), 'Expected');
    +  //t.throws(castArray(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js
    index 9fab8a947..7101ab686 100644
    --- a/test/chainAsync/chainAsync.test.js
    +++ b/test/chainAsync/chainAsync.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const chainAsync = require('./chainAsync.js');
     
     test('Testing chainAsync', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof chainAsync === 'function', 'chainAsync is a Function');
    -	//t.deepEqual(chainAsync(args..), 'Expected');
    -	//t.equal(chainAsync(args..), 'Expected');
    -	//t.false(chainAsync(args..), 'Expected');
    -	//t.throws(chainAsync(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof chainAsync === 'function', 'chainAsync is a Function');
    +  //t.deepEqual(chainAsync(args..), 'Expected');
    +  //t.equal(chainAsync(args..), 'Expected');
    +  //t.false(chainAsync(args..), 'Expected');
    +  //t.throws(chainAsync(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js
    index a4dc0051a..348d04f49 100644
    --- a/test/chunk/chunk.test.js
    +++ b/test/chunk/chunk.test.js
    @@ -2,11 +2,11 @@ const test = require('tape');
     const chunk = require('./chunk.js');
     
     test('Testing chunk', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
       t.true(typeof chunk === 'function', 'chunk is a Function');
    -	t.deepEqual(chunk([1, 2, 3, 4, 5], 2), [[1,2],[3,4],[5]], "chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] ");
    -	t.deepEqual(chunk([]), [], 'chunk([]) returns []');
    +  t.deepEqual(chunk([1, 2, 3, 4, 5], 2), [[1,2],[3,4],[5]], "chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] ");
    +  t.deepEqual(chunk([]), [], 'chunk([]) returns []');
       t.deepEqual(chunk(123), [], 'chunk(123) returns []');
       t.deepEqual(chunk({ a: 123}), [], 'chunk({ a: 123}) returns []');
       t.deepEqual(chunk('string', 2), [ 'st', 'ri', 'ng' ], 'chunk(string, 2) returns [ st, ri, ng ]');
    diff --git a/test/clampNumber/clampNumber.test.js b/test/clampNumber/clampNumber.test.js
    index 6cc3b3029..0e62c5b8f 100644
    --- a/test/clampNumber/clampNumber.test.js
    +++ b/test/clampNumber/clampNumber.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const clampNumber = require('./clampNumber.js');
     
     test('Testing clampNumber', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof clampNumber === 'function', 'clampNumber is a Function');
    -	t.equal(clampNumber(2, 3, 5), 3, "Clamps num within the inclusive range specified by the boundary values a and b");
    -	//t.deepEqual(clampNumber(args..), 'Expected');
    -	//t.equal(clampNumber(args..), 'Expected');
    -	//t.false(clampNumber(args..), 'Expected');
    -	//t.throws(clampNumber(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof clampNumber === 'function', 'clampNumber is a Function');
    +  t.equal(clampNumber(2, 3, 5), 3, "Clamps num within the inclusive range specified by the boundary values a and b");
    +  //t.deepEqual(clampNumber(args..), 'Expected');
    +  //t.equal(clampNumber(args..), 'Expected');
    +  //t.false(clampNumber(args..), 'Expected');
    +  //t.throws(clampNumber(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js
    index 8869354da..db490ed45 100644
    --- a/test/cleanObj/cleanObj.test.js
    +++ b/test/cleanObj/cleanObj.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const cleanObj = require('./cleanObj.js');
     
     test('Testing cleanObj', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof cleanObj === 'function', 'cleanObj is a Function');
    -	const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } };
    -	t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object");
    -	//t.deepEqual(cleanObj(args..), 'Expected');
    -	//t.equal(cleanObj(args..), 'Expected');
    -	//t.false(cleanObj(args..), 'Expected');
    -	//t.throws(cleanObj(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof cleanObj === 'function', 'cleanObj is a Function');
    +  const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } };
    +  t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object");
    +  //t.deepEqual(cleanObj(args..), 'Expected');
    +  //t.equal(cleanObj(args..), 'Expected');
    +  //t.false(cleanObj(args..), 'Expected');
    +  //t.throws(cleanObj(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js
    index 787c47fff..17b2ce8c0 100644
    --- a/test/cloneRegExp/cloneRegExp.test.js
    +++ b/test/cloneRegExp/cloneRegExp.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const cloneRegExp = require('./cloneRegExp.js');
     
     test('Testing cloneRegExp', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof cloneRegExp === 'function', 'cloneRegExp is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof cloneRegExp === 'function', 'cloneRegExp is a Function');
       const rgTest = /./g;
       t.notEqual(cloneRegExp(rgTest), rgTest, 'Clones regular expressions properly');
    -	//t.deepEqual(cloneRegExp(args..), 'Expected');
    -	//t.equal(cloneRegExp(args..), 'Expected');
    -	//t.false(cloneRegExp(args..), 'Expected');
    -	//t.throws(cloneRegExp(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(cloneRegExp(args..), 'Expected');
    +  //t.equal(cloneRegExp(args..), 'Expected');
    +  //t.false(cloneRegExp(args..), 'Expected');
    +  //t.throws(cloneRegExp(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js
    index a1bd51e03..e32afaf95 100644
    --- a/test/coalesce/coalesce.test.js
    +++ b/test/coalesce/coalesce.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const coalesce = require('./coalesce.js');
     
     test('Testing coalesce', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof coalesce === 'function', 'coalesce is a Function');
    -	t.deepEqual(coalesce(null, undefined, '', NaN, 'Waldo'), '', "Returns the first non-null/undefined argument");
    -	//t.deepEqual(coalesce(args..), 'Expected');
    -	//t.equal(coalesce(args..), 'Expected');
    -	//t.false(coalesce(args..), 'Expected');
    -	//t.throws(coalesce(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof coalesce === 'function', 'coalesce is a Function');
    +  t.deepEqual(coalesce(null, undefined, '', NaN, 'Waldo'), '', "Returns the first non-null/undefined argument");
    +  //t.deepEqual(coalesce(args..), 'Expected');
    +  //t.equal(coalesce(args..), 'Expected');
    +  //t.false(coalesce(args..), 'Expected');
    +  //t.throws(coalesce(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/coalesceFactory/coalesceFactory.test.js b/test/coalesceFactory/coalesceFactory.test.js
    index 0b2f019c9..e0651ace2 100644
    --- a/test/coalesceFactory/coalesceFactory.test.js
    +++ b/test/coalesceFactory/coalesceFactory.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const coalesceFactory = require('./coalesceFactory.js');
     
     test('Testing coalesceFactory', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof coalesceFactory === 'function', 'coalesceFactory is a Function');
    -	const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_));
    -	t.deepEqual(customCoalesce(undefined, null, NaN, '', 'Waldo'), 'Waldo', "Returns a customized coalesce function");
    -	//t.deepEqual(coalesceFactory(args..), 'Expected');
    -	//t.equal(coalesceFactory(args..), 'Expected');
    -	//t.false(coalesceFactory(args..), 'Expected');
    -	//t.throws(coalesceFactory(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof coalesceFactory === 'function', 'coalesceFactory is a Function');
    +  const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_));
    +  t.deepEqual(customCoalesce(undefined, null, NaN, '', 'Waldo'), 'Waldo', "Returns a customized coalesce function");
    +  //t.deepEqual(coalesceFactory(args..), 'Expected');
    +  //t.equal(coalesceFactory(args..), 'Expected');
    +  //t.false(coalesceFactory(args..), 'Expected');
    +  //t.throws(coalesceFactory(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/collatz/collatz.test.js b/test/collatz/collatz.test.js
    index d713c999d..1922e40ed 100644
    --- a/test/collatz/collatz.test.js
    +++ b/test/collatz/collatz.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const collatz = require('./collatz.js');
     
     test('Testing collatz', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof collatz === 'function', 'collatz is a Function');
    -	//t.deepEqual(collatz(args..), 'Expected');
    -	//t.equal(collatz(args..), 'Expected');
    -	//t.false(collatz(args..), 'Expected');
    -	//t.throws(collatz(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof collatz === 'function', 'collatz is a Function');
    +  //t.deepEqual(collatz(args..), 'Expected');
    +  //t.equal(collatz(args..), 'Expected');
    +  //t.false(collatz(args..), 'Expected');
    +  //t.throws(collatz(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js
    index 99407663e..a3d303e5a 100644
    --- a/test/collectInto/collectInto.test.js
    +++ b/test/collectInto/collectInto.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const collectInto = require('./collectInto.js');
     
     test('Testing collectInto', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof collectInto === 'function', 'collectInto is a Function');
    -	//t.deepEqual(collectInto(args..), 'Expected');
    -	//t.equal(collectInto(args..), 'Expected');
    -	//t.false(collectInto(args..), 'Expected');
    -	//t.throws(collectInto(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof collectInto === 'function', 'collectInto is a Function');
    +  //t.deepEqual(collectInto(args..), 'Expected');
    +  //t.equal(collectInto(args..), 'Expected');
    +  //t.false(collectInto(args..), 'Expected');
    +  //t.throws(collectInto(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/colorize/colorize.test.js b/test/colorize/colorize.test.js
    index a20fe2a3f..29ff32ef2 100644
    --- a/test/colorize/colorize.test.js
    +++ b/test/colorize/colorize.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const colorize = require('./colorize.js');
     
     test('Testing colorize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof colorize === 'function', 'colorize is a Function');
    -	//t.deepEqual(colorize(args..), 'Expected');
    -	//t.equal(colorize(args..), 'Expected');
    -	//t.false(colorize(args..), 'Expected');
    -	//t.throws(colorize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof colorize === 'function', 'colorize is a Function');
    +  //t.deepEqual(colorize(args..), 'Expected');
    +  //t.equal(colorize(args..), 'Expected');
    +  //t.false(colorize(args..), 'Expected');
    +  //t.throws(colorize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/compact/compact.test.js b/test/compact/compact.test.js
    index 6c03b0f5e..74de02b1b 100644
    --- a/test/compact/compact.test.js
    +++ b/test/compact/compact.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const compact = require('./compact.js');
     
     test('Testing compact', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof compact === 'function', 'compact is a Function');
    -	t.deepEqual(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]), [ 1, 2, 3, 'a', 's', 34 ], "Removes falsey values from an array");
    -	//t.deepEqual(compact(args..), 'Expected');
    -	//t.equal(compact(args..), 'Expected');
    -	//t.false(compact(args..), 'Expected');
    -	//t.throws(compact(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof compact === 'function', 'compact is a Function');
    +  t.deepEqual(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]), [ 1, 2, 3, 'a', 's', 34 ], "Removes falsey values from an array");
    +  //t.deepEqual(compact(args..), 'Expected');
    +  //t.equal(compact(args..), 'Expected');
    +  //t.false(compact(args..), 'Expected');
    +  //t.throws(compact(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/compose/compose.test.js b/test/compose/compose.test.js
    index 97d0304bc..87c2ea8bd 100644
    --- a/test/compose/compose.test.js
    +++ b/test/compose/compose.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const compose = require('./compose.js');
     
     test('Testing compose', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof compose === 'function', 'compose is a Function');
    -	const add5 = x => x + 5;
    -	const multiply = (x, y) => x * y;
    -	const multiplyAndAdd5 = compose(add5, multiply);
    -	t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition");
    -	//t.deepEqual(compose(args..), 'Expected');
    -	//t.equal(compose(args..), 'Expected');
    -	//t.false(compose(args..), 'Expected');
    -	//t.throws(compose(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof compose === 'function', 'compose is a Function');
    +  const add5 = x => x + 5;
    +  const multiply = (x, y) => x * y;
    +  const multiplyAndAdd5 = compose(add5, multiply);
    +  t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition");
    +  //t.deepEqual(compose(args..), 'Expected');
    +  //t.equal(compose(args..), 'Expected');
    +  //t.false(compose(args..), 'Expected');
    +  //t.throws(compose(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js
    index be6a1ee90..c07f7e8a5 100644
    --- a/test/composeRight/composeRight.test.js
    +++ b/test/composeRight/composeRight.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const composeRight = require('./composeRight.js');
     
     test('Testing composeRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof composeRight === 'function', 'composeRight is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof composeRight === 'function', 'composeRight is a Function');
       const add = (x, y) => x + y;
       const square = x => x * x;
       const addAndSquare = composeRight(add, square);
       t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition");
    -	//t.deepEqual(composeRight(args..), 'Expected');
    -	//t.equal(composeRight(args..), 'Expected');
    -	//t.false(composeRight(args..), 'Expected');
    -	//t.throws(composeRight(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(composeRight(args..), 'Expected');
    +  //t.equal(composeRight(args..), 'Expected');
    +  //t.false(composeRight(args..), 'Expected');
    +  //t.throws(composeRight(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/copyToClipboard/copyToClipboard.test.js b/test/copyToClipboard/copyToClipboard.test.js
    index af7678391..83d9419da 100644
    --- a/test/copyToClipboard/copyToClipboard.test.js
    +++ b/test/copyToClipboard/copyToClipboard.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const copyToClipboard = require('./copyToClipboard.js');
     
     test('Testing copyToClipboard', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof copyToClipboard === 'function', 'copyToClipboard is a Function');
    -	//t.deepEqual(copyToClipboard(args..), 'Expected');
    -	//t.equal(copyToClipboard(args..), 'Expected');
    -	//t.false(copyToClipboard(args..), 'Expected');
    -	//t.throws(copyToClipboard(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof copyToClipboard === 'function', 'copyToClipboard is a Function');
    +  //t.deepEqual(copyToClipboard(args..), 'Expected');
    +  //t.equal(copyToClipboard(args..), 'Expected');
    +  //t.false(copyToClipboard(args..), 'Expected');
    +  //t.throws(copyToClipboard(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js
    index 24ca39f7e..ea6c3b748 100644
    --- a/test/countBy/countBy.test.js
    +++ b/test/countBy/countBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const countBy = require('./countBy.js');
     
     test('Testing countBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof countBy === 'function', 'countBy is a Function');
    -	//t.deepEqual(countBy(args..), 'Expected');
    -	//t.equal(countBy(args..), 'Expected');
    -	//t.false(countBy(args..), 'Expected');
    -	//t.throws(countBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof countBy === 'function', 'countBy is a Function');
    +  //t.deepEqual(countBy(args..), 'Expected');
    +  //t.equal(countBy(args..), 'Expected');
    +  //t.false(countBy(args..), 'Expected');
    +  //t.throws(countBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/countOccurrences/countOccurrences.test.js b/test/countOccurrences/countOccurrences.test.js
    index 1f160ff52..1459d5ae8 100644
    --- a/test/countOccurrences/countOccurrences.test.js
    +++ b/test/countOccurrences/countOccurrences.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const countOccurrences = require('./countOccurrences.js');
     
     test('Testing countOccurrences', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof countOccurrences === 'function', 'countOccurrences is a Function');
    -	t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array");
    -	//t.deepEqual(countOccurrences(args..), 'Expected');
    -	//t.equal(countOccurrences(args..), 'Expected');
    -	//t.false(countOccurrences(args..), 'Expected');
    -	//t.throws(countOccurrences(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof countOccurrences === 'function', 'countOccurrences is a Function');
    +  t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array");
    +  //t.deepEqual(countOccurrences(args..), 'Expected');
    +  //t.equal(countOccurrences(args..), 'Expected');
    +  //t.false(countOccurrences(args..), 'Expected');
    +  //t.throws(countOccurrences(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/countVowels/countVowels.test.js b/test/countVowels/countVowels.test.js
    index 2b91572e9..98a67a2b1 100644
    --- a/test/countVowels/countVowels.test.js
    +++ b/test/countVowels/countVowels.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const countVowels = require('./countVowels.js');
     
     test('Testing countVowels', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof countVowels === 'function', 'countVowels is a Function');
    -	//t.deepEqual(countVowels(args..), 'Expected');
    -	//t.equal(countVowels(args..), 'Expected');
    -	//t.false(countVowels(args..), 'Expected');
    -	//t.throws(countVowels(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof countVowels === 'function', 'countVowels is a Function');
    +  //t.deepEqual(countVowels(args..), 'Expected');
    +  //t.equal(countVowels(args..), 'Expected');
    +  //t.false(countVowels(args..), 'Expected');
    +  //t.throws(countVowels(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js
    index bda8d943e..f773ea672 100644
    --- a/test/createElement/createElement.test.js
    +++ b/test/createElement/createElement.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const createElement = require('./createElement.js');
     
     test('Testing createElement', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof createElement === 'function', 'createElement is a Function');
    -	//t.deepEqual(createElement(args..), 'Expected');
    -	//t.equal(createElement(args..), 'Expected');
    -	//t.false(createElement(args..), 'Expected');
    -	//t.throws(createElement(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof createElement === 'function', 'createElement is a Function');
    +  //t.deepEqual(createElement(args..), 'Expected');
    +  //t.equal(createElement(args..), 'Expected');
    +  //t.false(createElement(args..), 'Expected');
    +  //t.throws(createElement(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js
    index 527237cf4..759c461b3 100644
    --- a/test/createEventHub/createEventHub.test.js
    +++ b/test/createEventHub/createEventHub.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const createEventHub = require('./createEventHub.js');
     
     test('Testing createEventHub', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof createEventHub === 'function', 'createEventHub is a Function');
    -	//t.deepEqual(createEventHub(args..), 'Expected');
    -	//t.equal(createEventHub(args..), 'Expected');
    -	//t.false(createEventHub(args..), 'Expected');
    -	//t.throws(createEventHub(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof createEventHub === 'function', 'createEventHub is a Function');
    +  //t.deepEqual(createEventHub(args..), 'Expected');
    +  //t.equal(createEventHub(args..), 'Expected');
    +  //t.false(createEventHub(args..), 'Expected');
    +  //t.throws(createEventHub(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js
    index ee9f82d9c..e7dba8ee4 100644
    --- a/test/currentURL/currentURL.test.js
    +++ b/test/currentURL/currentURL.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const currentURL = require('./currentURL.js');
     
     test('Testing currentURL', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof currentURL === 'function', 'currentURL is a Function');
    -	//t.deepEqual(currentURL(args..), 'Expected');
    -	//t.equal(currentURL(args..), 'Expected');
    -	//t.false(currentURL(args..), 'Expected');
    -	//t.throws(currentURL(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof currentURL === 'function', 'currentURL is a Function');
    +  //t.deepEqual(currentURL(args..), 'Expected');
    +  //t.equal(currentURL(args..), 'Expected');
    +  //t.false(currentURL(args..), 'Expected');
    +  //t.throws(currentURL(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js
    index a8014b100..341b11811 100644
    --- a/test/curry/curry.test.js
    +++ b/test/curry/curry.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const curry = require('./curry.js');
     
     test('Testing curry', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof curry === 'function', 'curry is a Function');
    -	t.equal(curry(Math.pow)(2)(10), 1024, "curries a Math.pow");
    -	t.equal(curry(Math.min, 3)(10)(50)(2), 2, "curries a Math.min");
    -	//t.deepEqual(curry(args..), 'Expected');
    -	//t.equal(curry(args..), 'Expected');
    -	//t.false(curry(args..), 'Expected');
    -	//t.throws(curry(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof curry === 'function', 'curry is a Function');
    +  t.equal(curry(Math.pow)(2)(10), 1024, "curries a Math.pow");
    +  t.equal(curry(Math.min, 3)(10)(50)(2), 2, "curries a Math.min");
    +  //t.deepEqual(curry(args..), 'Expected');
    +  //t.equal(curry(args..), 'Expected');
    +  //t.false(curry(args..), 'Expected');
    +  //t.throws(curry(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js
    index 5ce0e6f5c..c18264447 100644
    --- a/test/decapitalize/decapitalize.test.js
    +++ b/test/decapitalize/decapitalize.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const decapitalize = require('./decapitalize.js');
     
     test('Testing decapitalize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof decapitalize === 'function', 'decapitalize is a Function');
    -	//t.deepEqual(decapitalize(args..), 'Expected');
    -	//t.equal(decapitalize(args..), 'Expected');
    -	//t.false(decapitalize(args..), 'Expected');
    -	//t.throws(decapitalize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof decapitalize === 'function', 'decapitalize is a Function');
    +  //t.deepEqual(decapitalize(args..), 'Expected');
    +  //t.equal(decapitalize(args..), 'Expected');
    +  //t.false(decapitalize(args..), 'Expected');
    +  //t.throws(decapitalize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js
    index 2098a1acf..03c936c46 100644
    --- a/test/deepClone/deepClone.test.js
    +++ b/test/deepClone/deepClone.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const deepClone = require('./deepClone.js');
     
     test('Testing deepClone', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof deepClone === 'function', 'deepClone is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof deepClone === 'function', 'deepClone is a Function');
       const a = { foo: 'bar', obj: { a: 1, b: 2 } };
       const b = deepClone(a);
       t.notEqual(a, b, 'Shallow cloning works');
       t.notEqual(a.obj, b.obj, 'Deep cloning works');
    -	//t.deepEqual(deepClone(args..), 'Expected');
    -	//t.equal(deepClone(args..), 'Expected');
    -	//t.false(deepClone(args..), 'Expected');
    -	//t.throws(deepClone(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(deepClone(args..), 'Expected');
    +  //t.equal(deepClone(args..), 'Expected');
    +  //t.false(deepClone(args..), 'Expected');
    +  //t.throws(deepClone(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/deepFlatten/deepFlatten.test.js b/test/deepFlatten/deepFlatten.test.js
    index 78db29885..d6225da28 100644
    --- a/test/deepFlatten/deepFlatten.test.js
    +++ b/test/deepFlatten/deepFlatten.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const deepFlatten = require('./deepFlatten.js');
     
     test('Testing deepFlatten', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof deepFlatten === 'function', 'deepFlatten is a Function');
    -	t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array");
    -	//t.deepEqual(deepFlatten(args..), 'Expected');
    -	//t.equal(deepFlatten(args..), 'Expected');
    -	//t.false(deepFlatten(args..), 'Expected');
    -	//t.throws(deepFlatten(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof deepFlatten === 'function', 'deepFlatten is a Function');
    +  t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array");
    +  //t.deepEqual(deepFlatten(args..), 'Expected');
    +  //t.equal(deepFlatten(args..), 'Expected');
    +  //t.false(deepFlatten(args..), 'Expected');
    +  //t.throws(deepFlatten(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js
    index 2497c9c57..ab1afa29e 100644
    --- a/test/defaults/defaults.test.js
    +++ b/test/defaults/defaults.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const defaults = require('./defaults.js');
     
     test('Testing defaults', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof defaults === 'function', 'defaults is a Function');
    -	//t.deepEqual(defaults(args..), 'Expected');
    -	//t.equal(defaults(args..), 'Expected');
    -	//t.false(defaults(args..), 'Expected');
    -	//t.throws(defaults(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof defaults === 'function', 'defaults is a Function');
    +  //t.deepEqual(defaults(args..), 'Expected');
    +  //t.equal(defaults(args..), 'Expected');
    +  //t.false(defaults(args..), 'Expected');
    +  //t.throws(defaults(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js
    index b019474ba..faa5731c9 100644
    --- a/test/defer/defer.test.js
    +++ b/test/defer/defer.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const defer = require('./defer.js');
     
     test('Testing defer', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof defer === 'function', 'defer is a Function');
    -	//t.deepEqual(defer(args..), 'Expected');
    -	//t.equal(defer(args..), 'Expected');
    -	//t.false(defer(args..), 'Expected');
    -	//t.throws(defer(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof defer === 'function', 'defer is a Function');
    +  //t.deepEqual(defer(args..), 'Expected');
    +  //t.equal(defer(args..), 'Expected');
    +  //t.false(defer(args..), 'Expected');
    +  //t.throws(defer(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js
    index 31c2d875a..544f8632d 100644
    --- a/test/delay/delay.test.js
    +++ b/test/delay/delay.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const delay = require('./delay.js');
     
     test('Testing delay', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof delay === 'function', 'delay is a Function');
    -	//t.deepEqual(delay(args..), 'Expected');
    -	//t.equal(delay(args..), 'Expected');
    -	//t.false(delay(args..), 'Expected');
    -	//t.throws(delay(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof delay === 'function', 'delay is a Function');
    +  //t.deepEqual(delay(args..), 'Expected');
    +  //t.equal(delay(args..), 'Expected');
    +  //t.false(delay(args..), 'Expected');
    +  //t.throws(delay(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/detectDeviceType/detectDeviceType.test.js b/test/detectDeviceType/detectDeviceType.test.js
    index 8795d1650..365388681 100644
    --- a/test/detectDeviceType/detectDeviceType.test.js
    +++ b/test/detectDeviceType/detectDeviceType.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const detectDeviceType = require('./detectDeviceType.js');
     
     test('Testing detectDeviceType', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof detectDeviceType === 'function', 'detectDeviceType is a Function');
    -	//t.deepEqual(detectDeviceType(args..), 'Expected');
    -	//t.equal(detectDeviceType(args..), 'Expected');
    -	//t.false(detectDeviceType(args..), 'Expected');
    -	//t.throws(detectDeviceType(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof detectDeviceType === 'function', 'detectDeviceType is a Function');
    +  //t.deepEqual(detectDeviceType(args..), 'Expected');
    +  //t.equal(detectDeviceType(args..), 'Expected');
    +  //t.false(detectDeviceType(args..), 'Expected');
    +  //t.throws(detectDeviceType(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js
    index 4adeb6577..17a5b7ba2 100644
    --- a/test/difference/difference.test.js
    +++ b/test/difference/difference.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const difference = require('./difference.js');
     
     test('Testing difference', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof difference === 'function', 'difference is a Function');
    -	t.deepEqual(difference([1, 2, 3], [1, 2, 4]), [3], "Returns the difference between two arrays");
    -	//t.deepEqual(difference(args..), 'Expected');
    -	//t.equal(difference(args..), 'Expected');
    -	//t.false(difference(args..), 'Expected');
    -	//t.throws(difference(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof difference === 'function', 'difference is a Function');
    +  t.deepEqual(difference([1, 2, 3], [1, 2, 4]), [3], "Returns the difference between two arrays");
    +  //t.deepEqual(difference(args..), 'Expected');
    +  //t.equal(difference(args..), 'Expected');
    +  //t.false(difference(args..), 'Expected');
    +  //t.throws(difference(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js
    index d4be8a710..377de9614 100644
    --- a/test/differenceBy/differenceBy.test.js
    +++ b/test/differenceBy/differenceBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const differenceBy = require('./differenceBy.js');
     
     test('Testing differenceBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof differenceBy === 'function', 'differenceBy is a Function');
    -	//t.deepEqual(differenceBy(args..), 'Expected');
    -	//t.equal(differenceBy(args..), 'Expected');
    -	//t.false(differenceBy(args..), 'Expected');
    -	//t.throws(differenceBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof differenceBy === 'function', 'differenceBy is a Function');
    +  //t.deepEqual(differenceBy(args..), 'Expected');
    +  //t.equal(differenceBy(args..), 'Expected');
    +  //t.false(differenceBy(args..), 'Expected');
    +  //t.throws(differenceBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/differenceWith/differenceWith.test.js b/test/differenceWith/differenceWith.test.js
    index edeae5bf4..b3dd65cd5 100644
    --- a/test/differenceWith/differenceWith.test.js
    +++ b/test/differenceWith/differenceWith.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const differenceWith = require('./differenceWith.js');
     
     test('Testing differenceWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof differenceWith === 'function', 'differenceWith is a Function');
    -	t.deepEqual(differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2], "Filters out all values from an array");
    -	//t.deepEqual(differenceWith(args..), 'Expected');
    -	//t.equal(differenceWith(args..), 'Expected');
    -	//t.false(differenceWith(args..), 'Expected');
    -	//t.throws(differenceWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof differenceWith === 'function', 'differenceWith is a Function');
    +  t.deepEqual(differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2], "Filters out all values from an array");
    +  //t.deepEqual(differenceWith(args..), 'Expected');
    +  //t.equal(differenceWith(args..), 'Expected');
    +  //t.false(differenceWith(args..), 'Expected');
    +  //t.throws(differenceWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/digitize/digitize.test.js b/test/digitize/digitize.test.js
    index 93a67e7eb..2fb81a471 100644
    --- a/test/digitize/digitize.test.js
    +++ b/test/digitize/digitize.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const digitize = require('./digitize.js');
     
     test('Testing digitize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof digitize === 'function', 'digitize is a Function');
    -	t.deepEqual(digitize(123), [1, 2, 3], "Converts a number to an array of digits");
    -	//t.deepEqual(digitize(args..), 'Expected');
    -	//t.equal(digitize(args..), 'Expected');
    -	//t.false(digitize(args..), 'Expected');
    -	//t.throws(digitize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof digitize === 'function', 'digitize is a Function');
    +  t.deepEqual(digitize(123), [1, 2, 3], "Converts a number to an array of digits");
    +  //t.deepEqual(digitize(args..), 'Expected');
    +  //t.equal(digitize(args..), 'Expected');
    +  //t.false(digitize(args..), 'Expected');
    +  //t.throws(digitize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/distance/distance.test.js b/test/distance/distance.test.js
    index ace1084cb..e74474e75 100644
    --- a/test/distance/distance.test.js
    +++ b/test/distance/distance.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const distance = require('./distance.js');
     
     test('Testing distance', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof distance === 'function', 'distance is a Function');
    -	//t.deepEqual(distance(args..), 'Expected');
    -	//t.equal(distance(args..), 'Expected');
    -	//t.false(distance(args..), 'Expected');
    -	//t.throws(distance(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof distance === 'function', 'distance is a Function');
    +  //t.deepEqual(distance(args..), 'Expected');
    +  //t.equal(distance(args..), 'Expected');
    +  //t.false(distance(args..), 'Expected');
    +  //t.throws(distance(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/dropElements/dropElements.test.js b/test/dropElements/dropElements.test.js
    index 95c551602..b92ecd37d 100644
    --- a/test/dropElements/dropElements.test.js
    +++ b/test/dropElements/dropElements.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const dropElements = require('./dropElements.js');
     
     test('Testing dropElements', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof dropElements === 'function', 'dropElements is a Function');
    -	t.deepEqual(dropElements([1, 2, 3, 4], n => n >= 3), [3,4], "Removes elements in an array until the passed function returns true");
    -	//t.deepEqual(dropElements(args..), 'Expected');
    -	//t.equal(dropElements(args..), 'Expected');
    -	//t.false(dropElements(args..), 'Expected');
    -	//t.throws(dropElements(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof dropElements === 'function', 'dropElements is a Function');
    +  t.deepEqual(dropElements([1, 2, 3, 4], n => n >= 3), [3,4], "Removes elements in an array until the passed function returns true");
    +  //t.deepEqual(dropElements(args..), 'Expected');
    +  //t.equal(dropElements(args..), 'Expected');
    +  //t.false(dropElements(args..), 'Expected');
    +  //t.throws(dropElements(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/dropRight/dropRight.test.js b/test/dropRight/dropRight.test.js
    index 8a347b736..b224b0a47 100644
    --- a/test/dropRight/dropRight.test.js
    +++ b/test/dropRight/dropRight.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const dropRight = require('./dropRight.js');
     
     test('Testing dropRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof dropRight === 'function', 'dropRight is a Function');
    -	t.deepEqual(dropRight([1, 2, 3]), [1,2], "Returns a new array with n elements removed from the right");
    -	t.deepEqual(dropRight([1, 2, 3], 2), [1], "Returns a new array with n elements removed from the right");
    -	t.deepEqual(dropRight([1, 2, 3], 42), [], "Returns a new array with n elements removed from the right");
    -	//t.deepEqual(dropRight(args..), 'Expected');
    -	//t.equal(dropRight(args..), 'Expected');
    -	//t.false(dropRight(args..), 'Expected');
    -	//t.throws(dropRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof dropRight === 'function', 'dropRight is a Function');
    +  t.deepEqual(dropRight([1, 2, 3]), [1,2], "Returns a new array with n elements removed from the right");
    +  t.deepEqual(dropRight([1, 2, 3], 2), [1], "Returns a new array with n elements removed from the right");
    +  t.deepEqual(dropRight([1, 2, 3], 42), [], "Returns a new array with n elements removed from the right");
    +  //t.deepEqual(dropRight(args..), 'Expected');
    +  //t.equal(dropRight(args..), 'Expected');
    +  //t.false(dropRight(args..), 'Expected');
    +  //t.throws(dropRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js
    index 6fd276aef..2dd349424 100644
    --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js
    +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js');
     
     test('Testing elementIsVisibleInViewport', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof elementIsVisibleInViewport === 'function', 'elementIsVisibleInViewport is a Function');
    -	//t.deepEqual(elementIsVisibleInViewport(args..), 'Expected');
    -	//t.equal(elementIsVisibleInViewport(args..), 'Expected');
    -	//t.false(elementIsVisibleInViewport(args..), 'Expected');
    -	//t.throws(elementIsVisibleInViewport(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof elementIsVisibleInViewport === 'function', 'elementIsVisibleInViewport is a Function');
    +  //t.deepEqual(elementIsVisibleInViewport(args..), 'Expected');
    +  //t.equal(elementIsVisibleInViewport(args..), 'Expected');
    +  //t.false(elementIsVisibleInViewport(args..), 'Expected');
    +  //t.throws(elementIsVisibleInViewport(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js
    index b425f7fb1..c7f757a8e 100644
    --- a/test/elo/elo.test.js
    +++ b/test/elo/elo.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const elo = require('./elo.js');
     
     test('Testing elo', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof elo === 'function', 'elo is a Function');
    -	t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s");
    -	t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s";
    -	t.deepEqual(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185, 1154], "4 player FFA, all same rank");
    -	//t.deepEqual(elo(args..), 'Expected');
    -	//t.equal(elo(args..), 'Expected');
    -	//t.false(elo(args..), 'Expected');
    -	//t.throws(elo(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof elo === 'function', 'elo is a Function');
    +  t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s");
    +  t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s";
    +  t.deepEqual(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185, 1154], "4 player FFA, all same rank");
    +  //t.deepEqual(elo(args..), 'Expected');
    +  //t.equal(elo(args..), 'Expected');
    +  //t.false(elo(args..), 'Expected');
    +  //t.throws(elo(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/equals/equals.test.js b/test/equals/equals.test.js
    index eaa62a6ba..3c4caf3aa 100644
    --- a/test/equals/equals.test.js
    +++ b/test/equals/equals.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const equals = require('./equals.js');
     
     test('Testing equals', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof equals === 'function', 'equals is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof equals === 'function', 'equals is a Function');
       t.true(equals({ a: [2, {e: 3}], b: [4], c: 'foo' }, { a: [2, {e: 3}], b: [4], c: 'foo' }), "{ a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' }");
       t.true(equals([1, 2, 3], [1, 2, 3]), '[1,2,3] is equal to [1,2,3]');
       t.false(equals({ a: [2, 3], b: [4] }, { a: [2, 3], b: [6] }), '{ a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] }');
       t.false(equals([1, 2, 3], [1, 2, 4]), '[1,2,3] is not equal to [1,2,4]');
       t.true(equals([1, 2, 3], { 0: 1, 1: 2, 2: 3 }), '[1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match.')
    -	//t.deepEqual(equals(args..), 'Expected');
    -	//t.equal(equals(args..), 'Expected');
    -	//t.false(equals(args..), 'Expected');
    -	//t.throws(equals(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(equals(args..), 'Expected');
    +  //t.equal(equals(args..), 'Expected');
    +  //t.false(equals(args..), 'Expected');
    +  //t.throws(equals(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js
    index fd116668e..642cbfd5b 100644
    --- a/test/escapeHTML/escapeHTML.test.js
    +++ b/test/escapeHTML/escapeHTML.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const escapeHTML = require('./escapeHTML.js');
     
     test('Testing escapeHTML', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof escapeHTML === 'function', 'escapeHTML is a Function');
    -	t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML");
    -	//t.deepEqual(escapeHTML(args..), 'Expected');
    -	//t.equal(escapeHTML(args..), 'Expected');
    -	//t.false(escapeHTML(args..), 'Expected');
    -	//t.throws(escapeHTML(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof escapeHTML === 'function', 'escapeHTML is a Function');
    +  t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML");
    +  //t.deepEqual(escapeHTML(args..), 'Expected');
    +  //t.equal(escapeHTML(args..), 'Expected');
    +  //t.false(escapeHTML(args..), 'Expected');
    +  //t.throws(escapeHTML(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/escapeRegExp/escapeRegExp.test.js b/test/escapeRegExp/escapeRegExp.test.js
    index 507b53eb8..9ecb9497a 100644
    --- a/test/escapeRegExp/escapeRegExp.test.js
    +++ b/test/escapeRegExp/escapeRegExp.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const escapeRegExp = require('./escapeRegExp.js');
     
     test('Testing escapeRegExp', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof escapeRegExp === 'function', 'escapeRegExp is a Function');
    -	t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression");
    -	//t.deepEqual(escapeRegExp(args..), 'Expected');
    -	//t.equal(escapeRegExp(args..), 'Expected');
    -	//t.false(escapeRegExp(args..), 'Expected');
    -	//t.throws(escapeRegExp(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof escapeRegExp === 'function', 'escapeRegExp is a Function');
    +  t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression");
    +  //t.deepEqual(escapeRegExp(args..), 'Expected');
    +  //t.equal(escapeRegExp(args..), 'Expected');
    +  //t.false(escapeRegExp(args..), 'Expected');
    +  //t.throws(escapeRegExp(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/everyNth/everyNth.test.js b/test/everyNth/everyNth.test.js
    index 06f157c6a..53c3851ef 100644
    --- a/test/everyNth/everyNth.test.js
    +++ b/test/everyNth/everyNth.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const everyNth = require('./everyNth.js');
     
     test('Testing everyNth', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof everyNth === 'function', 'everyNth is a Function');
    -	t.deepEqual(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4, 6 ], "Returns every nth element in an array");
    -	//t.deepEqual(everyNth(args..), 'Expected');
    -	//t.equal(everyNth(args..), 'Expected');
    -	//t.false(everyNth(args..), 'Expected');
    -	//t.throws(everyNth(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof everyNth === 'function', 'everyNth is a Function');
    +  t.deepEqual(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4, 6 ], "Returns every nth element in an array");
    +  //t.deepEqual(everyNth(args..), 'Expected');
    +  //t.equal(everyNth(args..), 'Expected');
    +  //t.false(everyNth(args..), 'Expected');
    +  //t.throws(everyNth(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/extendHex/extendHex.test.js b/test/extendHex/extendHex.test.js
    index c69e8cc84..c9fd57973 100644
    --- a/test/extendHex/extendHex.test.js
    +++ b/test/extendHex/extendHex.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const extendHex = require('./extendHex.js');
     
     test('Testing extendHex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof extendHex === 'function', 'extendHex is a Function');
    -	t.equal(extendHex('#03f'), '#0033ff', "Extends a 3-digit color code to a 6-digit color code");
    -	t.equal(extendHex('05a'), '#0055aa', "Extends a 3-digit color code to a 6-digit color code");
    -	//t.deepEqual(extendHex(args..), 'Expected');
    -	//t.equal(extendHex(args..), 'Expected');
    -	//t.false(extendHex(args..), 'Expected');
    -	//t.throws(extendHex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof extendHex === 'function', 'extendHex is a Function');
    +  t.equal(extendHex('#03f'), '#0033ff', "Extends a 3-digit color code to a 6-digit color code");
    +  t.equal(extendHex('05a'), '#0055aa', "Extends a 3-digit color code to a 6-digit color code");
    +  //t.deepEqual(extendHex(args..), 'Expected');
    +  //t.equal(extendHex(args..), 'Expected');
    +  //t.false(extendHex(args..), 'Expected');
    +  //t.throws(extendHex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js
    index 6eb4467ff..d8694b446 100644
    --- a/test/factorial/factorial.test.js
    +++ b/test/factorial/factorial.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const factorial = require('./factorial.js');
     
     test('Testing factorial', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof factorial === 'function', 'factorial is a Function');
    -	t.equal(factorial(6), 720, "Calculates the factorial of 720");
    -	t.equal(factorial(0), 1, "Calculates the factorial of 0");
    -	t.equal(factorial(1), 1, "Calculates the factorial of 1");
    -	t.equal(factorial(4), 24, "Calculates the factorial of 4");
    -	t.equal(factorial(10), 3628800, "Calculates the factorial of 10");
    -	//t.deepEqual(factorial(args..), 'Expected');
    -	//t.equal(factorial(args..), 'Expected');
    -	//t.false(factorial(args..), 'Expected');
    -	//t.throws(factorial(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof factorial === 'function', 'factorial is a Function');
    +  t.equal(factorial(6), 720, "Calculates the factorial of 720");
    +  t.equal(factorial(0), 1, "Calculates the factorial of 0");
    +  t.equal(factorial(1), 1, "Calculates the factorial of 1");
    +  t.equal(factorial(4), 24, "Calculates the factorial of 4");
    +  t.equal(factorial(10), 3628800, "Calculates the factorial of 10");
    +  //t.deepEqual(factorial(args..), 'Expected');
    +  //t.equal(factorial(args..), 'Expected');
    +  //t.false(factorial(args..), 'Expected');
    +  //t.throws(factorial(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/factors/factors.test.js b/test/factors/factors.test.js
    index b2058c3e1..cd9d3a0c9 100644
    --- a/test/factors/factors.test.js
    +++ b/test/factors/factors.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const factors = require('./factors.js');
     
     test('Testing factors', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof factors === 'function', 'factors is a Function');
    -	//t.deepEqual(factors(args..), 'Expected');
    -	//t.equal(factors(args..), 'Expected');
    -	//t.false(factors(args..), 'Expected');
    -	//t.throws(factors(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof factors === 'function', 'factors is a Function');
    +  //t.deepEqual(factors(args..), 'Expected');
    +  //t.equal(factors(args..), 'Expected');
    +  //t.false(factors(args..), 'Expected');
    +  //t.throws(factors(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js
    index d15065425..75951a4de 100644
    --- a/test/fibonacci/fibonacci.test.js
    +++ b/test/fibonacci/fibonacci.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const fibonacci = require('./fibonacci.js');
     
     test('Testing fibonacci', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof fibonacci === 'function', 'fibonacci is a Function');
    -	t.deepEqual(fibonacci(6), [0, 1, 1, 2, 3, 5], "Generates an array, containing the Fibonacci sequence");
    -	//t.deepEqual(fibonacci(args..), 'Expected');
    -	//t.equal(fibonacci(args..), 'Expected');
    -	//t.false(fibonacci(args..), 'Expected');
    -	//t.throws(fibonacci(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof fibonacci === 'function', 'fibonacci is a Function');
    +  t.deepEqual(fibonacci(6), [0, 1, 1, 2, 3, 5], "Generates an array, containing the Fibonacci sequence");
    +  //t.deepEqual(fibonacci(args..), 'Expected');
    +  //t.equal(fibonacci(args..), 'Expected');
    +  //t.false(fibonacci(args..), 'Expected');
    +  //t.throws(fibonacci(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js
    index b8aa2498d..6d14331d3 100644
    --- a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js
    +++ b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js');
     
     test('Testing fibonacciCountUntilNum', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof fibonacciCountUntilNum === 'function', 'fibonacciCountUntilNum is a Function');
    -	//t.deepEqual(fibonacciCountUntilNum(args..), 'Expected');
    -	//t.equal(fibonacciCountUntilNum(args..), 'Expected');
    -	//t.false(fibonacciCountUntilNum(args..), 'Expected');
    -	//t.throws(fibonacciCountUntilNum(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof fibonacciCountUntilNum === 'function', 'fibonacciCountUntilNum is a Function');
    +  //t.deepEqual(fibonacciCountUntilNum(args..), 'Expected');
    +  //t.equal(fibonacciCountUntilNum(args..), 'Expected');
    +  //t.false(fibonacciCountUntilNum(args..), 'Expected');
    +  //t.throws(fibonacciCountUntilNum(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.test.js b/test/fibonacciUntilNum/fibonacciUntilNum.test.js
    index 603df0935..a023c376c 100644
    --- a/test/fibonacciUntilNum/fibonacciUntilNum.test.js
    +++ b/test/fibonacciUntilNum/fibonacciUntilNum.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const fibonacciUntilNum = require('./fibonacciUntilNum.js');
     
     test('Testing fibonacciUntilNum', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof fibonacciUntilNum === 'function', 'fibonacciUntilNum is a Function');
    -	//t.deepEqual(fibonacciUntilNum(args..), 'Expected');
    -	//t.equal(fibonacciUntilNum(args..), 'Expected');
    -	//t.false(fibonacciUntilNum(args..), 'Expected');
    -	//t.throws(fibonacciUntilNum(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof fibonacciUntilNum === 'function', 'fibonacciUntilNum is a Function');
    +  //t.deepEqual(fibonacciUntilNum(args..), 'Expected');
    +  //t.equal(fibonacciUntilNum(args..), 'Expected');
    +  //t.false(fibonacciUntilNum(args..), 'Expected');
    +  //t.throws(fibonacciUntilNum(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js
    index f7b06efaa..9fd18bf41 100644
    --- a/test/filterNonUnique/filterNonUnique.test.js
    +++ b/test/filterNonUnique/filterNonUnique.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const filterNonUnique = require('./filterNonUnique.js');
     
     test('Testing filterNonUnique', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof filterNonUnique === 'function', 'filterNonUnique is a Function');
    -	t.deepEqual(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3,5], "Filters out the non-unique values in an array");
    -	//t.deepEqual(filterNonUnique(args..), 'Expected');
    -	//t.equal(filterNonUnique(args..), 'Expected');
    -	//t.false(filterNonUnique(args..), 'Expected');
    -	//t.throws(filterNonUnique(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof filterNonUnique === 'function', 'filterNonUnique is a Function');
    +  t.deepEqual(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3,5], "Filters out the non-unique values in an array");
    +  //t.deepEqual(filterNonUnique(args..), 'Expected');
    +  //t.equal(filterNonUnique(args..), 'Expected');
    +  //t.false(filterNonUnique(args..), 'Expected');
    +  //t.throws(filterNonUnique(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js
    index f70d57f32..d4b7870d0 100644
    --- a/test/findKey/findKey.test.js
    +++ b/test/findKey/findKey.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const findKey = require('./findKey.js');
     
     test('Testing findKey', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof findKey === 'function', 'findKey is a Function');
    -	//t.deepEqual(findKey(args..), 'Expected');
    -	//t.equal(findKey(args..), 'Expected');
    -	//t.false(findKey(args..), 'Expected');
    -	//t.throws(findKey(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof findKey === 'function', 'findKey is a Function');
    +  //t.deepEqual(findKey(args..), 'Expected');
    +  //t.equal(findKey(args..), 'Expected');
    +  //t.false(findKey(args..), 'Expected');
    +  //t.throws(findKey(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js
    index 036d5f313..6e9ec236d 100644
    --- a/test/findLast/findLast.test.js
    +++ b/test/findLast/findLast.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const findLast = require('./findLast.js');
     
     test('Testing findLast', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof findLast === 'function', 'findLast is a Function');
    -	//t.deepEqual(findLast(args..), 'Expected');
    -	//t.equal(findLast(args..), 'Expected');
    -	//t.false(findLast(args..), 'Expected');
    -	//t.throws(findLast(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof findLast === 'function', 'findLast is a Function');
    +  //t.deepEqual(findLast(args..), 'Expected');
    +  //t.equal(findLast(args..), 'Expected');
    +  //t.false(findLast(args..), 'Expected');
    +  //t.throws(findLast(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js
    index c0bf93814..0791336b2 100644
    --- a/test/findLastIndex/findLastIndex.test.js
    +++ b/test/findLastIndex/findLastIndex.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const findLastIndex = require('./findLastIndex.js');
     
     test('Testing findLastIndex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof findLastIndex === 'function', 'findLastIndex is a Function');
    -	//t.deepEqual(findLastIndex(args..), 'Expected');
    -	//t.equal(findLastIndex(args..), 'Expected');
    -	//t.false(findLastIndex(args..), 'Expected');
    -	//t.throws(findLastIndex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof findLastIndex === 'function', 'findLastIndex is a Function');
    +  //t.deepEqual(findLastIndex(args..), 'Expected');
    +  //t.equal(findLastIndex(args..), 'Expected');
    +  //t.false(findLastIndex(args..), 'Expected');
    +  //t.throws(findLastIndex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js
    index b2fa57478..f0e99a748 100644
    --- a/test/findLastKey/findLastKey.test.js
    +++ b/test/findLastKey/findLastKey.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const findLastKey = require('./findLastKey.js');
     
     test('Testing findLastKey', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof findLastKey === 'function', 'findLastKey is a Function');
    -	//t.deepEqual(findLastKey(args..), 'Expected');
    -	//t.equal(findLastKey(args..), 'Expected');
    -	//t.false(findLastKey(args..), 'Expected');
    -	//t.throws(findLastKey(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof findLastKey === 'function', 'findLastKey is a Function');
    +  //t.deepEqual(findLastKey(args..), 'Expected');
    +  //t.equal(findLastKey(args..), 'Expected');
    +  //t.false(findLastKey(args..), 'Expected');
    +  //t.throws(findLastKey(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js
    index e7741039f..eb54b6c19 100644
    --- a/test/flatten/flatten.test.js
    +++ b/test/flatten/flatten.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const flatten = require('./flatten.js');
     
     test('Testing flatten', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof flatten === 'function', 'flatten is a Function');
    -	t.deepEqual(flatten([1, [2], 3, 4]), [1, 2, 3, 4], "Flattens an array");
    -	t.deepEqual(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2), [1, 2, 3, [4, 5], 6, 7, 8], "Flattens an array");
    -	//t.deepEqual(flatten(args..), 'Expected');
    -	//t.equal(flatten(args..), 'Expected');
    -	//t.false(flatten(args..), 'Expected');
    -	//t.throws(flatten(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof flatten === 'function', 'flatten is a Function');
    +  t.deepEqual(flatten([1, [2], 3, 4]), [1, 2, 3, 4], "Flattens an array");
    +  t.deepEqual(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2), [1, 2, 3, [4, 5], 6, 7, 8], "Flattens an array");
    +  //t.deepEqual(flatten(args..), 'Expected');
    +  //t.equal(flatten(args..), 'Expected');
    +  //t.false(flatten(args..), 'Expected');
    +  //t.throws(flatten(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js
    index 664c5df50..25991568f 100644
    --- a/test/flip/flip.test.js
    +++ b/test/flip/flip.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const flip = require('./flip.js');
     
     test('Testing flip', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof flip === 'function', 'flip is a Function');
    -	//t.deepEqual(flip(args..), 'Expected');
    -	//t.equal(flip(args..), 'Expected');
    -	//t.false(flip(args..), 'Expected');
    -	//t.throws(flip(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof flip === 'function', 'flip is a Function');
    +  //t.deepEqual(flip(args..), 'Expected');
    +  //t.equal(flip(args..), 'Expected');
    +  //t.false(flip(args..), 'Expected');
    +  //t.throws(flip(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js
    index 286035dd6..75cfdec4b 100644
    --- a/test/forEachRight/forEachRight.test.js
    +++ b/test/forEachRight/forEachRight.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const forEachRight = require('./forEachRight.js');
     
     test('Testing forEachRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof forEachRight === 'function', 'forEachRight is a Function');
    -	//t.deepEqual(forEachRight(args..), 'Expected');
    -	//t.equal(forEachRight(args..), 'Expected');
    -	//t.false(forEachRight(args..), 'Expected');
    -	//t.throws(forEachRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof forEachRight === 'function', 'forEachRight is a Function');
    +  //t.deepEqual(forEachRight(args..), 'Expected');
    +  //t.equal(forEachRight(args..), 'Expected');
    +  //t.false(forEachRight(args..), 'Expected');
    +  //t.throws(forEachRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js
    index eb60add6c..5962d9ee4 100644
    --- a/test/forOwn/forOwn.test.js
    +++ b/test/forOwn/forOwn.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const forOwn = require('./forOwn.js');
     
     test('Testing forOwn', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof forOwn === 'function', 'forOwn is a Function');
    -	//t.deepEqual(forOwn(args..), 'Expected');
    -	//t.equal(forOwn(args..), 'Expected');
    -	//t.false(forOwn(args..), 'Expected');
    -	//t.throws(forOwn(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof forOwn === 'function', 'forOwn is a Function');
    +  //t.deepEqual(forOwn(args..), 'Expected');
    +  //t.equal(forOwn(args..), 'Expected');
    +  //t.false(forOwn(args..), 'Expected');
    +  //t.throws(forOwn(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js
    index 6b80619fe..ecd69a71c 100644
    --- a/test/forOwnRight/forOwnRight.test.js
    +++ b/test/forOwnRight/forOwnRight.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const forOwnRight = require('./forOwnRight.js');
     
     test('Testing forOwnRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof forOwnRight === 'function', 'forOwnRight is a Function');
    -	//t.deepEqual(forOwnRight(args..), 'Expected');
    -	//t.equal(forOwnRight(args..), 'Expected');
    -	//t.false(forOwnRight(args..), 'Expected');
    -	//t.throws(forOwnRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof forOwnRight === 'function', 'forOwnRight is a Function');
    +  //t.deepEqual(forOwnRight(args..), 'Expected');
    +  //t.equal(forOwnRight(args..), 'Expected');
    +  //t.false(forOwnRight(args..), 'Expected');
    +  //t.throws(forOwnRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/formatDuration/formatDuration.test.js b/test/formatDuration/formatDuration.test.js
    index 95708428a..6c5cc23c3 100644
    --- a/test/formatDuration/formatDuration.test.js
    +++ b/test/formatDuration/formatDuration.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const formatDuration = require('./formatDuration.js');
     
     test('Testing formatDuration', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof formatDuration === 'function', 'formatDuration is a Function');
    -	t.equal(formatDuration(1001), '1 second, 1 millisecond', "Returns the human readable format of the given number of milliseconds");
    -	t.equal(formatDuration(34325055574), '397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds', "Returns the human readable format of the given number of milliseconds");
    -	//t.deepEqual(formatDuration(args..), 'Expected');
    -	//t.equal(formatDuration(args..), 'Expected');
    -	//t.false(formatDuration(args..), 'Expected');
    -	//t.throws(formatDuration(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof formatDuration === 'function', 'formatDuration is a Function');
    +  t.equal(formatDuration(1001), '1 second, 1 millisecond', "Returns the human readable format of the given number of milliseconds");
    +  t.equal(formatDuration(34325055574), '397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds', "Returns the human readable format of the given number of milliseconds");
    +  //t.deepEqual(formatDuration(args..), 'Expected');
    +  //t.equal(formatDuration(args..), 'Expected');
    +  //t.false(formatDuration(args..), 'Expected');
    +  //t.throws(formatDuration(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/fromCamelCase/fromCamelCase.test.js b/test/fromCamelCase/fromCamelCase.test.js
    index 73ea04316..58ecffed9 100644
    --- a/test/fromCamelCase/fromCamelCase.test.js
    +++ b/test/fromCamelCase/fromCamelCase.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const fromCamelCase = require('./fromCamelCase.js');
     
     test('Testing fromCamelCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof fromCamelCase === 'function', 'fromCamelCase is a Function');
    -	t.equal(fromCamelCase('someDatabaseFieldName', ' '), 'some database field name', "Converts a string from camelcase");
    -	t.equal(fromCamelCase('someLabelThatNeedsToBeCamelized', '-'), 'some-label-that-needs-to-be-camelized', "Converts a string from camelcase");
    -	t.equal(fromCamelCase('someJavascriptProperty', '_'), 'some_javascript_property', "Converts a string from camelcase");
    -	//t.deepEqual(fromCamelCase(args..), 'Expected');
    -	//t.equal(fromCamelCase(args..), 'Expected');
    -	//t.false(fromCamelCase(args..), 'Expected');
    -	//t.throws(fromCamelCase(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof fromCamelCase === 'function', 'fromCamelCase is a Function');
    +  t.equal(fromCamelCase('someDatabaseFieldName', ' '), 'some database field name', "Converts a string from camelcase");
    +  t.equal(fromCamelCase('someLabelThatNeedsToBeCamelized', '-'), 'some-label-that-needs-to-be-camelized', "Converts a string from camelcase");
    +  t.equal(fromCamelCase('someJavascriptProperty', '_'), 'some_javascript_property', "Converts a string from camelcase");
    +  //t.deepEqual(fromCamelCase(args..), 'Expected');
    +  //t.equal(fromCamelCase(args..), 'Expected');
    +  //t.false(fromCamelCase(args..), 'Expected');
    +  //t.throws(fromCamelCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js
    index f377cb49f..d2a5d41d4 100644
    --- a/test/functionName/functionName.test.js
    +++ b/test/functionName/functionName.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const functionName = require('./functionName.js');
     
     test('Testing functionName', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof functionName === 'function', 'functionName is a Function');
    -	//t.deepEqual(functionName(args..), 'Expected');
    -	//t.equal(functionName(args..), 'Expected');
    -	//t.false(functionName(args..), 'Expected');
    -	//t.throws(functionName(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof functionName === 'function', 'functionName is a Function');
    +  //t.deepEqual(functionName(args..), 'Expected');
    +  //t.equal(functionName(args..), 'Expected');
    +  //t.false(functionName(args..), 'Expected');
    +  //t.throws(functionName(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js
    index 8590341fb..a47314d11 100644
    --- a/test/functions/functions.test.js
    +++ b/test/functions/functions.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const functions = require('./functions.js');
     
     test('Testing functions', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof functions === 'function', 'functions is a Function');
    -	//t.deepEqual(functions(args..), 'Expected');
    -	//t.equal(functions(args..), 'Expected');
    -	//t.false(functions(args..), 'Expected');
    -	//t.throws(functions(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof functions === 'function', 'functions is a Function');
    +  //t.deepEqual(functions(args..), 'Expected');
    +  //t.equal(functions(args..), 'Expected');
    +  //t.false(functions(args..), 'Expected');
    +  //t.throws(functions(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js
    index 8ed4650a8..a222fe04b 100644
    --- a/test/gcd/gcd.test.js
    +++ b/test/gcd/gcd.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const gcd = require('./gcd.js');
     
     test('Testing gcd', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof gcd === 'function', 'gcd is a Function');
    -	t.equal(gcd(8, 36), 4, "Calculates the greatest common divisor between two or more numbers/arrays");
    -	t.deepEqual(gcd(...[12, 8, 32]), 4, "Calculates the greatest common divisor between two or more numbers/arrays");
    -	//t.deepEqual(gcd(args..), 'Expected');
    -	//t.equal(gcd(args..), 'Expected');
    -	//t.false(gcd(args..), 'Expected');
    -	//t.throws(gcd(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof gcd === 'function', 'gcd is a Function');
    +  t.equal(gcd(8, 36), 4, "Calculates the greatest common divisor between two or more numbers/arrays");
    +  t.deepEqual(gcd(...[12, 8, 32]), 4, "Calculates the greatest common divisor between two or more numbers/arrays");
    +  //t.deepEqual(gcd(args..), 'Expected');
    +  //t.equal(gcd(args..), 'Expected');
    +  //t.false(gcd(args..), 'Expected');
    +  //t.throws(gcd(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js
    index 09fb3093d..059e83682 100644
    --- a/test/geometricProgression/geometricProgression.test.js
    +++ b/test/geometricProgression/geometricProgression.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const geometricProgression = require('./geometricProgression.js');
     
     test('Testing geometricProgression', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof geometricProgression === 'function', 'geometricProgression is a Function');
    -	t.deepEqual(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128, 256], "Initializes an array containing the numbers in the specified range");
    -	t.deepEqual(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96, 192], "Initializes an array containing the numbers in the specified range");
    -	t.deepEqual(geometricProgression(256, 1, 4), [1, 4, 16, 64, 256], "Initializes an array containing the numbers in the specified range");
    -	//t.deepEqual(geometricProgression(args..), 'Expected');
    -	//t.equal(geometricProgression(args..), 'Expected');
    -	//t.false(geometricProgression(args..), 'Expected');
    -	//t.throws(geometricProgression(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof geometricProgression === 'function', 'geometricProgression is a Function');
    +  t.deepEqual(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128, 256], "Initializes an array containing the numbers in the specified range");
    +  t.deepEqual(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96, 192], "Initializes an array containing the numbers in the specified range");
    +  t.deepEqual(geometricProgression(256, 1, 4), [1, 4, 16, 64, 256], "Initializes an array containing the numbers in the specified range");
    +  //t.deepEqual(geometricProgression(args..), 'Expected');
    +  //t.equal(geometricProgression(args..), 'Expected');
    +  //t.false(geometricProgression(args..), 'Expected');
    +  //t.throws(geometricProgression(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/get/get.test.js b/test/get/get.test.js
    index fbe638391..d8448a171 100644
    --- a/test/get/get.test.js
    +++ b/test/get/get.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const get = require('./get.js');
     
     test('Testing get', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof get === 'function', 'get is a Function');
    -	const obj = { selector: { to: { val: 'val to get' } } };
    -	t.deepEqual(get(obj, 'selector.to.val'), ['val to get'], "Retrieve a property indicated by the selector from an object.");
    -	//t.deepEqual(get(args..), 'Expected');
    -	//t.equal(get(args..), 'Expected');
    -	//t.false(get(args..), 'Expected');
    -	//t.throws(get(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof get === 'function', 'get is a Function');
    +  const obj = { selector: { to: { val: 'val to get' } } };
    +  t.deepEqual(get(obj, 'selector.to.val'), ['val to get'], "Retrieve a property indicated by the selector from an object.");
    +  //t.deepEqual(get(args..), 'Expected');
    +  //t.equal(get(args..), 'Expected');
    +  //t.false(get(args..), 'Expected');
    +  //t.throws(get(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js
    index 39633f863..56bf82f8c 100644
    --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js
    +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js');
     
     test('Testing getDaysDiffBetweenDates', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof getDaysDiffBetweenDates === 'function', 'getDaysDiffBetweenDates is a Function');
    -	t.equal(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')), 9, "Returns the difference in days between two dates");
    -	//t.deepEqual(getDaysDiffBetweenDates(args..), 'Expected');
    -	//t.equal(getDaysDiffBetweenDates(args..), 'Expected');
    -	//t.false(getDaysDiffBetweenDates(args..), 'Expected');
    -	//t.throws(getDaysDiffBetweenDates(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof getDaysDiffBetweenDates === 'function', 'getDaysDiffBetweenDates is a Function');
    +  t.equal(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')), 9, "Returns the difference in days between two dates");
    +  //t.deepEqual(getDaysDiffBetweenDates(args..), 'Expected');
    +  //t.equal(getDaysDiffBetweenDates(args..), 'Expected');
    +  //t.false(getDaysDiffBetweenDates(args..), 'Expected');
    +  //t.throws(getDaysDiffBetweenDates(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js
    index ef46dac55..ded20c020 100644
    --- a/test/getScrollPosition/getScrollPosition.test.js
    +++ b/test/getScrollPosition/getScrollPosition.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const getScrollPosition = require('./getScrollPosition.js');
     
     test('Testing getScrollPosition', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof getScrollPosition === 'function', 'getScrollPosition is a Function');
    -	//t.deepEqual(getScrollPosition(args..), 'Expected');
    -	//t.equal(getScrollPosition(args..), 'Expected');
    -	//t.false(getScrollPosition(args..), 'Expected');
    -	//t.throws(getScrollPosition(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof getScrollPosition === 'function', 'getScrollPosition is a Function');
    +  //t.deepEqual(getScrollPosition(args..), 'Expected');
    +  //t.equal(getScrollPosition(args..), 'Expected');
    +  //t.false(getScrollPosition(args..), 'Expected');
    +  //t.throws(getScrollPosition(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js
    index 6fed01e98..11c2c9244 100644
    --- a/test/getStyle/getStyle.test.js
    +++ b/test/getStyle/getStyle.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const getStyle = require('./getStyle.js');
     
     test('Testing getStyle', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof getStyle === 'function', 'getStyle is a Function');
    -	//t.deepEqual(getStyle(args..), 'Expected');
    -	//t.equal(getStyle(args..), 'Expected');
    -	//t.false(getStyle(args..), 'Expected');
    -	//t.throws(getStyle(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof getStyle === 'function', 'getStyle is a Function');
    +  //t.deepEqual(getStyle(args..), 'Expected');
    +  //t.equal(getStyle(args..), 'Expected');
    +  //t.false(getStyle(args..), 'Expected');
    +  //t.throws(getStyle(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js
    index 2ae35510b..359e9ea07 100644
    --- a/test/getType/getType.test.js
    +++ b/test/getType/getType.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const getType = require('./getType.js');
     
     test('Testing getType', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof getType === 'function', 'getType is a Function');
    -	t.equal(getType(new Set([1, 2, 3])), 'set', "Returns the native type of a value");
    -	//t.deepEqual(getType(args..), 'Expected');
    -	//t.equal(getType(args..), 'Expected');
    -	//t.false(getType(args..), 'Expected');
    -	//t.throws(getType(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof getType === 'function', 'getType is a Function');
    +  t.equal(getType(new Set([1, 2, 3])), 'set', "Returns the native type of a value");
    +  //t.deepEqual(getType(args..), 'Expected');
    +  //t.equal(getType(args..), 'Expected');
    +  //t.false(getType(args..), 'Expected');
    +  //t.throws(getType(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js
    index 4c9463228..a030f86ee 100644
    --- a/test/getURLParameters/getURLParameters.test.js
    +++ b/test/getURLParameters/getURLParameters.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const getURLParameters = require('./getURLParameters.js');
     
     test('Testing getURLParameters', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof getURLParameters === 'function', 'getURLParameters is a Function');
    -	t.deepEqual(getURLParameters('http://url.com/page?name=Adam&surname=Smith'), {name: 'Adam', surname: 'Smith'}, "Returns an object containing the parameters of the current URL");
    -	//t.deepEqual(getURLParameters(args..), 'Expected');
    -	//t.equal(getURLParameters(args..), 'Expected');
    -	//t.false(getURLParameters(args..), 'Expected');
    -	//t.throws(getURLParameters(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof getURLParameters === 'function', 'getURLParameters is a Function');
    +  t.deepEqual(getURLParameters('http://url.com/page?name=Adam&surname=Smith'), {name: 'Adam', surname: 'Smith'}, "Returns an object containing the parameters of the current URL");
    +  //t.deepEqual(getURLParameters(args..), 'Expected');
    +  //t.equal(getURLParameters(args..), 'Expected');
    +  //t.false(getURLParameters(args..), 'Expected');
    +  //t.throws(getURLParameters(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js
    index 1470c4070..e3e8528bb 100644
    --- a/test/groupBy/groupBy.test.js
    +++ b/test/groupBy/groupBy.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const groupBy = require('./groupBy.js');
     
     test('Testing groupBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof groupBy === 'function', 'groupBy is a Function');
    -	t.deepEqual(groupBy([6.1, 4.2, 6.3], Math.floor), {4: [4.2], 6: [6.1, 6.3]}, "Groups the elements of an array based on the given function");
    -	t.deepEqual(groupBy(['one', 'two', 'three'], 'length'), {3: ['one', 'two'], 5: ['three']}, "Groups the elements of an array based on the given function");
    -	//t.deepEqual(groupBy(args..), 'Expected');
    -	//t.equal(groupBy(args..), 'Expected');
    -	//t.false(groupBy(args..), 'Expected');
    -	//t.throws(groupBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof groupBy === 'function', 'groupBy is a Function');
    +  t.deepEqual(groupBy([6.1, 4.2, 6.3], Math.floor), {4: [4.2], 6: [6.1, 6.3]}, "Groups the elements of an array based on the given function");
    +  t.deepEqual(groupBy(['one', 'two', 'three'], 'length'), {3: ['one', 'two'], 5: ['three']}, "Groups the elements of an array based on the given function");
    +  //t.deepEqual(groupBy(args..), 'Expected');
    +  //t.equal(groupBy(args..), 'Expected');
    +  //t.false(groupBy(args..), 'Expected');
    +  //t.throws(groupBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js
    index 503ddde36..6ada1733c 100644
    --- a/test/hammingDistance/hammingDistance.test.js
    +++ b/test/hammingDistance/hammingDistance.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const hammingDistance = require('./hammingDistance.js');
     
     test('Testing hammingDistance', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hammingDistance === 'function', 'hammingDistance is a Function');
    -	t.equal(hammingDistance(2, 3), 1, "retuns hamming disance between 2 values");
    -	//t.deepEqual(hammingDistance(args..), 'Expected');
    -	//t.equal(hammingDistance(args..), 'Expected');
    -	//t.false(hammingDistance(args..), 'Expected');
    -	//t.throws(hammingDistance(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hammingDistance === 'function', 'hammingDistance is a Function');
    +  t.equal(hammingDistance(2, 3), 1, "retuns hamming disance between 2 values");
    +  //t.deepEqual(hammingDistance(args..), 'Expected');
    +  //t.equal(hammingDistance(args..), 'Expected');
    +  //t.false(hammingDistance(args..), 'Expected');
    +  //t.throws(hammingDistance(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js
    index f70f22d73..43932ea01 100644
    --- a/test/hasClass/hasClass.test.js
    +++ b/test/hasClass/hasClass.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const hasClass = require('./hasClass.js');
     
     test('Testing hasClass', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hasClass === 'function', 'hasClass is a Function');
    -	//t.deepEqual(hasClass(args..), 'Expected');
    -	//t.equal(hasClass(args..), 'Expected');
    -	//t.false(hasClass(args..), 'Expected');
    -	//t.throws(hasClass(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hasClass === 'function', 'hasClass is a Function');
    +  //t.deepEqual(hasClass(args..), 'Expected');
    +  //t.equal(hasClass(args..), 'Expected');
    +  //t.false(hasClass(args..), 'Expected');
    +  //t.throws(hasClass(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js
    index 9425e55d9..0245051be 100644
    --- a/test/hasFlags/hasFlags.test.js
    +++ b/test/hasFlags/hasFlags.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const hasFlags = require('./hasFlags.js');
     
     test('Testing hasFlags', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hasFlags === 'function', 'hasFlags is a Function');
    -	//t.deepEqual(hasFlags(args..), 'Expected');
    -	//t.equal(hasFlags(args..), 'Expected');
    -	//t.false(hasFlags(args..), 'Expected');
    -	//t.throws(hasFlags(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hasFlags === 'function', 'hasFlags is a Function');
    +  //t.deepEqual(hasFlags(args..), 'Expected');
    +  //t.equal(hasFlags(args..), 'Expected');
    +  //t.false(hasFlags(args..), 'Expected');
    +  //t.throws(hasFlags(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js
    index 93ad07918..d01cafc5b 100644
    --- a/test/hashBrowser/hashBrowser.test.js
    +++ b/test/hashBrowser/hashBrowser.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const hashBrowser = require('./hashBrowser.js');
     
     test('Testing hashBrowser', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
    -	//t.deepEqual(hashBrowser(args..), 'Expected');
    -	//t.equal(hashBrowser(args..), 'Expected');
    -	//t.false(hashBrowser(args..), 'Expected');
    -	//t.throws(hashBrowser(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
    +  //t.deepEqual(hashBrowser(args..), 'Expected');
    +  //t.equal(hashBrowser(args..), 'Expected');
    +  //t.false(hashBrowser(args..), 'Expected');
    +  //t.throws(hashBrowser(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js
    index 31d0a0324..e89dafe9e 100644
    --- a/test/hashNode/hashNode.test.js
    +++ b/test/hashNode/hashNode.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const hashNode = require('./hashNode.js');
     
     test('Testing hashNode', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hashNode === 'function', 'hashNode is a Function');
    -	//t.deepEqual(hashNode(args..), 'Expected');
    -	//t.equal(hashNode(args..), 'Expected');
    -	//t.false(hashNode(args..), 'Expected');
    -	//t.throws(hashNode(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hashNode === 'function', 'hashNode is a Function');
    +  //t.deepEqual(hashNode(args..), 'Expected');
    +  //t.equal(hashNode(args..), 'Expected');
    +  //t.false(hashNode(args..), 'Expected');
    +  //t.throws(hashNode(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/head/head.test.js b/test/head/head.test.js
    index 7cf67cd9c..b6fa2d188 100644
    --- a/test/head/head.test.js
    +++ b/test/head/head.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const head = require('./head.js');
     
     test('Testing head', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
       t.true(typeof head === 'function', 'head is a Function');
       t.true(head({ a: 1234}) === undefined, 'head({ a: 1234}) returns undefined');
       t.equal(head([1, 2, 3]), 1, "head([1, 2, 3]) returns 1");
       t.equal(head({ 0: false}), false, 'head({ 0: false}) returns false');
    -	t.equal(head('String'), 'S', 'head(String) returns S');
    +  t.equal(head('String'), 'S', 'head(String) returns S');
       t.throws(() => head(null), 'head(null) throws an Error');
       t.throws(() => head(undefined), 'head(undefined) throws an Error');
       t.throws(() => head(), 'head() throws an Error');
    @@ -17,5 +17,5 @@ test('Testing head', (t) => {
       head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]);
       let end = new Date().getTime();
       t.true((end - start) < 2000, 'head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run');
    -	t.end();
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js
    index b3f6a7c4b..4b3d0fdd8 100644
    --- a/test/hexToRGB/hexToRGB.test.js
    +++ b/test/hexToRGB/hexToRGB.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const hexToRGB = require('./hexToRGB.js');
     
     test('Testing hexToRGB', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hexToRGB === 'function', 'hexToRGB is a Function');
    -	t.equal(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96, 255)', "Converts a color code to a rgb() or rgba() string");
    -	t.equal(hexToRGB('27ae60'), 'rgb(39, 174, 96)', "Converts a color code to a rgb() or rgba() string");
    -	t.equal(hexToRGB('#fff'), 'rgb(255, 255, 255)', "Converts a color code to a rgb() or rgba() string");
    -	//t.deepEqual(hexToRGB(args..), 'Expected');
    -	//t.equal(hexToRGB(args..), 'Expected');
    -	//t.false(hexToRGB(args..), 'Expected');
    -	//t.throws(hexToRGB(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hexToRGB === 'function', 'hexToRGB is a Function');
    +  t.equal(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96, 255)', "Converts a color code to a rgb() or rgba() string");
    +  t.equal(hexToRGB('27ae60'), 'rgb(39, 174, 96)', "Converts a color code to a rgb() or rgba() string");
    +  t.equal(hexToRGB('#fff'), 'rgb(255, 255, 255)', "Converts a color code to a rgb() or rgba() string");
    +  //t.deepEqual(hexToRGB(args..), 'Expected');
    +  //t.equal(hexToRGB(args..), 'Expected');
    +  //t.false(hexToRGB(args..), 'Expected');
    +  //t.throws(hexToRGB(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js
    index 9746171a3..d93d3fa74 100644
    --- a/test/hide/hide.test.js
    +++ b/test/hide/hide.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const hide = require('./hide.js');
     
     test('Testing hide', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof hide === 'function', 'hide is a Function');
    -	//t.deepEqual(hide(args..), 'Expected');
    -	//t.equal(hide(args..), 'Expected');
    -	//t.false(hide(args..), 'Expected');
    -	//t.throws(hide(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof hide === 'function', 'hide is a Function');
    +  //t.deepEqual(hide(args..), 'Expected');
    +  //t.equal(hide(args..), 'Expected');
    +  //t.false(hide(args..), 'Expected');
    +  //t.throws(hide(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js
    index 98fc00b85..250b542ce 100644
    --- a/test/howManyTimes/howManyTimes.test.js
    +++ b/test/howManyTimes/howManyTimes.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const howManyTimes = require('./howManyTimes.js');
     
     test('Testing howManyTimes', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof howManyTimes === 'function', 'howManyTimes is a Function');
    -	//t.deepEqual(howManyTimes(args..), 'Expected');
    -	//t.equal(howManyTimes(args..), 'Expected');
    -	//t.false(howManyTimes(args..), 'Expected');
    -	//t.throws(howManyTimes(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof howManyTimes === 'function', 'howManyTimes is a Function');
    +  //t.deepEqual(howManyTimes(args..), 'Expected');
    +  //t.equal(howManyTimes(args..), 'Expected');
    +  //t.false(howManyTimes(args..), 'Expected');
    +  //t.throws(howManyTimes(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js
    index 862230e23..d4edd42a9 100644
    --- a/test/httpDelete/httpDelete.test.js
    +++ b/test/httpDelete/httpDelete.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const httpDelete = require('./httpDelete.js');
     
     test('Testing httpDelete', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof httpDelete === 'function', 'httpDelete is a Function');
    -	//t.deepEqual(httpDelete(args..), 'Expected');
    -	//t.equal(httpDelete(args..), 'Expected');
    -	//t.false(httpDelete(args..), 'Expected');
    -	//t.throws(httpDelete(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof httpDelete === 'function', 'httpDelete is a Function');
    +  //t.deepEqual(httpDelete(args..), 'Expected');
    +  //t.equal(httpDelete(args..), 'Expected');
    +  //t.false(httpDelete(args..), 'Expected');
    +  //t.throws(httpDelete(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js
    index c55559714..22a743776 100644
    --- a/test/httpGet/httpGet.test.js
    +++ b/test/httpGet/httpGet.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const httpGet = require('./httpGet.js');
     
     test('Testing httpGet', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof httpGet === 'function', 'httpGet is a Function');
    -	//t.deepEqual(httpGet(args..), 'Expected');
    -	//t.equal(httpGet(args..), 'Expected');
    -	//t.false(httpGet(args..), 'Expected');
    -	//t.throws(httpGet(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof httpGet === 'function', 'httpGet is a Function');
    +  //t.deepEqual(httpGet(args..), 'Expected');
    +  //t.equal(httpGet(args..), 'Expected');
    +  //t.false(httpGet(args..), 'Expected');
    +  //t.throws(httpGet(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js
    index df8add407..6b291825f 100644
    --- a/test/httpPost/httpPost.test.js
    +++ b/test/httpPost/httpPost.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const httpPost = require('./httpPost.js');
     
     test('Testing httpPost', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof httpPost === 'function', 'httpPost is a Function');
    -	//t.deepEqual(httpPost(args..), 'Expected');
    -	//t.equal(httpPost(args..), 'Expected');
    -	//t.false(httpPost(args..), 'Expected');
    -	//t.throws(httpPost(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof httpPost === 'function', 'httpPost is a Function');
    +  //t.deepEqual(httpPost(args..), 'Expected');
    +  //t.equal(httpPost(args..), 'Expected');
    +  //t.false(httpPost(args..), 'Expected');
    +  //t.throws(httpPost(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js
    index 1ca28c87d..d7c3f1e86 100644
    --- a/test/httpPut/httpPut.test.js
    +++ b/test/httpPut/httpPut.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const httpPut = require('./httpPut.js');
     
     test('Testing httpPut', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof httpPut === 'function', 'httpPut is a Function');
    -	//t.deepEqual(httpPut(args..), 'Expected');
    -	//t.equal(httpPut(args..), 'Expected');
    -	//t.false(httpPut(args..), 'Expected');
    -	//t.throws(httpPut(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof httpPut === 'function', 'httpPut is a Function');
    +  //t.deepEqual(httpPut(args..), 'Expected');
    +  //t.equal(httpPut(args..), 'Expected');
    +  //t.false(httpPut(args..), 'Expected');
    +  //t.throws(httpPut(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js
    index dbd08805a..20f70d654 100644
    --- a/test/httpsRedirect/httpsRedirect.test.js
    +++ b/test/httpsRedirect/httpsRedirect.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const httpsRedirect = require('./httpsRedirect.js');
     
     test('Testing httpsRedirect', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof httpsRedirect === 'function', 'httpsRedirect is a Function');
    -	//t.deepEqual(httpsRedirect(args..), 'Expected');
    -	//t.equal(httpsRedirect(args..), 'Expected');
    -	//t.false(httpsRedirect(args..), 'Expected');
    -	//t.throws(httpsRedirect(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof httpsRedirect === 'function', 'httpsRedirect is a Function');
    +  //t.deepEqual(httpsRedirect(args..), 'Expected');
    +  //t.equal(httpsRedirect(args..), 'Expected');
    +  //t.false(httpsRedirect(args..), 'Expected');
    +  //t.throws(httpsRedirect(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js
    index 5107eefa1..10b2a2bec 100644
    --- a/test/inRange/inRange.test.js
    +++ b/test/inRange/inRange.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const inRange = require('./inRange.js');
     
     test('Testing inRange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof inRange === 'function', 'inRange is a Function');
    -	t.equal(inRange(3, 2, 5), true, "The given number falls within the given range");
    -	t.equal(inRange(3, 4), true, "The given number falls within the given range");
    -	t.equal(inRange(2, 3, 5), false, "The given number does not falls within the given range");
    -	t.equal(inRange(3, 2), false, "The given number does not falls within the given range");
    -	//t.deepEqual(inRange(args..), 'Expected');
    -	//t.equal(inRange(args..), 'Expected');
    -	//t.false(inRange(args..), 'Expected');
    -	//t.throws(inRange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof inRange === 'function', 'inRange is a Function');
    +  t.equal(inRange(3, 2, 5), true, "The given number falls within the given range");
    +  t.equal(inRange(3, 4), true, "The given number falls within the given range");
    +  t.equal(inRange(2, 3, 5), false, "The given number does not falls within the given range");
    +  t.equal(inRange(3, 2), false, "The given number does not falls within the given range");
    +  //t.deepEqual(inRange(args..), 'Expected');
    +  //t.equal(inRange(args..), 'Expected');
    +  //t.false(inRange(args..), 'Expected');
    +  //t.throws(inRange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js
    index 9adf23302..d9c681a65 100644
    --- a/test/indexOfAll/indexOfAll.test.js
    +++ b/test/indexOfAll/indexOfAll.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const indexOfAll = require('./indexOfAll.js');
     
     test('Testing indexOfAll', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof indexOfAll === 'function', 'indexOfAll is a Function');
    -	t.deepEqual(indexOfAll([1, 2, 3, 1, 2, 3], 1), [0,3], "Returns all indices of val in an array");
    -	t.deepEqual(indexOfAll([1, 2, 3], 4), [], "Returns all indices of val in an array");
    -	//t.deepEqual(indexOfAll(args..), 'Expected');
    -	//t.equal(indexOfAll(args..), 'Expected');
    -	//t.false(indexOfAll(args..), 'Expected');
    -	//t.throws(indexOfAll(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof indexOfAll === 'function', 'indexOfAll is a Function');
    +  t.deepEqual(indexOfAll([1, 2, 3, 1, 2, 3], 1), [0,3], "Returns all indices of val in an array");
    +  t.deepEqual(indexOfAll([1, 2, 3], 4), [], "Returns all indices of val in an array");
    +  //t.deepEqual(indexOfAll(args..), 'Expected');
    +  //t.equal(indexOfAll(args..), 'Expected');
    +  //t.false(indexOfAll(args..), 'Expected');
    +  //t.throws(indexOfAll(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/initial/initial.test.js b/test/initial/initial.test.js
    index 5b72d4bfb..d4b0b76d6 100644
    --- a/test/initial/initial.test.js
    +++ b/test/initial/initial.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const initial = require('./initial.js');
     
     test('Testing initial', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof initial === 'function', 'initial is a Function');
    -	t.deepEqual(initial([1, 2, 3]), [1, 2], "Returns all the elements of an array except the last one");
    -	//t.deepEqual(initial(args..), 'Expected');
    -	//t.equal(initial(args..), 'Expected');
    -	//t.false(initial(args..), 'Expected');
    -	//t.throws(initial(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof initial === 'function', 'initial is a Function');
    +  t.deepEqual(initial([1, 2, 3]), [1, 2], "Returns all the elements of an array except the last one");
    +  //t.deepEqual(initial(args..), 'Expected');
    +  //t.equal(initial(args..), 'Expected');
    +  //t.false(initial(args..), 'Expected');
    +  //t.throws(initial(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/initialize2DArray/initialize2DArray.test.js b/test/initialize2DArray/initialize2DArray.test.js
    index 73699d3bb..d2436a46a 100644
    --- a/test/initialize2DArray/initialize2DArray.test.js
    +++ b/test/initialize2DArray/initialize2DArray.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const initialize2DArray = require('./initialize2DArray.js');
     
     test('Testing initialize2DArray', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof initialize2DArray === 'function', 'initialize2DArray is a Function');
    -	t.deepEqual(initialize2DArray(2, 2, 0), [[0,0], [0,0]], "Initializes a 2D array of given width and height and value");
    -	//t.deepEqual(initialize2DArray(args..), 'Expected');
    -	//t.equal(initialize2DArray(args..), 'Expected');
    -	//t.false(initialize2DArray(args..), 'Expected');
    -	//t.throws(initialize2DArray(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof initialize2DArray === 'function', 'initialize2DArray is a Function');
    +  t.deepEqual(initialize2DArray(2, 2, 0), [[0,0], [0,0]], "Initializes a 2D array of given width and height and value");
    +  //t.deepEqual(initialize2DArray(args..), 'Expected');
    +  //t.equal(initialize2DArray(args..), 'Expected');
    +  //t.false(initialize2DArray(args..), 'Expected');
    +  //t.throws(initialize2DArray(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.test.js b/test/initializeArrayWithRange/initializeArrayWithRange.test.js
    index 0d7db7b62..c35b1f557 100644
    --- a/test/initializeArrayWithRange/initializeArrayWithRange.test.js
    +++ b/test/initializeArrayWithRange/initializeArrayWithRange.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const initializeArrayWithRange = require('./initializeArrayWithRange.js');
     
     test('Testing initializeArrayWithRange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof initializeArrayWithRange === 'function', 'initializeArrayWithRange is a Function');
    -	t.deepEqual(initializeArrayWithRange(5), [0, 1, 2, 3, 4, 5], "Initializes an array containing the numbers in the specified range");
    -	//t.deepEqual(initializeArrayWithRange(args..), 'Expected');
    -	//t.equal(initializeArrayWithRange(args..), 'Expected');
    -	//t.false(initializeArrayWithRange(args..), 'Expected');
    -	//t.throws(initializeArrayWithRange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof initializeArrayWithRange === 'function', 'initializeArrayWithRange is a Function');
    +  t.deepEqual(initializeArrayWithRange(5), [0, 1, 2, 3, 4, 5], "Initializes an array containing the numbers in the specified range");
    +  //t.deepEqual(initializeArrayWithRange(args..), 'Expected');
    +  //t.equal(initializeArrayWithRange(args..), 'Expected');
    +  //t.false(initializeArrayWithRange(args..), 'Expected');
    +  //t.throws(initializeArrayWithRange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js
    index 34418ca28..f630da0c4 100644
    --- a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js
    +++ b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js');
     
     test('Testing initializeArrayWithRangeRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof initializeArrayWithRangeRight === 'function', 'initializeArrayWithRangeRight is a Function');
    -	//t.deepEqual(initializeArrayWithRangeRight(args..), 'Expected');
    -	//t.equal(initializeArrayWithRangeRight(args..), 'Expected');
    -	//t.false(initializeArrayWithRangeRight(args..), 'Expected');
    -	//t.throws(initializeArrayWithRangeRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof initializeArrayWithRangeRight === 'function', 'initializeArrayWithRangeRight is a Function');
    +  //t.deepEqual(initializeArrayWithRangeRight(args..), 'Expected');
    +  //t.equal(initializeArrayWithRangeRight(args..), 'Expected');
    +  //t.false(initializeArrayWithRangeRight(args..), 'Expected');
    +  //t.throws(initializeArrayWithRangeRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js
    index bfbb060b1..e4590fcaa 100644
    --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js
    +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const initializeArrayWithValues = require('./initializeArrayWithValues.js');
     
     test('Testing initializeArrayWithValues', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof initializeArrayWithValues === 'function', 'initializeArrayWithValues is a Function');
    -	t.deepEqual(initializeArrayWithValues(5, 2), [2, 2, 2, 2, 2], "Initializes and fills an array with the specified values");
    -	//t.deepEqual(initializeArrayWithValues(args..), 'Expected');
    -	//t.equal(initializeArrayWithValues(args..), 'Expected');
    -	//t.false(initializeArrayWithValues(args..), 'Expected');
    -	//t.throws(initializeArrayWithValues(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof initializeArrayWithValues === 'function', 'initializeArrayWithValues is a Function');
    +  t.deepEqual(initializeArrayWithValues(5, 2), [2, 2, 2, 2, 2], "Initializes and fills an array with the specified values");
    +  //t.deepEqual(initializeArrayWithValues(args..), 'Expected');
    +  //t.equal(initializeArrayWithValues(args..), 'Expected');
    +  //t.false(initializeArrayWithValues(args..), 'Expected');
    +  //t.throws(initializeArrayWithValues(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js
    index 078a912c1..065d86356 100644
    --- a/test/intersection/intersection.test.js
    +++ b/test/intersection/intersection.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const intersection = require('./intersection.js');
     
     test('Testing intersection', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof intersection === 'function', 'intersection is a Function');
    -	t.deepEqual(intersection([1, 2, 3], [4, 3, 2]), [2, 3], "Returns a list of elements that exist in both arrays");
    -	//t.deepEqual(intersection(args..), 'Expected');
    -	//t.equal(intersection(args..), 'Expected');
    -	//t.false(intersection(args..), 'Expected');
    -	//t.throws(intersection(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof intersection === 'function', 'intersection is a Function');
    +  t.deepEqual(intersection([1, 2, 3], [4, 3, 2]), [2, 3], "Returns a list of elements that exist in both arrays");
    +  //t.deepEqual(intersection(args..), 'Expected');
    +  //t.equal(intersection(args..), 'Expected');
    +  //t.false(intersection(args..), 'Expected');
    +  //t.throws(intersection(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js
    index e4c5af9b0..f9cead537 100644
    --- a/test/intersectionBy/intersectionBy.test.js
    +++ b/test/intersectionBy/intersectionBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const intersectionBy = require('./intersectionBy.js');
     
     test('Testing intersectionBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof intersectionBy === 'function', 'intersectionBy is a Function');
    -	//t.deepEqual(intersectionBy(args..), 'Expected');
    -	//t.equal(intersectionBy(args..), 'Expected');
    -	//t.false(intersectionBy(args..), 'Expected');
    -	//t.throws(intersectionBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof intersectionBy === 'function', 'intersectionBy is a Function');
    +  //t.deepEqual(intersectionBy(args..), 'Expected');
    +  //t.equal(intersectionBy(args..), 'Expected');
    +  //t.false(intersectionBy(args..), 'Expected');
    +  //t.throws(intersectionBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js
    index 12501f66a..061a95a96 100644
    --- a/test/intersectionWith/intersectionWith.test.js
    +++ b/test/intersectionWith/intersectionWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const intersectionWith = require('./intersectionWith.js');
     
     test('Testing intersectionWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof intersectionWith === 'function', 'intersectionWith is a Function');
    -	//t.deepEqual(intersectionWith(args..), 'Expected');
    -	//t.equal(intersectionWith(args..), 'Expected');
    -	//t.false(intersectionWith(args..), 'Expected');
    -	//t.throws(intersectionWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof intersectionWith === 'function', 'intersectionWith is a Function');
    +  //t.deepEqual(intersectionWith(args..), 'Expected');
    +  //t.equal(intersectionWith(args..), 'Expected');
    +  //t.false(intersectionWith(args..), 'Expected');
    +  //t.throws(intersectionWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js
    index d51d06314..948a80889 100644
    --- a/test/invertKeyValues/invertKeyValues.test.js
    +++ b/test/invertKeyValues/invertKeyValues.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const invertKeyValues = require('./invertKeyValues.js');
     
     test('Testing invertKeyValues', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof invertKeyValues === 'function', 'invertKeyValues is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof invertKeyValues === 'function', 'invertKeyValues is a Function');
       t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }), { 1: [ 'a', 'c' ], 2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }");
       t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value), { group1: [ 'a', 'c' ], group2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] }");
    -	//t.deepEqual(invertKeyValues(args..), 'Expected');
    -	//t.equal(invertKeyValues(args..), 'Expected');
    -	//t.false(invertKeyValues(args..), 'Expected');
    -	//t.throws(invertKeyValues(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(invertKeyValues(args..), 'Expected');
    +  //t.equal(invertKeyValues(args..), 'Expected');
    +  //t.false(invertKeyValues(args..), 'Expected');
    +  //t.throws(invertKeyValues(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/is/is.test.js b/test/is/is.test.js
    index 922cc0f8c..d99c05d6f 100644
    --- a/test/is/is.test.js
    +++ b/test/is/is.test.js
    @@ -2,9 +2,9 @@ const test = require('tape');
     const is = require('./is.js');
     
     test('Testing is', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof is === 'function', 'is is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof is === 'function', 'is is a Function');
       t.true(is(Array, [1]), `Works for arrays with data`);
       t.true(is(Array, []), `Works for empty arrays`);
       t.false(is(Array, {}), `Works for arrays, not objects`);
    @@ -21,9 +21,9 @@ test('Testing is', (t) => {
       t.false(is(Boolean, false), `Works for booleans - returns false for primitive`);
       t.true(is(Boolean, new Boolean(false)), `Works for booleans - returns true when using constructor`);
       t.true(is(Function, () => null), `Works for functions`);
    -	//t.deepEqual(is(args..), 'Expected');
    -	//t.equal(is(args..), 'Expected');
    -	//t.false(is(args..), 'Expected');
    -	//t.throws(is(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(is(args..), 'Expected');
    +  //t.equal(is(args..), 'Expected');
    +  //t.false(is(args..), 'Expected');
    +  //t.throws(is(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/isAbsoluteURL/isAbsoluteURL.test.js b/test/isAbsoluteURL/isAbsoluteURL.test.js
    index 31ede0273..965d48cdc 100644
    --- a/test/isAbsoluteURL/isAbsoluteURL.test.js
    +++ b/test/isAbsoluteURL/isAbsoluteURL.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const isAbsoluteURL = require('./isAbsoluteURL.js');
     
     test('Testing isAbsoluteURL', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isAbsoluteURL === 'function', 'isAbsoluteURL is a Function');
    -	t.equal(isAbsoluteURL('https://google.com'), true, "Given string is an absolute URL");
    -	t.equal(isAbsoluteURL('ftp://www.myserver.net'), true, "Given string is an absolute URL");
    -	t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL");
    -	//t.deepEqual(isAbsoluteURL(args..), 'Expected');
    -	//t.equal(isAbsoluteURL(args..), 'Expected');
    -	//t.false(isAbsoluteURL(args..), 'Expected');
    -	//t.throws(isAbsoluteURL(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isAbsoluteURL === 'function', 'isAbsoluteURL is a Function');
    +  t.equal(isAbsoluteURL('https://google.com'), true, "Given string is an absolute URL");
    +  t.equal(isAbsoluteURL('ftp://www.myserver.net'), true, "Given string is an absolute URL");
    +  t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL");
    +  //t.deepEqual(isAbsoluteURL(args..), 'Expected');
    +  //t.equal(isAbsoluteURL(args..), 'Expected');
    +  //t.false(isAbsoluteURL(args..), 'Expected');
    +  //t.throws(isAbsoluteURL(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isArmstrongNumber/isArmstrongNumber.test.js b/test/isArmstrongNumber/isArmstrongNumber.test.js
    index d3e32e507..dbebfbfd0 100644
    --- a/test/isArmstrongNumber/isArmstrongNumber.test.js
    +++ b/test/isArmstrongNumber/isArmstrongNumber.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isArmstrongNumber = require('./isArmstrongNumber.js');
     
     test('Testing isArmstrongNumber', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isArmstrongNumber === 'function', 'isArmstrongNumber is a Function');
    -	//t.deepEqual(isArmstrongNumber(args..), 'Expected');
    -	//t.equal(isArmstrongNumber(args..), 'Expected');
    -	//t.false(isArmstrongNumber(args..), 'Expected');
    -	//t.throws(isArmstrongNumber(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isArmstrongNumber === 'function', 'isArmstrongNumber is a Function');
    +  //t.deepEqual(isArmstrongNumber(args..), 'Expected');
    +  //t.equal(isArmstrongNumber(args..), 'Expected');
    +  //t.false(isArmstrongNumber(args..), 'Expected');
    +  //t.throws(isArmstrongNumber(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js
    index 26c1dc5c0..7d56d1112 100644
    --- a/test/isArray/isArray.test.js
    +++ b/test/isArray/isArray.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const isArray = require('./isArray.js');
     
     test('Testing isArray', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isArray === 'function', 'isArray is a Function');
    -	t.equal(isArray([1]), true, "passed value is an array");
    -	t.equal(isArray('array'), false, "passed value is not an array");
    -	//t.equal(isArray(args..), 'Expected');
    -	//t.false(isArray(args..), 'Expected');
    -	//t.throws(isArray(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isArray === 'function', 'isArray is a Function');
    +  t.equal(isArray([1]), true, "passed value is an array");
    +  t.equal(isArray('array'), false, "passed value is not an array");
    +  //t.equal(isArray(args..), 'Expected');
    +  //t.false(isArray(args..), 'Expected');
    +  //t.throws(isArray(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isArrayBuffer/isArrayBuffer.test.js b/test/isArrayBuffer/isArrayBuffer.test.js
    index 8b3656960..1d9cffa97 100644
    --- a/test/isArrayBuffer/isArrayBuffer.test.js
    +++ b/test/isArrayBuffer/isArrayBuffer.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isArrayBuffer = require('./isArrayBuffer.js');
     
     test('Testing isArrayBuffer', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isArrayBuffer === 'function', 'isArrayBuffer is a Function');
    -	//t.deepEqual(isArrayBuffer(args..), 'Expected');
    -	//t.equal(isArrayBuffer(args..), 'Expected');
    -	//t.false(isArrayBuffer(args..), 'Expected');
    -	//t.throws(isArrayBuffer(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isArrayBuffer === 'function', 'isArrayBuffer is a Function');
    +  //t.deepEqual(isArrayBuffer(args..), 'Expected');
    +  //t.equal(isArrayBuffer(args..), 'Expected');
    +  //t.false(isArrayBuffer(args..), 'Expected');
    +  //t.throws(isArrayBuffer(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js
    index d8a528c05..2239caf3d 100644
    --- a/test/isArrayLike/isArrayLike.test.js
    +++ b/test/isArrayLike/isArrayLike.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isArrayLike = require('./isArrayLike.js');
     
     test('Testing isArrayLike', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isArrayLike === 'function', 'isArrayLike is a Function');
    -	//t.deepEqual(isArrayLike(args..), 'Expected');
    -	//t.equal(isArrayLike(args..), 'Expected');
    -	//t.false(isArrayLike(args..), 'Expected');
    -	//t.throws(isArrayLike(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isArrayLike === 'function', 'isArrayLike is a Function');
    +  //t.deepEqual(isArrayLike(args..), 'Expected');
    +  //t.equal(isArrayLike(args..), 'Expected');
    +  //t.false(isArrayLike(args..), 'Expected');
    +  //t.throws(isArrayLike(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js
    index c18f04d02..68334e925 100644
    --- a/test/isBoolean/isBoolean.test.js
    +++ b/test/isBoolean/isBoolean.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const isBoolean = require('./isBoolean.js');
     
     test('Testing isBoolean', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isBoolean === 'function', 'isBoolean is a Function');
    -	t.equal(isBoolean(null), false, "passed value is not a boolean");
    -	t.equal(isBoolean(false), true, "passed value is not a boolean");
    -	//t.deepEqual(isBoolean(args..), 'Expected');
    -	//t.equal(isBoolean(args..), 'Expected');
    -	//t.false(isBoolean(args..), 'Expected');
    -	//t.throws(isBoolean(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isBoolean === 'function', 'isBoolean is a Function');
    +  t.equal(isBoolean(null), false, "passed value is not a boolean");
    +  t.equal(isBoolean(false), true, "passed value is not a boolean");
    +  //t.deepEqual(isBoolean(args..), 'Expected');
    +  //t.equal(isBoolean(args..), 'Expected');
    +  //t.false(isBoolean(args..), 'Expected');
    +  //t.throws(isBoolean(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js
    index 40eeb4bc9..bdfa8a5c2 100644
    --- a/test/isDivisible/isDivisible.test.js
    +++ b/test/isDivisible/isDivisible.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isDivisible = require('./isDivisible.js');
     
     test('Testing isDivisible', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isDivisible === 'function', 'isDivisible is a Function');
    -	t.equal(isDivisible(6, 3), true, 'The number 6 is divisible by 3');
    -	//t.deepEqual(isDivisible(args..), 'Expected');
    -	//t.false(isDivisible(args..), 'Expected');
    -	//t.throws(isDivisible(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isDivisible === 'function', 'isDivisible is a Function');
    +  t.equal(isDivisible(6, 3), true, 'The number 6 is divisible by 3');
    +  //t.deepEqual(isDivisible(args..), 'Expected');
    +  //t.false(isDivisible(args..), 'Expected');
    +  //t.throws(isDivisible(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js
    index bc457c018..2c101b5c5 100644
    --- a/test/isEmpty/isEmpty.test.js
    +++ b/test/isEmpty/isEmpty.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isEmpty = require('./isEmpty.js');
     
     test('Testing isEmpty', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isEmpty === 'function', 'isEmpty is a Function');
    -	//t.deepEqual(isEmpty(args..), 'Expected');
    -	//t.equal(isEmpty(args..), 'Expected');
    -	//t.false(isEmpty(args..), 'Expected');
    -	//t.throws(isEmpty(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isEmpty === 'function', 'isEmpty is a Function');
    +  //t.deepEqual(isEmpty(args..), 'Expected');
    +  //t.equal(isEmpty(args..), 'Expected');
    +  //t.false(isEmpty(args..), 'Expected');
    +  //t.throws(isEmpty(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isEven/isEven.test.js b/test/isEven/isEven.test.js
    index 6436226b4..8c9e29455 100644
    --- a/test/isEven/isEven.test.js
    +++ b/test/isEven/isEven.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isEven = require('./isEven.js');
     
     test('Testing isEven', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isEven === 'function', 'isEven is a Function');
    -	t.equal(isEven(4), true, '4 is even number');
    -	t.false(isEven(5), false, '5 is not an even number');
    -	//t.deepEqual(isEven(args..), 'Expected');
    -	//t.throws(isEven(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isEven === 'function', 'isEven is a Function');
    +  t.equal(isEven(4), true, '4 is even number');
    +  t.false(isEven(5), false, '5 is not an even number');
    +  //t.deepEqual(isEven(args..), 'Expected');
    +  //t.throws(isEven(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isFunction/isFunction.test.js b/test/isFunction/isFunction.test.js
    index 90ee51c8c..7311b25d4 100644
    --- a/test/isFunction/isFunction.test.js
    +++ b/test/isFunction/isFunction.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const isFunction = require('./isFunction.js');
     
     test('Testing isFunction', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isFunction === 'function', 'isFunction is a Function');
    -	t.equal(isFunction(x => x), true, "passed value is a function");
    -	t.equal(isFunction('x'), false, "passed value is not a function");
    -	//t.equal(isFunction(args..), 'Expected');
    -	//t.false(isFunction(args..), 'Expected');
    -	//t.throws(isFunction(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isFunction === 'function', 'isFunction is a Function');
    +  t.equal(isFunction(x => x), true, "passed value is a function");
    +  t.equal(isFunction('x'), false, "passed value is not a function");
    +  //t.equal(isFunction(args..), 'Expected');
    +  //t.false(isFunction(args..), 'Expected');
    +  //t.throws(isFunction(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isLowerCase/isLowerCase.test.js b/test/isLowerCase/isLowerCase.test.js
    index 815babfe4..0e596dff9 100644
    --- a/test/isLowerCase/isLowerCase.test.js
    +++ b/test/isLowerCase/isLowerCase.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const isLowerCase = require('./isLowerCase.js');
     
     test('Testing isLowerCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isLowerCase === 'function', 'isLowerCase is a Function');
    -	t.equal(isLowerCase('abc'), true, "passed string is a lowercase");
    -	t.equal(isLowerCase('a3@$'), true, "passed string is a lowercase");
    -	t.equal(isLowerCase('A3@$'), false, "passed value is not a lowercase");
    -	//t.deepEqual(isLowerCase(args..), 'Expected');
    -	//t.equal(isLowerCase(args..), 'Expected');
    -	//t.false(isLowerCase(args..), 'Expected');
    -	//t.throws(isLowerCase(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isLowerCase === 'function', 'isLowerCase is a Function');
    +  t.equal(isLowerCase('abc'), true, "passed string is a lowercase");
    +  t.equal(isLowerCase('a3@$'), true, "passed string is a lowercase");
    +  t.equal(isLowerCase('A3@$'), false, "passed value is not a lowercase");
    +  //t.deepEqual(isLowerCase(args..), 'Expected');
    +  //t.equal(isLowerCase(args..), 'Expected');
    +  //t.false(isLowerCase(args..), 'Expected');
    +  //t.throws(isLowerCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isMap/isMap.test.js b/test/isMap/isMap.test.js
    index 4f73f16de..bc9fe3187 100644
    --- a/test/isMap/isMap.test.js
    +++ b/test/isMap/isMap.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isMap = require('./isMap.js');
     
     test('Testing isMap', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isMap === 'function', 'isMap is a Function');
    -	//t.deepEqual(isMap(args..), 'Expected');
    -	//t.equal(isMap(args..), 'Expected');
    -	//t.false(isMap(args..), 'Expected');
    -	//t.throws(isMap(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isMap === 'function', 'isMap is a Function');
    +  //t.deepEqual(isMap(args..), 'Expected');
    +  //t.equal(isMap(args..), 'Expected');
    +  //t.false(isMap(args..), 'Expected');
    +  //t.throws(isMap(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js
    index 324d68b84..4ad388e23 100644
    --- a/test/isNil/isNil.test.js
    +++ b/test/isNil/isNil.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isNil = require('./isNil.js');
     
     test('Testing isNil', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isNil === 'function', 'isNil is a Function');
    -	//t.deepEqual(isNil(args..), 'Expected');
    -	//t.equal(isNil(args..), 'Expected');
    -	//t.false(isNil(args..), 'Expected');
    -	//t.throws(isNil(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isNil === 'function', 'isNil is a Function');
    +  //t.deepEqual(isNil(args..), 'Expected');
    +  //t.equal(isNil(args..), 'Expected');
    +  //t.false(isNil(args..), 'Expected');
    +  //t.throws(isNil(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isNull/isNull.test.js b/test/isNull/isNull.test.js
    index 4244872b0..dbc7d20c8 100644
    --- a/test/isNull/isNull.test.js
    +++ b/test/isNull/isNull.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const isNull = require('./isNull.js');
     
     test('Testing isNull', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isNull === 'function', 'isNull is a Function');
    -	t.equal(isNull(null), true, "passed argument is a null");
    -	t.equal(isNull(NaN), false, "passed argument is a null");
    -	//t.deepEqual(isNull(args..), 'Expected');
    -	//t.equal(isNull(args..), 'Expected');
    -	//t.false(isNull(args..), 'Expected');
    -	//t.throws(isNull(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isNull === 'function', 'isNull is a Function');
    +  t.equal(isNull(null), true, "passed argument is a null");
    +  t.equal(isNull(NaN), false, "passed argument is a null");
    +  //t.deepEqual(isNull(args..), 'Expected');
    +  //t.equal(isNull(args..), 'Expected');
    +  //t.false(isNull(args..), 'Expected');
    +  //t.throws(isNull(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isNumber/isNumber.test.js b/test/isNumber/isNumber.test.js
    index 3845c0818..90af5bb5b 100644
    --- a/test/isNumber/isNumber.test.js
    +++ b/test/isNumber/isNumber.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const isNumber = require('./isNumber.js');
     
     test('Testing isNumber', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isNumber === 'function', 'isNumber is a Function');
    -	t.equal(isNumber(1), true, "passed argument is a number");
    -	t.equal(isNumber('1'), false, "passed argument is not a number");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isNumber === 'function', 'isNumber is a Function');
    +  t.equal(isNumber(1), true, "passed argument is a number");
    +  t.equal(isNumber('1'), false, "passed argument is not a number");
     
    -	//t.deepEqual(isNumber(args..), 'Expected');
    -	//t.equal(isNumber(args..), 'Expected');
    -	//t.false(isNumber(args..), 'Expected');
    -	//t.throws(isNumber(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(isNumber(args..), 'Expected');
    +  //t.equal(isNumber(args..), 'Expected');
    +  //t.false(isNumber(args..), 'Expected');
    +  //t.throws(isNumber(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isObject/isObject.test.js b/test/isObject/isObject.test.js
    index b9a2e77b1..8ed7620c8 100644
    --- a/test/isObject/isObject.test.js
    +++ b/test/isObject/isObject.test.js
    @@ -2,18 +2,18 @@ const test = require('tape');
     const isObject = require('./isObject.js');
     
     test('Testing isObject', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isObject === 'function', 'isObject is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isObject === 'function', 'isObject is a Function');
     
    -	t.true(isObject([1, 2, 3, 4]), 'isObject([1, 2, 3, 4]) is a object');
    -	t.true(isObject([]), 'isObject([]) is a object');
    -	t.true(isObject({ a:1 }), 'isObject({ a:1 }) is a object');
    -	t.false(isObject(true), 'isObject(true) is not a object');
    +  t.true(isObject([1, 2, 3, 4]), 'isObject([1, 2, 3, 4]) is a object');
    +  t.true(isObject([]), 'isObject([]) is a object');
    +  t.true(isObject({ a:1 }), 'isObject({ a:1 }) is a object');
    +  t.false(isObject(true), 'isObject(true) is not a object');
     
    -	//t.deepEqual(isObject(args..), 'Expected');
    -	//t.equal(isObject(args..), 'Expected');
    -	//t.false(isObject(args..), 'Expected');
    -	//t.throws(isObject(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(isObject(args..), 'Expected');
    +  //t.equal(isObject(args..), 'Expected');
    +  //t.false(isObject(args..), 'Expected');
    +  //t.throws(isObject(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js
    index 48f3a5c72..aa9f7b7e8 100644
    --- a/test/isObjectLike/isObjectLike.test.js
    +++ b/test/isObjectLike/isObjectLike.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isObjectLike = require('./isObjectLike.js');
     
     test('Testing isObjectLike', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isObjectLike === 'function', 'isObjectLike is a Function');
    -	//t.deepEqual(isObjectLike(args..), 'Expected');
    -	//t.equal(isObjectLike(args..), 'Expected');
    -	//t.false(isObjectLike(args..), 'Expected');
    -	//t.throws(isObjectLike(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isObjectLike === 'function', 'isObjectLike is a Function');
    +  //t.deepEqual(isObjectLike(args..), 'Expected');
    +  //t.equal(isObjectLike(args..), 'Expected');
    +  //t.false(isObjectLike(args..), 'Expected');
    +  //t.throws(isObjectLike(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js
    index 6e749b2c3..9de8feba3 100644
    --- a/test/isPlainObject/isPlainObject.test.js
    +++ b/test/isPlainObject/isPlainObject.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isPlainObject = require('./isPlainObject.js');
     
     test('Testing isPlainObject', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isPlainObject === 'function', 'isPlainObject is a Function');
    -	//t.deepEqual(isPlainObject(args..), 'Expected');
    -	//t.equal(isPlainObject(args..), 'Expected');
    -	//t.false(isPlainObject(args..), 'Expected');
    -	//t.throws(isPlainObject(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isPlainObject === 'function', 'isPlainObject is a Function');
    +  //t.deepEqual(isPlainObject(args..), 'Expected');
    +  //t.equal(isPlainObject(args..), 'Expected');
    +  //t.false(isPlainObject(args..), 'Expected');
    +  //t.throws(isPlainObject(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isPrime/isPrime.test.js b/test/isPrime/isPrime.test.js
    index 7d0fdda19..8d7ce3b8b 100644
    --- a/test/isPrime/isPrime.test.js
    +++ b/test/isPrime/isPrime.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const isPrime = require('./isPrime.js');
     
     test('Testing isPrime', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isPrime === 'function', 'isPrime is a Function');
    -	t.equal(isPrime(11), true, "passed number is a prime");
    -	//t.deepEqual(isPrime(args..), 'Expected');
    -	//t.equal(isPrime(args..), 'Expected');
    -	//t.false(isPrime(args..), 'Expected');
    -	//t.throws(isPrime(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isPrime === 'function', 'isPrime is a Function');
    +  t.equal(isPrime(11), true, "passed number is a prime");
    +  //t.deepEqual(isPrime(args..), 'Expected');
    +  //t.equal(isPrime(args..), 'Expected');
    +  //t.false(isPrime(args..), 'Expected');
    +  //t.throws(isPrime(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js
    index 2cebc77ff..3e0a21076 100644
    --- a/test/isPrimitive/isPrimitive.test.js
    +++ b/test/isPrimitive/isPrimitive.test.js
    @@ -2,23 +2,23 @@ const test = require('tape');
     const isPrimitive = require('./isPrimitive.js');
     
     test('Testing isPrimitive', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function');
       t.true(isPrimitive(null), "isPrimitive(null) is primitive");
       t.true(isPrimitive(undefined), "isPrimitive(undefined) is primitive");
       t.true(isPrimitive('string'), "isPrimitive(string) is primitive");
    -	t.true(isPrimitive(true), "isPrimitive(true) is primitive");
    -	t.true(isPrimitive(50), "isPrimitive(50) is primitive");
    -	t.true(isPrimitive('Hello'), "isPrimitive('Hello') is primitive");
    -	t.true(isPrimitive(false), "isPrimitive(false) is primitive");
    -	t.true(isPrimitive(Symbol()), "isPrimitive(Symbol()) is primitive");
    -	t.false(isPrimitive([1, 2, 3]), "isPrimitive([1, 2, 3]) is not primitive");
    +  t.true(isPrimitive(true), "isPrimitive(true) is primitive");
    +  t.true(isPrimitive(50), "isPrimitive(50) is primitive");
    +  t.true(isPrimitive('Hello'), "isPrimitive('Hello') is primitive");
    +  t.true(isPrimitive(false), "isPrimitive(false) is primitive");
    +  t.true(isPrimitive(Symbol()), "isPrimitive(Symbol()) is primitive");
    +  t.false(isPrimitive([1, 2, 3]), "isPrimitive([1, 2, 3]) is not primitive");
       t.false(isPrimitive({ a: 123 }), "isPrimitive({ a: 123 }) is not primitive");
       
       let start = new Date().getTime();
       isPrimitive({ a: 123 });
       let end = new Date().getTime();  
       t.true((end - start) < 2000, 'isPrimitive({ a: 123 }) takes less than 2s to run');
    -	t.end();
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isPromiseLike/isPromiseLike.test.js b/test/isPromiseLike/isPromiseLike.test.js
    index 2a8234343..b84a7c798 100644
    --- a/test/isPromiseLike/isPromiseLike.test.js
    +++ b/test/isPromiseLike/isPromiseLike.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isPromiseLike = require('./isPromiseLike.js');
     
     test('Testing isPromiseLike', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isPromiseLike === 'function', 'isPromiseLike is a Function');
    -	//t.deepEqual(isPromiseLike(args..), 'Expected');
    -	//t.equal(isPromiseLike(args..), 'Expected');
    -	//t.false(isPromiseLike(args..), 'Expected');
    -	//t.throws(isPromiseLike(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isPromiseLike === 'function', 'isPromiseLike is a Function');
    +  //t.deepEqual(isPromiseLike(args..), 'Expected');
    +  //t.equal(isPromiseLike(args..), 'Expected');
    +  //t.false(isPromiseLike(args..), 'Expected');
    +  //t.throws(isPromiseLike(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isRegExp/isRegExp.test.js b/test/isRegExp/isRegExp.test.js
    index f896a6a62..2580a138d 100644
    --- a/test/isRegExp/isRegExp.test.js
    +++ b/test/isRegExp/isRegExp.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isRegExp = require('./isRegExp.js');
     
     test('Testing isRegExp', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isRegExp === 'function', 'isRegExp is a Function');
    -	//t.deepEqual(isRegExp(args..), 'Expected');
    -	//t.equal(isRegExp(args..), 'Expected');
    -	//t.false(isRegExp(args..), 'Expected');
    -	//t.throws(isRegExp(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isRegExp === 'function', 'isRegExp is a Function');
    +  //t.deepEqual(isRegExp(args..), 'Expected');
    +  //t.equal(isRegExp(args..), 'Expected');
    +  //t.false(isRegExp(args..), 'Expected');
    +  //t.throws(isRegExp(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isSet/isSet.test.js b/test/isSet/isSet.test.js
    index 757064687..81fae132b 100644
    --- a/test/isSet/isSet.test.js
    +++ b/test/isSet/isSet.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isSet = require('./isSet.js');
     
     test('Testing isSet', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isSet === 'function', 'isSet is a Function');
    -	//t.deepEqual(isSet(args..), 'Expected');
    -	//t.equal(isSet(args..), 'Expected');
    -	//t.false(isSet(args..), 'Expected');
    -	//t.throws(isSet(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isSet === 'function', 'isSet is a Function');
    +  //t.deepEqual(isSet(args..), 'Expected');
    +  //t.equal(isSet(args..), 'Expected');
    +  //t.false(isSet(args..), 'Expected');
    +  //t.throws(isSet(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js
    index 183435cd4..9d80c6c8e 100644
    --- a/test/isSorted/isSorted.test.js
    +++ b/test/isSorted/isSorted.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const isSorted = require('./isSorted.js');
     
     test('Testing isSorted', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isSorted === 'function', 'isSorted is a Function');
    -	//t.deepEqual(isSorted(args..), 'Expected');
    -	t.equal(isSorted([0, 1, 2, 2]), 1, 'Array is sorted in ascending order');
    -	t.equal(isSorted([4, 3, 2]), -1, 'Array is sorted in descending order');
    -	t.equal(isSorted([4, 3, 5]), 0, 'Array is not sorted, direction changed in array')
    -	//t.false(isSorted(args..), 'Expected');
    -	//t.throws(isSorted(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isSorted === 'function', 'isSorted is a Function');
    +  //t.deepEqual(isSorted(args..), 'Expected');
    +  t.equal(isSorted([0, 1, 2, 2]), 1, 'Array is sorted in ascending order');
    +  t.equal(isSorted([4, 3, 2]), -1, 'Array is sorted in descending order');
    +  t.equal(isSorted([4, 3, 5]), 0, 'Array is not sorted, direction changed in array')
    +  //t.false(isSorted(args..), 'Expected');
    +  //t.throws(isSorted(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isString/isString.test.js b/test/isString/isString.test.js
    index 7d47db410..f48d8cfe0 100644
    --- a/test/isString/isString.test.js
    +++ b/test/isString/isString.test.js
    @@ -2,18 +2,18 @@ const test = require('tape');
     const isString = require('./isString.js');
     
     test('Testing isString', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isString === 'function', 'isString is a Function');
    -	t.equal(isString('foo'), true, 'foo is a string');
    -	t.equal(isString('10'), true, '"10" is a string');
    -	t.equal(isString(''), true, 'Empty string is a string');
    -	t.equal(isString(10), false, '10 is not a string');
    -	t.equal(isString(true), false, 'true is not string');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isString === 'function', 'isString is a Function');
    +  t.equal(isString('foo'), true, 'foo is a string');
    +  t.equal(isString('10'), true, '"10" is a string');
    +  t.equal(isString(''), true, 'Empty string is a string');
    +  t.equal(isString(10), false, '10 is not a string');
    +  t.equal(isString(true), false, 'true is not string');
     
    -	//t.deepEqual(isString(args..), 'Expected');
    -	//t.equal(isString(args..), 'Expected');
    -	//t.false(isString(args..), 'Expected');
    -	//t.throws(isString(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(isString(args..), 'Expected');
    +  //t.equal(isString(args..), 'Expected');
    +  //t.false(isString(args..), 'Expected');
    +  //t.throws(isString(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js
    index 7b7a2876b..24a4defdf 100644
    --- a/test/isSymbol/isSymbol.test.js
    +++ b/test/isSymbol/isSymbol.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const isSymbol = require('./isSymbol.js');
     
     test('Testing isSymbol', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isSymbol === 'function', 'isSymbol is a Function');
    -	t.equal(isSymbol(Symbol('x')), true, "Checks if the given argument is a symbol");
    -	//t.deepEqual(isSymbol(args..), 'Expected');
    -	//t.equal(isSymbol(args..), 'Expected');
    -	//t.false(isSymbol(args..), 'Expected');
    -	//t.throws(isSymbol(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isSymbol === 'function', 'isSymbol is a Function');
    +  t.equal(isSymbol(Symbol('x')), true, "Checks if the given argument is a symbol");
    +  //t.deepEqual(isSymbol(args..), 'Expected');
    +  //t.equal(isSymbol(args..), 'Expected');
    +  //t.false(isSymbol(args..), 'Expected');
    +  //t.throws(isSymbol(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isTravisCI/isTravisCI.test.js b/test/isTravisCI/isTravisCI.test.js
    index e6278bcaf..603bffd6f 100644
    --- a/test/isTravisCI/isTravisCI.test.js
    +++ b/test/isTravisCI/isTravisCI.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isTravisCI = require('./isTravisCI.js');
     
     test('Testing isTravisCI', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isTravisCI === 'function', 'isTravisCI is a Function');
    -	//t.deepEqual(isTravisCI(args..), 'Expected');
    -	//t.equal(isTravisCI(args..), 'Expected');
    -	//t.false(isTravisCI(args..), 'Expected');
    -	//t.throws(isTravisCI(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isTravisCI === 'function', 'isTravisCI is a Function');
    +  //t.deepEqual(isTravisCI(args..), 'Expected');
    +  //t.equal(isTravisCI(args..), 'Expected');
    +  //t.false(isTravisCI(args..), 'Expected');
    +  //t.throws(isTravisCI(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isTypedArray/isTypedArray.test.js b/test/isTypedArray/isTypedArray.test.js
    index abe111200..75253822d 100644
    --- a/test/isTypedArray/isTypedArray.test.js
    +++ b/test/isTypedArray/isTypedArray.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isTypedArray = require('./isTypedArray.js');
     
     test('Testing isTypedArray', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isTypedArray === 'function', 'isTypedArray is a Function');
    -	//t.deepEqual(isTypedArray(args..), 'Expected');
    -	//t.equal(isTypedArray(args..), 'Expected');
    -	//t.false(isTypedArray(args..), 'Expected');
    -	//t.throws(isTypedArray(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isTypedArray === 'function', 'isTypedArray is a Function');
    +  //t.deepEqual(isTypedArray(args..), 'Expected');
    +  //t.equal(isTypedArray(args..), 'Expected');
    +  //t.false(isTypedArray(args..), 'Expected');
    +  //t.throws(isTypedArray(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isUndefined/isUndefined.test.js b/test/isUndefined/isUndefined.test.js
    index 701faed0a..ce988c9ef 100644
    --- a/test/isUndefined/isUndefined.test.js
    +++ b/test/isUndefined/isUndefined.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isUndefined = require('./isUndefined.js');
     
     test('Testing isUndefined', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isUndefined === 'function', 'isUndefined is a Function');
    -	//t.deepEqual(isUndefined(args..), 'Expected');
    -	//t.equal(isUndefined(args..), 'Expected');
    -	//t.false(isUndefined(args..), 'Expected');
    -	//t.throws(isUndefined(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isUndefined === 'function', 'isUndefined is a Function');
    +  //t.deepEqual(isUndefined(args..), 'Expected');
    +  //t.equal(isUndefined(args..), 'Expected');
    +  //t.false(isUndefined(args..), 'Expected');
    +  //t.throws(isUndefined(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js
    index e42088f8e..a0b8e8a89 100644
    --- a/test/isUpperCase/isUpperCase.test.js
    +++ b/test/isUpperCase/isUpperCase.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const isUpperCase = require('./isUpperCase.js');
     
     test('Testing isUpperCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isUpperCase === 'function', 'isUpperCase is a Function');
    -	//t.deepEqual(isUpperCase(args..), 'Expected');
    -	t.equal(isUpperCase('ABC'), true, 'ABC is all upper case');
    -	t.equal(isUpperCase('abc'), false, 'abc is not all upper case');
    -	t.equal(isUpperCase('A3@$'), true, 'A3@$ is all uppercase');
    -	//t.false(isUpperCase(args..), 'Expected');
    -	//t.throws(isUpperCase(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isUpperCase === 'function', 'isUpperCase is a Function');
    +  //t.deepEqual(isUpperCase(args..), 'Expected');
    +  t.equal(isUpperCase('ABC'), true, 'ABC is all upper case');
    +  t.equal(isUpperCase('abc'), false, 'abc is not all upper case');
    +  t.equal(isUpperCase('A3@$'), true, 'A3@$ is all uppercase');
    +  //t.false(isUpperCase(args..), 'Expected');
    +  //t.throws(isUpperCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js
    index 1c38c04d0..b0ad1dac5 100644
    --- a/test/isValidJSON/isValidJSON.test.js
    +++ b/test/isValidJSON/isValidJSON.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const isValidJSON = require('./isValidJSON.js');
     
     test('Testing isValidJSON', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isValidJSON === 'function', 'isValidJSON is a Function');
    -	t.equal(isValidJSON('{"name":"Adam","age":20}'), true, '{"name":"Adam","age":20} is a valid JSON');
    -	t.equal(isValidJSON('{"name":"Adam",age:"20"}'), false, '{"name":"Adam",age:"20"} is not a valid JSON');
    -	t.equal(isValidJSON(null), true, 'null is a valid JSON');
    -	//t.deepEqual(isValidJSON(args..), 'Expected');
    -	//t.equal(isValidJSON(args..), 'Expected');
    -	//t.false(isValidJSON(args..), 'Expected');
    -	//t.throws(isValidJSON(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isValidJSON === 'function', 'isValidJSON is a Function');
    +  t.equal(isValidJSON('{"name":"Adam","age":20}'), true, '{"name":"Adam","age":20} is a valid JSON');
    +  t.equal(isValidJSON('{"name":"Adam",age:"20"}'), false, '{"name":"Adam",age:"20"} is not a valid JSON');
    +  t.equal(isValidJSON(null), true, 'null is a valid JSON');
    +  //t.deepEqual(isValidJSON(args..), 'Expected');
    +  //t.equal(isValidJSON(args..), 'Expected');
    +  //t.false(isValidJSON(args..), 'Expected');
    +  //t.throws(isValidJSON(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isWeakMap/isWeakMap.test.js b/test/isWeakMap/isWeakMap.test.js
    index f691dad74..72bb4544a 100644
    --- a/test/isWeakMap/isWeakMap.test.js
    +++ b/test/isWeakMap/isWeakMap.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isWeakMap = require('./isWeakMap.js');
     
     test('Testing isWeakMap', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isWeakMap === 'function', 'isWeakMap is a Function');
    -	//t.deepEqual(isWeakMap(args..), 'Expected');
    -	//t.equal(isWeakMap(args..), 'Expected');
    -	//t.false(isWeakMap(args..), 'Expected');
    -	//t.throws(isWeakMap(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isWeakMap === 'function', 'isWeakMap is a Function');
    +  //t.deepEqual(isWeakMap(args..), 'Expected');
    +  //t.equal(isWeakMap(args..), 'Expected');
    +  //t.false(isWeakMap(args..), 'Expected');
    +  //t.throws(isWeakMap(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/isWeakSet/isWeakSet.test.js b/test/isWeakSet/isWeakSet.test.js
    index ca333cf3a..3bb390cde 100644
    --- a/test/isWeakSet/isWeakSet.test.js
    +++ b/test/isWeakSet/isWeakSet.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const isWeakSet = require('./isWeakSet.js');
     
     test('Testing isWeakSet', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof isWeakSet === 'function', 'isWeakSet is a Function');
    -	//t.deepEqual(isWeakSet(args..), 'Expected');
    -	//t.equal(isWeakSet(args..), 'Expected');
    -	//t.false(isWeakSet(args..), 'Expected');
    -	//t.throws(isWeakSet(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof isWeakSet === 'function', 'isWeakSet is a Function');
    +  //t.deepEqual(isWeakSet(args..), 'Expected');
    +  //t.equal(isWeakSet(args..), 'Expected');
    +  //t.false(isWeakSet(args..), 'Expected');
    +  //t.throws(isWeakSet(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/join/join.test.js b/test/join/join.test.js
    index e0238a7b7..385ef56b8 100644
    --- a/test/join/join.test.js
    +++ b/test/join/join.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const join = require('./join.js');
     
     test('Testing join', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof join === 'function', 'join is a Function');
    -	t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'), "pen,pineapple,apple&pen", "Joins all elements of an array into a string and returns this string");
    -	t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ','), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string");
    -	t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen']), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof join === 'function', 'join is a Function');
    +  t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'), "pen,pineapple,apple&pen", "Joins all elements of an array into a string and returns this string");
    +  t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ','), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string");
    +  t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen']), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string");
     
    -	//t.deepEqual(join(args..), 'Expected');
    -	//t.equal(join(args..), 'Expected');
    -	//t.false(join(args..), 'Expected');
    -	//t.throws(join(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(join(args..), 'Expected');
    +  //t.equal(join(args..), 'Expected');
    +  //t.false(join(args..), 'Expected');
    +  //t.throws(join(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/last/last.test.js b/test/last/last.test.js
    index 528a363ab..fc0ba799c 100644
    --- a/test/last/last.test.js
    +++ b/test/last/last.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const last = require('./last.js');
     
     test('Testing last', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof last === 'function', 'last is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof last === 'function', 'last is a Function');
       t.true(last({ a: 1234}) === undefined, 'last({ a: 1234}) returns undefined');
       t.equal(last([1, 2, 3]), 3, "last([1, 2, 3]) returns 3");
       t.equal(last({ 0: false}), undefined, 'last({ 0: false}) returns undefined');
    -	t.equal(last('String'), 'g', 'last(String) returns g');
    +  t.equal(last('String'), 'g', 'last(String) returns g');
       t.throws(() => last(null), 'last(null) throws an Error');
       t.throws(() => last(undefined), 'last(undefined) throws an Error');
       t.throws(() => last(), 'last() throws an Error');
    @@ -17,5 +17,5 @@ test('Testing last', (t) => {
       last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]);
       let end = new Date().getTime();
       t.true((end - start) < 2000, 'last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run');
    -	t.end();
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js
    index 469dce174..cba81345c 100644
    --- a/test/lcm/lcm.test.js
    +++ b/test/lcm/lcm.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const lcm = require('./lcm.js');
     
     test('Testing lcm', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof lcm === 'function', 'lcm is a Function');
    -	t.equal(lcm(12, 7), 84, "Returns the least common multiple of two or more numbers.");
    -	t.equal(lcm(...[1, 3, 4, 5]), 60, "Returns the least common multiple of two or more numbers.");
    -	//t.deepEqual(lcm(args..), 'Expected');
    -	//t.equal(lcm(args..), 'Expected');
    -	//t.false(lcm(args..), 'Expected');
    -	//t.throws(lcm(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof lcm === 'function', 'lcm is a Function');
    +  t.equal(lcm(12, 7), 84, "Returns the least common multiple of two or more numbers.");
    +  t.equal(lcm(...[1, 3, 4, 5]), 60, "Returns the least common multiple of two or more numbers.");
    +  //t.deepEqual(lcm(args..), 'Expected');
    +  //t.equal(lcm(args..), 'Expected');
    +  //t.false(lcm(args..), 'Expected');
    +  //t.throws(lcm(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js
    index 9e09b19c2..ae4b53739 100644
    --- a/test/longestItem/longestItem.test.js
    +++ b/test/longestItem/longestItem.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const longestItem = require('./longestItem.js');
     
     test('Testing longestItem', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof longestItem === 'function', 'longestItem is a Function');
    -	t.deepEqual(longestItem('this', 'is', 'a', 'testcase'), 'testcase', "Returns the longest object");
    -	//t.deepEqual(longestItem(args..), 'Expected');
    -	//t.equal(longestItem(args..), 'Expected');
    -	//t.false(longestItem(args..), 'Expected');
    -	//t.throws(longestItem(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof longestItem === 'function', 'longestItem is a Function');
    +  t.deepEqual(longestItem('this', 'is', 'a', 'testcase'), 'testcase', "Returns the longest object");
    +  //t.deepEqual(longestItem(args..), 'Expected');
    +  //t.equal(longestItem(args..), 'Expected');
    +  //t.false(longestItem(args..), 'Expected');
    +  //t.throws(longestItem(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/lowercaseKeys/lowercaseKeys.test.js b/test/lowercaseKeys/lowercaseKeys.test.js
    index a3a697e00..d1069cb19 100644
    --- a/test/lowercaseKeys/lowercaseKeys.test.js
    +++ b/test/lowercaseKeys/lowercaseKeys.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const lowercaseKeys = require('./lowercaseKeys.js');
     
     test('Testing lowercaseKeys', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof lowercaseKeys === 'function', 'lowercaseKeys is a Function');
    -	//t.deepEqual(lowercaseKeys(args..), 'Expected');
    -	//t.equal(lowercaseKeys(args..), 'Expected');
    -	//t.false(lowercaseKeys(args..), 'Expected');
    -	//t.throws(lowercaseKeys(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof lowercaseKeys === 'function', 'lowercaseKeys is a Function');
    +  //t.deepEqual(lowercaseKeys(args..), 'Expected');
    +  //t.equal(lowercaseKeys(args..), 'Expected');
    +  //t.false(lowercaseKeys(args..), 'Expected');
    +  //t.throws(lowercaseKeys(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js
    index b53fe9c36..e044cbd85 100644
    --- a/test/luhnCheck/luhnCheck.test.js
    +++ b/test/luhnCheck/luhnCheck.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const luhnCheck = require('./luhnCheck.js');
     
     test('Testing luhnCheck', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof luhnCheck === 'function', 'luhnCheck is a Function');
    -	t.equal(luhnCheck(6011329933655299), false, "validates identification number");
    -	t.equal(luhnCheck('4485275742308327'), true, "validates identification number");
    -	t.equal(luhnCheck(123456789), false, "validates identification number");
    -	//t.deepEqual(luhnCheck(args..), 'Expected');
    -	//t.equal(luhnCheck(args..), 'Expected');
    -	//t.false(luhnCheck(args..), 'Expected');
    -	//t.throws(luhnCheck(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof luhnCheck === 'function', 'luhnCheck is a Function');
    +  t.equal(luhnCheck(6011329933655299), false, "validates identification number");
    +  t.equal(luhnCheck('4485275742308327'), true, "validates identification number");
    +  t.equal(luhnCheck(123456789), false, "validates identification number");
    +  //t.deepEqual(luhnCheck(args..), 'Expected');
    +  //t.equal(luhnCheck(args..), 'Expected');
    +  //t.false(luhnCheck(args..), 'Expected');
    +  //t.throws(luhnCheck(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js
    index a2b7ea63a..0522146fe 100644
    --- a/test/mapKeys/mapKeys.test.js
    +++ b/test/mapKeys/mapKeys.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const mapKeys = require('./mapKeys.js');
     
     test('Testing mapKeys', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof mapKeys === 'function', 'mapKeys is a Function');
    -	//t.deepEqual(mapKeys(args..), 'Expected');
    -	//t.equal(mapKeys(args..), 'Expected');
    -	//t.false(mapKeys(args..), 'Expected');
    -	//t.throws(mapKeys(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof mapKeys === 'function', 'mapKeys is a Function');
    +  //t.deepEqual(mapKeys(args..), 'Expected');
    +  //t.equal(mapKeys(args..), 'Expected');
    +  //t.false(mapKeys(args..), 'Expected');
    +  //t.throws(mapKeys(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js
    index d534b43b0..044c43b19 100644
    --- a/test/mapObject/mapObject.test.js
    +++ b/test/mapObject/mapObject.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const mapObject = require('./mapObject.js');
     
     test('Testing mapObject', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof mapObject === 'function', 'mapObject is a Function');
    -	const squareIt = arr => mapObject(arr, a => a * a);
    -	t.deepEqual(squareIt([1, 2, 3]), { 1: 1, 2: 4, 3: 9 }, "Maps the values of an array to an object using a function");
    -	//t.deepEqual(mapObject(args..), 'Expected');
    -	//t.equal(mapObject(args..), 'Expected');
    -	//t.false(mapObject(args..), 'Expected');
    -	//t.throws(mapObject(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof mapObject === 'function', 'mapObject is a Function');
    +  const squareIt = arr => mapObject(arr, a => a * a);
    +  t.deepEqual(squareIt([1, 2, 3]), { 1: 1, 2: 4, 3: 9 }, "Maps the values of an array to an object using a function");
    +  //t.deepEqual(mapObject(args..), 'Expected');
    +  //t.equal(mapObject(args..), 'Expected');
    +  //t.false(mapObject(args..), 'Expected');
    +  //t.throws(mapObject(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/mapValues/mapValues.test.js b/test/mapValues/mapValues.test.js
    index e30e06c66..741e4f4f3 100644
    --- a/test/mapValues/mapValues.test.js
    +++ b/test/mapValues/mapValues.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const mapValues = require('./mapValues.js');
     
     test('Testing mapValues', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof mapValues === 'function', 'mapValues is a Function');
    -	//t.deepEqual(mapValues(args..), 'Expected');
    -	//t.equal(mapValues(args..), 'Expected');
    -	//t.false(mapValues(args..), 'Expected');
    -	//t.throws(mapValues(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof mapValues === 'function', 'mapValues is a Function');
    +  //t.deepEqual(mapValues(args..), 'Expected');
    +  //t.equal(mapValues(args..), 'Expected');
    +  //t.false(mapValues(args..), 'Expected');
    +  //t.throws(mapValues(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/mask/mask.test.js b/test/mask/mask.test.js
    index b423586cf..dc57ed888 100644
    --- a/test/mask/mask.test.js
    +++ b/test/mask/mask.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const mask = require('./mask.js');
     
     test('Testing mask', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof mask === 'function', 'mask is a Function');
    -	t.equal(mask(1234567890), '******7890', "Replaces all but the last num of characters with the specified mask character");
    -	t.equal(mask(1234567890, 3), '*******890', "Replaces all but the last num of characters with the specified mask character");
    -	t.equal(mask(1234567890, -4, '$'), '$$$$567890', "Replaces all but the last num of characters with the specified mask character");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof mask === 'function', 'mask is a Function');
    +  t.equal(mask(1234567890), '******7890', "Replaces all but the last num of characters with the specified mask character");
    +  t.equal(mask(1234567890, 3), '*******890', "Replaces all but the last num of characters with the specified mask character");
    +  t.equal(mask(1234567890, -4, '$'), '$$$$567890', "Replaces all but the last num of characters with the specified mask character");
     
    -	//t.equal(mask(args..), 'Expected');
    -	//t.false(mask(args..), 'Expected');
    -	//t.throws(mask(args..), 'Expected');
    -	t.end();
    +  //t.equal(mask(args..), 'Expected');
    +  //t.false(mask(args..), 'Expected');
    +  //t.throws(mask(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/matches/matches.test.js b/test/matches/matches.test.js
    index 8bf340a59..82fd66a08 100644
    --- a/test/matches/matches.test.js
    +++ b/test/matches/matches.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const matches = require('./matches.js');
     
     test('Testing matches', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof matches === 'function', 'matches is a Function');
    -	//t.deepEqual(matches(args..), 'Expected');
    -	//t.equal(matches(args..), 'Expected');
    -	//t.false(matches(args..), 'Expected');
    -	//t.throws(matches(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof matches === 'function', 'matches is a Function');
    +  //t.deepEqual(matches(args..), 'Expected');
    +  //t.equal(matches(args..), 'Expected');
    +  //t.false(matches(args..), 'Expected');
    +  //t.throws(matches(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/matchesWith/matchesWith.test.js b/test/matchesWith/matchesWith.test.js
    index 0faa74a62..b7f696224 100644
    --- a/test/matchesWith/matchesWith.test.js
    +++ b/test/matchesWith/matchesWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const matchesWith = require('./matchesWith.js');
     
     test('Testing matchesWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof matchesWith === 'function', 'matchesWith is a Function');
    -	//t.deepEqual(matchesWith(args..), 'Expected');
    -	//t.equal(matchesWith(args..), 'Expected');
    -	//t.false(matchesWith(args..), 'Expected');
    -	//t.throws(matchesWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof matchesWith === 'function', 'matchesWith is a Function');
    +  //t.deepEqual(matchesWith(args..), 'Expected');
    +  //t.equal(matchesWith(args..), 'Expected');
    +  //t.false(matchesWith(args..), 'Expected');
    +  //t.throws(matchesWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js
    index 1fff2c517..3c0d156b3 100644
    --- a/test/maxBy/maxBy.test.js
    +++ b/test/maxBy/maxBy.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const maxBy = require('./maxBy.js');
     
     test('Testing maxBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof maxBy === 'function', 'maxBy is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof maxBy === 'function', 'maxBy is a Function');
       t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 8, 'Produces the right result with a function');
       t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 8, 'Produces the right result with a property name');
    -	//t.deepEqual(maxBy(args..), 'Expected');
    -	//t.equal(maxBy(args..), 'Expected');
    -	//t.false(maxBy(args..), 'Expected');
    -	//t.throws(maxBy(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(maxBy(args..), 'Expected');
    +  //t.equal(maxBy(args..), 'Expected');
    +  //t.false(maxBy(args..), 'Expected');
    +  //t.throws(maxBy(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js
    index 085f54341..89e14ab98 100644
    --- a/test/maxN/maxN.test.js
    +++ b/test/maxN/maxN.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const maxN = require('./maxN.js');
     
     test('Testing maxN', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof maxN === 'function', 'maxN is a Function');
    -	t.deepEqual(maxN([1, 2, 3]), [3], "Returns the n maximum elements from the provided array");
    -	t.deepEqual(maxN([1, 2, 3], 2), [3, 2], "Returns the n maximum elements from the provided array");
    -	//t.deepEqual(maxN(args..), 'Expected');
    -	//t.equal(maxN(args..), 'Expected');
    -	//t.false(maxN(args..), 'Expected');
    -	//t.throws(maxN(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof maxN === 'function', 'maxN is a Function');
    +  t.deepEqual(maxN([1, 2, 3]), [3], "Returns the n maximum elements from the provided array");
    +  t.deepEqual(maxN([1, 2, 3], 2), [3, 2], "Returns the n maximum elements from the provided array");
    +  //t.deepEqual(maxN(args..), 'Expected');
    +  //t.equal(maxN(args..), 'Expected');
    +  //t.false(maxN(args..), 'Expected');
    +  //t.throws(maxN(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/median/median.test.js b/test/median/median.test.js
    index bfb1a5cfc..9fa44be9c 100644
    --- a/test/median/median.test.js
    +++ b/test/median/median.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const median = require('./median.js');
     
     test('Testing median', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof median === 'function', 'median is a Function');
    -	t.equal(median([5, 6, 50, 1, -5]), 5, "Returns the median of an array of numbers");
    -	t.equal(median([1, 2, 3]), 2, "Returns the median of an array of numbers");
    -	//t.deepEqual(median(args..), 'Expected');
    -	//t.equal(median(args..), 'Expected');
    -	//t.false(median(args..), 'Expected');
    -	//t.throws(median(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof median === 'function', 'median is a Function');
    +  t.equal(median([5, 6, 50, 1, -5]), 5, "Returns the median of an array of numbers");
    +  t.equal(median([1, 2, 3]), 2, "Returns the median of an array of numbers");
    +  //t.deepEqual(median(args..), 'Expected');
    +  //t.equal(median(args..), 'Expected');
    +  //t.false(median(args..), 'Expected');
    +  //t.throws(median(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/memoize/memoize.test.js b/test/memoize/memoize.test.js
    index cf045ba86..d6eee6068 100644
    --- a/test/memoize/memoize.test.js
    +++ b/test/memoize/memoize.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const memoize = require('./memoize.js');
     
     test('Testing memoize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof memoize === 'function', 'memoize is a Function');
    -	//t.deepEqual(memoize(args..), 'Expected');
    -	//t.equal(memoize(args..), 'Expected');
    -	//t.false(memoize(args..), 'Expected');
    -	//t.throws(memoize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof memoize === 'function', 'memoize is a Function');
    +  //t.deepEqual(memoize(args..), 'Expected');
    +  //t.equal(memoize(args..), 'Expected');
    +  //t.false(memoize(args..), 'Expected');
    +  //t.throws(memoize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/merge/merge.test.js b/test/merge/merge.test.js
    index 28ade12bd..1ed749488 100644
    --- a/test/merge/merge.test.js
    +++ b/test/merge/merge.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const merge = require('./merge.js');
     
     test('Testing merge', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof merge === 'function', 'merge is a Function');
    -	//t.deepEqual(merge(args..), 'Expected');
    -	//t.equal(merge(args..), 'Expected');
    -	//t.false(merge(args..), 'Expected');
    -	//t.throws(merge(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof merge === 'function', 'merge is a Function');
    +  //t.deepEqual(merge(args..), 'Expected');
    +  //t.equal(merge(args..), 'Expected');
    +  //t.false(merge(args..), 'Expected');
    +  //t.throws(merge(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/minBy/minBy.test.js b/test/minBy/minBy.test.js
    index 975fc6232..f2a0ca5ff 100644
    --- a/test/minBy/minBy.test.js
    +++ b/test/minBy/minBy.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const minBy = require('./minBy.js');
     
     test('Testing minBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof minBy === 'function', 'minBy is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof minBy === 'function', 'minBy is a Function');
       t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 2, 'Produces the right result with a function');
       t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 2, 'Produces the right result with a property name');
    -	//t.deepEqual(minBy(args..), 'Expected');
    -	//t.equal(minBy(args..), 'Expected');
    -	//t.false(minBy(args..), 'Expected');
    -	//t.throws(minBy(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(minBy(args..), 'Expected');
    +  //t.equal(minBy(args..), 'Expected');
    +  //t.false(minBy(args..), 'Expected');
    +  //t.throws(minBy(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/minN/minN.test.js b/test/minN/minN.test.js
    index 6d0460bf5..edfd36631 100644
    --- a/test/minN/minN.test.js
    +++ b/test/minN/minN.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const minN = require('./minN.js');
     
     test('Testing minN', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof minN === 'function', 'minN is a Function');
    -	t.deepEqual(minN([1, 2, 3]), [1], "Returns the n minimum elements from the provided array");
    -	t.deepEqual(minN([1, 2, 3], 2), [1, 2], "Returns the n minimum elements from the provided array");
    -	//t.equal(minN(args..), 'Expected');
    -	//t.false(minN(args..), 'Expected');
    -	//t.throws(minN(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof minN === 'function', 'minN is a Function');
    +  t.deepEqual(minN([1, 2, 3]), [1], "Returns the n minimum elements from the provided array");
    +  t.deepEqual(minN([1, 2, 3], 2), [1, 2], "Returns the n minimum elements from the provided array");
    +  //t.equal(minN(args..), 'Expected');
    +  //t.false(minN(args..), 'Expected');
    +  //t.throws(minN(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js
    index 0f761e218..8e85ef475 100644
    --- a/test/negate/negate.test.js
    +++ b/test/negate/negate.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const negate = require('./negate.js');
     
     test('Testing negate', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof negate === 'function', 'negate is a Function');
    -	t.deepEqual([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 == 0)), [1, 3, 5], "Negates a predicate function");
    -	//t.deepEqual(negate(args..), 'Expected');
    -	//t.equal(negate(args..), 'Expected');
    -	//t.false(negate(args..), 'Expected');
    -	//t.throws(negate(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof negate === 'function', 'negate is a Function');
    +  t.deepEqual([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 == 0)), [1, 3, 5], "Negates a predicate function");
    +  //t.deepEqual(negate(args..), 'Expected');
    +  //t.equal(negate(args..), 'Expected');
    +  //t.false(negate(args..), 'Expected');
    +  //t.throws(negate(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js
    index 626789aa5..6061c25e9 100644
    --- a/test/nthArg/nthArg.test.js
    +++ b/test/nthArg/nthArg.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const nthArg = require('./nthArg.js');
     
     test('Testing nthArg', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof nthArg === 'function', 'nthArg is a Function');
    -	//t.deepEqual(nthArg(args..), 'Expected');
    -	//t.equal(nthArg(args..), 'Expected');
    -	//t.false(nthArg(args..), 'Expected');
    -	//t.throws(nthArg(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof nthArg === 'function', 'nthArg is a Function');
    +  //t.deepEqual(nthArg(args..), 'Expected');
    +  //t.equal(nthArg(args..), 'Expected');
    +  //t.false(nthArg(args..), 'Expected');
    +  //t.throws(nthArg(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js
    index 4628abcda..6db6ddd4a 100644
    --- a/test/nthElement/nthElement.test.js
    +++ b/test/nthElement/nthElement.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const nthElement = require('./nthElement.js');
     
     test('Testing nthElement', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof nthElement === 'function', 'nthElement is a Function');
    -	t.equal(nthElement(['a', 'b', 'c'], 1), 'b', "Returns the nth element of an array.");
    -	t.equal(nthElement(['a', 'b', 'c'], -3), 'a', "Returns the nth element of an array.");
    -	//t.deepEqual(nthElement(args..), 'Expected');
    -	//t.equal(nthElement(args..), 'Expected');
    -	//t.false(nthElement(args..), 'Expected');
    -	//t.throws(nthElement(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof nthElement === 'function', 'nthElement is a Function');
    +  t.equal(nthElement(['a', 'b', 'c'], 1), 'b', "Returns the nth element of an array.");
    +  t.equal(nthElement(['a', 'b', 'c'], -3), 'a', "Returns the nth element of an array.");
    +  //t.deepEqual(nthElement(args..), 'Expected');
    +  //t.equal(nthElement(args..), 'Expected');
    +  //t.false(nthElement(args..), 'Expected');
    +  //t.throws(nthElement(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js
    index a661ac37f..af270b7cf 100644
    --- a/test/objectFromPairs/objectFromPairs.test.js
    +++ b/test/objectFromPairs/objectFromPairs.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const objectFromPairs = require('./objectFromPairs.js');
     
     test('Testing objectFromPairs', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof objectFromPairs === 'function', 'objectFromPairs is a Function');
    -	t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs.");
    -	//t.deepEqual(objectFromPairs(args..), 'Expected');
    -	//t.equal(objectFromPairs(args..), 'Expected');
    -	//t.false(objectFromPairs(args..), 'Expected');
    -	//t.throws(objectFromPairs(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof objectFromPairs === 'function', 'objectFromPairs is a Function');
    +  t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs.");
    +  //t.deepEqual(objectFromPairs(args..), 'Expected');
    +  //t.equal(objectFromPairs(args..), 'Expected');
    +  //t.false(objectFromPairs(args..), 'Expected');
    +  //t.throws(objectFromPairs(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/objectToPairs/objectToPairs.test.js b/test/objectToPairs/objectToPairs.test.js
    index 087092236..e3477d39b 100644
    --- a/test/objectToPairs/objectToPairs.test.js
    +++ b/test/objectToPairs/objectToPairs.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const objectToPairs = require('./objectToPairs.js');
     
     test('Testing objectToPairs', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof objectToPairs === 'function', 'objectToPairs is a Function');
    -	t.deepEqual(objectToPairs({ a: 1, b: 2 }), [['a',1],['b',2]], "Creates an array of key-value pair arrays from an object.");
    -	//t.deepEqual(objectToPairs(args..), 'Expected');
    -	//t.equal(objectToPairs(args..), 'Expected');
    -	//t.false(objectToPairs(args..), 'Expected');
    -	//t.throws(objectToPairs(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof objectToPairs === 'function', 'objectToPairs is a Function');
    +  t.deepEqual(objectToPairs({ a: 1, b: 2 }), [['a',1],['b',2]], "Creates an array of key-value pair arrays from an object.");
    +  //t.deepEqual(objectToPairs(args..), 'Expected');
    +  //t.equal(objectToPairs(args..), 'Expected');
    +  //t.false(objectToPairs(args..), 'Expected');
    +  //t.throws(objectToPairs(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/observeMutations/observeMutations.test.js b/test/observeMutations/observeMutations.test.js
    index eca8ff0d4..0c6d479a7 100644
    --- a/test/observeMutations/observeMutations.test.js
    +++ b/test/observeMutations/observeMutations.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const observeMutations = require('./observeMutations.js');
     
     test('Testing observeMutations', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof observeMutations === 'function', 'observeMutations is a Function');
    -	//t.deepEqual(observeMutations(args..), 'Expected');
    -	//t.equal(observeMutations(args..), 'Expected');
    -	//t.false(observeMutations(args..), 'Expected');
    -	//t.throws(observeMutations(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof observeMutations === 'function', 'observeMutations is a Function');
    +  //t.deepEqual(observeMutations(args..), 'Expected');
    +  //t.equal(observeMutations(args..), 'Expected');
    +  //t.false(observeMutations(args..), 'Expected');
    +  //t.throws(observeMutations(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/off/off.test.js b/test/off/off.test.js
    index b2cbbde08..030e7797a 100644
    --- a/test/off/off.test.js
    +++ b/test/off/off.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const off = require('./off.js');
     
     test('Testing off', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof off === 'function', 'off is a Function');
    -	//t.deepEqual(off(args..), 'Expected');
    -	//t.equal(off(args..), 'Expected');
    -	//t.false(off(args..), 'Expected');
    -	//t.throws(off(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof off === 'function', 'off is a Function');
    +  //t.deepEqual(off(args..), 'Expected');
    +  //t.equal(off(args..), 'Expected');
    +  //t.false(off(args..), 'Expected');
    +  //t.throws(off(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/omit/omit.test.js b/test/omit/omit.test.js
    index 207453a9c..27f191a04 100644
    --- a/test/omit/omit.test.js
    +++ b/test/omit/omit.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const omit = require('./omit.js');
     
     test('Testing omit', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof omit === 'function', 'omit is a Function');
    -	//t.deepEqual(omit(args..), 'Expected');
    -	//t.equal(omit(args..), 'Expected');
    -	//t.false(omit(args..), 'Expected');
    -	//t.throws(omit(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof omit === 'function', 'omit is a Function');
    +  //t.deepEqual(omit(args..), 'Expected');
    +  //t.equal(omit(args..), 'Expected');
    +  //t.false(omit(args..), 'Expected');
    +  //t.throws(omit(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js
    index f187ee9d6..c103338a8 100644
    --- a/test/omitBy/omitBy.test.js
    +++ b/test/omitBy/omitBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const omitBy = require('./omitBy.js');
     
     test('Testing omitBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof omitBy === 'function', 'omitBy is a Function');
    -	//t.deepEqual(omitBy(args..), 'Expected');
    -	//t.equal(omitBy(args..), 'Expected');
    -	//t.false(omitBy(args..), 'Expected');
    -	//t.throws(omitBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof omitBy === 'function', 'omitBy is a Function');
    +  //t.deepEqual(omitBy(args..), 'Expected');
    +  //t.equal(omitBy(args..), 'Expected');
    +  //t.false(omitBy(args..), 'Expected');
    +  //t.throws(omitBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/on/on.test.js b/test/on/on.test.js
    index 15a242fa9..5bfa58a76 100644
    --- a/test/on/on.test.js
    +++ b/test/on/on.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const on = require('./on.js');
     
     test('Testing on', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof on === 'function', 'on is a Function');
    -	//t.deepEqual(on(args..), 'Expected');
    -	//t.equal(on(args..), 'Expected');
    -	//t.false(on(args..), 'Expected');
    -	//t.throws(on(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof on === 'function', 'on is a Function');
    +  //t.deepEqual(on(args..), 'Expected');
    +  //t.equal(on(args..), 'Expected');
    +  //t.false(on(args..), 'Expected');
    +  //t.throws(on(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js
    index ee4b3dc14..c4c181806 100644
    --- a/test/onUserInputChange/onUserInputChange.test.js
    +++ b/test/onUserInputChange/onUserInputChange.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const onUserInputChange = require('./onUserInputChange.js');
     
     test('Testing onUserInputChange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof onUserInputChange === 'function', 'onUserInputChange is a Function');
    -	//t.deepEqual(onUserInputChange(args..), 'Expected');
    -	//t.equal(onUserInputChange(args..), 'Expected');
    -	//t.false(onUserInputChange(args..), 'Expected');
    -	//t.throws(onUserInputChange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof onUserInputChange === 'function', 'onUserInputChange is a Function');
    +  //t.deepEqual(onUserInputChange(args..), 'Expected');
    +  //t.equal(onUserInputChange(args..), 'Expected');
    +  //t.false(onUserInputChange(args..), 'Expected');
    +  //t.throws(onUserInputChange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/once/once.test.js b/test/once/once.test.js
    index bc0742b89..6d457fe01 100644
    --- a/test/once/once.test.js
    +++ b/test/once/once.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const once = require('./once.js');
     
     test('Testing once', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof once === 'function', 'once is a Function');
    -	//t.deepEqual(once(args..), 'Expected');
    -	//t.equal(once(args..), 'Expected');
    -	//t.false(once(args..), 'Expected');
    -	//t.throws(once(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof once === 'function', 'once is a Function');
    +  //t.deepEqual(once(args..), 'Expected');
    +  //t.equal(once(args..), 'Expected');
    +  //t.false(once(args..), 'Expected');
    +  //t.throws(once(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js
    index 4ee8706a2..2a721f61e 100644
    --- a/test/orderBy/orderBy.test.js
    +++ b/test/orderBy/orderBy.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const orderBy = require('./orderBy.js');
     
     test('Testing orderBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof orderBy === 'function', 'orderBy is a Function');
    -	const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }];
    -	t.deepEqual(orderBy(users, ['name', 'age'], ['asc', 'desc']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}], "Returns a sorted array of objects ordered by properties and orders.");
    -	t.deepEqual(orderBy(users, ['name', 'age']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}], "Returns a sorted array of objects ordered by properties and orders.");
    -	//t.deepEqual(orderBy(args..), 'Expected');
    -	//t.equal(orderBy(args..), 'Expected');
    -	//t.false(orderBy(args..), 'Expected');
    -	//t.throws(orderBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof orderBy === 'function', 'orderBy is a Function');
    +  const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }];
    +  t.deepEqual(orderBy(users, ['name', 'age'], ['asc', 'desc']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}], "Returns a sorted array of objects ordered by properties and orders.");
    +  t.deepEqual(orderBy(users, ['name', 'age']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}], "Returns a sorted array of objects ordered by properties and orders.");
    +  //t.deepEqual(orderBy(args..), 'Expected');
    +  //t.equal(orderBy(args..), 'Expected');
    +  //t.false(orderBy(args..), 'Expected');
    +  //t.throws(orderBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/over/over.test.js b/test/over/over.test.js
    index 1f2ecada6..e7ef99156 100644
    --- a/test/over/over.test.js
    +++ b/test/over/over.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const over = require('./over.js');
     
     test('Testing over', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof over === 'function', 'over is a Function');
    -	//t.deepEqual(over(args..), 'Expected');
    -	//t.equal(over(args..), 'Expected');
    -	//t.false(over(args..), 'Expected');
    -	//t.throws(over(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof over === 'function', 'over is a Function');
    +  //t.deepEqual(over(args..), 'Expected');
    +  //t.equal(over(args..), 'Expected');
    +  //t.false(over(args..), 'Expected');
    +  //t.throws(over(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js
    index 0c4076cdd..2c65f5995 100644
    --- a/test/palindrome/palindrome.test.js
    +++ b/test/palindrome/palindrome.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const palindrome = require('./palindrome.js');
     
     test('Testing palindrome', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof palindrome === 'function', 'palindrome is a Function');
    -	t.equal(palindrome('taco cat'), true, "Given string is a palindrome");
    -	t.equal(palindrome('foobar'), false, "Given string is not a palindrome");
    -	//t.deepEqual(palindrome(args..), 'Expected');
    -	//t.equal(palindrome(args..), 'Expected');
    -	//t.false(palindrome(args..), 'Expected');
    -	//t.throws(palindrome(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof palindrome === 'function', 'palindrome is a Function');
    +  t.equal(palindrome('taco cat'), true, "Given string is a palindrome");
    +  t.equal(palindrome('foobar'), false, "Given string is not a palindrome");
    +  //t.deepEqual(palindrome(args..), 'Expected');
    +  //t.equal(palindrome(args..), 'Expected');
    +  //t.false(palindrome(args..), 'Expected');
    +  //t.throws(palindrome(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/parseCookie/parseCookie.test.js b/test/parseCookie/parseCookie.test.js
    index 76a02bbe2..16ba1a6ad 100644
    --- a/test/parseCookie/parseCookie.test.js
    +++ b/test/parseCookie/parseCookie.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const parseCookie = require('./parseCookie.js');
     
     test('Testing parseCookie', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof parseCookie === 'function', 'parseCookie is a Function');
    -	//t.deepEqual(parseCookie(args..), 'Expected');
    -	//t.equal(parseCookie(args..), 'Expected');
    -	//t.false(parseCookie(args..), 'Expected');
    -	//t.throws(parseCookie(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof parseCookie === 'function', 'parseCookie is a Function');
    +  //t.deepEqual(parseCookie(args..), 'Expected');
    +  //t.equal(parseCookie(args..), 'Expected');
    +  //t.false(parseCookie(args..), 'Expected');
    +  //t.throws(parseCookie(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js
    index d8304f016..763548f40 100644
    --- a/test/partial/partial.test.js
    +++ b/test/partial/partial.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const partial = require('./partial.js');
     
     test('Testing partial', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof partial === 'function', 'partial is a Function');
    -	//t.deepEqual(partial(args..), 'Expected');
    -	//t.equal(partial(args..), 'Expected');
    -	//t.false(partial(args..), 'Expected');
    -	//t.throws(partial(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof partial === 'function', 'partial is a Function');
    +  //t.deepEqual(partial(args..), 'Expected');
    +  //t.equal(partial(args..), 'Expected');
    +  //t.false(partial(args..), 'Expected');
    +  //t.throws(partial(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js
    index 749a80244..7fda308da 100644
    --- a/test/partialRight/partialRight.test.js
    +++ b/test/partialRight/partialRight.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const partialRight = require('./partialRight.js');
     
     test('Testing partialRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof partialRight === 'function', 'partialRight is a Function');
    -	//t.deepEqual(partialRight(args..), 'Expected');
    -	//t.equal(partialRight(args..), 'Expected');
    -	//t.false(partialRight(args..), 'Expected');
    -	//t.throws(partialRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof partialRight === 'function', 'partialRight is a Function');
    +  //t.deepEqual(partialRight(args..), 'Expected');
    +  //t.equal(partialRight(args..), 'Expected');
    +  //t.false(partialRight(args..), 'Expected');
    +  //t.throws(partialRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/partition/partition.test.js b/test/partition/partition.test.js
    index fec483e88..429fae050 100644
    --- a/test/partition/partition.test.js
    +++ b/test/partition/partition.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const partition = require('./partition.js');
     
     test('Testing partition', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof partition === 'function', 'partition is a Function');
    -	const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }];
    -	t.deepEqual(partition(users, o => o.active), [[{ 'user': 'fred',    'age': 40, 'active': true }],[{ 'user': 'barney',  'age': 36, 'active': false }]], "Groups the elements into two arrays, depending on the provided function's truthiness for each element.");
    -	//t.deepEqual(partition(args..), 'Expected');
    -	//t.equal(partition(args..), 'Expected');
    -	//t.false(partition(args..), 'Expected');
    -	//t.throws(partition(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof partition === 'function', 'partition is a Function');
    +  const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }];
    +  t.deepEqual(partition(users, o => o.active), [[{ 'user': 'fred',    'age': 40, 'active': true }],[{ 'user': 'barney',  'age': 36, 'active': false }]], "Groups the elements into two arrays, depending on the provided function's truthiness for each element.");
    +  //t.deepEqual(partition(args..), 'Expected');
    +  //t.equal(partition(args..), 'Expected');
    +  //t.false(partition(args..), 'Expected');
    +  //t.throws(partition(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/percentile/percentile.test.js b/test/percentile/percentile.test.js
    index 573076404..63cf07868 100644
    --- a/test/percentile/percentile.test.js
    +++ b/test/percentile/percentile.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const percentile = require('./percentile.js');
     
     test('Testing percentile', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof percentile === 'function', 'percentile is a Function');
    -	t.equal(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6), 55, "Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.");
    -	//t.deepEqual(percentile(args..), 'Expected');
    -	//t.equal(percentile(args..), 'Expected');
    -	//t.false(percentile(args..), 'Expected');
    -	//t.throws(percentile(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof percentile === 'function', 'percentile is a Function');
    +  t.equal(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6), 55, "Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.");
    +  //t.deepEqual(percentile(args..), 'Expected');
    +  //t.equal(percentile(args..), 'Expected');
    +  //t.false(percentile(args..), 'Expected');
    +  //t.throws(percentile(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pick/pick.test.js b/test/pick/pick.test.js
    index 9a1a66aee..61565a0a2 100644
    --- a/test/pick/pick.test.js
    +++ b/test/pick/pick.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const pick = require('./pick.js');
     
     test('Testing pick', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pick === 'function', 'pick is a Function');
    -	t.deepEqual(pick({ a: 1, b: '2', c: 3 }, ['a', 'c']), { 'a': 1, 'c': 3 }, "Picks the key-value pairs corresponding to the given keys from an object.");
    -	//t.deepEqual(pick(args..), 'Expected');
    -	//t.equal(pick(args..), 'Expected');
    -	//t.false(pick(args..), 'Expected');
    -	//t.throws(pick(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pick === 'function', 'pick is a Function');
    +  t.deepEqual(pick({ a: 1, b: '2', c: 3 }, ['a', 'c']), { 'a': 1, 'c': 3 }, "Picks the key-value pairs corresponding to the given keys from an object.");
    +  //t.deepEqual(pick(args..), 'Expected');
    +  //t.equal(pick(args..), 'Expected');
    +  //t.false(pick(args..), 'Expected');
    +  //t.throws(pick(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js
    index 013c0cd2f..5fc44a26e 100644
    --- a/test/pickBy/pickBy.test.js
    +++ b/test/pickBy/pickBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pickBy = require('./pickBy.js');
     
     test('Testing pickBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pickBy === 'function', 'pickBy is a Function');
    -	//t.deepEqual(pickBy(args..), 'Expected');
    -	//t.equal(pickBy(args..), 'Expected');
    -	//t.false(pickBy(args..), 'Expected');
    -	//t.throws(pickBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pickBy === 'function', 'pickBy is a Function');
    +  //t.deepEqual(pickBy(args..), 'Expected');
    +  //t.equal(pickBy(args..), 'Expected');
    +  //t.false(pickBy(args..), 'Expected');
    +  //t.throws(pickBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js
    index 61d1285c9..b6255bfad 100644
    --- a/test/pipeFunctions/pipeFunctions.test.js
    +++ b/test/pipeFunctions/pipeFunctions.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pipeFunctions = require('./pipeFunctions.js');
     
     test('Testing pipeFunctions', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pipeFunctions === 'function', 'pipeFunctions is a Function');
    -	//t.deepEqual(pipeFunctions(args..), 'Expected');
    -	//t.equal(pipeFunctions(args..), 'Expected');
    -	//t.false(pipeFunctions(args..), 'Expected');
    -	//t.throws(pipeFunctions(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pipeFunctions === 'function', 'pipeFunctions is a Function');
    +  //t.deepEqual(pipeFunctions(args..), 'Expected');
    +  //t.equal(pipeFunctions(args..), 'Expected');
    +  //t.false(pipeFunctions(args..), 'Expected');
    +  //t.throws(pipeFunctions(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pluralize/pluralize.test.js b/test/pluralize/pluralize.test.js
    index a78180d7a..219f80886 100644
    --- a/test/pluralize/pluralize.test.js
    +++ b/test/pluralize/pluralize.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pluralize = require('./pluralize.js');
     
     test('Testing pluralize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pluralize === 'function', 'pluralize is a Function');
    -	//t.deepEqual(pluralize(args..), 'Expected');
    -	//t.equal(pluralize(args..), 'Expected');
    -	//t.false(pluralize(args..), 'Expected');
    -	//t.throws(pluralize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pluralize === 'function', 'pluralize is a Function');
    +  //t.deepEqual(pluralize(args..), 'Expected');
    +  //t.equal(pluralize(args..), 'Expected');
    +  //t.false(pluralize(args..), 'Expected');
    +  //t.throws(pluralize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/powerset/powerset.test.js b/test/powerset/powerset.test.js
    index f0516ca63..a9bf7ba6a 100644
    --- a/test/powerset/powerset.test.js
    +++ b/test/powerset/powerset.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const powerset = require('./powerset.js');
     
     test('Testing powerset', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof powerset === 'function', 'powerset is a Function');
    -	t.deepEqual(powerset([1, 2]), [[], [1], [2], [2,1]], "Returns the powerset of a given array of numbers.");
    -	//t.deepEqual(powerset(args..), 'Expected');
    -	//t.equal(powerset(args..), 'Expected');
    -	//t.false(powerset(args..), 'Expected');
    -	//t.throws(powerset(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof powerset === 'function', 'powerset is a Function');
    +  t.deepEqual(powerset([1, 2]), [[], [1], [2], [2,1]], "Returns the powerset of a given array of numbers.");
    +  //t.deepEqual(powerset(args..), 'Expected');
    +  //t.equal(powerset(args..), 'Expected');
    +  //t.false(powerset(args..), 'Expected');
    +  //t.throws(powerset(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js
    index 62f974c06..7553e5304 100644
    --- a/test/prettyBytes/prettyBytes.test.js
    +++ b/test/prettyBytes/prettyBytes.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const prettyBytes = require('./prettyBytes.js');
     
     test('Testing prettyBytes', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof prettyBytes === 'function', 'prettyBytes is a Function');
    -	t.equal(prettyBytes(1000), '1 KB', "Converts a number in bytes to a human-readable string.");
    -	t.equal(prettyBytes(-27145424323.5821, 5), '-27.145 GB', "Converts a number in bytes to a human-readable string.");
    -	t.equal(prettyBytes(123456789, 3, false), '123MB', "Converts a number in bytes to a human-readable string.");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof prettyBytes === 'function', 'prettyBytes is a Function');
    +  t.equal(prettyBytes(1000), '1 KB', "Converts a number in bytes to a human-readable string.");
    +  t.equal(prettyBytes(-27145424323.5821, 5), '-27.145 GB', "Converts a number in bytes to a human-readable string.");
    +  t.equal(prettyBytes(123456789, 3, false), '123MB', "Converts a number in bytes to a human-readable string.");
     
    -	//t.deepEqual(prettyBytes(args..), 'Expected');
    -	//t.equal(prettyBytes(args..), 'Expected');
    -	//t.false(prettyBytes(args..), 'Expected');
    -	//t.throws(prettyBytes(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(prettyBytes(args..), 'Expected');
    +  //t.equal(prettyBytes(args..), 'Expected');
    +  //t.false(prettyBytes(args..), 'Expected');
    +  //t.throws(prettyBytes(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/primes/primes.test.js b/test/primes/primes.test.js
    index 0e7c448d9..d64602713 100644
    --- a/test/primes/primes.test.js
    +++ b/test/primes/primes.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const primes = require('./primes.js');
     
     test('Testing primes', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof primes === 'function', 'primes is a Function');
    -	t.deepEqual(primes(10), [2, 3, 5, 7], "Generates primes up to a given number, using the Sieve of Eratosthenes.");
    -	//t.deepEqual(primes(args..), 'Expected');
    -	//t.equal(primes(args..), 'Expected');
    -	//t.false(primes(args..), 'Expected');
    -	//t.throws(primes(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof primes === 'function', 'primes is a Function');
    +  t.deepEqual(primes(10), [2, 3, 5, 7], "Generates primes up to a given number, using the Sieve of Eratosthenes.");
    +  //t.deepEqual(primes(args..), 'Expected');
    +  //t.equal(primes(args..), 'Expected');
    +  //t.false(primes(args..), 'Expected');
    +  //t.throws(primes(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/promisify/promisify.test.js b/test/promisify/promisify.test.js
    index 0ef7c8465..bba6e071d 100644
    --- a/test/promisify/promisify.test.js
    +++ b/test/promisify/promisify.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const promisify = require('./promisify.js');
     
     test('Testing promisify', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof promisify === 'function', 'promisify is a Function');
    -	//t.deepEqual(promisify(args..), 'Expected');
    -	//t.equal(promisify(args..), 'Expected');
    -	//t.false(promisify(args..), 'Expected');
    -	//t.throws(promisify(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof promisify === 'function', 'promisify is a Function');
    +  //t.deepEqual(promisify(args..), 'Expected');
    +  //t.equal(promisify(args..), 'Expected');
    +  //t.false(promisify(args..), 'Expected');
    +  //t.throws(promisify(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js
    index e067e10b6..aa4b11755 100644
    --- a/test/pull/pull.test.js
    +++ b/test/pull/pull.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pull = require('./pull.js');
     
     test('Testing pull', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pull === 'function', 'pull is a Function');
    -	//t.deepEqual(pull(args..), 'Expected');
    -	//t.equal(pull(args..), 'Expected');
    -	//t.false(pull(args..), 'Expected');
    -	//t.throws(pull(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pull === 'function', 'pull is a Function');
    +  //t.deepEqual(pull(args..), 'Expected');
    +  //t.equal(pull(args..), 'Expected');
    +  //t.false(pull(args..), 'Expected');
    +  //t.throws(pull(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pullAtIndex/pullAtIndex.test.js b/test/pullAtIndex/pullAtIndex.test.js
    index 0fd62bedc..6e243ef04 100644
    --- a/test/pullAtIndex/pullAtIndex.test.js
    +++ b/test/pullAtIndex/pullAtIndex.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pullAtIndex = require('./pullAtIndex.js');
     
     test('Testing pullAtIndex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pullAtIndex === 'function', 'pullAtIndex is a Function');
    -	//t.deepEqual(pullAtIndex(args..), 'Expected');
    -	//t.equal(pullAtIndex(args..), 'Expected');
    -	//t.false(pullAtIndex(args..), 'Expected');
    -	//t.throws(pullAtIndex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pullAtIndex === 'function', 'pullAtIndex is a Function');
    +  //t.deepEqual(pullAtIndex(args..), 'Expected');
    +  //t.equal(pullAtIndex(args..), 'Expected');
    +  //t.false(pullAtIndex(args..), 'Expected');
    +  //t.throws(pullAtIndex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js
    index 10f6b09d0..887020c33 100644
    --- a/test/pullAtValue/pullAtValue.test.js
    +++ b/test/pullAtValue/pullAtValue.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const pullAtValue = require('./pullAtValue.js');
     
     test('Testing pullAtValue', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof pullAtValue === 'function', 'pullAtValue is a Function');
    -	//t.deepEqual(pullAtValue(args..), 'Expected');
    -	//t.equal(pullAtValue(args..), 'Expected');
    -	//t.false(pullAtValue(args..), 'Expected');
    -	//t.throws(pullAtValue(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof pullAtValue === 'function', 'pullAtValue is a Function');
    +  //t.deepEqual(pullAtValue(args..), 'Expected');
    +  //t.equal(pullAtValue(args..), 'Expected');
    +  //t.false(pullAtValue(args..), 'Expected');
    +  //t.throws(pullAtValue(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js
    index 1252196cd..067b62ce5 100644
    --- a/test/quickSort/quickSort.test.js
    +++ b/test/quickSort/quickSort.test.js
    @@ -2,11 +2,11 @@ const test = require('tape');
     const quickSort = require('./quickSort.js');
     
     test('Testing quickSort', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof quickSort === 'function', 'quickSort is a Function');
    -	t.deepEqual(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6], 'quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]');
    -	t.deepEqual(quickSort([-1, 0, -2]), [-2, -1, 0], 'quickSort([-1, 0, -2]) returns [-2, -1, 0]');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof quickSort === 'function', 'quickSort is a Function');
    +  t.deepEqual(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6], 'quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]');
    +  t.deepEqual(quickSort([-1, 0, -2]), [-2, -1, 0], 'quickSort([-1, 0, -2]) returns [-2, -1, 0]');
       t.throws(() => quickSort(), 'quickSort() throws an error');
       t.throws(() => quickSort(123), 'quickSort(123) throws an error');
       t.throws(() => quickSort({ 234: string}), 'quickSort({ 234: string}) throws an error');
    @@ -18,5 +18,5 @@ test('Testing quickSort', (t) => {
       let end = new Date().getTime();
       t.true((end - start) < 2000, 'quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run');
       
    -	t.end();
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js
    index 39b41b2a7..63f117367 100644
    --- a/test/randomHexColorCode/randomHexColorCode.test.js
    +++ b/test/randomHexColorCode/randomHexColorCode.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const randomHexColorCode = require('./randomHexColorCode.js');
     
     test('Testing randomHexColorCode', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode is a Function');
    -	//t.deepEqual(randomHexColorCode(args..), 'Expected');
    -	//t.equal(randomHexColorCode(args..), 'Expected');
    -	//t.false(randomHexColorCode(args..), 'Expected');
    -	//t.throws(randomHexColorCode(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode is a Function');
    +  //t.deepEqual(randomHexColorCode(args..), 'Expected');
    +  //t.equal(randomHexColorCode(args..), 'Expected');
    +  //t.false(randomHexColorCode(args..), 'Expected');
    +  //t.throws(randomHexColorCode(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js
    index 57952ff83..9a7735e44 100644
    --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js
    +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const randomIntArrayInRange = require('./randomIntArrayInRange.js');
     
     test('Testing randomIntArrayInRange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof randomIntArrayInRange === 'function', 'randomIntArrayInRange is a Function');
    -	//t.deepEqual(randomIntArrayInRange(args..), 'Expected');
    -	//t.equal(randomIntArrayInRange(args..), 'Expected');
    -	//t.false(randomIntArrayInRange(args..), 'Expected');
    -	//t.throws(randomIntArrayInRange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof randomIntArrayInRange === 'function', 'randomIntArrayInRange is a Function');
    +  //t.deepEqual(randomIntArrayInRange(args..), 'Expected');
    +  //t.equal(randomIntArrayInRange(args..), 'Expected');
    +  //t.false(randomIntArrayInRange(args..), 'Expected');
    +  //t.throws(randomIntArrayInRange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/randomIntegerInRange/randomIntegerInRange.test.js b/test/randomIntegerInRange/randomIntegerInRange.test.js
    index 3e821c31f..c294b1208 100644
    --- a/test/randomIntegerInRange/randomIntegerInRange.test.js
    +++ b/test/randomIntegerInRange/randomIntegerInRange.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const randomIntegerInRange = require('./randomIntegerInRange.js');
     
     test('Testing randomIntegerInRange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof randomIntegerInRange === 'function', 'randomIntegerInRange is a Function');
    -	//t.deepEqual(randomIntegerInRange(args..), 'Expected');
    -	//t.equal(randomIntegerInRange(args..), 'Expected');
    -	//t.false(randomIntegerInRange(args..), 'Expected');
    -	//t.throws(randomIntegerInRange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof randomIntegerInRange === 'function', 'randomIntegerInRange is a Function');
    +  //t.deepEqual(randomIntegerInRange(args..), 'Expected');
    +  //t.equal(randomIntegerInRange(args..), 'Expected');
    +  //t.false(randomIntegerInRange(args..), 'Expected');
    +  //t.throws(randomIntegerInRange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/randomNumberInRange/randomNumberInRange.test.js b/test/randomNumberInRange/randomNumberInRange.test.js
    index 4cc797080..2d3d46bde 100644
    --- a/test/randomNumberInRange/randomNumberInRange.test.js
    +++ b/test/randomNumberInRange/randomNumberInRange.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const randomNumberInRange = require('./randomNumberInRange.js');
     
     test('Testing randomNumberInRange', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof randomNumberInRange === 'function', 'randomNumberInRange is a Function');
    -	//t.deepEqual(randomNumberInRange(args..), 'Expected');
    -	//t.equal(randomNumberInRange(args..), 'Expected');
    -	//t.false(randomNumberInRange(args..), 'Expected');
    -	//t.throws(randomNumberInRange(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof randomNumberInRange === 'function', 'randomNumberInRange is a Function');
    +  //t.deepEqual(randomNumberInRange(args..), 'Expected');
    +  //t.equal(randomNumberInRange(args..), 'Expected');
    +  //t.false(randomNumberInRange(args..), 'Expected');
    +  //t.throws(randomNumberInRange(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/readFileLines/readFileLines.test.js b/test/readFileLines/readFileLines.test.js
    index 481741a58..87404799e 100644
    --- a/test/readFileLines/readFileLines.test.js
    +++ b/test/readFileLines/readFileLines.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const readFileLines = require('./readFileLines.js');
     
     test('Testing readFileLines', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof readFileLines === 'function', 'readFileLines is a Function');
    -	//t.deepEqual(readFileLines(args..), 'Expected');
    -	//t.equal(readFileLines(args..), 'Expected');
    -	//t.false(readFileLines(args..), 'Expected');
    -	//t.throws(readFileLines(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof readFileLines === 'function', 'readFileLines is a Function');
    +  //t.deepEqual(readFileLines(args..), 'Expected');
    +  //t.equal(readFileLines(args..), 'Expected');
    +  //t.false(readFileLines(args..), 'Expected');
    +  //t.throws(readFileLines(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js
    index 12dee47dd..0d2f8d4a1 100644
    --- a/test/redirect/redirect.test.js
    +++ b/test/redirect/redirect.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const redirect = require('./redirect.js');
     
     test('Testing redirect', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof redirect === 'function', 'redirect is a Function');
    -	//t.deepEqual(redirect(args..), 'Expected');
    -	//t.equal(redirect(args..), 'Expected');
    -	//t.false(redirect(args..), 'Expected');
    -	//t.throws(redirect(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof redirect === 'function', 'redirect is a Function');
    +  //t.deepEqual(redirect(args..), 'Expected');
    +  //t.equal(redirect(args..), 'Expected');
    +  //t.false(redirect(args..), 'Expected');
    +  //t.throws(redirect(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js
    index 2cd1bc2d5..87ec36cdd 100644
    --- a/test/reduceSuccessive/reduceSuccessive.test.js
    +++ b/test/reduceSuccessive/reduceSuccessive.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const reduceSuccessive = require('./reduceSuccessive.js');
     
     test('Testing reduceSuccessive', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof reduceSuccessive === 'function', 'reduceSuccessive is a Function');
    -	//t.deepEqual(reduceSuccessive(args..), 'Expected');
    -	//t.equal(reduceSuccessive(args..), 'Expected');
    -	//t.false(reduceSuccessive(args..), 'Expected');
    -	//t.throws(reduceSuccessive(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof reduceSuccessive === 'function', 'reduceSuccessive is a Function');
    +  //t.deepEqual(reduceSuccessive(args..), 'Expected');
    +  //t.equal(reduceSuccessive(args..), 'Expected');
    +  //t.false(reduceSuccessive(args..), 'Expected');
    +  //t.throws(reduceSuccessive(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js
    index 29590ad2c..db6dcdc9e 100644
    --- a/test/reducedFilter/reducedFilter.test.js
    +++ b/test/reducedFilter/reducedFilter.test.js
    @@ -2,25 +2,25 @@ const test = require('tape');
     const reducedFilter = require('./reducedFilter.js');
     
     test('Testing reducedFilter', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof reducedFilter === 'function', 'reducedFilter is a Function');
    -	const data = [
    -		{
    -		  id: 1,
    -		  name: 'john',
    -		  age: 24
    -		},
    -		{
    -		  id: 2,
    -		  name: 'mike',
    -		  age: 50
    -		}
    -	  ];
    -	  t.deepEqual(reducedFilter(data, ['id', 'name'], item => item.age > 24), [{ id: 2, name: 'mike'}], "Filter an array of objects based on a condition while also filtering out unspecified keys.");
    -	//t.deepEqual(reducedFilter(args..), 'Expected');
    -	//t.equal(reducedFilter(args..), 'Expected');
    -	//t.false(reducedFilter(args..), 'Expected');
    -	//t.throws(reducedFilter(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof reducedFilter === 'function', 'reducedFilter is a Function');
    +  const data = [
    +    {
    +      id: 1,
    +      name: 'john',
    +      age: 24
    +    },
    +    {
    +      id: 2,
    +      name: 'mike',
    +      age: 50
    +    }
    +    ];
    +    t.deepEqual(reducedFilter(data, ['id', 'name'], item => item.age > 24), [{ id: 2, name: 'mike'}], "Filter an array of objects based on a condition while also filtering out unspecified keys.");
    +  //t.deepEqual(reducedFilter(args..), 'Expected');
    +  //t.equal(reducedFilter(args..), 'Expected');
    +  //t.false(reducedFilter(args..), 'Expected');
    +  //t.throws(reducedFilter(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/remove/remove.test.js b/test/remove/remove.test.js
    index f0b658901..0300c8c2a 100644
    --- a/test/remove/remove.test.js
    +++ b/test/remove/remove.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const remove = require('./remove.js');
     
     test('Testing remove', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof remove === 'function', 'remove is a Function');
    -	t.deepEqual(remove([1, 2, 3, 4], n => n % 2 == 0), [2, 4], "Removes elements from an array for which the given function returns false");
    -	//t.deepEqual(remove(args..), 'Expected');
    -	//t.equal(remove(args..), 'Expected');
    -	//t.false(remove(args..), 'Expected');
    -	//t.throws(remove(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof remove === 'function', 'remove is a Function');
    +  t.deepEqual(remove([1, 2, 3, 4], n => n % 2 == 0), [2, 4], "Removes elements from an array for which the given function returns false");
    +  //t.deepEqual(remove(args..), 'Expected');
    +  //t.equal(remove(args..), 'Expected');
    +  //t.false(remove(args..), 'Expected');
    +  //t.throws(remove(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/removeVowels/removeVowels.test.js b/test/removeVowels/removeVowels.test.js
    index be9566c24..67a187869 100644
    --- a/test/removeVowels/removeVowels.test.js
    +++ b/test/removeVowels/removeVowels.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const removeVowels = require('./removeVowels.js');
     
     test('Testing removeVowels', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof removeVowels === 'function', 'removeVowels is a Function');
    -	//t.deepEqual(removeVowels(args..), 'Expected');
    -	//t.equal(removeVowels(args..), 'Expected');
    -	//t.false(removeVowels(args..), 'Expected');
    -	//t.throws(removeVowels(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof removeVowels === 'function', 'removeVowels is a Function');
    +  //t.deepEqual(removeVowels(args..), 'Expected');
    +  //t.equal(removeVowels(args..), 'Expected');
    +  //t.false(removeVowels(args..), 'Expected');
    +  //t.throws(removeVowels(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/reverseString/reverseString.test.js b/test/reverseString/reverseString.test.js
    index aa930ef15..7aeca53df 100644
    --- a/test/reverseString/reverseString.test.js
    +++ b/test/reverseString/reverseString.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const reverseString = require('./reverseString.js');
     
     test('Testing reverseString', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof reverseString === 'function', 'reverseString is a Function');
    -	t.equal(reverseString('foobar'), 'raboof', "Reverses a string.");
    -	//t.deepEqual(reverseString(args..), 'Expected');
    -	//t.equal(reverseString(args..), 'Expected');
    -	//t.false(reverseString(args..), 'Expected');
    -	//t.throws(reverseString(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof reverseString === 'function', 'reverseString is a Function');
    +  t.equal(reverseString('foobar'), 'raboof', "Reverses a string.");
    +  //t.deepEqual(reverseString(args..), 'Expected');
    +  //t.equal(reverseString(args..), 'Expected');
    +  //t.false(reverseString(args..), 'Expected');
    +  //t.throws(reverseString(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/round/round.test.js b/test/round/round.test.js
    index 47aab350f..7af718c04 100644
    --- a/test/round/round.test.js
    +++ b/test/round/round.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const round = require('./round.js');
     
     test('Testing round', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof round === 'function', 'round is a Function');
    -	t.equal(round(1.005, 2), 1.01, "Rounds a number to a specified amount of digits.");
    -	//t.equal(round(args..), 'Expected');
    -	//t.false(round(args..), 'Expected');
    -	//t.throws(round(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof round === 'function', 'round is a Function');
    +  t.equal(round(1.005, 2), 1.01, "Rounds a number to a specified amount of digits.");
    +  //t.equal(round(args..), 'Expected');
    +  //t.false(round(args..), 'Expected');
    +  //t.throws(round(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/runAsync/runAsync.test.js b/test/runAsync/runAsync.test.js
    index 5d6a24c56..76e7b11c0 100644
    --- a/test/runAsync/runAsync.test.js
    +++ b/test/runAsync/runAsync.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const runAsync = require('./runAsync.js');
     
     test('Testing runAsync', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof runAsync === 'function', 'runAsync is a Function');
    -	//t.deepEqual(runAsync(args..), 'Expected');
    -	//t.equal(runAsync(args..), 'Expected');
    -	//t.false(runAsync(args..), 'Expected');
    -	//t.throws(runAsync(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof runAsync === 'function', 'runAsync is a Function');
    +  //t.deepEqual(runAsync(args..), 'Expected');
    +  //t.equal(runAsync(args..), 'Expected');
    +  //t.false(runAsync(args..), 'Expected');
    +  //t.throws(runAsync(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js
    index 78a7b13e9..9011ddaf5 100644
    --- a/test/runPromisesInSeries/runPromisesInSeries.test.js
    +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const runPromisesInSeries = require('./runPromisesInSeries.js');
     
     test('Testing runPromisesInSeries', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof runPromisesInSeries === 'function', 'runPromisesInSeries is a Function');
    -	//t.deepEqual(runPromisesInSeries(args..), 'Expected');
    -	//t.equal(runPromisesInSeries(args..), 'Expected');
    -	//t.false(runPromisesInSeries(args..), 'Expected');
    -	//t.throws(runPromisesInSeries(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof runPromisesInSeries === 'function', 'runPromisesInSeries is a Function');
    +  //t.deepEqual(runPromisesInSeries(args..), 'Expected');
    +  //t.equal(runPromisesInSeries(args..), 'Expected');
    +  //t.false(runPromisesInSeries(args..), 'Expected');
    +  //t.throws(runPromisesInSeries(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js
    index 6f2e5ee2c..47f575acb 100644
    --- a/test/sample/sample.test.js
    +++ b/test/sample/sample.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const sample = require('./sample.js');
     
     test('Testing sample', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sample === 'function', 'sample is a Function');
    -	//t.deepEqual(sample(args..), 'Expected');
    -	//t.equal(sample(args..), 'Expected');
    -	//t.false(sample(args..), 'Expected');
    -	//t.throws(sample(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sample === 'function', 'sample is a Function');
    +  //t.deepEqual(sample(args..), 'Expected');
    +  //t.equal(sample(args..), 'Expected');
    +  //t.false(sample(args..), 'Expected');
    +  //t.throws(sample(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js
    index 5527d8304..1ac15836e 100644
    --- a/test/sampleSize/sampleSize.test.js
    +++ b/test/sampleSize/sampleSize.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const sampleSize = require('./sampleSize.js');
     
     test('Testing sampleSize', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sampleSize === 'function', 'sampleSize is a Function');
    -	//t.deepEqual(sampleSize(args..), 'Expected');
    -	//t.equal(sampleSize(args..), 'Expected');
    -	//t.false(sampleSize(args..), 'Expected');
    -	//t.throws(sampleSize(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sampleSize === 'function', 'sampleSize is a Function');
    +  //t.deepEqual(sampleSize(args..), 'Expected');
    +  //t.equal(sampleSize(args..), 'Expected');
    +  //t.false(sampleSize(args..), 'Expected');
    +  //t.throws(sampleSize(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/scrollToTop/scrollToTop.test.js b/test/scrollToTop/scrollToTop.test.js
    index acc2ff3a2..082b4fc4e 100644
    --- a/test/scrollToTop/scrollToTop.test.js
    +++ b/test/scrollToTop/scrollToTop.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const scrollToTop = require('./scrollToTop.js');
     
     test('Testing scrollToTop', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof scrollToTop === 'function', 'scrollToTop is a Function');
    -	//t.deepEqual(scrollToTop(args..), 'Expected');
    -	//t.equal(scrollToTop(args..), 'Expected');
    -	//t.false(scrollToTop(args..), 'Expected');
    -	//t.throws(scrollToTop(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof scrollToTop === 'function', 'scrollToTop is a Function');
    +  //t.deepEqual(scrollToTop(args..), 'Expected');
    +  //t.equal(scrollToTop(args..), 'Expected');
    +  //t.false(scrollToTop(args..), 'Expected');
    +  //t.throws(scrollToTop(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js
    index c0247bccf..8152041bb 100644
    --- a/test/sdbm/sdbm.test.js
    +++ b/test/sdbm/sdbm.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const sdbm = require('./sdbm.js');
     
     test('Testing sdbm', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sdbm === 'function', 'sdbm is a Function');
    -	t.equal(sdbm('name'), -3521204949, "Hashes the input string into a whole number.");
    -	//t.deepEqual(sdbm(args..), 'Expected');
    -	//t.equal(sdbm(args..), 'Expected');
    -	//t.false(sdbm(args..), 'Expected');
    -	//t.throws(sdbm(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sdbm === 'function', 'sdbm is a Function');
    +  t.equal(sdbm('name'), -3521204949, "Hashes the input string into a whole number.");
    +  //t.deepEqual(sdbm(args..), 'Expected');
    +  //t.equal(sdbm(args..), 'Expected');
    +  //t.false(sdbm(args..), 'Expected');
    +  //t.throws(sdbm(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/serializeCookie/serializeCookie.test.js b/test/serializeCookie/serializeCookie.test.js
    index 7e4e3a88a..526f353ec 100644
    --- a/test/serializeCookie/serializeCookie.test.js
    +++ b/test/serializeCookie/serializeCookie.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const serializeCookie = require('./serializeCookie.js');
     
     test('Testing serializeCookie', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof serializeCookie === 'function', 'serializeCookie is a Function');
    -	//t.deepEqual(serializeCookie(args..), 'Expected');
    -	//t.equal(serializeCookie(args..), 'Expected');
    -	//t.false(serializeCookie(args..), 'Expected');
    -	//t.throws(serializeCookie(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof serializeCookie === 'function', 'serializeCookie is a Function');
    +  //t.deepEqual(serializeCookie(args..), 'Expected');
    +  //t.equal(serializeCookie(args..), 'Expected');
    +  //t.false(serializeCookie(args..), 'Expected');
    +  //t.throws(serializeCookie(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js
    index 9ccaea787..796ab1316 100644
    --- a/test/setStyle/setStyle.test.js
    +++ b/test/setStyle/setStyle.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const setStyle = require('./setStyle.js');
     
     test('Testing setStyle', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof setStyle === 'function', 'setStyle is a Function');
    -	//t.deepEqual(setStyle(args..), 'Expected');
    -	//t.equal(setStyle(args..), 'Expected');
    -	//t.false(setStyle(args..), 'Expected');
    -	//t.throws(setStyle(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof setStyle === 'function', 'setStyle is a Function');
    +  //t.deepEqual(setStyle(args..), 'Expected');
    +  //t.equal(setStyle(args..), 'Expected');
    +  //t.false(setStyle(args..), 'Expected');
    +  //t.throws(setStyle(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js
    index 9f0885344..71223569b 100644
    --- a/test/shallowClone/shallowClone.test.js
    +++ b/test/shallowClone/shallowClone.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const shallowClone = require('./shallowClone.js');
     
     test('Testing shallowClone', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof shallowClone === 'function', 'shallowClone is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof shallowClone === 'function', 'shallowClone is a Function');
       const a = { foo: 'bar', obj: { a: 1, b: 2 } };
       const b = shallowClone(a);
       t.notEqual(a, b, 'Shallow cloning works');
       t.equal(a.obj, b.obj, 'Does not clone deeply');
    -	//t.deepEqual(shallowClone(args..), 'Expected');
    -	//t.equal(shallowClone(args..), 'Expected');
    -	//t.false(shallowClone(args..), 'Expected');
    -	//t.throws(shallowClone(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(shallowClone(args..), 'Expected');
    +  //t.equal(shallowClone(args..), 'Expected');
    +  //t.false(shallowClone(args..), 'Expected');
    +  //t.throws(shallowClone(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/show/show.test.js b/test/show/show.test.js
    index f8e81e7a5..06cf5e26e 100644
    --- a/test/show/show.test.js
    +++ b/test/show/show.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const show = require('./show.js');
     
     test('Testing show', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof show === 'function', 'show is a Function');
    -	//t.deepEqual(show(args..), 'Expected');
    -	//t.equal(show(args..), 'Expected');
    -	//t.false(show(args..), 'Expected');
    -	//t.throws(show(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof show === 'function', 'show is a Function');
    +  //t.deepEqual(show(args..), 'Expected');
    +  //t.equal(show(args..), 'Expected');
    +  //t.false(show(args..), 'Expected');
    +  //t.throws(show(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js
    index ebb1921f6..2d19478fa 100644
    --- a/test/shuffle/shuffle.test.js
    +++ b/test/shuffle/shuffle.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const shuffle = require('./shuffle.js');
     
     test('Testing shuffle', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof shuffle === 'function', 'shuffle is a Function');
    -	//t.deepEqual(shuffle(args..), 'Expected');
    -	//t.equal(shuffle(args..), 'Expected');
    -	//t.false(shuffle(args..), 'Expected');
    -	//t.throws(shuffle(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof shuffle === 'function', 'shuffle is a Function');
    +  //t.deepEqual(shuffle(args..), 'Expected');
    +  //t.equal(shuffle(args..), 'Expected');
    +  //t.false(shuffle(args..), 'Expected');
    +  //t.throws(shuffle(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/similarity/similarity.test.js b/test/similarity/similarity.test.js
    index fb6fbca4f..b82022707 100644
    --- a/test/similarity/similarity.test.js
    +++ b/test/similarity/similarity.test.js
    @@ -2,11 +2,11 @@ const test = require('tape');
     const similarity = require('./similarity.js');
     
     test('Testing similarity', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof similarity === 'function', 'similarity is a Function');
    -	t.deepEqual(similarity([1, 2, 3], [1, 2, 4]), [1, 2], "Returns an array of elements that appear in both arrays.");	//t.equal(similarity(args..), 'Expected');
    -	//t.false(similarity(args..), 'Expected');
    -	//t.throws(similarity(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof similarity === 'function', 'similarity is a Function');
    +  t.deepEqual(similarity([1, 2, 3], [1, 2, 4]), [1, 2], "Returns an array of elements that appear in both arrays.");  //t.equal(similarity(args..), 'Expected');
    +  //t.false(similarity(args..), 'Expected');
    +  //t.throws(similarity(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/size/size.test.js b/test/size/size.test.js
    index 467e842a2..5c8410b23 100644
    --- a/test/size/size.test.js
    +++ b/test/size/size.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const size = require('./size.js');
     
     test('Testing size', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof size === 'function', 'size is a Function');
    -	t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings.");
    -	// t.equal(size('size'), 4, "Get size of arrays, objects or strings."); DOESN'T WORK IN NODE ENV
    -	t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings.");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof size === 'function', 'size is a Function');
    +  t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings.");
    +  // t.equal(size('size'), 4, "Get size of arrays, objects or strings."); DOESN'T WORK IN NODE ENV
    +  t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings.");
     
    -	//t.deepEqual(size(args..), 'Expected');
    -	//t.equal(size(args..), 'Expected');
    -	//t.false(size(args..), 'Expected');
    -	//t.throws(size(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(size(args..), 'Expected');
    +  //t.equal(size(args..), 'Expected');
    +  //t.false(size(args..), 'Expected');
    +  //t.throws(size(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js
    index 7b56c9c77..8d5388924 100644
    --- a/test/sleep/sleep.test.js
    +++ b/test/sleep/sleep.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const sleep = require('./sleep.js');
     
     test('Testing sleep', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sleep === 'function', 'sleep is a Function');
    -	//t.deepEqual(sleep(args..), 'Expected');
    -	//t.equal(sleep(args..), 'Expected');
    -	//t.false(sleep(args..), 'Expected');
    -	//t.throws(sleep(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sleep === 'function', 'sleep is a Function');
    +  //t.deepEqual(sleep(args..), 'Expected');
    +  //t.equal(sleep(args..), 'Expected');
    +  //t.false(sleep(args..), 'Expected');
    +  //t.throws(sleep(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/solveRPN/solveRPN.test.js b/test/solveRPN/solveRPN.test.js
    index aa288918d..78cea6cdf 100644
    --- a/test/solveRPN/solveRPN.test.js
    +++ b/test/solveRPN/solveRPN.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const solveRPN = require('./solveRPN.js');
     
     test('Testing solveRPN', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof solveRPN === 'function', 'solveRPN is a Function');
    -	//t.deepEqual(solveRPN(args..), 'Expected');
    -	//t.equal(solveRPN(args..), 'Expected');
    -	//t.false(solveRPN(args..), 'Expected');
    -	//t.throws(solveRPN(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof solveRPN === 'function', 'solveRPN is a Function');
    +  //t.deepEqual(solveRPN(args..), 'Expected');
    +  //t.equal(solveRPN(args..), 'Expected');
    +  //t.false(solveRPN(args..), 'Expected');
    +  //t.throws(solveRPN(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js
    index 685393e6f..25fc97bd8 100644
    --- a/test/sortCharactersInString/sortCharactersInString.test.js
    +++ b/test/sortCharactersInString/sortCharactersInString.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const sortCharactersInString = require('./sortCharactersInString.js');
     
     test('Testing sortCharactersInString', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sortCharactersInString === 'function', 'sortCharactersInString is a Function');
    -	t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string.");
    -	//t.deepEqual(sortCharactersInString(args..), 'Expected');
    -	//t.equal(sortCharactersInString(args..), 'Expected');
    -	//t.false(sortCharactersInString(args..), 'Expected');
    -	//t.throws(sortCharactersInString(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sortCharactersInString === 'function', 'sortCharactersInString is a Function');
    +  t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string.");
    +  //t.deepEqual(sortCharactersInString(args..), 'Expected');
    +  //t.equal(sortCharactersInString(args..), 'Expected');
    +  //t.false(sortCharactersInString(args..), 'Expected');
    +  //t.throws(sortCharactersInString(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sortedIndex/sortedIndex.test.js b/test/sortedIndex/sortedIndex.test.js
    index f81cec793..c60ba058f 100644
    --- a/test/sortedIndex/sortedIndex.test.js
    +++ b/test/sortedIndex/sortedIndex.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const sortedIndex = require('./sortedIndex.js');
     
     test('Testing sortedIndex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sortedIndex === 'function', 'sortedIndex is a Function');
    -	t.equal(sortedIndex([5, 3, 2, 1], 4), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
    -	t.equal(sortedIndex([30, 50], 40), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
    -	//t.deepEqual(sortedIndex(args..), 'Expected');
    -	//t.equal(sortedIndex(args..), 'Expected');
    -	//t.false(sortedIndex(args..), 'Expected');
    -	//t.throws(sortedIndex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sortedIndex === 'function', 'sortedIndex is a Function');
    +  t.equal(sortedIndex([5, 3, 2, 1], 4), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
    +  t.equal(sortedIndex([30, 50], 40), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
    +  //t.deepEqual(sortedIndex(args..), 'Expected');
    +  //t.equal(sortedIndex(args..), 'Expected');
    +  //t.false(sortedIndex(args..), 'Expected');
    +  //t.throws(sortedIndex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js
    index daad01738..f51f3b732 100644
    --- a/test/sortedLastIndex/sortedLastIndex.test.js
    +++ b/test/sortedLastIndex/sortedLastIndex.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const sortedLastIndex = require('./sortedLastIndex.js');
     
     test('Testing sortedLastIndex', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sortedLastIndex === 'function', 'sortedLastIndex is a Function');
    -	//t.deepEqual(sortedLastIndex(args..), 'Expected');
    -	//t.equal(sortedLastIndex(args..), 'Expected');
    -	//t.false(sortedLastIndex(args..), 'Expected');
    -	//t.throws(sortedLastIndex(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sortedLastIndex === 'function', 'sortedLastIndex is a Function');
    +  //t.deepEqual(sortedLastIndex(args..), 'Expected');
    +  //t.equal(sortedLastIndex(args..), 'Expected');
    +  //t.false(sortedLastIndex(args..), 'Expected');
    +  //t.throws(sortedLastIndex(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/speechSynthesis/speechSynthesis.test.js b/test/speechSynthesis/speechSynthesis.test.js
    index 81b4547f4..16d2f891f 100644
    --- a/test/speechSynthesis/speechSynthesis.test.js
    +++ b/test/speechSynthesis/speechSynthesis.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const speechSynthesis = require('./speechSynthesis.js');
     
     test('Testing speechSynthesis', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof speechSynthesis === 'function', 'speechSynthesis is a Function');
    -	//t.deepEqual(speechSynthesis(args..), 'Expected');
    -	//t.equal(speechSynthesis(args..), 'Expected');
    -	//t.false(speechSynthesis(args..), 'Expected');
    -	//t.throws(speechSynthesis(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof speechSynthesis === 'function', 'speechSynthesis is a Function');
    +  //t.deepEqual(speechSynthesis(args..), 'Expected');
    +  //t.equal(speechSynthesis(args..), 'Expected');
    +  //t.false(speechSynthesis(args..), 'Expected');
    +  //t.throws(speechSynthesis(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js
    index e10b8b4b3..7d03fd581 100644
    --- a/test/splitLines/splitLines.test.js
    +++ b/test/splitLines/splitLines.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const splitLines = require('./splitLines.js');
     
     test('Testing splitLines', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof splitLines === 'function', 'splitLines is a Function');
    -	t.deepEqual(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' , ''], "Splits a multiline string into an array of lines.");
    -	//t.deepEqual(splitLines(args..), 'Expected');
    -	//t.equal(splitLines(args..), 'Expected');
    -	//t.false(splitLines(args..), 'Expected');
    -	//t.throws(splitLines(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof splitLines === 'function', 'splitLines is a Function');
    +  t.deepEqual(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' , ''], "Splits a multiline string into an array of lines.");
    +  //t.deepEqual(splitLines(args..), 'Expected');
    +  //t.equal(splitLines(args..), 'Expected');
    +  //t.false(splitLines(args..), 'Expected');
    +  //t.throws(splitLines(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/spreadOver/spreadOver.test.js b/test/spreadOver/spreadOver.test.js
    index ebb019d9b..d294b4f52 100644
    --- a/test/spreadOver/spreadOver.test.js
    +++ b/test/spreadOver/spreadOver.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const spreadOver = require('./spreadOver.js');
     
     test('Testing spreadOver', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof spreadOver === 'function', 'spreadOver is a Function');
    -	const arrayMax = spreadOver(Math.max);
    -	t.equal(arrayMax([1, 2, 3]), 3, "Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.");
    -	//t.deepEqual(spreadOver(args..), 'Expected');
    -	//t.equal(spreadOver(args..), 'Expected');
    -	//t.false(spreadOver(args..), 'Expected');
    -	//t.throws(spreadOver(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof spreadOver === 'function', 'spreadOver is a Function');
    +  const arrayMax = spreadOver(Math.max);
    +  t.equal(arrayMax([1, 2, 3]), 3, "Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.");
    +  //t.deepEqual(spreadOver(args..), 'Expected');
    +  //t.equal(spreadOver(args..), 'Expected');
    +  //t.false(spreadOver(args..), 'Expected');
    +  //t.throws(spreadOver(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/standardDeviation/standardDeviation.test.js b/test/standardDeviation/standardDeviation.test.js
    index fd0ffef6f..ad43efb90 100644
    --- a/test/standardDeviation/standardDeviation.test.js
    +++ b/test/standardDeviation/standardDeviation.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const standardDeviation = require('./standardDeviation.js');
     
     test('Testing standardDeviation', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof standardDeviation === 'function', 'standardDeviation is a Function');
    -	t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21]), 13.284434142114991, "Returns the standard deviation of an array of numbers");
    -	t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21], true), 12.29899614287479, "Returns the standard deviation of an array of numbers");
    -	//t.deepEqual(standardDeviation(args..), 'Expected');
    -	//t.equal(standardDeviation(args..), 'Expected');
    -	//t.false(standardDeviation(args..), 'Expected');
    -	//t.throws(standardDeviation(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof standardDeviation === 'function', 'standardDeviation is a Function');
    +  t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21]), 13.284434142114991, "Returns the standard deviation of an array of numbers");
    +  t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21], true), 12.29899614287479, "Returns the standard deviation of an array of numbers");
    +  //t.deepEqual(standardDeviation(args..), 'Expected');
    +  //t.equal(standardDeviation(args..), 'Expected');
    +  //t.false(standardDeviation(args..), 'Expected');
    +  //t.throws(standardDeviation(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sum/sum.test.js b/test/sum/sum.test.js
    index 476caad87..7abf88f6f 100644
    --- a/test/sum/sum.test.js
    +++ b/test/sum/sum.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const sum = require('./sum.js');
     
     test('Testing sum', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sum === 'function', 'sum is a Function');
    -	t.equal(sum(...[1, 2, 3, 4]), 10, "Returns the sum of two or more numbers/arrays.");
    -	//t.deepEqual(sum(args..), 'Expected');
    -	//t.equal(sum(args..), 'Expected');
    -	//t.false(sum(args..), 'Expected');
    -	//t.throws(sum(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sum === 'function', 'sum is a Function');
    +  t.equal(sum(...[1, 2, 3, 4]), 10, "Returns the sum of two or more numbers/arrays.");
    +  //t.deepEqual(sum(args..), 'Expected');
    +  //t.equal(sum(args..), 'Expected');
    +  //t.false(sum(args..), 'Expected');
    +  //t.throws(sum(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sumBy/sumBy.test.js b/test/sumBy/sumBy.test.js
    index 23c6140fe..7d2660dec 100644
    --- a/test/sumBy/sumBy.test.js
    +++ b/test/sumBy/sumBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const sumBy = require('./sumBy.js');
     
     test('Testing sumBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sumBy === 'function', 'sumBy is a Function');
    -	//t.deepEqual(sumBy(args..), 'Expected');
    -	//t.equal(sumBy(args..), 'Expected');
    -	//t.false(sumBy(args..), 'Expected');
    -	//t.throws(sumBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sumBy === 'function', 'sumBy is a Function');
    +  //t.deepEqual(sumBy(args..), 'Expected');
    +  //t.equal(sumBy(args..), 'Expected');
    +  //t.false(sumBy(args..), 'Expected');
    +  //t.throws(sumBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/sumPower/sumPower.test.js b/test/sumPower/sumPower.test.js
    index 2c5828339..44cb6d64f 100644
    --- a/test/sumPower/sumPower.test.js
    +++ b/test/sumPower/sumPower.test.js
    @@ -2,15 +2,15 @@ const test = require('tape');
     const sumPower = require('./sumPower.js');
     
     test('Testing sumPower', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof sumPower === 'function', 'sumPower is a Function');
    -	t.equal(sumPower(10), 385, "Returns the sum of the powers of all the numbers from start to end");
    -	t.equal(sumPower(10, 3), 3025, "Returns the sum of the powers of all the numbers from start to end");
    -	t.equal(sumPower(10, 3, 5), 2925, "Returns the sum of the powers of all the numbers from start to end");
    -	//t.deepEqual(sumPower(args..), 'Expected');
    -	//t.equal(sumPower(args..), 'Expected');
    -	//t.false(sumPower(args..), 'Expected');
    -	//t.throws(sumPower(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof sumPower === 'function', 'sumPower is a Function');
    +  t.equal(sumPower(10), 385, "Returns the sum of the powers of all the numbers from start to end");
    +  t.equal(sumPower(10, 3), 3025, "Returns the sum of the powers of all the numbers from start to end");
    +  t.equal(sumPower(10, 3, 5), 2925, "Returns the sum of the powers of all the numbers from start to end");
    +  //t.deepEqual(sumPower(args..), 'Expected');
    +  //t.equal(sumPower(args..), 'Expected');
    +  //t.false(sumPower(args..), 'Expected');
    +  //t.throws(sumPower(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/symmetricDifference/symmetricDifference.test.js b/test/symmetricDifference/symmetricDifference.test.js
    index 2c8d7544b..1ceeba195 100644
    --- a/test/symmetricDifference/symmetricDifference.test.js
    +++ b/test/symmetricDifference/symmetricDifference.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const symmetricDifference = require('./symmetricDifference.js');
     
     test('Testing symmetricDifference', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof symmetricDifference === 'function', 'symmetricDifference is a Function');
    -	t.deepEqual(symmetricDifference([1, 2, 3], [1, 2, 4]), [3, 4], "Returns the symmetric difference between two arrays.");
    -	//t.deepEqual(symmetricDifference(args..), 'Expected');
    -	//t.equal(symmetricDifference(args..), 'Expected');
    -	//t.false(symmetricDifference(args..), 'Expected');
    -	//t.throws(symmetricDifference(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof symmetricDifference === 'function', 'symmetricDifference is a Function');
    +  t.deepEqual(symmetricDifference([1, 2, 3], [1, 2, 4]), [3, 4], "Returns the symmetric difference between two arrays.");
    +  //t.deepEqual(symmetricDifference(args..), 'Expected');
    +  //t.equal(symmetricDifference(args..), 'Expected');
    +  //t.false(symmetricDifference(args..), 'Expected');
    +  //t.throws(symmetricDifference(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js
    index ef7eb6a0e..306e3d5e8 100644
    --- a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js
    +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const symmetricDifferenceBy = require('./symmetricDifferenceBy.js');
     
     test('Testing symmetricDifferenceBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof symmetricDifferenceBy === 'function', 'symmetricDifferenceBy is a Function');
    -	//t.deepEqual(symmetricDifferenceBy(args..), 'Expected');
    -	//t.equal(symmetricDifferenceBy(args..), 'Expected');
    -	//t.false(symmetricDifferenceBy(args..), 'Expected');
    -	//t.throws(symmetricDifferenceBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof symmetricDifferenceBy === 'function', 'symmetricDifferenceBy is a Function');
    +  //t.deepEqual(symmetricDifferenceBy(args..), 'Expected');
    +  //t.equal(symmetricDifferenceBy(args..), 'Expected');
    +  //t.false(symmetricDifferenceBy(args..), 'Expected');
    +  //t.throws(symmetricDifferenceBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js
    index bad9c3621..c2afcddd8 100644
    --- a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js
    +++ b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const symmetricDifferenceWith = require('./symmetricDifferenceWith.js');
     
     test('Testing symmetricDifferenceWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof symmetricDifferenceWith === 'function', 'symmetricDifferenceWith is a Function');
    -	//t.deepEqual(symmetricDifferenceWith(args..), 'Expected');
    -	//t.equal(symmetricDifferenceWith(args..), 'Expected');
    -	//t.false(symmetricDifferenceWith(args..), 'Expected');
    -	//t.throws(symmetricDifferenceWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof symmetricDifferenceWith === 'function', 'symmetricDifferenceWith is a Function');
    +  //t.deepEqual(symmetricDifferenceWith(args..), 'Expected');
    +  //t.equal(symmetricDifferenceWith(args..), 'Expected');
    +  //t.false(symmetricDifferenceWith(args..), 'Expected');
    +  //t.throws(symmetricDifferenceWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js
    index 499a1bc3a..6eb499139 100644
    --- a/test/tail/tail.test.js
    +++ b/test/tail/tail.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const tail = require('./tail.js');
     
     test('Testing tail', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof tail === 'function', 'tail is a Function');
    -	t.deepEqual(tail([1, 2, 3]), [2, 3], "Returns tail");
    -	t.deepEqual(tail([1]), [1], "Returns tail");
    -	//t.deepEqual(tail(args..), 'Expected');
    -	//t.equal(tail(args..), 'Expected');
    -	//t.false(tail(args..), 'Expected');
    -	//t.throws(tail(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof tail === 'function', 'tail is a Function');
    +  t.deepEqual(tail([1, 2, 3]), [2, 3], "Returns tail");
    +  t.deepEqual(tail([1]), [1], "Returns tail");
    +  //t.deepEqual(tail(args..), 'Expected');
    +  //t.equal(tail(args..), 'Expected');
    +  //t.false(tail(args..), 'Expected');
    +  //t.throws(tail(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/take/take.test.js b/test/take/take.test.js
    index 57a549c64..2d2aed44c 100644
    --- a/test/take/take.test.js
    +++ b/test/take/take.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const take = require('./take.js');
     
     test('Testing take', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof take === 'function', 'take is a Function');
    -	t.deepEqual(take([1, 2, 3], 5), [1, 2, 3], "Returns an array with n elements removed from the beginning.")
    -	t.deepEqual(take([1, 2, 3], 0), [], "Returns an array with n elements removed from the beginning.")
    -	//t.deepEqual(take(args..), 'Expected');
    -	//t.equal(take(args..), 'Expected');
    -	//t.false(take(args..), 'Expected');
    -	//t.throws(take(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof take === 'function', 'take is a Function');
    +  t.deepEqual(take([1, 2, 3], 5), [1, 2, 3], "Returns an array with n elements removed from the beginning.")
    +  t.deepEqual(take([1, 2, 3], 0), [], "Returns an array with n elements removed from the beginning.")
    +  //t.deepEqual(take(args..), 'Expected');
    +  //t.equal(take(args..), 'Expected');
    +  //t.false(take(args..), 'Expected');
    +  //t.throws(take(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js
    index 5a8231fe7..a7625862b 100644
    --- a/test/takeRight/takeRight.test.js
    +++ b/test/takeRight/takeRight.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const takeRight = require('./takeRight.js');
     
     test('Testing takeRight', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof takeRight === 'function', 'takeRight is a Function');
    -	t.deepEqual(takeRight([1, 2, 3], 2), [2, 3], "Returns an array with n elements removed from the end");
    -	t.deepEqual(takeRight([1, 2, 3]), [3], "Returns an array with n elements removed from the end");
    -	//t.deepEqual(takeRight(args..), 'Expected');
    -	//t.equal(takeRight(args..), 'Expected');
    -	//t.false(takeRight(args..), 'Expected');
    -	//t.throws(takeRight(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof takeRight === 'function', 'takeRight is a Function');
    +  t.deepEqual(takeRight([1, 2, 3], 2), [2, 3], "Returns an array with n elements removed from the end");
    +  t.deepEqual(takeRight([1, 2, 3]), [3], "Returns an array with n elements removed from the end");
    +  //t.deepEqual(takeRight(args..), 'Expected');
    +  //t.equal(takeRight(args..), 'Expected');
    +  //t.false(takeRight(args..), 'Expected');
    +  //t.throws(takeRight(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/testlog b/test/testlog
    index cbe9a981c..6e64a29a9 100644
    --- a/test/testlog
    +++ b/test/testlog
    @@ -1,4 +1,4 @@
    -Test log for: Wed Jan 24 2018 17:48:46 GMT+0200 (GTB Standard Time)
    +Test log for: Wed Jan 24 2018 17:52:14 GMT+0200 (GTB Standard Time)
     
     > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
     > tape test/**/*.test.js | tap-spec
    @@ -1476,6 +1476,6 @@ Test log for: Wed Jan 24 2018 17:48:46 GMT+0200 (GTB Standard Time)
     
       total:     638
       passing:   638
    -  duration:  418ms
    +  duration:  417ms
     
     
    diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js
    index 7e5201970..45d8aa0eb 100644
    --- a/test/timeTaken/timeTaken.test.js
    +++ b/test/timeTaken/timeTaken.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const timeTaken = require('./timeTaken.js');
     
     test('Testing timeTaken', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof timeTaken === 'function', 'timeTaken is a Function');
    -	//t.deepEqual(timeTaken(args..), 'Expected');
    -	//t.equal(timeTaken(args..), 'Expected');
    -	//t.false(timeTaken(args..), 'Expected');
    -	//t.throws(timeTaken(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof timeTaken === 'function', 'timeTaken is a Function');
    +  //t.deepEqual(timeTaken(args..), 'Expected');
    +  //t.equal(timeTaken(args..), 'Expected');
    +  //t.false(timeTaken(args..), 'Expected');
    +  //t.throws(timeTaken(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/times/times.test.js b/test/times/times.test.js
    index 72b659376..4e94c7d20 100644
    --- a/test/times/times.test.js
    +++ b/test/times/times.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const times = require('./times.js');
     
     test('Testing times', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof times === 'function', 'times is a Function');
    -	//t.deepEqual(times(args..), 'Expected');
    -	//t.equal(times(args..), 'Expected');
    -	//t.false(times(args..), 'Expected');
    -	//t.throws(times(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof times === 'function', 'times is a Function');
    +  //t.deepEqual(times(args..), 'Expected');
    +  //t.equal(times(args..), 'Expected');
    +  //t.false(times(args..), 'Expected');
    +  //t.throws(times(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js
    index 8746a2bf3..b41794011 100644
    --- a/test/toCamelCase/toCamelCase.test.js
    +++ b/test/toCamelCase/toCamelCase.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const toCamelCase = require('./toCamelCase.js');
     
     test('Testing toCamelCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toCamelCase === 'function', 'toCamelCase is a Function');
    -	t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "Converts a string to camelCase");
    -	t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "Converts a string to camelCase");
    -	t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "Converts a string to camelCase");
    -	t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "Converts a string to camelCase");
    -	//t.deepEqual(toCamelCase(args..), 'Expected');
    -	//t.equal(toCamelCase(args..), 'Expected');
    -	//t.false(toCamelCase(args..), 'Expected');
    -	//t.throws(toCamelCase(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toCamelCase === 'function', 'toCamelCase is a Function');
    +  t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "Converts a string to camelCase");
    +  t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "Converts a string to camelCase");
    +  t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "Converts a string to camelCase");
    +  t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "Converts a string to camelCase");
    +  //t.deepEqual(toCamelCase(args..), 'Expected');
    +  //t.equal(toCamelCase(args..), 'Expected');
    +  //t.false(toCamelCase(args..), 'Expected');
    +  //t.throws(toCamelCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js
    index d1234065f..0da36d864 100644
    --- a/test/toDecimalMark/toDecimalMark.test.js
    +++ b/test/toDecimalMark/toDecimalMark.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const toDecimalMark = require('./toDecimalMark.js');
     
     test('Testing toDecimalMark', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toDecimalMark === 'function', 'toDecimalMark is a Function');
    -	t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form");
    -	//t.deepEqual(toDecimalMark(args..), 'Expected');
    -	//t.equal(toDecimalMark(args..), 'Expected');
    -	//t.false(toDecimalMark(args..), 'Expected');
    -	//t.throws(toDecimalMark(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toDecimalMark === 'function', 'toDecimalMark is a Function');
    +  t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form");
    +  //t.deepEqual(toDecimalMark(args..), 'Expected');
    +  //t.equal(toDecimalMark(args..), 'Expected');
    +  //t.false(toDecimalMark(args..), 'Expected');
    +  //t.throws(toDecimalMark(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js
    index 01bd40b2c..fe305e2b2 100644
    --- a/test/toKebabCase/toKebabCase.test.js
    +++ b/test/toKebabCase/toKebabCase.test.js
    @@ -2,16 +2,16 @@ const test = require('tape');
     const toKebabCase = require('./toKebabCase.js');
     
     test('Testing toKebabCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toKebabCase === 'function', 'toKebabCase is a Function');
    -	t.equal(toKebabCase('camelCase'), 'camel-case', "string converts to snake case");
    -	t.equal(toKebabCase('some text'), 'some-text', "string converts to snake case");
    -	t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "string converts to snake case");
    -	t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "string converts to snake case");
    -	//t.deepEqual(toKebabCase(args..), 'Expected');
    -	//t.equal(toKebabCase(args..), 'Expected');
    -	//t.false(toKebabCase(args..), 'Expected');
    -	//t.throws(toKebabCase(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toKebabCase === 'function', 'toKebabCase is a Function');
    +  t.equal(toKebabCase('camelCase'), 'camel-case', "string converts to snake case");
    +  t.equal(toKebabCase('some text'), 'some-text', "string converts to snake case");
    +  t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "string converts to snake case");
    +  t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "string converts to snake case");
    +  //t.deepEqual(toKebabCase(args..), 'Expected');
    +  //t.equal(toKebabCase(args..), 'Expected');
    +  //t.false(toKebabCase(args..), 'Expected');
    +  //t.throws(toKebabCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.test.js b/test/toOrdinalSuffix/toOrdinalSuffix.test.js
    index d33dead0a..a58c7cf64 100644
    --- a/test/toOrdinalSuffix/toOrdinalSuffix.test.js
    +++ b/test/toOrdinalSuffix/toOrdinalSuffix.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const toOrdinalSuffix = require('./toOrdinalSuffix.js');
     
     test('Testing toOrdinalSuffix', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toOrdinalSuffix === 'function', 'toOrdinalSuffix is a Function');
    -	t.equal(toOrdinalSuffix('123'), '123rd', 'Adds an ordinal suffix to a number');
    -	t.equal(toOrdinalSuffix(5), '5th', 'Adds an ordinal suffix to a number');
    -	t.equal(toOrdinalSuffix(1), '1st', 'Adds an ordinal suffix to a number');
    -	t.equal(toOrdinalSuffix(0), '0th', 'Adds an ordinal suffix to a number');
    -	// t.equal(toOrdinalSuffix(), ,);
    -	//t.deepEqual(toOrdinalSuffix(args..), 'Expected');
    -	//t.equal(toOrdinalSuffix(args..), 'Expected');
    -	//t.false(toOrdinalSuffix(args..), 'Expected');
    -	//t.throws(toOrdinalSuffix(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toOrdinalSuffix === 'function', 'toOrdinalSuffix is a Function');
    +  t.equal(toOrdinalSuffix('123'), '123rd', 'Adds an ordinal suffix to a number');
    +  t.equal(toOrdinalSuffix(5), '5th', 'Adds an ordinal suffix to a number');
    +  t.equal(toOrdinalSuffix(1), '1st', 'Adds an ordinal suffix to a number');
    +  t.equal(toOrdinalSuffix(0), '0th', 'Adds an ordinal suffix to a number');
    +  // t.equal(toOrdinalSuffix(), ,);
    +  //t.deepEqual(toOrdinalSuffix(args..), 'Expected');
    +  //t.equal(toOrdinalSuffix(args..), 'Expected');
    +  //t.false(toOrdinalSuffix(args..), 'Expected');
    +  //t.throws(toOrdinalSuffix(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js
    index e04013774..508da718a 100644
    --- a/test/toSafeInteger/toSafeInteger.test.js
    +++ b/test/toSafeInteger/toSafeInteger.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const toSafeInteger = require('./toSafeInteger.js');
     
     test('Testing toSafeInteger', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toSafeInteger === 'function', 'toSafeInteger is a Function');
    -	t.equal(toSafeInteger(3.2), 3, "Converts a value to a safe integer");
    -	t.equal(toSafeInteger('4.2'), 4, "Converts a value to a safe integer");
    -	t.equal(toSafeInteger(4.6), 5, "Converts a value to a safe integer");
    -	t.equal(toSafeInteger(1.5), 2, "Converts a value to a safe integer");
    -	t.equal(toSafeInteger(Infinity), 9007199254740991, "Converts a value to a safe integer");
    -	//t.deepEqual(toSafeInteger(args..), 'Expected');
    -	//t.equal(toSafeInteger(args..), 'Expected');
    -	//t.false(toSafeInteger(args..), 'Expected');
    -	//t.throws(toSafeInteger(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toSafeInteger === 'function', 'toSafeInteger is a Function');
    +  t.equal(toSafeInteger(3.2), 3, "Converts a value to a safe integer");
    +  t.equal(toSafeInteger('4.2'), 4, "Converts a value to a safe integer");
    +  t.equal(toSafeInteger(4.6), 5, "Converts a value to a safe integer");
    +  t.equal(toSafeInteger(1.5), 2, "Converts a value to a safe integer");
    +  t.equal(toSafeInteger(Infinity), 9007199254740991, "Converts a value to a safe integer");
    +  //t.deepEqual(toSafeInteger(args..), 'Expected');
    +  //t.equal(toSafeInteger(args..), 'Expected');
    +  //t.false(toSafeInteger(args..), 'Expected');
    +  //t.throws(toSafeInteger(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js
    index ae281a8a0..14bed623d 100644
    --- a/test/toSnakeCase/toSnakeCase.test.js
    +++ b/test/toSnakeCase/toSnakeCase.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const toSnakeCase = require('./toSnakeCase.js');
     
     test('Testing toSnakeCase', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toSnakeCase === 'function', 'toSnakeCase is a Function');
    -	t.equal(toSnakeCase('camelCase'), 'camel_case', "string converts to snake case");
    -	t.equal(toSnakeCase('some text'), 'some_text', "string converts to snake case");
    -	t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "string converts to snake case");
    -	t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "string converts to snake case");
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toSnakeCase === 'function', 'toSnakeCase is a Function');
    +  t.equal(toSnakeCase('camelCase'), 'camel_case', "string converts to snake case");
    +  t.equal(toSnakeCase('some text'), 'some_text', "string converts to snake case");
    +  t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "string converts to snake case");
    +  t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "string converts to snake case");
     
    -	//t.deepEqual(toSnakeCase(args..), 'Expected');
    -	//t.equal(toSnakeCase(args..), 'Expected');
    -	//t.false(toSnakeCase(args..), 'Expected');
    -	//t.throws(toSnakeCase(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(toSnakeCase(args..), 'Expected');
    +  //t.equal(toSnakeCase(args..), 'Expected');
    +  //t.false(toSnakeCase(args..), 'Expected');
    +  //t.throws(toSnakeCase(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js
    index a1c97c303..f7424a31d 100644
    --- a/test/toggleClass/toggleClass.test.js
    +++ b/test/toggleClass/toggleClass.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const toggleClass = require('./toggleClass.js');
     
     test('Testing toggleClass', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof toggleClass === 'function', 'toggleClass is a Function');
    -	//t.deepEqual(toggleClass(args..), 'Expected');
    -	//t.equal(toggleClass(args..), 'Expected');
    -	//t.false(toggleClass(args..), 'Expected');
    -	//t.throws(toggleClass(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof toggleClass === 'function', 'toggleClass is a Function');
    +  //t.deepEqual(toggleClass(args..), 'Expected');
    +  //t.equal(toggleClass(args..), 'Expected');
    +  //t.false(toggleClass(args..), 'Expected');
    +  //t.throws(toggleClass(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/tomorrow/tomorrow.test.js b/test/tomorrow/tomorrow.test.js
    index 0e8ab6edf..f8490270f 100644
    --- a/test/tomorrow/tomorrow.test.js
    +++ b/test/tomorrow/tomorrow.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const tomorrow = require('./tomorrow.js');
     
     test('Testing tomorrow', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof tomorrow === 'function', 'tomorrow is a Function');
    -	//t.deepEqual(tomorrow(args..), 'Expected');
    -	//t.equal(tomorrow(args..), 'Expected');
    -	//t.false(tomorrow(args..), 'Expected');
    -	//t.throws(tomorrow(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof tomorrow === 'function', 'tomorrow is a Function');
    +  //t.deepEqual(tomorrow(args..), 'Expected');
    +  //t.equal(tomorrow(args..), 'Expected');
    +  //t.false(tomorrow(args..), 'Expected');
    +  //t.throws(tomorrow(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/transform/transform.test.js b/test/transform/transform.test.js
    index d32739d4a..957cddf20 100644
    --- a/test/transform/transform.test.js
    +++ b/test/transform/transform.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const transform = require('./transform.js');
     
     test('Testing transform', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof transform === 'function', 'transform is a Function');
    -	//t.deepEqual(transform(args..), 'Expected');
    -	//t.equal(transform(args..), 'Expected');
    -	//t.false(transform(args..), 'Expected');
    -	//t.throws(transform(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof transform === 'function', 'transform is a Function');
    +  //t.deepEqual(transform(args..), 'Expected');
    +  //t.equal(transform(args..), 'Expected');
    +  //t.false(transform(args..), 'Expected');
    +  //t.throws(transform(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/truncateString/truncateString.test.js b/test/truncateString/truncateString.test.js
    index da3ce1d3c..8022f5a6c 100644
    --- a/test/truncateString/truncateString.test.js
    +++ b/test/truncateString/truncateString.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const truncateString = require('./truncateString.js');
     
     test('Testing truncateString', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof truncateString === 'function', 'truncateString is a Function');
    -	t.equal(truncateString('boomerang', 7), 'boom...', 'Truncates a "boomerang" up to a specified length.');
    -	//t.equal(truncateString(args..), 'Expected');
    -	//t.false(truncateString(args..), 'Expected');
    -	//t.throws(truncateString(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof truncateString === 'function', 'truncateString is a Function');
    +  t.equal(truncateString('boomerang', 7), 'boom...', 'Truncates a "boomerang" up to a specified length.');
    +  //t.equal(truncateString(args..), 'Expected');
    +  //t.false(truncateString(args..), 'Expected');
    +  //t.throws(truncateString(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js
    index 80479572d..a844c925b 100644
    --- a/test/truthCheckCollection/truthCheckCollection.test.js
    +++ b/test/truthCheckCollection/truthCheckCollection.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const truthCheckCollection = require('./truthCheckCollection.js');
     
     test('Testing truthCheckCollection', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof truthCheckCollection === 'function', 'truthCheckCollection is a Function');
    -	t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection");
    -	//t.deepEqual(truthCheckCollection(args..), 'Expected');
    -	//t.equal(truthCheckCollection(args..), 'Expected');
    -	//t.false(truthCheckCollection(args..), 'Expected');
    -	//t.throws(truthCheckCollection(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof truthCheckCollection === 'function', 'truthCheckCollection is a Function');
    +  t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection");
    +  //t.deepEqual(truthCheckCollection(args..), 'Expected');
    +  //t.equal(truthCheckCollection(args..), 'Expected');
    +  //t.false(truthCheckCollection(args..), 'Expected');
    +  //t.throws(truthCheckCollection(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js
    index d741e1c39..9a6f878f9 100644
    --- a/test/unary/unary.test.js
    +++ b/test/unary/unary.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const unary = require('./unary.js');
     
     test('Testing unary', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unary === 'function', 'unary is a Function');
    -	//t.deepEqual(unary(args..), 'Expected');
    -	//t.equal(unary(args..), 'Expected');
    -	//t.false(unary(args..), 'Expected');
    -	//t.throws(unary(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unary === 'function', 'unary is a Function');
    +  //t.deepEqual(unary(args..), 'Expected');
    +  //t.equal(unary(args..), 'Expected');
    +  //t.false(unary(args..), 'Expected');
    +  //t.throws(unary(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unescapeHTML/unescapeHTML.test.js b/test/unescapeHTML/unescapeHTML.test.js
    index 5bd5d9eb9..460a20106 100644
    --- a/test/unescapeHTML/unescapeHTML.test.js
    +++ b/test/unescapeHTML/unescapeHTML.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const unescapeHTML = require('./unescapeHTML.js');
     
     test('Testing unescapeHTML', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unescapeHTML === 'function', 'unescapeHTML is a Function');
    -	t.equal(unescapeHTML('<a href="#">Me & you</a>'),  'Me & you', 'Unescapes escaped HTML characters.');
    -	//t.deepEqual(unescapeHTML(args..), 'Expected');
    -	//t.equal(unescapeHTML(args..), 'Expected');
    -	//t.false(unescapeHTML(args..), 'Expected');
    -	//t.throws(unescapeHTML(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unescapeHTML === 'function', 'unescapeHTML is a Function');
    +  t.equal(unescapeHTML('<a href="#">Me & you</a>'),  'Me & you', 'Unescapes escaped HTML characters.');
    +  //t.deepEqual(unescapeHTML(args..), 'Expected');
    +  //t.equal(unescapeHTML(args..), 'Expected');
    +  //t.false(unescapeHTML(args..), 'Expected');
    +  //t.throws(unescapeHTML(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js
    index d13332937..ac4334008 100644
    --- a/test/unfold/unfold.test.js
    +++ b/test/unfold/unfold.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const unfold = require('./unfold.js');
     
     test('Testing unfold', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unfold === 'function', 'unfold is a Function');
    -	//t.deepEqual(unfold(args..), 'Expected');
    -	//t.equal(unfold(args..), 'Expected');
    -	//t.false(unfold(args..), 'Expected');
    -	//t.throws(unfold(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unfold === 'function', 'unfold is a Function');
    +  //t.deepEqual(unfold(args..), 'Expected');
    +  //t.equal(unfold(args..), 'Expected');
    +  //t.false(unfold(args..), 'Expected');
    +  //t.throws(unfold(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/union/union.test.js b/test/union/union.test.js
    index 1426f4a28..73427934a 100644
    --- a/test/union/union.test.js
    +++ b/test/union/union.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const union = require('./union.js');
     
     test('Testing union', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof union === 'function', 'union is a Function');
    -	t.deepEqual(union([1, 2, 3], [4, 3, 2]), [1, 2, 3, 4], "Returns every element that exists in any of the two arrays once");
    -	//t.deepEqual(union(args..), 'Expected');
    -	//t.equal(union(args..), 'Expected');
    -	//t.false(union(args..), 'Expected');
    -	//t.throws(union(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof union === 'function', 'union is a Function');
    +  t.deepEqual(union([1, 2, 3], [4, 3, 2]), [1, 2, 3, 4], "Returns every element that exists in any of the two arrays once");
    +  //t.deepEqual(union(args..), 'Expected');
    +  //t.equal(union(args..), 'Expected');
    +  //t.false(union(args..), 'Expected');
    +  //t.throws(union(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js
    index 8377bbbce..c59c4c303 100644
    --- a/test/unionBy/unionBy.test.js
    +++ b/test/unionBy/unionBy.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const unionBy = require('./unionBy.js');
     
     test('Testing unionBy', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unionBy === 'function', 'unionBy is a Function');
    -	//t.deepEqual(unionBy(args..), 'Expected');
    -	//t.equal(unionBy(args..), 'Expected');
    -	//t.false(unionBy(args..), 'Expected');
    -	//t.throws(unionBy(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unionBy === 'function', 'unionBy is a Function');
    +  //t.deepEqual(unionBy(args..), 'Expected');
    +  //t.equal(unionBy(args..), 'Expected');
    +  //t.false(unionBy(args..), 'Expected');
    +  //t.throws(unionBy(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js
    index e9df2f1c8..9b3f5ebfc 100644
    --- a/test/unionWith/unionWith.test.js
    +++ b/test/unionWith/unionWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const unionWith = require('./unionWith.js');
     
     test('Testing unionWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unionWith === 'function', 'unionWith is a Function');
    -	//t.deepEqual(unionWith(args..), 'Expected');
    -	//t.equal(unionWith(args..), 'Expected');
    -	//t.false(unionWith(args..), 'Expected');
    -	//t.throws(unionWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unionWith === 'function', 'unionWith is a Function');
    +  //t.deepEqual(unionWith(args..), 'Expected');
    +  //t.equal(unionWith(args..), 'Expected');
    +  //t.false(unionWith(args..), 'Expected');
    +  //t.throws(unionWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js
    index d2e30f925..38d55aea5 100644
    --- a/test/uniqueElements/uniqueElements.test.js
    +++ b/test/uniqueElements/uniqueElements.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const uniqueElements = require('./uniqueElements.js');
     
     test('Testing uniqueElements', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof uniqueElements === 'function', 'uniqueElements is a Function');
    -	t.deepEqual(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4,5], "Returns all unique values of an array");
    -	//t.deepEqual(uniqueElements(args..), 'Expected');
    -	//t.equal(uniqueElements(args..), 'Expected');
    -	//t.false(uniqueElements(args..), 'Expected');
    -	//t.throws(uniqueElements(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof uniqueElements === 'function', 'uniqueElements is a Function');
    +  t.deepEqual(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4,5], "Returns all unique values of an array");
    +  //t.deepEqual(uniqueElements(args..), 'Expected');
    +  //t.equal(uniqueElements(args..), 'Expected');
    +  //t.false(uniqueElements(args..), 'Expected');
    +  //t.throws(uniqueElements(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/untildify/untildify.test.js b/test/untildify/untildify.test.js
    index 0777b4917..3c3b286eb 100644
    --- a/test/untildify/untildify.test.js
    +++ b/test/untildify/untildify.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const untildify = require('./untildify.js');
     
     test('Testing untildify', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof untildify === 'function', 'untildify is a Function');
    -	//t.deepEqual(untildify(args..), 'Expected');
    -	//t.equal(untildify(args..), 'Expected');
    -	//t.false(untildify(args..), 'Expected');
    -	//t.throws(untildify(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof untildify === 'function', 'untildify is a Function');
    +  //t.deepEqual(untildify(args..), 'Expected');
    +  //t.equal(untildify(args..), 'Expected');
    +  //t.false(untildify(args..), 'Expected');
    +  //t.throws(untildify(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js
    index 76be27786..acfddc110 100644
    --- a/test/unzip/unzip.test.js
    +++ b/test/unzip/unzip.test.js
    @@ -2,14 +2,14 @@ const test = require('tape');
     const unzip = require('./unzip.js');
     
     test('Testing unzip', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unzip === 'function', 'unzip is a Function');
    -	t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`);
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unzip === 'function', 'unzip is a Function');
    +  t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`);
       t.deepEqual(unzip([['a', 1, true], ['b', 2]]), [['a', 'b'], [1, 2], [true]], `unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]`);
    -	//t.deepEqual(unzip(args..), 'Expected');
    -	//t.equal(unzip(args..), 'Expected');
    -	//t.false(unzip(args..), 'Expected');
    -	//t.throws(unzip(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(unzip(args..), 'Expected');
    +  //t.equal(unzip(args..), 'Expected');
    +  //t.false(unzip(args..), 'Expected');
    +  //t.throws(unzip(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js
    index 8c3cbea6a..a9416e7c2 100644
    --- a/test/unzipWith/unzipWith.test.js
    +++ b/test/unzipWith/unzipWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const unzipWith = require('./unzipWith.js');
     
     test('Testing unzipWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof unzipWith === 'function', 'unzipWith is a Function');
    -	t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`);
    -	//t.equal(unzipWith(args..), 'Expected');
    -	//t.false(unzipWith(args..), 'Expected');
    -	//t.throws(unzipWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof unzipWith === 'function', 'unzipWith is a Function');
    +  t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`);
    +  //t.equal(unzipWith(args..), 'Expected');
    +  //t.false(unzipWith(args..), 'Expected');
    +  //t.throws(unzipWith(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/validateNumber/validateNumber.test.js b/test/validateNumber/validateNumber.test.js
    index 4f8908d88..e8037cc65 100644
    --- a/test/validateNumber/validateNumber.test.js
    +++ b/test/validateNumber/validateNumber.test.js
    @@ -2,21 +2,21 @@ const test = require('tape');
     const validateNumber = require('./validateNumber.js');
     
     test('Testing validateNumber', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof validateNumber === 'function', 'validateNumber is a Function');
    -	t.true(validateNumber(9), 'validateNumber(9) returns true');
    -	t.true(validateNumber('234asd'.slice(0, 2)), 'validateNumber(234asd.slice(0, 2)) returns true');
    -	t.true(validateNumber(1232), 'validateNumber(1232) returns true');
    -	t.true(validateNumber(1232 + 13423), 'validateNumber(1232 + 13423) returns true');
    -	t.true(validateNumber(1232 * 2342 * 123), 'validateNumber(1232 * 2342 * 123) returns true');
    -	t.true(validateNumber(1232.23423536), 'validateNumber(1232.23423536) returns true');
    -	t.false(validateNumber('234asd'), 'validateNumber(234asd) returns false');
    -	t.false(validateNumber('e234d'), 'validateNumber(e234d) returns false');
    -	t.false(validateNumber(false), 'validateNumber(false) returns false');
    -	t.false(validateNumber(true), 'validateNumber(true) returns false');
    -	t.false(validateNumber(null), 'validateNumber(null) returns false');
    -	t.false(validateNumber(123 * 'asd'), 'validateNumber(123 * asd) returns false');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof validateNumber === 'function', 'validateNumber is a Function');
    +  t.true(validateNumber(9), 'validateNumber(9) returns true');
    +  t.true(validateNumber('234asd'.slice(0, 2)), 'validateNumber(234asd.slice(0, 2)) returns true');
    +  t.true(validateNumber(1232), 'validateNumber(1232) returns true');
    +  t.true(validateNumber(1232 + 13423), 'validateNumber(1232 + 13423) returns true');
    +  t.true(validateNumber(1232 * 2342 * 123), 'validateNumber(1232 * 2342 * 123) returns true');
    +  t.true(validateNumber(1232.23423536), 'validateNumber(1232.23423536) returns true');
    +  t.false(validateNumber('234asd'), 'validateNumber(234asd) returns false');
    +  t.false(validateNumber('e234d'), 'validateNumber(e234d) returns false');
    +  t.false(validateNumber(false), 'validateNumber(false) returns false');
    +  t.false(validateNumber(true), 'validateNumber(true) returns false');
    +  t.false(validateNumber(null), 'validateNumber(null) returns false');
    +  t.false(validateNumber(123 * 'asd'), 'validateNumber(123 * asd) returns false');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/without/without.test.js b/test/without/without.test.js
    index 09fdcb121..7d9fa7e70 100644
    --- a/test/without/without.test.js
    +++ b/test/without/without.test.js
    @@ -2,18 +2,18 @@ const test = require('tape');
     const without = require('./without.js');
     
     test('Testing without', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof without === 'function', 'without is a Function');
    -	t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]");
    -	t.deepEqual(without([]), [], "without([]) returns []");
    -	t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]");
    -	t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']");
    -	t.throws(() => without(), 'without() throws an error');
    -	t.throws(() => without(null), 'without(null) throws an error');
    -	t.throws(() => without(undefined), 'without(undefined) throws an error');
    -	t.throws(() => without(123), 'without() throws an error');
    -	t.throws(() => without({}), 'without({}) throws an error');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof without === 'function', 'without is a Function');
    +  t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]");
    +  t.deepEqual(without([]), [], "without([]) returns []");
    +  t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]");
    +  t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']");
    +  t.throws(() => without(), 'without() throws an error');
    +  t.throws(() => without(null), 'without(null) throws an error');
    +  t.throws(() => without(undefined), 'without(undefined) throws an error');
    +  t.throws(() => without(123), 'without() throws an error');
    +  t.throws(() => without({}), 'without({}) throws an error');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/words/words.test.js b/test/words/words.test.js
    index bb92b2c10..1c8a7fda7 100644
    --- a/test/words/words.test.js
    +++ b/test/words/words.test.js
    @@ -2,18 +2,18 @@ const test = require('tape');
     const words = require('./words.js');
     
     test('Testing words', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof words === 'function', 'words is a Function');
    -	t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]");
    -	t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]");
    -	t.true(Array.isArray(words('I love javaScript!!')), 'words(I love javaScript!!) returns an array');
    -	t.throws(() => words(), 'words() throws a error');
    -	t.throws(() => words(null), 'words(null) throws a error');
    -	t.throws(() => words(undefined), 'words(undefined) throws a error');
    -	t.throws(() => words({}), 'words({}) throws a error');
    -	t.throws(() => words([]), 'words([]) throws a error');
    -	t.throws(() => words(1234), 'words(1234) throws a error');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof words === 'function', 'words is a Function');
    +  t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]");
    +  t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]");
    +  t.true(Array.isArray(words('I love javaScript!!')), 'words(I love javaScript!!) returns an array');
    +  t.throws(() => words(), 'words() throws a error');
    +  t.throws(() => words(null), 'words(null) throws a error');
    +  t.throws(() => words(undefined), 'words(undefined) throws a error');
    +  t.throws(() => words({}), 'words({}) throws a error');
    +  t.throws(() => words([]), 'words([]) throws a error');
    +  t.throws(() => words(1234), 'words(1234) throws a error');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js
    index 9d650e65c..9bc6571de 100644
    --- a/test/xProd/xProd.test.js
    +++ b/test/xProd/xProd.test.js
    @@ -2,13 +2,13 @@ const test = require('tape');
     const xProd = require('./xProd.js');
     
     test('Testing xProd', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof xProd === 'function', 'xProd is a Function');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof xProd === 'function', 'xProd is a Function');
       t.deepEqual(xProd([1, 2], ['a', 'b']), [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']], `xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]`);
    -	//t.deepEqual(xProd(args..), 'Expected');
    -	//t.equal(xProd(args..), 'Expected');
    -	//t.false(xProd(args..), 'Expected');
    -	//t.throws(xProd(args..), 'Expected');
    -	t.end();
    +  //t.deepEqual(xProd(args..), 'Expected');
    +  //t.equal(xProd(args..), 'Expected');
    +  //t.false(xProd(args..), 'Expected');
    +  //t.throws(xProd(args..), 'Expected');
    +  t.end();
     });
    diff --git a/test/yesNo/yesNo.test.js b/test/yesNo/yesNo.test.js
    index c50e452db..6b7c66d1c 100644
    --- a/test/yesNo/yesNo.test.js
    +++ b/test/yesNo/yesNo.test.js
    @@ -2,21 +2,21 @@ const test = require('tape');
     const yesNo = require('./yesNo.js');
     
     test('Testing yesNo', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof yesNo === 'function', 'yesNo is a Function');
    -	t.true(yesNo('Y'), 'yesNo(Y) returns true');
    -	t.true(yesNo('yes'), 'yesNo(yes) returns true');
    -	t.true(yesNo('foo', true), 'yesNo(foo, true) returns true');
    -	t.false(yesNo('No'), 'yesNo(No) returns false');
    -	t.false(yesNo(), 'yesNo() returns false');
    -	t.false(yesNo(null), 'yesNo(null) returns false');
    -	t.false(yesNo(undefined), 'yesNo(undefined) returns false');
    -	t.false(yesNo([123, null]), 'yesNo([123, null]) returns false');
    -	t.false(yesNo(['Yes', 'No']), 'yesNo([Yes, No]) returns false');
    -	t.false(yesNo({ 2: 'Yes' }), 'yesNo({ 2: Yes }) returns false');
    -	t.true(yesNo(['Yes', 'No'], true), 'yesNo([Yes, No], true) returns true');
    -	t.true(yesNo({ 2: 'Yes' }, true), 'yesNo({ 2: Yes }, true) returns true');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof yesNo === 'function', 'yesNo is a Function');
    +  t.true(yesNo('Y'), 'yesNo(Y) returns true');
    +  t.true(yesNo('yes'), 'yesNo(yes) returns true');
    +  t.true(yesNo('foo', true), 'yesNo(foo, true) returns true');
    +  t.false(yesNo('No'), 'yesNo(No) returns false');
    +  t.false(yesNo(), 'yesNo() returns false');
    +  t.false(yesNo(null), 'yesNo(null) returns false');
    +  t.false(yesNo(undefined), 'yesNo(undefined) returns false');
    +  t.false(yesNo([123, null]), 'yesNo([123, null]) returns false');
    +  t.false(yesNo(['Yes', 'No']), 'yesNo([Yes, No]) returns false');
    +  t.false(yesNo({ 2: 'Yes' }), 'yesNo({ 2: Yes }) returns false');
    +  t.true(yesNo(['Yes', 'No'], true), 'yesNo([Yes, No], true) returns true');
    +  t.true(yesNo({ 2: 'Yes' }, true), 'yesNo({ 2: Yes }, true) returns true');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js
    index c198670d9..8e6ce6747 100644
    --- a/test/zip/zip.test.js
    +++ b/test/zip/zip.test.js
    @@ -2,17 +2,17 @@ const test = require('tape');
     const zip = require('./zip.js');
     
     test('Testing zip', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof zip === 'function', 'zip is a Function');
    -	t.deepEqual(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]], 'zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]');
    -	t.deepEqual(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]], 'zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]');
    -	t.deepEqual(zip(), [], 'zip([]) returns []');
    -	t.deepEqual(zip(123), [], 'zip(123) returns []');
    -	t.true(Array.isArray(zip(['a', 'b'], [1, 2], [true, false])), 'zip([a, b], [1, 2], [true, false]) returns an Array');
    -	t.true(Array.isArray(zip(['a'], [1, 2], [true, false])), 'zip([a], [1, 2], [true, false]) returns an Array');
    -	t.throws(() => zip(null), 'zip(null) throws an error');
    -	t.throws(() => zip(undefined), 'zip(undefined) throws an error');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof zip === 'function', 'zip is a Function');
    +  t.deepEqual(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]], 'zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]');
    +  t.deepEqual(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]], 'zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]');
    +  t.deepEqual(zip(), [], 'zip([]) returns []');
    +  t.deepEqual(zip(123), [], 'zip(123) returns []');
    +  t.true(Array.isArray(zip(['a', 'b'], [1, 2], [true, false])), 'zip([a, b], [1, 2], [true, false]) returns an Array');
    +  t.true(Array.isArray(zip(['a'], [1, 2], [true, false])), 'zip([a], [1, 2], [true, false]) returns an Array');
    +  t.throws(() => zip(null), 'zip(null) throws an error');
    +  t.throws(() => zip(undefined), 'zip(undefined) throws an error');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js
    index ab0f9223d..83ba782a0 100644
    --- a/test/zipObject/zipObject.test.js
    +++ b/test/zipObject/zipObject.test.js
    @@ -2,18 +2,18 @@ const test = require('tape');
     const zipObject = require('./zipObject.js');
     
     test('Testing zipObject', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof zipObject === 'function', 'zipObject is a Function');
    -	t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}');
    -	t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}');
    -	t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }');
    -	t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }');
    -	t.throws(() => zipObject(), 'zipObject() throws an error');
    -	t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error');
    -	t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error');
    -	t.throws(() => zipObject('string'), 'zipObject(string) throws an error');
    -	t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error');
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof zipObject === 'function', 'zipObject is a Function');
    +  t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}');
    +  t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}');
    +  t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }');
    +  t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }');
    +  t.throws(() => zipObject(), 'zipObject() throws an error');
    +  t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error');
    +  t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error');
    +  t.throws(() => zipObject('string'), 'zipObject(string) throws an error');
    +  t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error');
     
    -	t.end();
    +  t.end();
     });
    diff --git a/test/zipWith/zipWith.test.js b/test/zipWith/zipWith.test.js
    index 382c59776..2cf409e24 100644
    --- a/test/zipWith/zipWith.test.js
    +++ b/test/zipWith/zipWith.test.js
    @@ -2,12 +2,12 @@ const test = require('tape');
     const zipWith = require('./zipWith.js');
     
     test('Testing zipWith', (t) => {
    -	//For more information on all the methods supported by tape
    -	//Please go to https://github.com/substack/tape
    -	t.true(typeof zipWith === 'function', 'zipWith is a Function');
    -	//t.deepEqual(zipWith(args..), 'Expected');
    -	//t.equal(zipWith(args..), 'Expected');
    -	//t.false(zipWith(args..), 'Expected');
    -	//t.throws(zipWith(args..), 'Expected');
    -	t.end();
    +  //For more information on all the methods supported by tape
    +  //Please go to https://github.com/substack/tape
    +  t.true(typeof zipWith === 'function', 'zipWith is a Function');
    +  //t.deepEqual(zipWith(args..), 'Expected');
    +  //t.equal(zipWith(args..), 'Expected');
    +  //t.false(zipWith(args..), 'Expected');
    +  //t.throws(zipWith(args..), 'Expected');
    +  t.end();
     });
    \ No newline at end of file
    
    From a4f0c2092a152d2f48f6f98c4708a4a1323331a0 Mon Sep 17 00:00:00 2001
    From: Angelos Chalaris 
    Date: Wed, 24 Jan 2018 18:02:55 +0200
    Subject: [PATCH 091/103] Fixed order in tag script
    
    ---
     scripts/tag.js | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/scripts/tag.js b/scripts/tag.js
    index 733e45f18..e4bbc80e9 100644
    --- a/scripts/tag.js
    +++ b/scripts/tag.js
    @@ -57,7 +57,6 @@ try {
           })
       );
       tagDbStats = Object.entries(tagDbData)
    -    .sort((a, b) => a[1][0].localeCompare(b[1][0]))
         .reduce((acc, val) => {
           val[1].forEach(v => acc.hasOwnProperty(v) ? acc[v]++ : (acc[v] = 1));
           return acc;
    @@ -89,7 +88,7 @@ try {
     }
     // Log statistics for the tag_database file
     console.log(`\n${chalk.bgWhite(chalk.black('=== TAG STATS ==='))}`);
    -for (let tagData of Object.entries(tagDbStats).filter(v => v[0] !== 'undefined'))
    +for (let tagData of Object.entries(tagDbStats).filter(v => v[0] !== 'undefined').sort((a,b) => a[0].localeCompare(b[0])))
       console.log(`${chalk.green(tagData[0])}: ${tagData[1]} snippets`);
     console.log(
       `${chalk.blue("New untagged snippets (will be tagged as 'uncategorized'):")} ${missingTags}\n`
    
    From 2877ae4e76b4ad432aa8b482c45bc874e3637867 Mon Sep 17 00:00:00 2001
    From: 30secondsofcode <30secondsofcode@gmail.com>
    Date: Wed, 24 Jan 2018 20:13:16 +0000
    Subject: [PATCH 092/103] Travis build: 1413 [cron]
    
    ---
     dist/_30s.es5.js     |  336 ++++-
     dist/_30s.es5.min.js |    2 +-
     dist/_30s.esm.js     |  107 +-
     dist/_30s.js         |  107 +-
     dist/_30s.min.js     |    2 +-
     test/testlog         | 2854 +++++++++++++++++++++---------------------
     6 files changed, 1929 insertions(+), 1479 deletions(-)
    
    diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js
    index 738d54353..7ebf0ef35 100644
    --- a/dist/_30s.es5.js
    +++ b/dist/_30s.es5.js
    @@ -49,6 +49,18 @@ var arrayToHtmlList = function arrayToHtmlList(arr, listID) {
       });
     };
     
    +function _toConsumableArray(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 ary = function ary(fn, n) {
    +  return function () {
    +    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    +      args[_key] = arguments[_key];
    +    }
    +
    +    return fn.apply(undefined, _toConsumableArray(args.slice(0, n)));
    +  };
    +};
    +
     var atob = function atob(str) {
       return new Buffer(str, 'base64').toString('binary');
     };
    @@ -71,6 +83,26 @@ var averageBy = function averageBy(arr, fn) {
       }, 0) / arr.length;
     };
     
    +var bind = function bind(fn, context) {
    +  for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    +    args[_key - 2] = arguments[_key];
    +  }
    +
    +  return function () {
    +    return fn.apply(context, args.concat.apply(args, arguments));
    +  };
    +};
    +
    +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];
    +  }
    +
    +  return function () {
    +    return context[fn].apply(context, args.concat.apply(args, arguments));
    +  };
    +};
    +
     var bottomVisible = function bottomVisible() {
       return document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight);
     };
    @@ -207,6 +239,18 @@ var compose = function compose() {
       });
     };
     
    +var composeRight = function composeRight() {
    +  for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
    +    fns[_key] = arguments[_key];
    +  }
    +
    +  return fns.reduce(function (f, g) {
    +    return function () {
    +      return g(f.apply(undefined, arguments));
    +    };
    +  });
    +};
    +
     var copyToClipboard = function copyToClipboard(str) {
       var el = document.createElement('textarea');
       el.value = str;
    @@ -300,24 +344,24 @@ var deepClone = function deepClone(obj) {
       return clone;
     };
     
    -function _toConsumableArray(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); } }
    +function _toConsumableArray$1(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 deepFlatten = function deepFlatten(arr) {
       var _ref;
     
    -  return (_ref = []).concat.apply(_ref, _toConsumableArray(arr.map(function (v) {
    +  return (_ref = []).concat.apply(_ref, _toConsumableArray$1(arr.map(function (v) {
         return Array.isArray(v) ? deepFlatten(v) : v;
       })));
     };
     
    -function _toConsumableArray$1(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); } }
    +function _toConsumableArray$2(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 defaults = function defaults(obj) {
       for (var _len = arguments.length, defs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
         defs[_key - 1] = arguments[_key];
       }
     
    -  return Object.assign.apply(Object, [{}, obj].concat(_toConsumableArray$1(defs.reverse()), [obj]));
    +  return Object.assign.apply(Object, [{}, obj].concat(_toConsumableArray$2(defs.reverse()), [obj]));
     };
     
     var defer = function defer(fn) {
    @@ -328,6 +372,14 @@ var defer = function defer(fn) {
       return setTimeout.apply(undefined, [fn, 1].concat(args));
     };
     
    +var delay = function delay(fn, wait) {
    +  for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    +    args[_key - 2] = arguments[_key];
    +  }
    +
    +  return setTimeout.apply(undefined, [fn, wait].concat(args));
    +};
    +
     var detectDeviceType = function detectDeviceType() {
       return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop'
       );
    @@ -340,6 +392,15 @@ var difference = function difference(a, b) {
       });
     };
     
    +var differenceBy = function differenceBy(a, b, fn) {
    +  var s = new Set(b.map(function (v) {
    +    return fn(v);
    +  }));
    +  return a.filter(function (x) {
    +    return !s.has(fn(x));
    +  });
    +};
    +
     var differenceWith = function differenceWith(arr, val, comp) {
       return arr.filter(function (a) {
         return val.findIndex(function (b) {
    @@ -348,10 +409,10 @@ var differenceWith = function differenceWith(arr, val, comp) {
       });
     };
     
    -function _toConsumableArray$2(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); } }
    +function _toConsumableArray$3(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 digitize = function digitize(n) {
    -  return [].concat(_toConsumableArray$2("" + n)).map(function (i) {
    +  return [].concat(_toConsumableArray$3("" + n)).map(function (i) {
         return parseInt(i);
       });
     };
    @@ -496,7 +557,15 @@ var findKey = function findKey(obj, fn) {
     };
     
     var findLast = function findLast(arr, fn) {
    -  return arr.filter(fn).slice(-1);
    +  return arr.filter(fn).slice(-1)[0];
    +};
    +
    +var findLastIndex = function findLastIndex(arr, fn) {
    +  return arr.map(function (val, i) {
    +    return [i, val];
    +  }).filter(function (val) {
    +    return fn(val[1], val[0], arr);
    +  }).slice(-1)[0][0];
     };
     
     var findLastKey = function findLastKey(obj, fn) {
    @@ -565,11 +634,11 @@ var functionName = function functionName(fn) {
       return console.debug(fn.name), fn;
     };
     
    -function _toConsumableArray$3(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); } }
    +function _toConsumableArray$4(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 functions = function functions(obj) {
       var inherited = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    -  return (inherited ? [].concat(_toConsumableArray$3(Object.keys(obj)), _toConsumableArray$3(Object.keys(Object.getPrototypeOf(obj)))) : Object.keys(obj)).filter(function (key) {
    +  return (inherited ? [].concat(_toConsumableArray$4(Object.keys(obj)), _toConsumableArray$4(Object.keys(Object.getPrototypeOf(obj)))) : Object.keys(obj)).filter(function (key) {
         return typeof obj[key] === 'function';
       });
     };
    @@ -685,12 +754,12 @@ var head = function head(arr) {
       return arr[0];
     };
     
    -function _toConsumableArray$4(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); } }
    +function _toConsumableArray$5(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 hexToRGB = function hexToRGB(hex) {
       var alpha = false,
           h = hex.slice(hex.startsWith('#') ? 1 : 0);
    -  if (h.length === 3) h = [].concat(_toConsumableArray$4(h)).map(function (x) {
    +  if (h.length === 3) h = [].concat(_toConsumableArray$5(h)).map(function (x) {
         return x + x;
       }).join('');else if (h.length === 8) alpha = true;
       h = parseInt(h, 16);
    @@ -794,6 +863,23 @@ var intersection = function intersection(a, b) {
       });
     };
     
    +var intersectionBy = function intersectionBy(a, b, fn) {
    +  var s = new Set(b.map(function (x) {
    +    return fn(x);
    +  }));
    +  return a.filter(function (x) {
    +    return s.has(fn(x));
    +  });
    +};
    +
    +var intersectionWith = function intersectionWith(a, b, comp) {
    +  return a.filter(function (x) {
    +    return b.findIndex(function (y) {
    +      return comp(x, y);
    +    }) !== -1;
    +  });
    +};
    +
     var invertKeyValues = function invertKeyValues(obj, fn) {
       return Object.keys(obj).reduce(function (acc, key) {
         var val = fn ? fn(obj[key]) : obj[key];
    @@ -812,11 +898,11 @@ var isAbsoluteURL = function isAbsoluteURL(str) {
       );
     };
     
    -function _toConsumableArray$5(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); } }
    +function _toConsumableArray$6(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 isArrayLike = function isArrayLike(val) {
       try {
    -    return [].concat(_toConsumableArray$5(val)), true;
    +    return [].concat(_toConsumableArray$6(val)), true;
       } catch (e) {
         return false;
       }
    @@ -1056,28 +1142,28 @@ var matchesWith = function matchesWith(obj, source, fn) {
       });
     };
     
    -function _toConsumableArray$6(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); } }
    +function _toConsumableArray$7(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 maxBy = function maxBy(arr, fn) {
    -  return Math.max.apply(Math, _toConsumableArray$6(arr.map(typeof fn === 'function' ? fn : function (val) {
    +  return Math.max.apply(Math, _toConsumableArray$7(arr.map(typeof fn === 'function' ? fn : function (val) {
         return val[fn];
       })));
     };
     
    -function _toConsumableArray$7(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); } }
    +function _toConsumableArray$8(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 maxN = function maxN(arr) {
       var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
    -  return [].concat(_toConsumableArray$7(arr)).sort(function (a, b) {
    +  return [].concat(_toConsumableArray$8(arr)).sort(function (a, b) {
         return b - a;
       }).slice(0, n);
     };
     
    -function _toConsumableArray$8(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); } }
    +function _toConsumableArray$9(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 median = function median(arr) {
       var mid = Math.floor(arr.length / 2),
    -      nums = [].concat(_toConsumableArray$8(arr)).sort(function (a, b) {
    +      nums = [].concat(_toConsumableArray$9(arr)).sort(function (a, b) {
         return a - b;
       });
       return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
    @@ -1105,19 +1191,19 @@ var merge = function merge() {
       }, {});
     };
     
    -function _toConsumableArray$9(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); } }
    +function _toConsumableArray$10(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 minBy = function minBy(arr, fn) {
    -  return Math.min.apply(Math, _toConsumableArray$9(arr.map(typeof fn === 'function' ? fn : function (val) {
    +  return Math.min.apply(Math, _toConsumableArray$10(arr.map(typeof fn === 'function' ? fn : function (val) {
         return val[fn];
       })));
     };
     
    -function _toConsumableArray$10(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); } }
    +function _toConsumableArray$11(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 minN = function minN(arr) {
       var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
    -  return [].concat(_toConsumableArray$10(arr)).sort(function (a, b) {
    +  return [].concat(_toConsumableArray$11(arr)).sort(function (a, b) {
         return a - b;
       }).slice(0, n);
     };
    @@ -1233,10 +1319,10 @@ var once = function once(fn) {
     
     var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
     
    -function _toConsumableArray$11(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); } }
    +function _toConsumableArray$12(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 orderBy = function orderBy(arr, props, orders) {
    -  return [].concat(_toConsumableArray$11(arr)).sort(function (a, b) {
    +  return [].concat(_toConsumableArray$12(arr)).sort(function (a, b) {
         return props.reduce(function (acc, prop, i) {
           if (acc === 0) {
             var _ref = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]],
    @@ -1281,6 +1367,34 @@ var parseCookie = function parseCookie(str) {
       }, {});
     };
     
    +var partial = function partial(fn) {
    +  for (var _len = arguments.length, partials = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    +    partials[_key - 1] = arguments[_key];
    +  }
    +
    +  return function () {
    +    for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    +      args[_key2] = arguments[_key2];
    +    }
    +
    +    return fn.apply(undefined, partials.concat(args));
    +  };
    +};
    +
    +var partialRight = function partialRight(fn) {
    +  for (var _len = arguments.length, partials = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    +    partials[_key - 1] = arguments[_key];
    +  }
    +
    +  return function () {
    +    for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    +      args[_key2] = arguments[_key2];
    +    }
    +
    +    return fn.apply(undefined, args.concat(partials));
    +  };
    +};
    +
     var partition = function partition(arr, fn) {
       return arr.reduce(function (acc, val, i, arr) {
         acc[fn(val, i, arr) ? 0 : 1].push(val);
    @@ -1458,6 +1572,12 @@ var redirect = function redirect(url) {
       return asLink ? window.location.href = url : window.location.replace(url);
     };
     
    +var reduceSuccessive = function reduceSuccessive(arr, fn, acc) {
    +  return arr.reduce(function (res, val, i, arr) {
    +    return res.push(fn(res.slice(-1)[0], val, i, arr)), res;
    +  }, [acc]);
    +};
    +
     var reducedFilter = function reducedFilter(data, keys, fn) {
       return data.filter(fn).map(function (el) {
         return keys.reduce(function (acc, key) {
    @@ -1474,10 +1594,10 @@ var remove = function remove(arr, func) {
       }, []) : [];
     };
     
    -function _toConsumableArray$12(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); } }
    +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) {
    -  return [].concat(_toConsumableArray$12(str)).reverse().join('');
    +  return [].concat(_toConsumableArray$13(str)).reverse().join('');
     };
     
     var round = function round(n) {
    @@ -1601,10 +1721,10 @@ var sleep = function sleep(ms) {
       });
     };
     
    -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); } }
    +function _toConsumableArray$14(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 sortCharactersInString = function sortCharactersInString(str) {
    -  return [].concat(_toConsumableArray$13(str)).sort(function (a, b) {
    +  return [].concat(_toConsumableArray$14(str)).sort(function (a, b) {
         return a.localeCompare(b);
       }).join('');
     };
    @@ -1617,15 +1737,25 @@ var sortedIndex = function sortedIndex(arr, n) {
       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;
    +};
    +
     var splitLines = function splitLines(str) {
       return str.split(/\r?\n/);
     };
     
    -function _toConsumableArray$14(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); } }
    +function _toConsumableArray$15(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 spreadOver = function spreadOver(fn) {
       return function (argsArr) {
    -    return fn.apply(undefined, _toConsumableArray$14(argsArr));
    +    return fn.apply(undefined, _toConsumableArray$15(argsArr));
       };
     };
     
    @@ -1670,18 +1800,48 @@ var sumPower = function sumPower(end) {
       }, 0);
     };
     
    -function _toConsumableArray$15(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); } }
    +function _toConsumableArray$16(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 symmetricDifference = function symmetricDifference(a, b) {
       var sA = new Set(a),
           sB = new Set(b);
    -  return [].concat(_toConsumableArray$15(a.filter(function (x) {
    +  return [].concat(_toConsumableArray$16(a.filter(function (x) {
         return !sB.has(x);
    -  })), _toConsumableArray$15(b.filter(function (x) {
    +  })), _toConsumableArray$16(b.filter(function (x) {
         return !sA.has(x);
       })));
     };
     
    +function _toConsumableArray$17(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 symmetricDifferenceBy = function symmetricDifferenceBy(a, b, fn) {
    +  var sA = new Set(a.map(function (v) {
    +    return fn(v);
    +  })),
    +      sB = new Set(b.map(function (v) {
    +    return fn(v);
    +  }));
    +  return [].concat(_toConsumableArray$17(a.filter(function (x) {
    +    return !sB.has(fn(x));
    +  })), _toConsumableArray$17(b.filter(function (x) {
    +    return !sA.has(fn(x));
    +  })));
    +};
    +
    +function _toConsumableArray$18(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 symmetricDifferenceWith = function symmetricDifferenceWith(arr, val, comp) {
    +  return [].concat(_toConsumableArray$18(arr.filter(function (a) {
    +    return val.findIndex(function (b) {
    +      return comp(a, b);
    +    }) === -1;
    +  })), _toConsumableArray$18(val.filter(function (a) {
    +    return arr.findIndex(function (b) {
    +      return comp(a, b);
    +    }) === -1;
    +  })));
    +};
    +
     var tail = function tail(arr) {
       return arr.length > 1 ? arr.slice(1) : arr;
     };
    @@ -1703,6 +1863,13 @@ var timeTaken = function timeTaken(callback) {
       return r;
     };
     
    +var times = function times(n, fn) {
    +  var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
    +
    +  var i = 0;
    +  while (fn.call(context, i) !== false && ++i < n) {}
    +};
    +
     var toCamelCase = function toCamelCase(str) {
       var s = str && str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(function (x) {
         return x.slice(0, 1).toUpperCase() + x.slice(1).toLowerCase();
    @@ -1765,6 +1932,12 @@ var truthCheckCollection = function truthCheckCollection(collection, pre) {
       });
     };
     
    +var unary = function unary(fn) {
    +  return function (val) {
    +    return fn(val);
    +  };
    +};
    +
     var unescapeHTML = function unescapeHTML(str) {
       return str.replace(/&|<|>|'|"/g, function (tag) {
         return {
    @@ -1777,22 +1950,85 @@ var unescapeHTML = function unescapeHTML(str) {
       });
     };
     
    -function _toConsumableArray$16(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 union = function union(a, b) {
    -  return Array.from(new Set([].concat(_toConsumableArray$16(a), _toConsumableArray$16(b))));
    +var unfold = function unfold(fn, seed) {
    +  var result = [],
    +      val = [null, seed];
    +  while (val = fn(val[1])) {
    +    result.push(val[0]);
    +  }return result;
     };
     
    -function _toConsumableArray$17(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); } }
    +function _toConsumableArray$19(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 union = function union(a, b) {
    +  return Array.from(new Set([].concat(_toConsumableArray$19(a), _toConsumableArray$19(b))));
    +};
    +
    +function _toConsumableArray$20(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 unionBy = function unionBy(a, b, fn) {
    +  var s = new Set(a.map(function (v) {
    +    return fn(v);
    +  }));
    +  return Array.from(new Set([].concat(_toConsumableArray$20(a), _toConsumableArray$20(b.filter(function (x) {
    +    return !s.has(fn(x));
    +  })))));
    +};
    +
    +function _toConsumableArray$21(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 unionWith = function unionWith(a, b, comp) {
    +  return Array.from(new Set([].concat(_toConsumableArray$21(a), _toConsumableArray$21(b.filter(function (x) {
    +    return a.findIndex(function (y) {
    +      return comp(x, y);
    +    }) === -1;
    +  })))));
    +};
    +
    +function _toConsumableArray$22(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 uniqueElements = function uniqueElements(arr) {
    -  return [].concat(_toConsumableArray$17(new Set(arr)));
    +  return [].concat(_toConsumableArray$22(new Set(arr)));
     };
     
     var untildify = function untildify(str) {
       return str.replace(/^~($|\/|\\)/, (typeof require !== "undefined" && require('os').homedir()) + "$1");
     };
     
    +function _toConsumableArray$23(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 unzip = function unzip(arr) {
    +  return arr.reduce(function (acc, val) {
    +    return val.forEach(function (v, i) {
    +      return acc[i].push(v);
    +    }), acc;
    +  }, Array.from({
    +    length: Math.max.apply(Math, _toConsumableArray$23(arr.map(function (x) {
    +      return x.length;
    +    })))
    +  }).map(function (x) {
    +    return [];
    +  }));
    +};
    +
    +function _toConsumableArray$24(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 unzipWith = function unzipWith(arr, fn) {
    +  return arr.reduce(function (acc, val) {
    +    return val.forEach(function (v, i) {
    +      return acc[i].push(v);
    +    }), acc;
    +  }, Array.from({
    +    length: Math.max.apply(Math, _toConsumableArray$24(arr.map(function (x) {
    +      return x.length;
    +    })))
    +  }).map(function (x) {
    +    return [];
    +  })).map(function (val) {
    +    return fn.apply(undefined, _toConsumableArray$24(val));
    +  });
    +};
    +
     var validateNumber = function validateNumber(n) {
       return !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
     };
    @@ -1812,20 +2048,28 @@ var words = function words(str) {
       return str.split(pattern).filter(Boolean);
     };
     
    +var xProd = function xProd(a, b) {
    +  return a.reduce(function (acc, x) {
    +    return acc.concat(b.map(function (y) {
    +      return [x, y];
    +    }));
    +  }, []);
    +};
    +
     var yesNo = function yesNo(val) {
       var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
       return (/^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def
       );
     };
     
    -function _toConsumableArray$18(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); } }
    +function _toConsumableArray$25(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 zip = function zip() {
       for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) {
         arrays[_key] = arguments[_key];
       }
     
    -  var maxLength = Math.max.apply(Math, _toConsumableArray$18(arrays.map(function (x) {
    +  var maxLength = Math.max.apply(Math, _toConsumableArray$25(arrays.map(function (x) {
         return x.length;
       })));
       return Array.from({ length: maxLength }).map(function (_, i) {
    @@ -1841,7 +2085,7 @@ var zipObject = function zipObject(props, values) {
       }, {});
     };
     
    -function _toConsumableArray$19(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); } }
    +function _toConsumableArray$26(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 zipWith = function zipWith() {
       for (var _len = arguments.length, arrays = Array(_len), _key = 0; _key < _len; _key++) {
    @@ -1851,7 +2095,7 @@ var zipWith = function zipWith() {
       var length = arrays.length;
       var fn = length > 1 ? arrays[length - 1] : undefined;
       fn = typeof fn == 'function' ? (arrays.pop(), fn) : undefined;
    -  var maxLength = Math.max.apply(Math, _toConsumableArray$19(arrays.map(function (x) {
    +  var maxLength = Math.max.apply(Math, _toConsumableArray$26(arrays.map(function (x) {
         return x.length;
       })));
       var result = Array.from({ length: maxLength }).map(function (_, i) {
    @@ -1860,11 +2104,11 @@ var zipWith = function zipWith() {
         });
       });
       return fn ? result.map(function (arr) {
    -    return fn.apply(undefined, _toConsumableArray$19(arr));
    +    return fn.apply(undefined, _toConsumableArray$26(arr));
       }) : result;
     };
     
    -var imports = { JSONToFile: JSONToFile, RGBToHex: RGBToHex, URLJoin: URLJoin, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, atob: atob, average: average, averageBy: averageBy, 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, copyToClipboard: copyToClipboard, countBy: countBy, countOccurrences: countOccurrences, createElement: createElement, createEventHub: createEventHub, currentURL: currentURL, curry: curry, decapitalize: decapitalize, deepClone: deepClone, deepFlatten: deepFlatten, defaults: defaults, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, dropElements: dropElements, 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, 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, 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, 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, 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, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumBy: sumBy, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSafeInteger: toSafeInteger, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, transform: transform, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, uniqueElements: uniqueElements, untildify: untildify, validateNumber: validateNumber, without: without, words: words, 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, 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, dropElements: dropElements, 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, 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 };
     
     return imports;
     
    diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js
    index 3a418a18d..934e0f4a9 100644
    --- a/dist/_30s.es5.min.js
    +++ b/dist/_30s.es5.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';function a(a){return Array.isArray(a)?a:Array.from(a)}function b(a){return Array.isArray(a)?a:Array.from(a)}function c(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b>a/4).toString(16)})},UUIDGeneratorNode:function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(a){return(a^H.randomBytes(1)[0]&15>>a/4).toString(16)})},anagrams:function a(b){return 2>=b.length?2===b.length?[b,b[1]+b[0]]:[b]:b.split('').reduce(function(c,d,e){return c.concat(a(b.slice(0,e)+b.slice(e+1)).map(function(a){return d+a}))},[])},arrayToHtmlList:function(a,b){return a.map(function(a){return document.querySelector('#'+b).innerHTML+='
  • '+a+'
  • '})},atob:function(a){return new Buffer(a,'base64').toString('binary')},average:function(){for(var a=arguments.length,b=Array(a),c=0;c=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},btoa:function(a){return new Buffer(a,'binary').toString('base64')},byteSize:function(a){return new Blob([a]).size},call:function(a){for(var b=arguments.length,c=Array(1'"]/g,function(a){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[a]||a})},escapeRegExp:function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},everyNth:function(a,b){return a.filter(function(a,c){return c%b==b-1})},extendHex:function(a){return'#'+a.slice(a.startsWith('#')?1:0).split('').map(function(a){return a+a}).join('')},factorial:function a(b){return 0>b?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=b?1:b*a(b-1)},fibonacci:function(a){return Array.from({length:a}).reduce(function(a,b,c){return a.concat(1a&&(a=-a);var b={day:B(a/8.64e7),hour:B(a/3.6e6)%24,minute:B(a/6e4)%60,second:B(a/1e3)%60,millisecond:B(a)%1e3};return Object.entries(b).filter(function(a){return 0!==a[1]}).map(function(a){return a[1]+' '+(1===a[1]?a[0]:a[0]+'s')}).join(', ')},fromCamelCase:function(a){var b=1>>(b?24:16))+', '+((c&(b?16711680:65280))>>>(b?16:8))+', '+((c&(b?65280:255))>>>(b?8:0))+(b?', '+(255&c):'')+')'},hide:function(){for(var a=arguments.length,b=Array(a),c=0;cc&&(c=b),null==c?0<=a&&a=b&&aa[1]?-1:1,d=!0,e=!1;try{for(var f,g=a.entries()[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){var h=f.value,j=Q(h,2),k=j[0],i=j[1];if(k===a.length-1)return c;if(0<(i-a[k+1])*c)return 0}}catch(a){e=!0,b=a}finally{try{!d&&g.return&&g.return()}finally{if(e)throw b}}},isString:function(a){return'string'==typeof a},isSymbol:function(a){return'symbol'===('undefined'==typeof a?'undefined':R(a))},isTravisCI:function(){return'TRAVIS'in process.env&&'CI'in process.env},isUndefined:function(a){return a===void 0},isUpperCase:function(a){return a===a.toUpperCase()},isValidJSON:function(a){try{return JSON.parse(a),!0}catch(a){return!1}},join:function(a){var b=1e-c&&(b='mouse',a(b),document.removeEventListener('mousemove',d)),c=e};document.addEventListener('touchstart',function(){'touch'==b||(b='touch',a(b),document.addEventListener('mousemove',d))})},once:function(a){var b=!1;return function(){if(!b){b=!0;for(var c=arguments.length,d=Array(c),e=0;ej?1:iMath.abs(a))return a+(c?' ':'')+d[0];var e=D(B(Math.log10(0>a?-a:a)/3),d.length-1),f=+((0>a?-a:a)/C(1e3,e)).toPrecision(b);return(0>a?'-':'')+f+(c?' ':'')+d[e]},primes:function(a){var b=Array.from({length:a-1}).map(function(a,b){return b+2}),c=B(A(a)),d=Array.from({length:c-1}).map(function(a,b){return b+2});return d.forEach(function(a){return b=b.filter(function(b){return 0!=b%a||b==a})}),b},promisify:function(a){return function(){for(var b=arguments.length,c=Array(b),d=0;da[a.length-1],d=a.findIndex(function(a){return c?b>=a:b<=a});return-1===d?a.length:d},splitLines:function(a){return a.split(/\r?\n/)},spreadOver:function(a){return function(b){return a.apply(void 0,t(b))}},standardDeviation:function(a){var b=1b?a.slice(0,3',"'":'\'',""":'"'}[a]||a})},union:function(c,a){return Array.from(new Set([].concat(v(c),v(a))))},uniqueElements:function(a){return[].concat(w(new Set(a)))},untildify:function(a){return a.replace(/^~($|\/|\\)/,('undefined'!=typeof require&&require('os').homedir())+'$1')},validateNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&+a==a},without:function(a){for(var b=arguments.length,c=Array(1>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 { const arrayToHtmlList = (arr, listID) => arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); +const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); + const atob = str => new Buffer(str, 'base64').toString('binary'); const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length; @@ -47,6 +49,16 @@ const averageBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0) / arr.length; +const bind = (fn, context, ...args) => + function() { + return fn.apply(context, args.concat(...arguments)); + }; + +const bindKey = (context, fn, ...args) => + function() { + return context[fn].apply(context, args.concat(...arguments)); + }; + const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); @@ -108,6 +120,8 @@ const compact = arr => arr.filter(Boolean); const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))); +const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); + const copyToClipboard = str => { const el = document.createElement('textarea'); el.value = str; @@ -177,6 +191,8 @@ const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj const defer = (fn, ...args) => setTimeout(fn, 1, ...args); +const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args); + const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' @@ -187,6 +203,11 @@ const difference = (a, b) => { return a.filter(x => !s.has(x)); }; +const differenceBy = (a, b, fn) => { + const s = new Set(b.map(v => fn(v))); + return a.filter(x => !s.has(fn(x))); +}; + const differenceWith = (arr, val, comp) => arr.filter(a => val.findIndex(b => comp(a, b)) === -1); const digitize = n => [...`${n}`].map(i => parseInt(i)); @@ -281,7 +302,13 @@ const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexO const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); -const findLast = (arr, fn) => arr.filter(fn).slice(-1); +const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0]; + +const findLastIndex = (arr, fn) => + arr + .map((val, i) => [i, val]) + .filter(val => fn(val[1], val[0], arr)) + .slice(-1)[0][0]; const findLastKey = (obj, fn) => Object.keys(obj) @@ -487,6 +514,13 @@ const intersection = (a, b) => { return a.filter(x => s.has(x)); }; +const intersectionBy = (a, b, fn) => { + const s = new Set(b.map(x => fn(x))); + return a.filter(x => s.has(fn(x))); +}; + +const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1); + const invertKeyValues = (obj, fn) => Object.keys(obj).reduce((acc, key) => { const val = fn ? fn(obj[key]) : obj[key]; @@ -773,6 +807,10 @@ const parseCookie = str => return acc; }, {}); +const partial = (fn, ...partials) => (...args) => fn(...partials, ...args); + +const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials); + const partition = (arr, fn) => arr.reduce( (acc, val, i, arr) => { @@ -873,6 +911,9 @@ const readFileLines = filename => const redirect = (url, asLink = true) => asLink ? (window.location.href = url) : window.location.replace(url); +const reduceSuccessive = (arr, fn, acc) => + arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]); + const reducedFilter = (data, keys, fn) => data.filter(fn).map(el => keys.reduce((acc, key) => { @@ -976,6 +1017,15 @@ const sortedIndex = (arr, n) => { 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; +}; + const splitLines = str => str.split(/\r?\n/); const spreadOver = fn => argsArr => fn(...argsArr); @@ -1005,6 +1055,17 @@ const symmetricDifference = (a, b) => { return [...a.filter(x => !sB.has(x)), ...b.filter(x => !sA.has(x))]; }; +const symmetricDifferenceBy = (a, b, fn) => { + const sA = new Set(a.map(v => fn(v))), + sB = new Set(b.map(v => fn(v))); + return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))]; +}; + +const symmetricDifferenceWith = (arr, val, comp) => [ + ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1), + ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1) +]; + const tail = arr => (arr.length > 1 ? arr.slice(1) : arr); const take = (arr, n = 1) => arr.slice(0, n); @@ -1018,6 +1079,11 @@ const timeTaken = callback => { return r; }; +const times = (n, fn, context = undefined) => { + let i = 0; + while (fn.call(context, i) !== false && ++i < n) {} +}; + const toCamelCase = str => { let s = str && @@ -1075,6 +1141,8 @@ const truncateString = (str, num) => const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]); +const unary = fn => val => fn(val); + const unescapeHTML = str => str.replace( /&|<|>|'|"/g, @@ -1088,18 +1156,53 @@ const unescapeHTML = str => }[tag] || tag) ); +const unfold = (fn, seed) => { + let result = [], + val = [null, seed]; + while ((val = fn(val[1]))) result.push(val[0]); + return result; +}; + const union = (a, b) => Array.from(new Set([...a, ...b])); +const unionBy = (a, b, fn) => { + const s = new Set(a.map(v => fn(v))); + return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))])); +}; + +const unionWith = (a, b, comp) => + Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])); + const uniqueElements = arr => [...new Set(arr)]; const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`); +const unzip = arr => + arr.reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ); + +const unzipWith = (arr, fn) => + arr + .reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ) + .map(val => fn(...val)); + const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; const without = (arr, ...args) => arr.filter(v => !args.includes(v)); const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean); +const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []); + const yesNo = (val, def = false) => /^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def; @@ -1124,6 +1227,6 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,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,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,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,zipWith,} +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,dropElements,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,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,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index 913418804..06310811f 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -45,6 +45,8 @@ const anagrams = str => { const arrayToHtmlList = (arr, listID) => arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); +const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); + const atob = str => new Buffer(str, 'base64').toString('binary'); const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length; @@ -53,6 +55,16 @@ const averageBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val) => acc + val, 0) / arr.length; +const bind = (fn, context, ...args) => + function() { + return fn.apply(context, args.concat(...arguments)); + }; + +const bindKey = (context, fn, ...args) => + function() { + return context[fn].apply(context, args.concat(...arguments)); + }; + const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); @@ -114,6 +126,8 @@ const compact = arr => arr.filter(Boolean); const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))); +const composeRight = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); + const copyToClipboard = str => { const el = document.createElement('textarea'); el.value = str; @@ -183,6 +197,8 @@ const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj const defer = (fn, ...args) => setTimeout(fn, 1, ...args); +const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args); + const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' @@ -193,6 +209,11 @@ const difference = (a, b) => { return a.filter(x => !s.has(x)); }; +const differenceBy = (a, b, fn) => { + const s = new Set(b.map(v => fn(v))); + return a.filter(x => !s.has(fn(x))); +}; + const differenceWith = (arr, val, comp) => arr.filter(a => val.findIndex(b => comp(a, b)) === -1); const digitize = n => [...`${n}`].map(i => parseInt(i)); @@ -287,7 +308,13 @@ const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexO const findKey = (obj, fn) => Object.keys(obj).find(key => fn(obj[key], key, obj)); -const findLast = (arr, fn) => arr.filter(fn).slice(-1); +const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0]; + +const findLastIndex = (arr, fn) => + arr + .map((val, i) => [i, val]) + .filter(val => fn(val[1], val[0], arr)) + .slice(-1)[0][0]; const findLastKey = (obj, fn) => Object.keys(obj) @@ -493,6 +520,13 @@ const intersection = (a, b) => { return a.filter(x => s.has(x)); }; +const intersectionBy = (a, b, fn) => { + const s = new Set(b.map(x => fn(x))); + return a.filter(x => s.has(fn(x))); +}; + +const intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1); + const invertKeyValues = (obj, fn) => Object.keys(obj).reduce((acc, key) => { const val = fn ? fn(obj[key]) : obj[key]; @@ -779,6 +813,10 @@ const parseCookie = str => return acc; }, {}); +const partial = (fn, ...partials) => (...args) => fn(...partials, ...args); + +const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials); + const partition = (arr, fn) => arr.reduce( (acc, val, i, arr) => { @@ -879,6 +917,9 @@ const readFileLines = filename => const redirect = (url, asLink = true) => asLink ? (window.location.href = url) : window.location.replace(url); +const reduceSuccessive = (arr, fn, acc) => + arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]); + const reducedFilter = (data, keys, fn) => data.filter(fn).map(el => keys.reduce((acc, key) => { @@ -982,6 +1023,15 @@ const sortedIndex = (arr, n) => { 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; +}; + const splitLines = str => str.split(/\r?\n/); const spreadOver = fn => argsArr => fn(...argsArr); @@ -1011,6 +1061,17 @@ const symmetricDifference = (a, b) => { return [...a.filter(x => !sB.has(x)), ...b.filter(x => !sA.has(x))]; }; +const symmetricDifferenceBy = (a, b, fn) => { + const sA = new Set(a.map(v => fn(v))), + sB = new Set(b.map(v => fn(v))); + return [...a.filter(x => !sB.has(fn(x))), ...b.filter(x => !sA.has(fn(x)))]; +}; + +const symmetricDifferenceWith = (arr, val, comp) => [ + ...arr.filter(a => val.findIndex(b => comp(a, b)) === -1), + ...val.filter(a => arr.findIndex(b => comp(a, b)) === -1) +]; + const tail = arr => (arr.length > 1 ? arr.slice(1) : arr); const take = (arr, n = 1) => arr.slice(0, n); @@ -1024,6 +1085,11 @@ const timeTaken = callback => { return r; }; +const times = (n, fn, context = undefined) => { + let i = 0; + while (fn.call(context, i) !== false && ++i < n) {} +}; + const toCamelCase = str => { let s = str && @@ -1081,6 +1147,8 @@ const truncateString = (str, num) => const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]); +const unary = fn => val => fn(val); + const unescapeHTML = str => str.replace( /&|<|>|'|"/g, @@ -1094,18 +1162,53 @@ const unescapeHTML = str => }[tag] || tag) ); +const unfold = (fn, seed) => { + let result = [], + val = [null, seed]; + while ((val = fn(val[1]))) result.push(val[0]); + return result; +}; + const union = (a, b) => Array.from(new Set([...a, ...b])); +const unionBy = (a, b, fn) => { + const s = new Set(a.map(v => fn(v))); + return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))])); +}; + +const unionWith = (a, b, comp) => + Array.from(new Set([...a, ...b.filter(x => a.findIndex(y => comp(x, y)) === -1)])); + const uniqueElements = arr => [...new Set(arr)]; const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`); +const unzip = arr => + arr.reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ); + +const unzipWith = (arr, fn) => + arr + .reduce( + (acc, val) => (val.forEach((v, i) => acc[i].push(v)), acc), + Array.from({ + length: Math.max(...arr.map(x => x.length)) + }).map(x => []) + ) + .map(val => fn(...val)); + const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; const without = (arr, ...args) => arr.filter(v => !args.includes(v)); const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean); +const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []); + const yesNo = (val, def = false) => /^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def; @@ -1130,7 +1233,7 @@ const zipWith = (...arrays) => { return fn ? result.map(arr => fn(...arr)) : result; }; -var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepClone,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,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,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,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,zipWith,} +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,dropElements,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,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,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index d10cf7959..d169593de 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}
  • `),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,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))),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),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))},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),dropElements:(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),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))},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),{}),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),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},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))]},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},toCamelCase:(a)=>{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]),unescapeHTML:(a)=>a.replace(/&|<|>|'|"/g,(a)=>({"&":'&',"<":'<',">":'>',"'":'\'',""":'"'})[a]||a),union:(c,a)=>Array.from(new Set([...c,...a])),uniqueElements:(a)=>[...new Set(a)],untildify:(a)=>a.replace(/^~($|\/|\\)/,`${'undefined'!=typeof require&&require('os').homedir()}$1`),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),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))},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),dropElements:(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]),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}}}); diff --git a/test/testlog b/test/testlog index 6e64a29a9..e861f5cf5 100644 --- a/test/testlog +++ b/test/testlog @@ -1,1481 +1,1481 @@ -Test log for: Wed Jan 24 2018 17:52:14 GMT+0200 (GTB Standard Time) +Test log for: Wed Jan 24 2018 20:13:12 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 - - 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 dropElements - - √ dropElements 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 - - 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 + ✔ 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 + ✔ JSONToFile 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 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. + ✔ README is a Function 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] + ✔ RGBToHex is a Function + ✔ Converts the values of RGB components to a color code. Testing URLJoin - √ URLJoin is a Function - √ Returns proper URL - √ Returns proper URL + ✔ URLJoin is a Function + ✔ Returns proper URL + ✔ Returns proper URL Testing UUIDGeneratorBrowser - √ UUIDGeneratorBrowser is a Function + ✔ UUIDGeneratorBrowser is a Function Testing UUIDGeneratorNode - √ UUIDGeneratorNode is a Function + ✔ UUIDGeneratorNode is a Function + + Testing anagrams + + ✔ anagrams is a Function + ✔ Generates all anagrams of a string + + Testing arrayToHtmlList + + ✔ arrayToHtmlList is a Function + + 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 dropElements + + ✔ dropElements 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 forOwn + + ✔ forOwn is a Function + + Testing forOwnRight + + ✔ forOwnRight 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 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 + + 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 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 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 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 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 onUserInputChange + + ✔ onUserInputChange is a Function + + Testing once + + ✔ once 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 redirect + + ✔ redirect is a Function + + Testing reduceSuccessive + + ✔ reduceSuccessive 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 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 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 timeTaken + + ✔ timeTaken is a Function + + Testing times + + ✔ times 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 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 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 toggleClass + + ✔ toggleClass is a Function + + Testing tomorrow + + ✔ tomorrow is a Function + + 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 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 + ✔ 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 + ✔ 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 + ✔ 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']] + ✔ 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 + ✔ 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 + ✔ 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 + ✔ 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 + ✔ zipWith is a Function total: 638 passing: 638 - duration: 417ms + duration: 374ms From 2649d952c0497fc526c51689831e0c3d9eea6e26 Mon Sep 17 00:00:00 2001 From: liuliangsir <2269305724@qq.com> Date: Tue, 23 Jan 2018 22:58:17 +0800 Subject: [PATCH 093/103] Added getMinOrMaxValueInArrayBySomeRules utility function --- .../getMinOrMaxValueInArrayBySomeRules.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 snippets/getMinOrMaxValueInArrayBySomeRules.md diff --git a/snippets/getMinOrMaxValueInArrayBySomeRules.md b/snippets/getMinOrMaxValueInArrayBySomeRules.md new file mode 100644 index 000000000..5b04cf87e --- /dev/null +++ b/snippets/getMinOrMaxValueInArrayBySomeRules.md @@ -0,0 +1,25 @@ +### getMinOrMaxValueInArrayBySomeRules + +By setting some rules, get Minimum or Maximum value in array . + +BTW, the Minimum / Maximum value could be `Object`, namely, the upper array could be a `Object` array(filled with `Object`). + +```js +const getMinOrMaxValueInArrayBySomeRules = (xs, comparator = (a, b) => a - b) => xs.reduce(function (a, b) { + return comparator(a, b) >= 0 ? b : a; +}); +``` + +```js +// get minimum value from numeric array +getMinOrMaxValueInArrayBySomeRules([1, 3, 2]); // 1 + +// get maximum value from numeric array +getMinOrMaxValueInArrayBySomeRules([1, 3, 2], function (a, b) {return b - a;}); // 3 + +// get minimum value from object array by a given key map to value +getMinOrMaxValueInArrayBySomeRules([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Lucy", age: 9} + +// get maximum value from object array by a given key map to value +getMinOrMaxValueInArrayBySomeRules([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Jack", age: 18} +``` \ No newline at end of file From ca12fcad1480818fc0b939805c6f7e6d946ae730 Mon Sep 17 00:00:00 2001 From: liuliangsir <2269305724@qq.com> Date: Wed, 24 Jan 2018 18:41:03 +0800 Subject: [PATCH 094/103] Rename original name to reduceWhich --- .../getMinOrMaxValueInArrayBySomeRules.md | 25 ------------------- snippets/reduceWhich.md | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 snippets/getMinOrMaxValueInArrayBySomeRules.md create mode 100644 snippets/reduceWhich.md diff --git a/snippets/getMinOrMaxValueInArrayBySomeRules.md b/snippets/getMinOrMaxValueInArrayBySomeRules.md deleted file mode 100644 index 5b04cf87e..000000000 --- a/snippets/getMinOrMaxValueInArrayBySomeRules.md +++ /dev/null @@ -1,25 +0,0 @@ -### getMinOrMaxValueInArrayBySomeRules - -By setting some rules, get Minimum or Maximum value in array . - -BTW, the Minimum / Maximum value could be `Object`, namely, the upper array could be a `Object` array(filled with `Object`). - -```js -const getMinOrMaxValueInArrayBySomeRules = (xs, comparator = (a, b) => a - b) => xs.reduce(function (a, b) { - return comparator(a, b) >= 0 ? b : a; -}); -``` - -```js -// get minimum value from numeric array -getMinOrMaxValueInArrayBySomeRules([1, 3, 2]); // 1 - -// get maximum value from numeric array -getMinOrMaxValueInArrayBySomeRules([1, 3, 2], function (a, b) {return b - a;}); // 3 - -// get minimum value from object array by a given key map to value -getMinOrMaxValueInArrayBySomeRules([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Lucy", age: 9} - -// get maximum value from object array by a given key map to value -getMinOrMaxValueInArrayBySomeRules([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Jack", age: 18} -``` \ No newline at end of file diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md new file mode 100644 index 000000000..36784dc3f --- /dev/null +++ b/snippets/reduceWhich.md @@ -0,0 +1,25 @@ +### reduceWhich + +By setting some rules, get Minimum or Maximum value in array . + +BTW, the Minimum / Maximum value could be `Object`, namely, the upper array could be a `Object` array(filled with `Object`). + +```js +const reduceWhich = (xs, comparator = (a, b) => a - b) => xs.reduce(function (a, b) { + return comparator(a, b) >= 0 ? b : a; +}); +``` + +```js +// get minimum value from numeric array +reduceWhich([1, 3, 2]); // 1 + +// get maximum value from numeric array +reduceWhich([1, 3, 2], function (a, b) {return b - a;}); // 3 + +// get minimum value from object array by a given key map to value +reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Lucy", age: 9} + +// get maximum value from object array by a given key map to value +reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Jack", age: 18} +``` \ No newline at end of file From a4ac6b45e322ef97563b4a6bd12ea08cd0369679 Mon Sep 17 00:00:00 2001 From: liuliangsir <2269305724@qq.com> Date: Thu, 25 Jan 2018 10:29:27 +0800 Subject: [PATCH 095/103] Fix incorrect test case --- snippets/reduceWhich.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md index 36784dc3f..2ce6bb198 100644 --- a/snippets/reduceWhich.md +++ b/snippets/reduceWhich.md @@ -21,5 +21,5 @@ reduceWhich([1, 3, 2], function (a, b) {return b - a;}); // 3 reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Lucy", age: 9} // get maximum value from object array by a given key map to value -reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Jack", age: 18} +reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return b.age - a.age;}) // {name: "Jack", age: 18} ``` \ No newline at end of file From e750c8e19ccb5b5efeae211d93bc3a72685c201f Mon Sep 17 00:00:00 2001 From: liuliangsir <2269305724@qq.com> Date: Thu, 25 Jan 2018 18:33:16 +0800 Subject: [PATCH 096/103] Fix some issues --- snippets/reduceWhich.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md index 2ce6bb198..98ea5202e 100644 --- a/snippets/reduceWhich.md +++ b/snippets/reduceWhich.md @@ -1,25 +1,17 @@ ### reduceWhich - -By setting some rules, get Minimum or Maximum value in array . - -BTW, the Minimum / Maximum value could be `Object`, namely, the upper array could be a `Object` array(filled with `Object`). +Return minimum / maximum value of a array, after applying the provided / defaulted function to set comparing rule. +Use `Array.reduce()` with the first arguments and pass the above comparator function to `Array.reduce()` when running. ```js -const reduceWhich = (xs, comparator = (a, b) => a - b) => xs.reduce(function (a, b) { +const reduceWhich = (arr, comparator = (a, b) => a - b) => arr.reduce(function (a, b) { return comparator(a, b) >= 0 ? b : a; }); ``` ```js -// get minimum value from numeric array reduceWhich([1, 3, 2]); // 1 -// get maximum value from numeric array -reduceWhich([1, 3, 2], function (a, b) {return b - a;}); // 3 +reduceWhich([1, 3, 2], (a, b) => b - a); // 3 -// get minimum value from object array by a given key map to value -reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return a.age - b.age;}) // {name: "Lucy", age: 9} - -// get maximum value from object array by a given key map to value -reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], function(a, b){return b.age - a.age;}) // {name: "Jack", age: 18} +reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], (a, b) => a.age - b.age) // {name: "Lucy", age: 9} ``` \ No newline at end of file From 610d140b5a0d7538d7ab9f03444579d883c12407 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 25 Jan 2018 13:40:37 +0200 Subject: [PATCH 097/103] Update reduceWhich.md --- snippets/reduceWhich.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md index 98ea5202e..c59153c4e 100644 --- a/snippets/reduceWhich.md +++ b/snippets/reduceWhich.md @@ -1,17 +1,16 @@ ### reduceWhich -Return minimum / maximum value of a array, after applying the provided / defaulted function to set comparing rule. -Use `Array.reduce()` with the first arguments and pass the above comparator function to `Array.reduce()` when running. + +Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule. + +Use `Array.reduce()` in combination with the `comparator` function to get the appropriate element in the array. +You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. ```js -const reduceWhich = (arr, comparator = (a, b) => a - b) => arr.reduce(function (a, b) { - return comparator(a, b) >= 0 ? b : a; -}); +const reduceWhich = (arr, comparator = (a, b) => a - b) => arr.reduce((a, b) => comparator(a, b) >= 0 ? b : a); ``` ```js reduceWhich([1, 3, 2]); // 1 - reduceWhich([1, 3, 2], (a, b) => b - a); // 3 - -reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], (a, b) => a.age - b.age) // {name: "Lucy", age: 9} -``` \ No newline at end of file +reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], (a, b) => a.age - b.age); // {name: "Lucy", age: 9} +``` From 92016c79980902def1c7f38232e41f02ac33c65b Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Thu, 25 Jan 2018 11:43:21 +0000 Subject: [PATCH 098/103] Travis build: 1415 --- README.md | 35 +++++++++++++++++++++++++++++++++++ docs/index.html | 12 ++++++++++-- snippets/reduceWhich.md | 8 ++++++-- tag_database | 1 + 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 16af20a52..e15f1990a 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,15 @@ average(1, 2, 3); +### _Uncategorized_ + +
    +View contents + +* [`reduceWhich`](#reducewhich) + +
    + --- ## 🔌 Adapter @@ -7327,6 +7336,32 @@ yesNo('Foo', true); // true
    [⬆ Back to top](#table-of-contents) +--- + ## _Uncategorized_ + +### reduceWhich + +Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule. + +Use `Array.reduce()` in combination with the `comparator` function to get the appropriate element in the array. +You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. + +```js +const reduceWhich = (arr, comparator = (a, b) => a - b) => + arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); +``` + +```js +reduceWhich([1, 3, 2]); // 1 +reduceWhich([1, 3, 2], (a, b) => b - a); // 3 +reduceWhich( + [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], + (a, b) => a.age - b.age +); // {name: "Lucy", age: 9} +``` + +
    [⬆ back to top](#table-of-contents) + ## Collaborators diff --git a/docs/index.html b/docs/index.html index 35a8033f7..db73c3d82 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -1706,4 +1706,12 @@ Logs: {
     yesNo('yes'); // true
     yesNo('No'); // false
     yesNo('Foo', true); // true
    -
    \ No newline at end of file +

    Uncategorized

    reduceWhich

    Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule.

    Use Array.reduce() in combination with the comparator function to get the appropriate element in the array. You can omit the second parameter, comparator, to use the default one that returns the minimum element in the array.

    const reduceWhich = (arr, comparator = (a, b) => a - b) =>
    +  arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a));
    +
    reduceWhich([1, 3, 2]); // 1
    +reduceWhich([1, 3, 2], (a, b) => b - a); // 3
    +reduceWhich(
    +  [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }],
    +  (a, b) => a.age - b.age
    +); // {name: "Lucy", age: 9}
    +
    \ No newline at end of file diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md index c59153c4e..49a188ce6 100644 --- a/snippets/reduceWhich.md +++ b/snippets/reduceWhich.md @@ -6,11 +6,15 @@ Use `Array.reduce()` in combination with the `comparator` function to get the ap You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. ```js -const reduceWhich = (arr, comparator = (a, b) => a - b) => arr.reduce((a, b) => comparator(a, b) >= 0 ? b : a); +const reduceWhich = (arr, comparator = (a, b) => a - b) => + arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); ``` ```js reduceWhich([1, 3, 2]); // 1 reduceWhich([1, 3, 2], (a, b) => b - a); // 3 -reduceWhich([{name: 'Tom', age: 12}, {name: 'Jack', age: 18}, {name: 'Lucy', age: 9}], (a, b) => a.age - b.age); // {name: "Lucy", age: 9} +reduceWhich( + [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], + (a, b) => a.age - b.age +); // {name: "Lucy", age: 9} ``` diff --git a/tag_database b/tag_database index 9bd036292..75adffe16 100644 --- a/tag_database +++ b/tag_database @@ -183,6 +183,7 @@ readFileLines:node,array,string redirect:browser,url reducedFilter:array reduceSuccessive:array,function +reduceWhich:uncategorized remove:array reverseString:string,array RGBToHex:utility From 5ff2b1ee8ee67cf5af3000a535c66320afc040e2 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 25 Jan 2018 13:44:54 +0200 Subject: [PATCH 099/103] Update tag_database --- tag_database | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_database b/tag_database index 75adffe16..80db02651 100644 --- a/tag_database +++ b/tag_database @@ -183,7 +183,7 @@ readFileLines:node,array,string redirect:browser,url reducedFilter:array reduceSuccessive:array,function -reduceWhich:uncategorized +reduceWhich:array,function remove:array reverseString:string,array RGBToHex:utility From 7c7b2398193df6f6b31b12f0a8027ae1ad3ae8d6 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Thu, 25 Jan 2018 11:46:26 +0000 Subject: [PATCH 100/103] Travis build: 1417 --- README.md | 65 +++++++++++++++++++++++-------------------------- docs/index.html | 20 +++++++-------- 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index e15f1990a..8067f8213 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ average(1, 2, 3); * [`pullAtValue`](#pullatvalue) * [`reducedFilter`](#reducedfilter) * [`reduceSuccessive`](#reducesuccessive) +* [`reduceWhich`](#reducewhich) * [`remove`](#remove) * [`sample`](#sample) * [`sampleSize`](#samplesize) @@ -412,15 +413,6 @@ average(1, 2, 3); -### _Uncategorized_ - -
    -View contents - -* [`reduceWhich`](#reducewhich) - -
    - --- ## 🔌 Adapter @@ -1726,6 +1718,35 @@ reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0); // [0, 1, 3, 6
    [⬆ Back to top](#table-of-contents) +### reduceWhich + +Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule. + +Use `Array.reduce()` in combination with the `comparator` function to get the appropriate element in the array. +You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. + +```js +const reduceWhich = (arr, comparator = (a, b) => a - b) => + arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); +``` + +
    +Examples + +```js +reduceWhich([1, 3, 2]); // 1 +reduceWhich([1, 3, 2], (a, b) => b - a); // 3 +reduceWhich( + [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], + (a, b) => a.age - b.age +); // {name: "Lucy", age: 9} +``` + +
    + +
    [⬆ Back to top](#table-of-contents) + + ### remove Removes elements from an array for which the given function returns `false`. @@ -7336,32 +7357,6 @@ yesNo('Foo', true); // true
    [⬆ Back to top](#table-of-contents) ---- - ## _Uncategorized_ - -### reduceWhich - -Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule. - -Use `Array.reduce()` in combination with the `comparator` function to get the appropriate element in the array. -You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. - -```js -const reduceWhich = (arr, comparator = (a, b) => a - b) => - arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); -``` - -```js -reduceWhich([1, 3, 2]); // 1 -reduceWhich([1, 3, 2], (a, b) => b - a); // 3 -reduceWhich( - [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], - (a, b) => a.age - b.age -); // {name: "Lucy", age: 9} -``` - -
    [⬆ back to top](#table-of-contents) - ## Collaborators diff --git a/docs/index.html b/docs/index.html index db73c3d82..a95790372 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ scrollToTop(); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.

     

    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -311,6 +311,14 @@ Object.assig
     

    reduceSuccessive

    Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values.

    Use Array.reduce() to apply the given function to the given array, storing each new result.

    const reduceSuccessive = (arr, fn, acc) =>
       arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]);
     
    reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0); // [0, 1, 3, 6, 10, 15, 21]
    +

    reduceWhich

    Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule.

    Use Array.reduce() in combination with the comparator function to get the appropriate element in the array. You can omit the second parameter, comparator, to use the default one that returns the minimum element in the array.

    const reduceWhich = (arr, comparator = (a, b) => a - b) =>
    +  arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a));
    +
    reduceWhich([1, 3, 2]); // 1
    +reduceWhich([1, 3, 2], (a, b) => b - a); // 3
    +reduceWhich(
    +  [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }],
    +  (a, b) => a.age - b.age
    +); // {name: "Lucy", age: 9}
     

    remove

    Removes elements from an array for which the given function returns false.

    Use Array.filter() to find array elements that return truthy values and Array.reduce() to remove elements using Array.splice(). The func is invoked with three arguments (value, index, array).

    const remove = (arr, func) =>
       Array.isArray(arr)
         ? arr.filter(func).reduce((acc, val) => {
    @@ -1706,12 +1714,4 @@ Logs: {
     yesNo('yes'); // true
     yesNo('No'); // false
     yesNo('Foo', true); // true
    -

    Uncategorized

    reduceWhich

    Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule.

    Use Array.reduce() in combination with the comparator function to get the appropriate element in the array. You can omit the second parameter, comparator, to use the default one that returns the minimum element in the array.

    const reduceWhich = (arr, comparator = (a, b) => a - b) =>
    -  arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a));
    -
    reduceWhich([1, 3, 2]); // 1
    -reduceWhich([1, 3, 2], (a, b) => b - a); // 3
    -reduceWhich(
    -  [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }],
    -  (a, b) => a.age - b.age
    -); // {name: "Lucy", age: 9}
    -
    \ No newline at end of file +
    \ No newline at end of file From 2445607d0c6bc829977776094959c1faa4cc3174 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH 101/103] Travis build: 1421 [cron] --- dist/_30s.es5.js | 11 ++++++++++- dist/_30s.es5.min.js | 2 +- dist/_30s.esm.js | 5 ++++- dist/_30s.js | 5 ++++- dist/_30s.min.js | 2 +- test/reduceWhich/reduceWhich.js | 3 +++ test/reduceWhich/reduceWhich.test.js | 13 +++++++++++++ test/testlog | 12 ++++++++---- 8 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 test/reduceWhich/reduceWhich.js create mode 100644 test/reduceWhich/reduceWhich.test.js diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js index 7ebf0ef35..1b615425d 100644 --- a/dist/_30s.es5.js +++ b/dist/_30s.es5.js @@ -1578,6 +1578,15 @@ var reduceSuccessive = function reduceSuccessive(arr, fn, acc) { }, [acc]); }; +var reduceWhich = function reduceWhich(arr) { + var comparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (a, b) { + return a - b; + }; + return arr.reduce(function (a, b) { + return comparator(a, b) >= 0 ? b : a; + }); +}; + var reducedFilter = function reducedFilter(data, keys, fn) { return data.filter(fn).map(function (el) { return keys.reduce(function (acc, key) { @@ -2108,7 +2117,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, dropElements: dropElements, 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, 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, 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, dropElements: dropElements, 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 }; return imports; diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js index 934e0f4a9..6f8ae37f2 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^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 const reduceSuccessive = (arr, fn, acc) => arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]); +const reduceWhich = (arr, comparator = (a, b) => a - b) => + arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); + const reducedFilter = (data, keys, fn) => data.filter(fn).map(el => keys.reduce((acc, key) => { @@ -1227,6 +1230,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,dropElements,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,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,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,dropElements,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,} export default imports; diff --git a/dist/_30s.js b/dist/_30s.js index 06310811f..8b49f6af6 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -920,6 +920,9 @@ const redirect = (url, asLink = true) => const reduceSuccessive = (arr, fn, acc) => arr.reduce((res, val, i, arr) => (res.push(fn(res.slice(-1)[0], val, i, arr)), res), [acc]); +const reduceWhich = (arr, comparator = (a, b) => a - b) => + arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); + const reducedFilter = (data, keys, fn) => data.filter(fn).map(el => keys.reduce((acc, key) => { @@ -1233,7 +1236,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,dropElements,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,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,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,dropElements,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,} return imports; diff --git a/dist/_30s.min.js b/dist/_30s.min.js index d169593de..a10afdf28 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),dropElements:(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]),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))},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),dropElements:(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}}}); diff --git a/test/reduceWhich/reduceWhich.js b/test/reduceWhich/reduceWhich.js new file mode 100644 index 000000000..4558ef6b7 --- /dev/null +++ b/test/reduceWhich/reduceWhich.js @@ -0,0 +1,3 @@ +const reduceWhich = (arr, comparator = (a, b) => a - b) => +arr.reduce((a, b) => (comparator(a, b) >= 0 ? b : a)); +module.exports = reduceWhich \ No newline at end of file diff --git a/test/reduceWhich/reduceWhich.test.js b/test/reduceWhich/reduceWhich.test.js new file mode 100644 index 000000000..c5363239b --- /dev/null +++ b/test/reduceWhich/reduceWhich.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const reduceWhich = require('./reduceWhich.js'); + +test('Testing reduceWhich', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof reduceWhich === 'function', 'reduceWhich is a Function'); + //t.deepEqual(reduceWhich(args..), 'Expected'); + //t.equal(reduceWhich(args..), 'Expected'); + //t.false(reduceWhich(args..), 'Expected'); + //t.throws(reduceWhich(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index e861f5cf5..956f11cdb 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Wed Jan 24 2018 20:13:12 GMT+0000 (UTC) +Test log for: Thu Jan 25 2018 20:12:57 GMT+0000 (UTC) > 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1087,6 +1087,10 @@ Test log for: Wed Jan 24 2018 20:13:12 GMT+0000 (UTC) ✔ reduceSuccessive is a Function + Testing reduceWhich + + ✔ reduceWhich is a Function + Testing reducedFilter ✔ reducedFilter is a Function @@ -1474,8 +1478,8 @@ Test log for: Wed Jan 24 2018 20:13:12 GMT+0000 (UTC) ✔ zipWith is a Function - total: 638 - passing: 638 - duration: 374ms + total: 639 + passing: 639 + duration: 487ms From 03571c4b1ba255e9315943d570a3447424f6cfb5 Mon Sep 17 00:00:00 2001 From: coolreader18 <33094578+coolreader18@users.noreply.github.com> Date: Thu, 25 Jan 2018 18:53:03 -0600 Subject: [PATCH 102/103] It said defer, it's really strange --- snippets/delay.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/delay.md b/snippets/delay.md index 09f7c2606..da524837f 100644 --- a/snippets/delay.md +++ b/snippets/delay.md @@ -1,4 +1,4 @@ -### defer +### delay Invokes the provided function after `wait` milliseconds. From c1a5eb4d9fe24c9534955d6135a624f826815d17 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Fri, 26 Jan 2018 02:33:27 +0000 Subject: [PATCH 103/103] Travis build: 1423 --- README.md | 2 +- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8067f8213..08c12c464 100644 --- a/README.md +++ b/README.md @@ -3431,7 +3431,7 @@ defer(longRunningFunction); // Browser will update the HTML then run the functio
    [⬆ Back to top](#table-of-contents) -### defer +### delay Invokes the provided function after `wait` milliseconds. diff --git a/docs/index.html b/docs/index.html index a95790372..7c85f7213 100644 --- a/docs/index.html +++ b/docs/index.html @@ -762,7 +762,7 @@ console.log< document.querySelector('#someElement').innerHTML = 'Hello'; longRunningFunction(); //Browser will not update the HTML until this has finished defer(longRunningFunction); // Browser will update the HTML then run the function -

    defer

    Invokes the provided function after wait milliseconds.

    Use setTimeout() to delay execution of fn. Use the spread (...) operator to supply the function with an arbitrary number of arguments.

    const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
    +

    delay

    Invokes the provided function after wait milliseconds.

    Use setTimeout() to delay execution of fn. Use the spread (...) operator to supply the function with an arbitrary number of arguments.

    const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);
     
    delay(
       function(text) {
         console.log(text);