UNPKG

fus-ext

Version:
748 lines (746 loc) 33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.insertAfter = exports.insertBeforeIndex = exports.insertBefore = exports.removeAllMatch = exports.removeMatch = exports.removeAll = exports.remove = exports.removeAt = exports.takeRandom = exports.takeRandomOne = exports.random = exports.randomOne = exports.join = exports.toObject = exports.asyncMap = exports.asyncEvery = exports.asyncSome = exports.asyncForEach = exports.forEach = exports.flatten = exports.intersect = exports.union = exports.distinct = exports.except = exports.reverse = exports.sortDescending = exports.sort = exports._sort = exports.group = exports.product = exports.median = exports.average = exports.sum = exports.min = exports.max = exports.withMin = exports.withMax = exports.singleOrVoid = exports.singleOrNull = exports.single = exports.lastOrVoid = exports.lastOrNull = exports.last = exports.firstOrVoid = exports.firstOrNull = exports.first = exports.contains = exports.includes = exports.atOrVoid = exports.atOrNull = exports.at = exports.portion = exports.bound = exports.isEmpty = exports.clone = exports._amountToLength = exports._positionToIndex = exports._reverseToIndex = exports._ratioToLength = exports._ratioToIndex = undefined; var _main = require("./main"); var ok_573300145710716007 = function (a) { return a !== undefined && a !== null; };var dotDotCalc_573300145710716007 = function (dotDot, a, b, c) { return dotDot(a)[b](a, ...c); };var _elementOrUseSelector, _ratioToIndex, _ratioToLength, _reverseToIndex, _positionToIndex, _amountToLength, clone, isEmpty, bound, portion, at, atOrNull, atOrVoid, includes, contains, first, firstOrNull, firstOrVoid, last, lastOrNull, lastOrVoid, single, singleOrNull, singleOrVoid, withMax, withMin, max, min, sum, average, median, product, group, _sort, sort, sortDescending, reverse, except, distinct, union, intersect, flatten, forEach, asyncForEach, asyncSome, asyncEvery, asyncMap, toObject, join, randomOne, random, takeRandomOne, takeRandom, removeAt, remove, removeAll, removeMatch, removeAllMatch, insertBefore, insertBeforeIndex, insertAfter;_elementOrUseSelector = function (element, selector) { return (() => { return ok_573300145710716007(selector) ? (() => { return selector(element); })() : (() => { return element; })(); })(); };exports._ratioToIndex = _ratioToIndex = function (arr, ratio) { return (() => { var r;r = Math.round(ratio * arr.length - 0.5);return r <= 0 ? (() => { return 0; })() : (() => { return r > arr.length - 1 ? (() => { return arr.length - 1; })() : (() => { return r; })(); })(); })(); };exports._ratioToLength = _ratioToLength = function (arr, ratio) { return (() => { var r;r = Math.round(ratio * (arr.length + 1) - 0.5);return r <= 0 ? (() => { return 0; })() : (() => { return r > arr.length ? (() => { return arr.length; })() : (() => { return r; })(); })(); })(); };exports._reverseToIndex = _reverseToIndex = function (arr, reverseIndex) { return (() => { return arr.length - 1 - reverseIndex; })(); };exports._positionToIndex = _positionToIndex = function (arr, pos) { return (() => { var var_573300145710716007_2, var_573300145710716007_3;typeof pos === "number" ? (() => { return 0 < (var_573300145710716007_2 = pos) && var_573300145710716007_2 < 1 ? (() => { pos = { Ratio: pos }; })() : (() => { return -1 < (var_573300145710716007_3 = pos) && var_573300145710716007_3 < 0 ? (() => { pos = { Reverse: { Ratio: -pos } }; })() : (() => { return pos < 0 ? (() => { pos = { Reverse: -pos - 1 }; })() : undefined; })(); })(); })() : undefined;return typeof pos === "number" ? (() => { return pos; })() : (() => { return ok_573300145710716007(pos) && ok_573300145710716007(pos.Reverse) && ok_573300145710716007(pos.Reverse.Ratio) ? (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_reverseToIndex", [dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToIndex", [pos.Reverse.Ratio])]); })() : (() => { return ok_573300145710716007(pos) && ok_573300145710716007(pos.Reverse) ? (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_reverseToIndex", [pos.Reverse]); })() : (() => { return ok_573300145710716007(pos) && ok_573300145710716007(pos.Ratio) ? (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToIndex", [pos.Ratio]); })() : (() => { return (0, _main.fail)(); })(); })(); })(); })(); })(); };exports._amountToLength = _amountToLength = function (arr, amount) { return (() => { var var_573300145710716007_4;typeof amount === "number" ? (() => { return 0 < (var_573300145710716007_4 = amount) && var_573300145710716007_4 < 1 ? (() => { amount = { Ratio: amount }; })() : undefined; })() : undefined;return typeof amount === "number" ? (() => { return amount; })() : (() => { return ok_573300145710716007(amount) && ok_573300145710716007(amount.Ratio) ? (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToLength", [amount.Ratio]); })() : (() => { return (0, _main.fail)(); })(); })(); })(); };exports.clone = clone = function (arr) { return (() => { return arr.slice(); })(); };exports.isEmpty = isEmpty = function (arr) { return (() => { return arr.length === 0; })(); };exports.bound = bound = function (arr) { return (() => { return arr.length - 1; })(); };exports.portion = portion = function (arr, startIndex, length, endIndex) { return (() => { startIndex = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [startIndex]);ok_573300145710716007(length) ? (() => { length = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_amountToLength", [length]); })() : undefined;ok_573300145710716007(endIndex) ? (() => { endIndex = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [endIndex]); })() : undefined;return arr.slice(startIndex, ok_573300145710716007(length) ? (() => { return startIndex + length; })() : (() => { return ok_573300145710716007(endIndex) ? (() => { return endIndex + 1; })() : (() => { return undefined; })(); })()); })(); };exports.at = at = function (arr, index) { return (() => { var var_573300145710716007_5;index = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [index]);(0, _main.assert)(Number.isInteger(index) && 0 <= (var_573300145710716007_5 = index) && var_573300145710716007_5 < arr.length);return arr[index]; })(); };exports.atOrNull = atOrNull = function (arr, index) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "at", [index]); })(); } catch (catch_573300145710716007) { return (() => { return null; })(); } finally {} })(); })(); };exports.atOrVoid = atOrVoid = function (arr, index) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "at", [index]); })(); } catch (catch_573300145710716007) { return (() => { return undefined; })(); } finally {} })(); })(); };exports.includes = includes = function (arr, value) { return (() => { return arr.indexOf(value) >= 0; })(); };exports.contains = contains = includes;exports.first = first = function (arr, predicate) { return (() => { var queryResult;queryResult = ok_573300145710716007(predicate) ? (() => { return arr.filter(predicate); })() : (() => { return arr; })();return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [0]); })(); };exports.firstOrNull = firstOrNull = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return null; })(); } finally {} })(); })(); };exports.firstOrVoid = firstOrVoid = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return undefined; })(); } finally {} })(); })(); };exports.last = last = function (arr, predicate) { return (() => { var queryResult;queryResult = ok_573300145710716007(predicate) ? (() => { return arr.filter(predicate); })() : (() => { return arr; })();return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [queryResult.length - 1]); })(); };exports.lastOrNull = lastOrNull = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "last", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return null; })(); } finally {} })(); })(); };exports.lastOrVoid = lastOrVoid = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "last", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return undefined; })(); } finally {} })(); })(); };exports.single = single = function (arr, predicate) { return (() => { var queryResult;queryResult = ok_573300145710716007(predicate) ? (() => { return arr.filter(predicate); })() : (() => { return arr; })();(0, _main.assert)(queryResult.length === 1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [0]); })(); };exports.singleOrNull = singleOrNull = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "single", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return null; })(); } finally {} })(); })(); };exports.singleOrVoid = singleOrVoid = function (arr, predicate) { return (() => { return (() => { try { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "single", [predicate]); })(); } catch (catch_573300145710716007) { return (() => { return undefined; })(); } finally {} })(); })(); };exports.withMax = withMax = function (arr, selector) { return (() => { return arr.reduce(function (a, b, index) { return (() => { return _elementOrUseSelector(a, selector) > _elementOrUseSelector(b, selector) ? (() => { return a; })() : (() => { return b; })(); })(); }); })(); };exports.withMin = withMin = function (arr, selector) { return (() => { return arr.reduce(function (a, b, index) { return (() => { return _elementOrUseSelector(a, selector) < _elementOrUseSelector(b, selector) ? (() => { return a; })() : (() => { return b; })(); })(); }); })(); };exports.max = max = function (arr, selector) { return (() => { return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "withMax", [selector]), selector); })(); };exports.min = min = function (arr, selector) { return (() => { return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "withMin", [selector]), selector); })(); };exports.sum = sum = function (arr, selector) { return (() => { return arr.length === 0 ? (() => { return 0; })() : (() => { return arr.length === 1 ? (() => { return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", []), selector); })() : (() => { return arr.reduce(function (a, b, index) { return (() => { return (index === 1 ? (() => { return _elementOrUseSelector(a, selector); })() : (() => { return a; })()) + _elementOrUseSelector(b, selector); })(); }); })(); })(); })(); };exports.average = average = function (arr, selector) { return (() => { return arr.length === 0 ? (() => { return (0, _main.fail)(); })() : (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sum", [selector]) / arr.length; })(); })(); };exports.median = median = function (arr, selector) { return (() => { var sorted, a, b, m, n;sorted = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sort", [selector]);a = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "at", [0.5 - Number.EPSILON]);b = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "at", [0.5 + Number.EPSILON]);m = _elementOrUseSelector(a, selector);n = _elementOrUseSelector(b, selector);return (m + n) / 2; })(); };exports.product = product = function (arr, selector) { return (() => { return arr.length === 0 ? (() => { return 1; })() : (() => { return arr.length === 1 ? (() => { return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", []), selector); })() : (() => { return arr.reduce(function (a, b, index) { return (() => { return (index === 1 ? (() => { return _elementOrUseSelector(a, selector); })() : (() => { return a; })()) * _elementOrUseSelector(b, selector); })(); }); })(); })(); })(); };exports.group = group = function (arr, keySelector, valueSelector) { return (() => { var sorted, results, comparedKey, elements;return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "isEmpty", []) ? (() => { return []; })() : (() => { sorted = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sort", [keySelector]);results = [];comparedKey = _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "first", []), keySelector);elements = [];sorted.forEach(function (m) { return (() => { var key;key = _elementOrUseSelector(m, keySelector);key !== comparedKey ? (() => { results.push([comparedKey, _elementOrUseSelector(elements, valueSelector)]);comparedKey = key;elements = []; })() : undefined;return elements.push(m); })(); });results.push([comparedKey, _elementOrUseSelector(elements, valueSelector)]);return results; })(); })(); };exports._sort = _sort = function (arr, keySelector, isDescending) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []).sort(function (a, b) { return (() => { var a1, b1;a1 = _elementOrUseSelector(a, keySelector);b1 = _elementOrUseSelector(b, keySelector);return a1 < b1 ? (() => { return isDescending ? (() => { return 1; })() : (() => { return -1; })(); })() : (() => { return a1 > b1 ? (() => { return isDescending ? (() => { return -1; })() : (() => { return 1; })(); })() : (() => { return 0; })(); })(); })(); }); })(); };exports.sort = sort = function (arr, keySelector) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_sort", [keySelector, false]); })(); };exports.sortDescending = sortDescending = function (arr, keySelector) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_sort", [keySelector, true]); })(); };exports.reverse = reverse = function (arr) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []).reverse(); })(); };exports.except = except = function (arr, array, equalityComparer) { if (equalityComparer === undefined) { equalityComparer = function (a, b) { return (() => { return a === b; })(); }; }return (() => { return arr.filter(function (m) { return (() => { return !array.some(function (n) { return (() => { return equalityComparer(n, m); })(); }); })(); }); })(); };exports.distinct = distinct = function (arr, equalityComparer) { if (equalityComparer === undefined) { equalityComparer = function (a, b) { return (() => { return a === b; })(); }; }return (() => { var r;r = [];arr.forEach(function (m) { return (() => { return !r.some(function (n) { return (() => { return equalityComparer(n, m); })(); }) ? (() => { return r.push(m); })() : undefined; })(); });return r; })(); };exports.union = union = function (arr, array, equalityComparer) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr.concat(array), "distinct", [equalityComparer]); })(); };exports.intersect = intersect = function (arr, array, equalityComparer) { if (equalityComparer === undefined) { equalityComparer = function (a, b) { return (() => { return a === b; })(); }; }return (() => { var r;r = [];dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "distinct", [equalityComparer]).forEach(function (m) { return (() => { return array.some(function (n) { return (() => { return equalityComparer(n, m); })(); }) ? (() => { return r.push(m); })() : undefined; })(); });return r; })(); };exports.flatten = flatten = function (arr, level) { return (() => { var r, canContinue;return level <= 0 ? (() => { return (0, _main.fail)(); })() : (() => { r = [];canContinue = false;arr.forEach(function (m) { return (() => { return m instanceof Array ? (() => { canContinue = true;return m.forEach(function (n) { return (() => { return r.push(n); })(); }); })() : (() => { return r.push(m); })(); })(); });return canContinue ? (() => { return ok_573300145710716007(level) ? (() => { return level === 1 ? (() => { return r; })() : (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, r, "flatten", [level - 1]); })(); })() : (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, r, "flatten", []); })(); })() : (() => { return r; })(); })(); })(); };exports.forEach = forEach = function (arr, callback) { return (() => { arr.every(function (element, index) { return (() => { return callback(element, index) === _main.break ? (() => { return false; })() : (() => { return true; })(); })(); });return undefined; })(); };exports.asyncForEach = asyncForEach = function (arr, callback) { return (() => { var promise;promise = Promise.resolve();arr.forEach(function (element, index) { return (() => { promise = promise.then(function (value) { return (() => { return value === _main.break ? (() => { return _main.break; })() : (() => { return callback(element, index); })(); })(); }); })(); });return promise.then(function () { var arg_573300145710716007 = arguments;return (() => {})(); }); })(); };exports.asyncSome = asyncSome = function (arr, callback) { return (() => { var promise;promise = Promise.resolve(false);arr.forEach(function (element, index) { return (() => { promise = promise.then(function (value) { return (() => { return value ? (() => { return true; })() : (() => { return callback(element, index); })(); })(); }); })(); });return promise.then(function (m) { return (() => { return m ? (() => { return true; })() : (() => { return false; })(); })(); }); })(); };exports.asyncEvery = asyncEvery = function (arr, callback) { return (() => { var promise;promise = Promise.resolve(true);arr.forEach(function (element, index) { return (() => { promise = promise.then(function (value) { return (() => { return !value ? (() => { return false; })() : (() => { return callback(element, index); })(); })(); }); })(); });return promise.then(function (m) { return (() => { return m ? (() => { return true; })() : (() => { return false; })(); })(); }); })(); };exports.asyncMap = asyncMap = function (arr, callback) { return (() => { var r, promise;r = [];return arr.length === 0 ? (() => { return Promise.resolve(r); })() : (() => { promise = Promise.resolve();arr.forEach(function (element, index) { return (() => { promise = promise.then(function (value) { return (() => { index > 0 ? (() => { return r.push(value); })() : undefined;return callback(element, index); })(); }); })(); });return promise.then(function (value) { return (() => { r.push(value);return r; })(); }); })(); })(); };exports.toObject = toObject = function (arr) { return (() => { var r;r = {};arr.forEach(function (element) { return (() => { r[element[0]] = element[1]; })(); });return r; })(); };exports.join = join = function (arr, ...args) { return (() => { args[0] instanceof Array ? (() => { args = args[0]; })() : undefined;return args.length <= 1 ? (() => { return arr.join(args[0]); })() : (() => { return arr.map(function (m) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, m, "join", [args.slice(0, -1)]); })(); }).join(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, args, "last", [])); })(); })(); };exports.randomOne = randomOne = function (arr) { return (() => { return arr[dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, Math, "randomInt", [arr.length])]; })(); };exports.random = random = function (arr, count) { return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []), "takeRandom", [count]); })(); };exports.takeRandomOne = takeRandomOne = function (arr) { return (() => { var index, r;index = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, Math, "randomInt", [arr.length]);r = arr[index];dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);return r; })(); };exports.takeRandom = takeRandom = function (arr, count) { return (() => { if (count === undefined || count === null) { count = arr.length; };count = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_amountToLength", [count]);return (0, _main.repeat)(count, function () { var arg_573300145710716007 = arguments;return (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "takeRandomOne", []); })(); }); })(); };exports.removeAt = removeAt = function (arr, index) { return (() => { arr.splice(index, 1);return arr; })(); };exports.remove = remove = function (arr, element) { return (() => { var index;index = arr.indexOf(element);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]); })(); };exports.removeAll = removeAll = function (arr, element) { return (() => { (0, _main.loop)(function () { return (() => { var index;index = arr.indexOf(element);return index === -1 ? (() => { return _main.break; })() : (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]); })(); })(); });return arr; })(); };exports.removeMatch = removeMatch = function (arr, predicate) { return (() => { var index;index = arr.findIndex(predicate);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]); })(); };exports.removeAllMatch = removeAllMatch = function (arr, predicate) { return (() => { (0, _main.loop)(function () { return (() => { var index;index = arr.findIndex(predicate);return index === -1 ? (() => { return _main.break; })() : (() => { return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]); })(); })(); });return arr; })(); };exports.insertBefore = insertBefore = function (arr, element, ...elements) { return (() => { var index;index = arr.indexOf(element);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "insertBeforeIndex", [index, ...elements]); })(); };exports.insertBeforeIndex = insertBeforeIndex = function (arr, index, ...elements) { return (() => { arr.splice(index, 0, ...elements);return arr; })(); };exports.insertAfter = insertAfter = function (arr, element, ...elements) { return (() => { var index;index = arr.indexOf(element);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "insertBeforeIndex", [index + 1, ...elements]); })(); };exports._ratioToIndex = _ratioToIndex; exports._ratioToLength = _ratioToLength; exports._reverseToIndex = _reverseToIndex; exports._positionToIndex = _positionToIndex; exports._amountToLength = _amountToLength; exports.clone = clone; exports.isEmpty = isEmpty; exports.bound = bound; exports.portion = portion; exports.at = at; exports.atOrNull = atOrNull; exports.atOrVoid = atOrVoid; exports.includes = includes; exports.contains = contains; exports.first = first; exports.firstOrNull = firstOrNull; exports.firstOrVoid = firstOrVoid; exports.last = last; exports.lastOrNull = lastOrNull; exports.lastOrVoid = lastOrVoid; exports.single = single; exports.singleOrNull = singleOrNull; exports.singleOrVoid = singleOrVoid; exports.withMax = withMax; exports.withMin = withMin; exports.max = max; exports.min = min; exports.sum = sum; exports.average = average; exports.median = median; exports.product = product; exports.group = group; exports._sort = _sort; exports.sort = sort; exports.sortDescending = sortDescending; exports.reverse = reverse; exports.except = except; exports.distinct = distinct; exports.union = union; exports.intersect = intersect; exports.flatten = flatten; exports.forEach = forEach; exports.asyncForEach = asyncForEach; exports.asyncSome = asyncSome; exports.asyncEvery = asyncEvery; exports.asyncMap = asyncMap; exports.toObject = toObject; exports.join = join; exports.randomOne = randomOne; exports.random = random; exports.takeRandomOne = takeRandomOne; exports.takeRandom = takeRandom; exports.removeAt = removeAt; exports.remove = remove; exports.removeAll = removeAll; exports.removeMatch = removeMatch; exports.removeAllMatch = removeAllMatch; exports.insertBefore = insertBefore; exports.insertBeforeIndex = insertBeforeIndex; exports.insertAfter = insertAfter;