array-reduce-x
Advanced tools
Comparing version 3.0.15 to 3.0.16
@@ -1,7 +0,3 @@ | ||
var _this = this; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } | ||
import attempt from 'attempt-x'; | ||
@@ -12,104 +8,79 @@ import splitIfBoxedBug from 'split-if-boxed-bug-x'; | ||
import assertIsFunction from 'assert-is-function-x'; | ||
import toBoolean from 'to-boolean-x'; | ||
import requireObjectCoercible from 'require-object-coercible-x'; | ||
var natRed = [].reduce; | ||
var castObject = {}.constructor; | ||
var nativeReduce = typeof natRed === 'function' && natRed; // ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
var nativeReduce = typeof natRed === 'function' && natRed; | ||
var isWorking; | ||
if (nativeReduce) { | ||
isWorking = attempt.call([], nativeReduce, function (acc) { | ||
_newArrowCheck(this, _this); | ||
var test1 = function test1() { | ||
return attempt.call([], nativeReduce, function attemptee(acc) { | ||
return acc; | ||
}.bind(this)).threw; | ||
var res; | ||
}).threw; | ||
}; | ||
if (isWorking) { | ||
res = attempt.call(castObject('abc'), nativeReduce, function (acc, c) { | ||
_newArrowCheck(this, _this); | ||
var test2 = function test2() { | ||
var res = attempt.call(castObject('abc'), nativeReduce, function attemptee(acc, c) { | ||
return acc + c; | ||
}, 'x'); | ||
return res.threw === false && res.value === 'xabc'; | ||
}; | ||
return acc + c; | ||
}.bind(this), 'x'); | ||
isWorking = res.threw === false && res.value === 'xabc'; | ||
} | ||
var test3 = function test3() { | ||
var res = attempt.call(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
}(1, 2, 3), nativeReduce, function attempte(acc, arg) { | ||
return acc + arg; | ||
}, 1); | ||
return res.threw === false && res.value === 7; | ||
}; | ||
if (isWorking) { | ||
res = attempt.call(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
}(1, 2, 3), nativeReduce, function (acc, arg) { | ||
_newArrowCheck(this, _this); | ||
var test4 = function test4() { | ||
var res = attempt.call({ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4 | ||
}, nativeReduce, function attempte(acc, arg) { | ||
return acc + arg; | ||
}, 2); | ||
return res.threw === false && res.value === 8; | ||
}; | ||
return acc + arg; | ||
}.bind(this), 1); | ||
isWorking = res.threw === false && res.value === 7; | ||
} | ||
var test5 = function test5() { | ||
var doc = typeof document !== 'undefined' && document; | ||
if (isWorking) { | ||
res = attempt.call({ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4 | ||
}, nativeReduce, function (acc, arg) { | ||
_newArrowCheck(this, _this); | ||
return acc + arg; | ||
}.bind(this), 2); | ||
isWorking = res.threw === false && res.value === 8; | ||
if (doc) { | ||
var fragment = doc.createDocumentFragment(); | ||
var div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
var res = attempt.call(fragment.childNodes, nativeReduce, function attempte(acc, node) { | ||
acc[acc.length] = node; | ||
return acc; | ||
}, []); | ||
return res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
if (isWorking) { | ||
var doc = typeof document !== 'undefined' && document; | ||
return true; | ||
}; | ||
if (doc) { | ||
var fragment = doc.createDocumentFragment(); | ||
var div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
res = attempt.call(fragment.childNodes, nativeReduce, function (acc, node) { | ||
_newArrowCheck(this, _this); | ||
var test6 = function test6() { | ||
var res = attempt.call('ab', nativeReduce, function attempte(_, __, ___, list) { | ||
return list; | ||
}); | ||
return res.threw === false && _typeof(res.value) === 'object'; | ||
}; // ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
acc[acc.length] = node; | ||
return acc; | ||
}.bind(this), []); | ||
isWorking = res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
} | ||
if (isWorking) { | ||
res = attempt.call('ab', nativeReduce, function (_, __, ___, list) { | ||
_newArrowCheck(this, _this); | ||
var isWorking = toBoolean(nativeReduce) && test1() && test2() && test3() && test4() && test5() && test6(); | ||
return list; | ||
}.bind(this)); | ||
isWorking = res.threw === false && _typeof(res.value) === 'object'; | ||
} | ||
} | ||
/** | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
var $reduce; | ||
if (nativeReduce && isWorking) { | ||
$reduce = function reduce(array, callBack | ||
var patchedReduce = function patchedReduce() { | ||
return function reduce(array, callBack | ||
/* , initialValue */ | ||
) { | ||
var args = [callBack]; | ||
requireObjectCoercible(array); | ||
var args = [assertIsFunction(callBack)]; | ||
@@ -123,4 +94,6 @@ if (arguments.length > 2) { | ||
}; | ||
} else { | ||
$reduce = function reduce(array, callBack | ||
}; | ||
var implementation = function implementation() { | ||
return function reduce(array, callBack | ||
/* , initialValue */ | ||
@@ -136,3 +109,3 @@ ) { | ||
if (length === 0 && argsLength < 3) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -158,3 +131,3 @@ | ||
if (i >= length) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -176,7 +149,23 @@ } while (true); | ||
}; | ||
} | ||
}; | ||
/* | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
var red = $reduce; | ||
export default red; | ||
var $reduce = isWorking ? patchedReduce() : implementation(); | ||
export default $reduce; | ||
//# sourceMappingURL=array-reduce-x.esm.js.map |
@@ -5,9 +5,9 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-07-27T14:53:32.572Z", | ||
"date": "2019-07-31T22:49:03.969Z", | ||
"describe": "", | ||
"description": "Reduce an array (from left to right) to a single value.", | ||
"file": "array-reduce-x.js", | ||
"hash": "50cbf04e29ee07d547db", | ||
"hash": "4fe35686f3dfb15a40a4", | ||
"license": "MIT", | ||
"version": "3.0.15" | ||
"version": "3.0.16" | ||
} | ||
@@ -1013,5 +1013,3 @@ */ | ||
// CONCATENATED MODULE: ./node_modules/is-function-x/dist/is-function-x.esm.js | ||
var is_function_x_esm_this = undefined; | ||
function is_function_x_esm_newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } | ||
@@ -1023,6 +1021,3 @@ | ||
var FunctionCtr = attempt_x_esm.constructor; | ||
var castBoolean = true.constructor; | ||
var is_function_x_esm_SPACE = ' '; | ||
@@ -1035,10 +1030,8 @@ var fToString = attempt_x_esm.toString; | ||
var test = ctrRx.test; | ||
var hasNativeClass = attempt_x_esm(function () { | ||
is_function_x_esm_newArrowCheck(this, is_function_x_esm_this); | ||
var hasNativeClass = attempt_x_esm(function attemptee() { | ||
/* eslint-disable-next-line babel/new-cap */ | ||
return FunctionCtr('"use strict"; return class My {};')(); | ||
}.bind(undefined)).threw === false; | ||
}).threw === false; | ||
var testClassstring = function _testClassstring(value) { | ||
var is_function_x_esm_testClassString = function testClassString(value) { | ||
return test.call(ctrRx, normalize_space_x_esm(replace_comments_x_esm(fToString.call(value), is_function_x_esm_SPACE))); | ||
@@ -1048,3 +1041,3 @@ }; | ||
var isES6ClassFn = function isES6ClassFunc(value) { | ||
var result = attempt_x_esm(testClassstring, value); | ||
var result = attempt_x_esm(is_function_x_esm_testClassString, value); | ||
return result.threw === false && result.value; | ||
@@ -1070,2 +1063,7 @@ }; | ||
}; | ||
var is_function_x_esm_compareTags = function compareTags(value) { | ||
var strTag = to_string_tag_x_esm(value); | ||
return strTag === funcTag || strTag === genTag || strTag === asyncTag; | ||
}; | ||
/** | ||
@@ -1090,8 +1088,7 @@ * Checks if `value` is classified as a `Function` object. | ||
if (hasNativeClass && castBoolean(allowClass) === false && isES6ClassFn(value)) { | ||
if (hasNativeClass && to_boolean_x_esm(allowClass) === false && isES6ClassFn(value)) { | ||
return false; | ||
} | ||
var strTag = to_string_tag_x_esm(value); | ||
return strTag === funcTag || strTag === genTag || strTag === asyncTag; | ||
return is_function_x_esm_compareTags(value); | ||
}; | ||
@@ -1118,7 +1115,3 @@ | ||
var DEFAULT = 'default'; | ||
/** @type {StringConstructor} */ | ||
var StringCtr = STRING.constructor; | ||
/** @type {NumberConstructor} */ | ||
var NumberCtr = ZERO.constructor; | ||
@@ -1134,2 +1127,10 @@ /* eslint-disable-next-line compat/compat */ | ||
var orderLength = 2; | ||
var assertHint = function assertHint(hint) { | ||
if (typeof hint !== 'string' || hint !== NUMBER && hint !== STRING) { | ||
throw new TypeError('hint must be "string" or "number"'); | ||
} | ||
return hint; | ||
}; | ||
/** | ||
@@ -1141,9 +1142,6 @@ * @param {*} ordinary - The ordinary to convert. | ||
var ordinaryToPrimitive = function _ordinaryToPrimitive(ordinary, hint) { | ||
var to_primitive_x_esm_ordinaryToPrimitive = function ordinaryToPrimitive(ordinary, hint) { | ||
require_object_coercible_x_esm(ordinary); | ||
if (typeof hint !== 'string' || hint !== NUMBER && hint !== STRING) { | ||
throw new TypeError('hint must be "string" or "number"'); | ||
} | ||
assertHint(hint); | ||
var methodNames = hint === STRING ? toStringOrder : toNumberOrder; | ||
@@ -1174,3 +1172,3 @@ var method; | ||
var getMethod = function _getMethod(object, property) { | ||
var to_primitive_x_esm_getMethod = function getMethod(object, property) { | ||
var func = object[property]; | ||
@@ -1221,3 +1219,3 @@ | ||
if (symToPrimitive) { | ||
return getMethod(value, symToPrimitive); | ||
return to_primitive_x_esm_getMethod(value, symToPrimitive); | ||
} | ||
@@ -1232,2 +1230,20 @@ | ||
}; | ||
var to_primitive_x_esm_evalExotic = function evalExotic(obj) { | ||
var exoticToPrim = obj.exoticToPrim, | ||
input = obj.input, | ||
hint = obj.hint; | ||
var result = exoticToPrim.call(input, hint); | ||
if (is_primitive_default()(result)) { | ||
return result; | ||
} | ||
throw new TypeError('unable to convert exotic object to primitive'); | ||
}; | ||
var to_primitive_x_esm_evalPrimitive = function evalPrimitive(input, hint) { | ||
var newHint = hint === DEFAULT && (is_date_object_default()(input) || is_symbol_default()(input)) ? STRING : hint; | ||
return to_primitive_x_esm_ordinaryToPrimitive(input, newHint === DEFAULT ? NUMBER : newHint); | ||
}; | ||
/** | ||
@@ -1243,3 +1259,3 @@ * This method converts a JavaScript object to a primitive value. | ||
* @param {*} input - The input to convert. | ||
* @param {NumberConstructor|StringConstructor} [preferredType] - The preferred type (String or Number). | ||
* @param {Function} [preferredType] - The preferred type (String or Number). | ||
* @throws {TypeError} If unable to convert input to a primitive. | ||
@@ -1258,15 +1274,7 @@ * @returns {string|number} The converted input as a primitive. | ||
var exoticToPrim = to_primitive_x_esm_getExoticToPrim(input); | ||
if (typeof exoticToPrim !== 'undefined') { | ||
var result = exoticToPrim.call(input, hint); | ||
if (is_primitive_default()(result)) { | ||
return result; | ||
} | ||
throw new TypeError('unable to convert exotic object to primitive'); | ||
} | ||
var newHint = hint === DEFAULT && (is_date_object_default()(input) || is_symbol_default()(input)) ? STRING : hint; | ||
return ordinaryToPrimitive(input, newHint === DEFAULT ? NUMBER : newHint); | ||
return typeof exoticToPrim === 'undefined' ? to_primitive_x_esm_evalPrimitive(input, hint) : to_primitive_x_esm_evalExotic({ | ||
exoticToPrim: exoticToPrim, | ||
input: input, | ||
hint: hint | ||
}); | ||
}; | ||
@@ -1348,3 +1356,3 @@ | ||
var isBinary = function _isBinary(value) { | ||
var isBinary = function isBinary(value) { | ||
return to_number_x_esm_test.call(binaryRegex, value); | ||
@@ -1355,10 +1363,10 @@ }; | ||
var isOctal = function _isOctal(value) { | ||
var isOctal = function isOctal(value) { | ||
return to_number_x_esm_test.call(octalRegex, value); | ||
}; | ||
var nonWSregex2018 = new RegExpConstructor("[\x85\u180E\u200B\uFFFE]", 'g'); | ||
var nonWSregex = new RegExpConstructor("[\x85\u180E\u200B\uFFFE]", 'g'); | ||
var hasNonWS2018 = function _hasNonWS(value) { | ||
return to_number_x_esm_test.call(nonWSregex2018, value); | ||
var hasNonWS = function hasNonWS(value) { | ||
return to_number_x_esm_test.call(nonWSregex, value); | ||
}; | ||
@@ -1368,7 +1376,51 @@ | ||
var isInvalidHexLiteral = function _isInvalidHexLiteral(value) { | ||
var isInvalidHexLiteral = function isInvalidHexLiteral(value) { | ||
return to_number_x_esm_test.call(invalidHexLiteral, value); | ||
}; | ||
var to_number_x_esm_assertNotSymbol = function assertNotSymbol(value) { | ||
if (is_symbol_default()(value)) { | ||
throw new TypeError(to_number_x_esm_ERROR_MESSAGE); | ||
} | ||
return value; | ||
}; | ||
var to_number_x_esm_parseBase = function parseBase(value, radix) { | ||
return parse_int_x_esm(pStrSlice.call(value, testCharsCount), radix); | ||
}; | ||
var parseString = function parseString(toNum, value) { | ||
if (isBinary(value)) { | ||
return toNum(to_number_x_esm_parseBase(value, binaryRadix)); | ||
} | ||
if (isOctal(value)) { | ||
return toNum(to_number_x_esm_parseBase(value, octalRadix)); | ||
} | ||
return null; | ||
}; | ||
var to_number_x_esm_convertString = function convertString(toNum, value) { | ||
var val = parseString(toNum, value); | ||
if (val !== null) { | ||
return val; | ||
} | ||
if (hasNonWS(value) || isInvalidHexLiteral(value)) { | ||
return nan_x_esm; | ||
} | ||
var trimmed = trim_x_esm(value); | ||
if (trimmed !== value) { | ||
return toNum(trimmed); | ||
} | ||
return null; | ||
}; | ||
/** | ||
* This method converts argument to a value of type Number. (ES2018). | ||
* This method converts argument to a value of type Number. (ES2019). | ||
* | ||
@@ -1382,26 +1434,10 @@ * @param {*} [argument] - The argument to convert to a number. | ||
var to_number_x_esm_toNumber = function toNumber(argument) { | ||
var value = to_primitive_x_esm(argument, to_number_x_esm_castNumber); | ||
var value = to_number_x_esm_assertNotSymbol(to_primitive_x_esm(argument, to_number_x_esm_castNumber)); | ||
if (is_symbol_default()(value)) { | ||
throw new TypeError(to_number_x_esm_ERROR_MESSAGE); | ||
} | ||
if (typeof value === 'string') { | ||
if (isBinary(value)) { | ||
return toNumber(parse_int_x_esm(pStrSlice.call(value, testCharsCount), binaryRadix)); | ||
} | ||
var val = to_number_x_esm_convertString(toNumber, value); | ||
if (isOctal(value)) { | ||
return toNumber(parse_int_x_esm(pStrSlice.call(value, testCharsCount), octalRadix)); | ||
if (val !== null) { | ||
return val; | ||
} | ||
if (hasNonWS2018(value) || isInvalidHexLiteral(value)) { | ||
return nan_x_esm; | ||
} | ||
var trimmed = trim_x_esm(value); | ||
if (trimmed !== value) { | ||
return toNumber(trimmed); | ||
} | ||
} | ||
@@ -1615,7 +1651,4 @@ | ||
// CONCATENATED MODULE: ./dist/array-reduce-x.esm.js | ||
var array_reduce_x_esm_this = undefined; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function array_reduce_x_esm_newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } | ||
@@ -1627,104 +1660,78 @@ | ||
var natRed = [].reduce; | ||
var array_reduce_x_esm_castObject = {}.constructor; | ||
var nativeReduce = typeof natRed === 'function' && natRed; // ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
var nativeReduce = typeof natRed === 'function' && natRed; | ||
var isWorking; | ||
if (nativeReduce) { | ||
isWorking = attempt_x_esm.call([], nativeReduce, function (acc) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
var array_reduce_x_esm_test1 = function test1() { | ||
return attempt_x_esm.call([], nativeReduce, function attemptee(acc) { | ||
return acc; | ||
}.bind(undefined)).threw; | ||
var res; | ||
}).threw; | ||
}; | ||
if (isWorking) { | ||
res = attempt_x_esm.call(array_reduce_x_esm_castObject('abc'), nativeReduce, function (acc, c) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
var array_reduce_x_esm_test2 = function test2() { | ||
var res = attempt_x_esm.call(array_reduce_x_esm_castObject('abc'), nativeReduce, function attemptee(acc, c) { | ||
return acc + c; | ||
}, 'x'); | ||
return res.threw === false && res.value === 'xabc'; | ||
}; | ||
return acc + c; | ||
}.bind(undefined), 'x'); | ||
isWorking = res.threw === false && res.value === 'xabc'; | ||
} | ||
var array_reduce_x_esm_test3 = function test3() { | ||
var res = attempt_x_esm.call(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
}(1, 2, 3), nativeReduce, function attempte(acc, arg) { | ||
return acc + arg; | ||
}, 1); | ||
return res.threw === false && res.value === 7; | ||
}; | ||
if (isWorking) { | ||
res = attempt_x_esm.call(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
}(1, 2, 3), nativeReduce, function (acc, arg) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
var array_reduce_x_esm_test4 = function test4() { | ||
var res = attempt_x_esm.call({ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4 | ||
}, nativeReduce, function attempte(acc, arg) { | ||
return acc + arg; | ||
}, 2); | ||
return res.threw === false && res.value === 8; | ||
}; | ||
return acc + arg; | ||
}.bind(undefined), 1); | ||
isWorking = res.threw === false && res.value === 7; | ||
} | ||
var array_reduce_x_esm_test5 = function test5() { | ||
var doc = typeof document !== 'undefined' && document; | ||
if (isWorking) { | ||
res = attempt_x_esm.call({ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4 | ||
}, nativeReduce, function (acc, arg) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
return acc + arg; | ||
}.bind(undefined), 2); | ||
isWorking = res.threw === false && res.value === 8; | ||
if (doc) { | ||
var fragment = doc.createDocumentFragment(); | ||
var div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
var res = attempt_x_esm.call(fragment.childNodes, nativeReduce, function attempte(acc, node) { | ||
acc[acc.length] = node; | ||
return acc; | ||
}, []); | ||
return res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
if (isWorking) { | ||
var doc = typeof document !== 'undefined' && document; | ||
return true; | ||
}; | ||
if (doc) { | ||
var fragment = doc.createDocumentFragment(); | ||
var div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
res = attempt_x_esm.call(fragment.childNodes, nativeReduce, function (acc, node) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
var array_reduce_x_esm_test6 = function test6() { | ||
var res = attempt_x_esm.call('ab', nativeReduce, function attempte(_, __, ___, list) { | ||
return list; | ||
}); | ||
return res.threw === false && _typeof(res.value) === 'object'; | ||
}; // ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
acc[acc.length] = node; | ||
return acc; | ||
}.bind(undefined), []); | ||
isWorking = res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
} | ||
if (isWorking) { | ||
res = attempt_x_esm.call('ab', nativeReduce, function (_, __, ___, list) { | ||
array_reduce_x_esm_newArrowCheck(this, array_reduce_x_esm_this); | ||
var isWorking = to_boolean_x_esm(nativeReduce) && array_reduce_x_esm_test1() && array_reduce_x_esm_test2() && array_reduce_x_esm_test3() && array_reduce_x_esm_test4() && array_reduce_x_esm_test5() && array_reduce_x_esm_test6(); | ||
return list; | ||
}.bind(undefined)); | ||
isWorking = res.threw === false && _typeof(res.value) === 'object'; | ||
} | ||
} | ||
/** | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
var $reduce; | ||
if (nativeReduce && isWorking) { | ||
$reduce = function reduce(array, callBack | ||
var array_reduce_x_esm_patchedReduce = function patchedReduce() { | ||
return function reduce(array, callBack | ||
/* , initialValue */ | ||
) { | ||
var args = [callBack]; | ||
require_object_coercible_x_esm(array); | ||
var args = [assert_is_function_x_esm(callBack)]; | ||
@@ -1738,4 +1745,6 @@ if (arguments.length > 2) { | ||
}; | ||
} else { | ||
$reduce = function reduce(array, callBack | ||
}; | ||
var array_reduce_x_esm_implementation = function implementation() { | ||
return function reduce(array, callBack | ||
/* , initialValue */ | ||
@@ -1751,3 +1760,3 @@ ) { | ||
if (length === 0 && argsLength < 3) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -1773,3 +1782,3 @@ | ||
if (i >= length) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -1791,9 +1800,25 @@ } while (true); | ||
}; | ||
} | ||
}; | ||
/* | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
var red = $reduce; | ||
/* harmony default export */ var array_reduce_x_esm = __webpack_exports__["default"] = (red); | ||
var $reduce = isWorking ? array_reduce_x_esm_patchedReduce() : array_reduce_x_esm_implementation(); | ||
/* harmony default export */ var array_reduce_x_esm = __webpack_exports__["default"] = ($reduce); | ||
/***/ }) | ||
@@ -1800,0 +1825,0 @@ /******/ ]); |
@@ -5,12 +5,12 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-07-27T14:53:32.572Z", | ||
"date": "2019-07-31T22:49:03.969Z", | ||
"describe": "", | ||
"description": "Reduce an array (from left to right) to a single value.", | ||
"file": "array-reduce-x.min.js", | ||
"hash": "b271b50249ffdb617f39", | ||
"hash": "0d58098be196dc049259", | ||
"license": "MIT", | ||
"version": "3.0.15" | ||
"version": "3.0.16" | ||
} | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.arrayReduceX=t():e.arrayReduceX=t()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t,r){"use strict";var n=Object.prototype.toString;if(r(4)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==n.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,r){"use strict"; | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.arrayReduceX=t():e.arrayReduceX=t()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(4)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict"; | ||
/*! | ||
@@ -21,3 +21,3 @@ * is-primitive <https://github.com/jonschlinkert/is-primitive> | ||
* Released under the MIT License. | ||
*/e.exports=function(e){return"object"==typeof e?null===e:"function"!=typeof e}},function(e,t,r){"use strict";var n=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,r){"use strict";(function(t){var n=t.Symbol,o=r(6);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,r(5))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,r){"use strict";r.r(t);var n=function(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return{threw:!1,value:e.apply(this,r)}}catch(e){return{threw:!0,value:e}}},o={}.constructor("a"),i="a"===o[0]&&0 in o,c=r(2),s="".split,u=!1===i&&"function"==typeof s&&r.n(c).a,a=function(e){return u&&u(e)?s.call(e,""):e},f=r(0),l=r.n(f);for(var p=n(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&l()(Symbol(""))}.bind(void 0)),y=!1===p.threw&&!0===p.value,d=r(1),b=r.n(d),g=r(3),v=r.n(g),m=function(e){return!!e},h={}.toString,w=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":h.call(e)},S=y&&l()(Symbol.toStringTag),j=function(e){return null==e},O=function(e){if(j(e))throw new TypeError("Cannot call method on ".concat(e));return e},x="Cannot convert a Symbol value to a string",T=x.constructor,E=function(e){if(l()(e))throw new TypeError(x);return T(e)},P=function(e){return E(O(e))},F=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],N="",M=F.length,C=0;C<M;C+=1)F[C].es2016&&F[C].string,F[C].es2018&&(N+=F[C].string);var k=N,D=new(0,/none/.constructor)("^[".concat(k,"]+")),$="".replace,_=function(e){return $.call(P(e),D,"")},A=new(0,/none/.constructor)("[".concat(k,"]+$")),I="".replace,R=function(e){return I.call(P(e),A,"")},X=function(e){return _(R(e))},q=new(0,/none/.constructor)("[".concat(k,"]+"),"g"),L=" ".replace,B=function(e){return L.call(X(e),q," ")},G=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,H="".replace,U=function(e,t){return H.call(P(e),G,arguments.length>1?E(t):"")};var V=n.constructor,z=(!0).constructor,J=n.toString,K=/^class /,Q=K.test,W=!1===n(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),V('"use strict"; return class My {};')()}.bind(void 0)).threw,Y=function(e){return Q.call(K,B(U(J.call(e)," ")))},Z=function(e){var t=n(Y,e);return!1===t.threw&&t.value},ee=function(e,t){if(b()(e))return!1;if(S)return function(e,t){return!(W&&!1===t&&Z(e)||!1!==n.call(e,J).threw)}(e,m(t));if(W&&!1===z(t)&&Z(e))return!1;var r=w(e);return"[object Function]"===r||"[object GeneratorFunction]"===r||"[object AsyncFunction]"===r},te="string".constructor,re=(0).constructor,ne=y&&Symbol.toPrimitive,oe=y&&Symbol.prototype.valueOf,ie=["toString","valueOf"],ce=["valueOf","toString"],se=function(e,t){if(O(e),"string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');for(var r,n,o="string"===t?ie:ce,i=0;i<2;i+=1)if(r=e[o[i]],ee(r)&&(n=r.call(e),b()(n)))return n;throw new TypeError("No default value")},ue=function(e,t){if(t){if(e===te)return"string";if(e===re)return"number"}return"default"},ae=function(e){if(y){if(ne)return function(e,t){var r=e[t];if(!1===j(r)){if(!1===ee(r))throw new TypeError("".concat(r," returned for property ").concat(t," of object ").concat(e," is not a function"));return r}}(e,ne);if(l()(e))return oe}},fe=function(e,t){if(b()(e))return e;var r=ue(t,arguments.length>1),n=ae(e);if(void 0!==n){var o=n.call(e,r);if(b()(o))return o;throw new TypeError("unable to convert exotic object to primitive")}var i="default"===r&&(v()(e)||l()(e))?"string":r;return se(e,"default"===i?"number":i)},le=parseInt,pe=(0).constructor,ye="".charAt,de=/^[-+]?0[xX]/,be=de.test,ge=function(e,t){var r=_(E(e));return""===ye.call(r,0)?NaN:le(r,pe(t)||(be.call(de,r)?16:10))},ve=2..constructor,me="Cannot convert a Symbol value to a number".slice,he=/^0b[01]+$/i,we=he.test,Se=/^0o[0-7]+$/i,je=new(0,he.constructor)("[ ]","g"),Oe=/^[-+]0x[0-9a-f]+$/i,xe=function e(t){var r=fe(t,ve);if(l()(r))throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof r){if(function(e){return we.call(he,e)}(r))return e(ge(me.call(r,2),2));if(function(e){return we.call(Se,e)}(r))return e(ge(me.call(r,2),8));if(function(e){return we.call(je,e)}(r)||function(e){return we.call(Oe,e)}(r))return NaN;var n=X(r);if(n!==r)return e(n)}return ve(r)},Te=function(e){return e!=e},Ee=function(e){return"number"==typeof e&&!1===Te(e)&&e!==1/0&&e!==-1/0},Pe=function(e){var t=xe(e);return 0===t||Te(t)?t:t>0?1:-1},Fe=Math.abs,Ne=Math.floor,Me=function(e){var t=xe(e);return Te(t)?0:0===t||!1===Ee(t)?t:Pe(t)*Ne(Fe(t))},Ce=function(e){var t=Me(e);return t<=0?0:t>9007199254740991?9007199254740991:t},ke={}.constructor,De=function(e){return ke(O(e))},$e=y&&Symbol.prototype.toString,_e="function"==typeof $e&&l.a,Ae="".constructor,Ie=function(e){return _e&&_e(e)?$e.call(e):Ae(e)},Re=function(e){if(!1===ee(e)){var t=b()(e)?Ie(e):"#<Object>";throw new TypeError("".concat(t," is not a function"))}return e};function Xe(e){return(Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qe(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}var Le,Be=[].reduce,Ge={}.constructor,He="function"==typeof Be&&Be;if(He){var Ue;if((Le=n.call([],He,function(e){return qe(this,void 0),e}.bind(void 0)).threw)&&(Le=!1===(Ue=n.call(Ge("abc"),He,function(e,t){return qe(this,void 0),e+t}.bind(void 0),"x")).threw&&"xabc"===Ue.value),Le&&(Le=!1===(Ue=n.call(function(){return arguments}(1,2,3),He,function(e,t){return qe(this,void 0),e+t}.bind(void 0),1)).threw&&7===Ue.value),Le&&(Le=!1===(Ue=n.call({0:1,1:2,3:3,4:4,length:4},He,function(e,t){return qe(this,void 0),e+t}.bind(void 0),2)).threw&&8===Ue.value),Le){var Ve="undefined"!=typeof document&&document;if(Ve){var ze=Ve.createDocumentFragment(),Je=Ve.createElement("div");ze.appendChild(Je),Le=!1===(Ue=n.call(ze.childNodes,He,function(e,t){return qe(this,void 0),e[e.length]=t,e}.bind(void 0),[])).threw&&1===Ue.value.length&&Ue.value[0]===Je}}Le&&(Le=!1===(Ue=n.call("ab",He,function(e,t,r,n){return qe(this,void 0),n}.bind(void 0))).threw&&"object"===Xe(Ue.value))}var Ke=He&&Le?function(e,t){var r=[t];return arguments.length>2&&(r[1]=arguments[2]),He.apply(e,r)}:function(e,t){var r=De(e);Re(t);var n=a(r),o=Ce(n.length),i=arguments.length;if(0===o&&i<3)throw new TypeError("reduce of empty array with no initial value");var c,s=0;if(i>2)c=arguments[2];else for(;;){if(s in n){c=n[s],s+=1;break}if((s+=1)>=o)throw new TypeError("reduce of empty array with no initial value")}for(;s<o;)s in n&&(c=t(c,n[s],s,r)),s+=1;return c};t.default=Ke}])}); | ||
*/e.exports=function(e){return"object"==typeof e?null===e:"function"!=typeof e}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(6);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(5))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";n.r(t);var r=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return{threw:!1,value:e.apply(this,n)}}catch(e){return{threw:!0,value:e}}},o={}.constructor("a"),i="a"===o[0]&&0 in o,c=n(2),u="".split,s=!1===i&&"function"==typeof u&&n.n(c).a,a=function(e){return s&&s(e)?u.call(e,""):e},f=n(0),l=n.n(f);for(var p=r(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&l()(Symbol(""))}.bind(void 0)),y=!1===p.threw&&!0===p.value,d=n(1),b=n.n(d),g=n(3),m=n.n(g),v=function(e){return!!e},h={}.toString,w=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":h.call(e)},S=y&&l()(Symbol.toStringTag),j=function(e){return null==e},O=function(e){if(j(e))throw new TypeError("Cannot call method on ".concat(e));return e},x="Cannot convert a Symbol value to a string",T=x.constructor,E=function(e){if(l()(e))throw new TypeError(x);return T(e)},P=function(e){return E(O(e))},F=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],N="",M=F.length,k=0;k<M;k+=1)F[k].es2016&&F[k].string,F[k].es2018&&(N+=F[k].string);var C=N,D=new(0,/none/.constructor)("^[".concat(C,"]+")),$="".replace,_=function(e){return $.call(P(e),D,"")},R=new(0,/none/.constructor)("[".concat(C,"]+$")),A="".replace,I=function(e){return A.call(P(e),R,"")},X=function(e){return _(I(e))},q=new(0,/none/.constructor)("[".concat(C,"]+"),"g"),L=" ".replace,B=function(e){return L.call(X(e),q," ")},G=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,H="".replace,U=function(e,t){return H.call(P(e),G,arguments.length>1?E(t):"")},V=r.constructor,z=r.toString,J=/^class /,K=J.test,Q=!1===r(function(){return V('"use strict"; return class My {};')()}).threw,W=function(e){return K.call(J,B(U(z.call(e)," ")))},Y=function(e){var t=r(W,e);return!1===t.threw&&t.value},Z=function(e,t){return!b()(e)&&(S?function(e,t){return!(Q&&!1===t&&Y(e)||!1!==r.call(e,z).threw)}(e,v(t)):(!Q||!1!==v(t)||!Y(e))&&function(e){var t=w(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t}(e))},ee="string".constructor,te=(0).constructor,ne=y&&Symbol.toPrimitive,re=y&&Symbol.prototype.valueOf,oe=["toString","valueOf"],ie=["valueOf","toString"],ce=function(e,t){O(e),function(e){if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"')}(t);for(var n,r,o="string"===t?oe:ie,i=0;i<2;i+=1)if(n=e[o[i]],Z(n)&&(r=n.call(e),b()(r)))return r;throw new TypeError("No default value")},ue=function(e,t){if(t){if(e===ee)return"string";if(e===te)return"number"}return"default"},se=function(e){if(y){if(ne)return function(e,t){var n=e[t];if(!1===j(n)){if(!1===Z(n))throw new TypeError("".concat(n," returned for property ").concat(t," of object ").concat(e," is not a function"));return n}}(e,ne);if(l()(e))return re}},ae=function(e){var t=e.exoticToPrim,n=e.input,r=e.hint,o=t.call(n,r);if(b()(o))return o;throw new TypeError("unable to convert exotic object to primitive")},fe=function(e,t){var n="default"===t&&(m()(e)||l()(e))?"string":t;return ce(e,"default"===n?"number":n)},le=function(e,t){if(b()(e))return e;var n=ue(t,arguments.length>1),r=se(e);return void 0===r?fe(e,n):ae({exoticToPrim:r,input:e,hint:n})},pe=parseInt,ye=(0).constructor,de="".charAt,be=/^[-+]?0[xX]/,ge=be.test,me=function(e,t){var n=_(E(e));return""===de.call(n,0)?NaN:pe(n,ye(t)||(ge.call(be,n)?16:10))},ve=2..constructor,he="Cannot convert a Symbol value to a number".slice,we=/^0b[01]+$/i,Se=we.test,je=/^0o[0-7]+$/i,Oe=new(0,we.constructor)("[ ]","g"),xe=/^[-+]0x[0-9a-f]+$/i,Te=function(e,t){return me(he.call(e,2),t)},Ee=function(e,t){return function(e){return Se.call(we,e)}(t)?e(Te(t,2)):function(e){return Se.call(je,e)}(t)?e(Te(t,8)):null},Pe=function(e,t){var n=Ee(e,t);if(null!==n)return n;if(function(e){return Se.call(Oe,e)}(t)||function(e){return Se.call(xe,e)}(t))return NaN;var r=X(t);return r!==t?e(r):null},Fe=function e(t){var n=function(e){if(l()(e))throw new TypeError("Cannot convert a Symbol value to a number");return e}(le(t,ve));if("string"==typeof n){var r=Pe(e,n);if(null!==r)return r}return ve(n)},Ne=function(e){return e!=e},Me=function(e){return"number"==typeof e&&!1===Ne(e)&&e!==1/0&&e!==-1/0},ke=function(e){var t=Fe(e);return 0===t||Ne(t)?t:t>0?1:-1},Ce=Math.abs,De=Math.floor,$e=function(e){var t=Fe(e);return Ne(t)?0:0===t||!1===Me(t)?t:ke(t)*De(Ce(t))},_e=function(e){var t=$e(e);return t<=0?0:t>9007199254740991?9007199254740991:t},Re={}.constructor,Ae=function(e){return Re(O(e))},Ie=y&&Symbol.prototype.toString,Xe="function"==typeof Ie&&l.a,qe="".constructor,Le=function(e){return Xe&&Xe(e)?Ie.call(e):qe(e)},Be=function(e){if(!1===Z(e)){var t=b()(e)?Le(e):"#<Object>";throw new TypeError("".concat(t," is not a function"))}return e};function Ge(e){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var He,Ue=[].reduce,Ve={}.constructor,ze="function"==typeof Ue&&Ue,Je=v(ze)&&r.call([],ze,function(e){return e}).threw&&(!1===(He=r.call(Ve("abc"),ze,function(e,t){return e+t},"x")).threw&&"xabc"===He.value)&&function(){var e=r.call(function(){return arguments}(1,2,3),ze,function(e,t){return e+t},1);return!1===e.threw&&7===e.value}()&&function(){var e=r.call({0:1,1:2,3:3,4:4,length:4},ze,function(e,t){return e+t},2);return!1===e.threw&&8===e.value}()&&function(){var e="undefined"!=typeof document&&document;if(e){var t=e.createDocumentFragment(),n=e.createElement("div");t.appendChild(n);var o=r.call(t.childNodes,ze,function(e,t){return e[e.length]=t,e},[]);return!1===o.threw&&1===o.value.length&&o.value[0]===n}return!0}()&&function(){var e=r.call("ab",ze,function(e,t,n,r){return r});return!1===e.threw&&"object"===Ge(e.value)}()?function(e,t){O(e);var n=[Be(t)];return arguments.length>2&&(n[1]=arguments[2]),ze.apply(e,n)}:function(e,t){var n=Ae(e);Be(t);var r=a(n),o=_e(r.length),i=arguments.length;if(0===o&&i<3)throw new TypeError("Reduce of empty array with no initial value");var c,u=0;if(i>2)c=arguments[2];else for(;;){if(u in r){c=r[u],u+=1;break}if((u+=1)>=o)throw new TypeError("Reduce of empty array with no initial value")}for(;u<o;)u in r&&(c=t(c,r[u],u,n)),u+=1;return c};t.default=Je}])}); | ||
//# sourceMappingURL=array-reduce-x.min.js.map |
{ | ||
"name": "array-reduce-x", | ||
"version": "3.0.15", | ||
"version": "3.0.16", | ||
"description": "Reduce an array (from left to right) to a single value.", | ||
@@ -53,7 +53,9 @@ "homepage": "https://github.com/Xotic750/array-reduce-x", | ||
"dependencies": { | ||
"assert-is-function-x": "^3.0.18", | ||
"attempt-x": "^2.0.22", | ||
"split-if-boxed-bug-x": "^2.0.22", | ||
"to-length-x": "^4.0.25", | ||
"to-object-x": "^2.0.20" | ||
"assert-is-function-x": "^3.0.19", | ||
"attempt-x": "^2.0.23", | ||
"require-object-coercible-x": "^2.0.27", | ||
"split-if-boxed-bug-x": "^2.0.23", | ||
"to-boolean-x": "^2.0.25", | ||
"to-length-x": "^4.0.26", | ||
"to-object-x": "^2.0.21" | ||
}, | ||
@@ -64,6 +66,2 @@ "devDependencies": { | ||
"@babel/node": "^7.5.5", | ||
"@babel/plugin-proposal-class-properties": "^7.5.5", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0", | ||
"@babel/plugin-syntax-export-default-from": "^7.2.0", | ||
"@babel/plugin-syntax-export-namespace-from": "^7.2.0", | ||
"@babel/plugin-transform-property-mutators": "^7.2.0", | ||
@@ -73,5 +71,5 @@ "@babel/plugin-transform-runtime": "^7.5.5", | ||
"@babel/runtime": "^7.5.5", | ||
"@prorenata/eslint-config-vue": "^1.13.14", | ||
"@types/jest": "^24.0.15", | ||
"@types/jest": "^24.0.16", | ||
"@types/node": "^12.6.8", | ||
"@xotic750/eslint-config-recommended": "^1.0.5", | ||
"babel-core": "^7.0.0-0", | ||
@@ -81,9 +79,5 @@ "babel-eslint": "^10.0.2", | ||
"babel-plugin-lodash": "^3.3.4", | ||
"caniuse-lite": "^1.0.30000986", | ||
"chalk": "^2.4.2", | ||
"concurrently": "^4.1.1", | ||
"caniuse-lite": "^1.0.30000988", | ||
"cross-env": "^5.2.0", | ||
"eslint": "=5.16.0", | ||
"eslint-config-airbnb-base": "^13.2.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-friendly-formatter": "^4.0.1", | ||
@@ -98,4 +92,4 @@ "eslint-import-resolver-webpack": "^0.11.1", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jest": "^22.14.0", | ||
"eslint-plugin-jsdoc": "^15.7.2", | ||
"eslint-plugin-jest": "^22.14.1", | ||
"eslint-plugin-jsdoc": "^15.8.0", | ||
"eslint-plugin-json": "^1.4.0", | ||
@@ -109,23 +103,17 @@ "eslint-plugin-lodash": "^5.1.0", | ||
"eslint-plugin-switch-case": "^1.1.2", | ||
"eslint-plugin-vue": "^5.2.3", | ||
"friendly-errors-webpack-plugin": "^1.7.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^24.8.0", | ||
"jest-cli": "^24.8.0", | ||
"jest-file": "^1.0.0", | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"lodash": "^4.17.15", | ||
"lodash-webpack-plugin": "^0.11.5", | ||
"mkdirp": "^0.5.1", | ||
"node-notifier": "^5.4.0", | ||
"nodemon": "^1.19.1", | ||
"prettier": "=1.14.3", | ||
"prettier": "^1.18.2", | ||
"rimraf": "^2.6.3", | ||
"semver": "^6.3.0", | ||
"source-map-loader": "^0.2.4", | ||
"strip-ansi": "^5.2.0", | ||
"terser-webpack-plugin": "^1.3.0", | ||
"terser-webpack-plugin": "^1.4.1", | ||
"typescript": "^3.5.3", | ||
"webpack": "^4.38.0", | ||
"webpack-bundle-analyzer": "^3.3.2", | ||
"webpack-bundle-analyzer": "^3.4.1", | ||
"webpack-cli": "^3.3.6", | ||
@@ -132,0 +120,0 @@ "webpack-merge": "^4.2.1" |
@@ -6,2 +6,4 @@ import attempt from 'attempt-x'; | ||
import assertIsFunction from 'assert-is-function-x'; | ||
import toBoolean from 'to-boolean-x'; | ||
import requireObjectCoercible from 'require-object-coercible-x'; | ||
@@ -12,114 +14,98 @@ const natRed = [].reduce; | ||
// ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
let isWorking; | ||
if (nativeReduce) { | ||
isWorking = attempt.call([], nativeReduce, (acc) => { | ||
const test1 = function test1() { | ||
return attempt.call([], nativeReduce, function attemptee(acc) { | ||
return acc; | ||
}).threw; | ||
}; | ||
let res; | ||
const test2 = function test2() { | ||
const res = attempt.call( | ||
castObject('abc'), | ||
nativeReduce, | ||
function attemptee(acc, c) { | ||
return acc + c; | ||
}, | ||
'x', | ||
); | ||
if (isWorking) { | ||
res = attempt.call( | ||
castObject('abc'), | ||
nativeReduce, | ||
(acc, c) => { | ||
return acc + c; | ||
}, | ||
'x', | ||
); | ||
return res.threw === false && res.value === 'xabc'; | ||
}; | ||
isWorking = res.threw === false && res.value === 'xabc'; | ||
} | ||
const test3 = function test3() { | ||
const res = attempt.call( | ||
(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
})(1, 2, 3), | ||
nativeReduce, | ||
function attempte(acc, arg) { | ||
return acc + arg; | ||
}, | ||
1, | ||
); | ||
if (isWorking) { | ||
res = attempt.call( | ||
(function getArgs() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
})(1, 2, 3), | ||
nativeReduce, | ||
(acc, arg) => { | ||
return acc + arg; | ||
}, | ||
1, | ||
); | ||
return res.threw === false && res.value === 7; | ||
}; | ||
isWorking = res.threw === false && res.value === 7; | ||
} | ||
const test4 = function test4() { | ||
const res = attempt.call( | ||
{ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4, | ||
}, | ||
nativeReduce, | ||
function attempte(acc, arg) { | ||
return acc + arg; | ||
}, | ||
2, | ||
); | ||
if (isWorking) { | ||
res = attempt.call( | ||
{ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4, | ||
}, | ||
return res.threw === false && res.value === 8; | ||
}; | ||
const test5 = function test5() { | ||
const doc = typeof document !== 'undefined' && document; | ||
if (doc) { | ||
const fragment = doc.createDocumentFragment(); | ||
const div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
const res = attempt.call( | ||
fragment.childNodes, | ||
nativeReduce, | ||
(acc, arg) => { | ||
return acc + arg; | ||
function attempte(acc, node) { | ||
acc[acc.length] = node; | ||
return acc; | ||
}, | ||
2, | ||
[], | ||
); | ||
isWorking = res.threw === false && res.value === 8; | ||
return res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
if (isWorking) { | ||
const doc = typeof document !== 'undefined' && document; | ||
return true; | ||
}; | ||
if (doc) { | ||
const fragment = doc.createDocumentFragment(); | ||
const div = doc.createElement('div'); | ||
fragment.appendChild(div); | ||
res = attempt.call( | ||
fragment.childNodes, | ||
nativeReduce, | ||
(acc, node) => { | ||
acc[acc.length] = node; | ||
const test6 = function test6() { | ||
const res = attempt.call('ab', nativeReduce, function attempte(_, __, ___, list) { | ||
return list; | ||
}); | ||
return acc; | ||
}, | ||
[], | ||
); | ||
return res.threw === false && typeof res.value === 'object'; | ||
}; | ||
isWorking = res.threw === false && res.value.length === 1 && res.value[0] === div; | ||
} | ||
} | ||
// ES5 15.4.4.21 | ||
// http://es5.github.com/#x15.4.4.21 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce | ||
const isWorking = toBoolean(nativeReduce) && test1() && test2() && test3() && test4() && test5() && test6(); | ||
if (isWorking) { | ||
res = attempt.call('ab', nativeReduce, (_, __, ___, list) => { | ||
return list; | ||
}); | ||
const patchedReduce = function patchedReduce() { | ||
return function reduce(array, callBack /* , initialValue */) { | ||
requireObjectCoercible(array); | ||
const args = [assertIsFunction(callBack)]; | ||
isWorking = res.threw === false && typeof res.value === 'object'; | ||
} | ||
} | ||
/** | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
let $reduce; | ||
if (nativeReduce && isWorking) { | ||
$reduce = function reduce(array, callBack /* , initialValue */) { | ||
const args = [callBack]; | ||
if (arguments.length > 2) { | ||
@@ -132,4 +118,6 @@ /* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
}; | ||
} else { | ||
$reduce = function reduce(array, callBack /* , initialValue */) { | ||
}; | ||
const implementation = function implementation() { | ||
return function reduce(array, callBack /* , initialValue */) { | ||
const object = toObject(array); | ||
@@ -144,3 +132,3 @@ // If no callback function or if callback is not a callable function | ||
if (length === 0 && argsLength < 3) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -166,3 +154,3 @@ | ||
if (i >= length) { | ||
throw new TypeError('reduce of empty array with no initial value'); | ||
throw new TypeError('Reduce of empty array with no initial value'); | ||
} | ||
@@ -182,6 +170,21 @@ } while (true); /* eslint-disable-line no-constant-condition */ | ||
}; | ||
} | ||
}; | ||
const red = $reduce; | ||
/* | ||
* This method applies a function against an accumulator and each element in the | ||
* array (from left to right) to reduce it to a single value. | ||
* | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to execute for each element. | ||
* @param {*} [initialValue] - Value to use as the first argument to the first | ||
* call of the callback. If no initial value is supplied, the first element in | ||
* the array will be used. Calling reduce on an empty array without an initial | ||
* value is an error. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @throws {TypeError} If called on an empty array without an initial value. | ||
* @returns {*} The value that results from the reduction. | ||
*/ | ||
const $reduce = isWorking ? patchedReduce() : implementation(); | ||
export default red; | ||
export default $reduce; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231407
53
11
1800
7
+ Addedto-boolean-x@^2.0.25
Updatedassert-is-function-x@^3.0.19
Updatedattempt-x@^2.0.23
Updatedsplit-if-boxed-bug-x@^2.0.23
Updatedto-length-x@^4.0.26
Updatedto-object-x@^2.0.21