array-some-x
Advanced tools
Comparing version 3.0.13 to 3.0.14
import attempt from 'attempt-x'; | ||
import splitIfBoxedBug from 'split-if-boxed-bug-x'; | ||
import toLength from 'to-length-x'; | ||
import toObject from 'to-object-x'; | ||
import assertIsFunction from 'assert-is-function-x'; | ||
import requireObjectCoercible from 'require-object-coercible-x'; | ||
import any from 'array-any-x'; | ||
import toBoolean from 'to-boolean-x'; | ||
var ns = [].some; | ||
@@ -21,3 +21,3 @@ var nativeSome = typeof ns === 'function' && ns; | ||
var spy = ''; | ||
var res = attempt.call({}.constructor('abc'), nativeSome, function spyAdd2(item, index) { | ||
var res = attempt.call(toObject('abc'), nativeSome, function spyAdd2(item, index) { | ||
spy += item; | ||
@@ -77,3 +77,3 @@ return index === 1; | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
return true.constructor(this) === false; | ||
return toBoolean(this) === false; | ||
}(); | ||
@@ -83,6 +83,9 @@ | ||
var spy = null; | ||
var res = attempt.call([1], nativeSome, function thisTest() { | ||
var thisTest = function thisTest() { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
spy = typeof this === 'string'; | ||
}, 'x'); | ||
}; | ||
var res = attempt.call([1], nativeSome, thisTest, 'x'); | ||
return res.threw === false && res.value === false && spy === true; | ||
@@ -99,22 +102,20 @@ } | ||
var res = attempt(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, true.constructor); | ||
var res = attempt(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, toBoolean); | ||
return res.threw === false && res.value === false && spy.value !== true; | ||
}; | ||
var isWorking = true.constructor(nativeSome) && test1() && test2() && test3() && test4() && test5() && test6() && test7(); | ||
var isWorking = toBoolean(nativeSome) && test1() && test2() && test3() && test4() && test5() && test6() && test7(); | ||
var patchedSome = function patchedSome() { | ||
return function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
requireObjectCoercible(array); | ||
var args = [assertIsFunction(callBack)]; | ||
var patchedSome = function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
requireObjectCoercible(array); | ||
var args = [assertIsFunction(callBack)]; | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
return nativeSome.apply(array, args); | ||
}; | ||
return nativeSome.apply(array, args); | ||
}; // ES5 15.4.4.17 | ||
@@ -125,23 +126,18 @@ // http://es5.github.com/#x15.4.4.17 | ||
export var implementation = function implementation() { | ||
return function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
var object = toObject(array); // If no callback function or if callback is not a callable function | ||
export var implementation = function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
var object = toObject(array); // If no callback function or if callback is not a callable function | ||
assertIsFunction(callBack); | ||
var iterable = splitIfBoxedBug(object); | ||
var length = toLength(iterable.length); | ||
/* eslint-disable-next-line prefer-rest-params,no-void */ | ||
assertIsFunction(callBack); | ||
var thisArg = arguments.length > 2 ? arguments[2] : void 0; | ||
var noThis = typeof thisArg === 'undefined'; | ||
var iteratee = function iteratee() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
var i = arguments[1]; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
for (var i = 0; i < length; i += 1) { | ||
if (i in iterable) { | ||
var item = iterable[i]; | ||
if (noThis ? callBack(item, i, object) : callBack.call(thisArg, item, i, object)) { | ||
return true; | ||
} | ||
if (i in arguments[2]) { | ||
/* eslint-disable-next-line prefer-rest-params,babel/no-invalid-this */ | ||
if (callBack.call(this, arguments[0], i, object)) { | ||
return true; | ||
} | ||
@@ -152,2 +148,6 @@ } | ||
}; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return any(object, iteratee, arguments[2]); | ||
}; | ||
@@ -167,5 +167,5 @@ /** | ||
var $some = isWorking ? patchedSome() : implementation(); | ||
var $some = isWorking ? patchedSome : implementation; | ||
export default $some; | ||
//# sourceMappingURL=array-some-x.esm.js.map |
@@ -5,9 +5,9 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-07-31T22:57:04.678Z", | ||
"date": "2019-08-05T18:52:36.836Z", | ||
"describe": "", | ||
"description": "Tests whether some element passes the provided function.", | ||
"file": "array-some-x.js", | ||
"hash": "5d7adb0bd5923c2665a9", | ||
"hash": "081e9e9c7af4da654961", | ||
"license": "MIT", | ||
"version": "3.0.13" | ||
"version": "3.0.14" | ||
} | ||
@@ -198,6 +198,6 @@ */ | ||
var strValue = String.prototype.valueOf; | ||
var tryStringObject = function tryStringObject(value) { | ||
var getDay = Date.prototype.getDay; | ||
var tryDateObject = function tryDateObject(value) { | ||
try { | ||
strValue.call(value); | ||
getDay.call(value); | ||
return true; | ||
@@ -208,10 +208,10 @@ } catch (e) { | ||
}; | ||
var toStr = Object.prototype.toString; | ||
var strClass = '[object String]'; | ||
var dateClass = '[object Date]'; | ||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; | ||
module.exports = function isString(value) { | ||
if (typeof value === 'string') { return true; } | ||
if (typeof value !== 'object') { return false; } | ||
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; | ||
module.exports = function isDateObject(value) { | ||
if (typeof value !== 'object' || value === null) { return false; } | ||
return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; | ||
}; | ||
@@ -227,6 +227,6 @@ | ||
var getDay = Date.prototype.getDay; | ||
var tryDateObject = function tryDateObject(value) { | ||
var strValue = String.prototype.valueOf; | ||
var tryStringObject = function tryStringObject(value) { | ||
try { | ||
getDay.call(value); | ||
strValue.call(value); | ||
return true; | ||
@@ -237,10 +237,10 @@ } catch (e) { | ||
}; | ||
var toStr = Object.prototype.toString; | ||
var dateClass = '[object Date]'; | ||
var strClass = '[object String]'; | ||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; | ||
module.exports = function isDateObject(value) { | ||
if (typeof value !== 'object' || value === null) { return false; } | ||
return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; | ||
module.exports = function isString(value) { | ||
if (typeof value === 'string') { return true; } | ||
if (typeof value !== 'object') { return false; } | ||
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; | ||
}; | ||
@@ -385,79 +385,58 @@ | ||
// CONCATENATED MODULE: ./node_modules/has-boxed-string-x/dist/has-boxed-string-x.esm.js | ||
var has_boxed_string_x_esm_string = 'a'; | ||
var boxedString = {}.constructor(has_boxed_string_x_esm_string); | ||
// CONCATENATED MODULE: ./node_modules/is-nil-x/dist/is-nil-x.esm.js | ||
/** | ||
* Check failure of by-index access of string characters (IE < 9) | ||
* and failure of `0 in boxedString` (Rhino). | ||
* Checks if `value` is `null` or `undefined`. | ||
* | ||
* `true` if no failure; otherwise `false`. | ||
* | ||
* @type boolean | ||
* @param {*} [value] - The value to check. | ||
* @returns {boolean} Returns `true` if `value` is nullish, else `false`. | ||
*/ | ||
var isNil = function isNil(value) { | ||
/* eslint-disable-next-line lodash/prefer-is-nil */ | ||
return value === null || typeof value === 'undefined'; | ||
}; | ||
var hasBoxed = boxedString[0] === has_boxed_string_x_esm_string && 0 in boxedString; | ||
/* harmony default export */ var has_boxed_string_x_esm = (hasBoxed); | ||
/* harmony default export */ var is_nil_x_esm = (isNil); | ||
// EXTERNAL MODULE: ./node_modules/is-string/index.js | ||
var is_string = __webpack_require__(2); | ||
var is_string_default = /*#__PURE__*/__webpack_require__.n(is_string); | ||
// CONCATENATED MODULE: ./node_modules/require-object-coercible-x/dist/require-object-coercible-x.esm.js | ||
// CONCATENATED MODULE: ./node_modules/split-if-boxed-bug-x/dist/split-if-boxed-bug-x.esm.js | ||
var EMPTY_STRING = ''; | ||
var strSplit = EMPTY_STRING.split; | ||
var isStringFn = has_boxed_string_x_esm === false && typeof strSplit === 'function' && is_string_default.a; | ||
/** | ||
* This method tests if a value is a string with the boxed bug; splits to an | ||
* array for iteration; otherwise returns the original value. | ||
* The abstract operation RequireObjectCoercible throws an error if argument | ||
* is a value that cannot be converted to an Object using ToObject. | ||
* | ||
* @param {*} [value] - The value to be tested. | ||
* @returns {*} An array or characters if value was a string with the boxed bug; | ||
* otherwise the value. | ||
* @param {*} [value] - The `value` to check. | ||
* @throws {TypeError} If `value` is a `null` or `undefined`. | ||
* @returns {string} The `value`. | ||
*/ | ||
var splitIfBoxedBug = function splitIfBoxedBug(value) { | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, EMPTY_STRING) : value; | ||
var require_object_coercible_x_esm_requireObjectCoercible = function requireObjectCoercible(value) { | ||
if (is_nil_x_esm(value)) { | ||
throw new TypeError("Cannot call method on ".concat(value)); | ||
} | ||
return value; | ||
}; | ||
/* harmony default export */ var split_if_boxed_bug_x_esm = (splitIfBoxedBug); | ||
/* harmony default export */ var require_object_coercible_x_esm = (require_object_coercible_x_esm_requireObjectCoercible); | ||
// EXTERNAL MODULE: ./node_modules/is-symbol/index.js | ||
var is_symbol = __webpack_require__(0); | ||
var is_symbol_default = /*#__PURE__*/__webpack_require__.n(is_symbol); | ||
// CONCATENATED MODULE: ./node_modules/to-object-x/dist/to-object-x.esm.js | ||
// CONCATENATED MODULE: ./node_modules/has-symbol-support-x/dist/has-symbol-support-x.esm.js | ||
var _this = undefined; | ||
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } | ||
var hasSymbolSupport = attempt_x_esm(function () { | ||
_newArrowCheck(this, _this); | ||
/* eslint-disable-next-line compat/compat */ | ||
return typeof Symbol === 'function' && is_symbol_default()(Symbol('')); | ||
}.bind(undefined)); | ||
var castObject = {}.constructor; | ||
/** | ||
* Indicates if `Symbol`exists and creates the correct type. | ||
* `true`, if it exists and creates the correct type, otherwise `false`. | ||
* The abstract operation ToObject converts argument to a value of | ||
* type Object. | ||
* | ||
* @type boolean | ||
* @param {*} value - The `value` to convert. | ||
* @throws {TypeError} If `value` is a `null` or `undefined`. | ||
* @returns {!object} The `value` converted to an object. | ||
*/ | ||
/* harmony default export */ var has_symbol_support_x_esm = (hasSymbolSupport.threw === false && hasSymbolSupport.value === true); | ||
var to_object_x_esm_toObject = function toObject(value) { | ||
return castObject(require_object_coercible_x_esm(value)); | ||
}; | ||
/* harmony default export */ var to_object_x_esm = (to_object_x_esm_toObject); | ||
// EXTERNAL MODULE: ./node_modules/is-primitive/index.js | ||
var is_primitive = __webpack_require__(1); | ||
var is_primitive_default = /*#__PURE__*/__webpack_require__.n(is_primitive); | ||
// EXTERNAL MODULE: ./node_modules/is-date-object/index.js | ||
var is_date_object = __webpack_require__(3); | ||
var is_date_object_default = /*#__PURE__*/__webpack_require__.n(is_date_object); | ||
// CONCATENATED MODULE: ./node_modules/to-boolean-x/dist/to-boolean-x.esm.js | ||
@@ -502,54 +481,48 @@ /** | ||
// CONCATENATED MODULE: ./node_modules/has-to-string-tag-x/dist/has-to-string-tag-x.esm.js | ||
// EXTERNAL MODULE: ./node_modules/is-symbol/index.js | ||
var is_symbol = __webpack_require__(0); | ||
var is_symbol_default = /*#__PURE__*/__webpack_require__.n(is_symbol); | ||
// CONCATENATED MODULE: ./node_modules/has-symbol-support-x/dist/has-symbol-support-x.esm.js | ||
var _this = undefined; | ||
/** | ||
* Indicates if `Symbol.toStringTag`exists and is the correct type. | ||
* `true`, if it exists and is the correct type, otherwise `false`. | ||
* | ||
* @type boolean | ||
*/ | ||
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } | ||
/* harmony default export */ var has_to_string_tag_x_esm = (has_symbol_support_x_esm && | ||
/* eslint-disable-next-line compat/compat */ | ||
is_symbol_default()(Symbol.toStringTag)); | ||
// CONCATENATED MODULE: ./node_modules/is-nil-x/dist/is-nil-x.esm.js | ||
var hasSymbolSupport = attempt_x_esm(function () { | ||
_newArrowCheck(this, _this); | ||
/* eslint-disable-next-line compat/compat */ | ||
return typeof Symbol === 'function' && is_symbol_default()(Symbol('')); | ||
}.bind(undefined)); | ||
/** | ||
* Checks if `value` is `null` or `undefined`. | ||
* Indicates if `Symbol`exists and creates the correct type. | ||
* `true`, if it exists and creates the correct type, otherwise `false`. | ||
* | ||
* @param {*} [value] - The value to check. | ||
* @returns {boolean} Returns `true` if `value` is nullish, else `false`. | ||
* @type boolean | ||
*/ | ||
var isNil = function isNil(value) { | ||
/* eslint-disable-next-line lodash/prefer-is-nil */ | ||
return value === null || typeof value === 'undefined'; | ||
}; | ||
/* harmony default export */ var is_nil_x_esm = (isNil); | ||
/* harmony default export */ var has_symbol_support_x_esm = (hasSymbolSupport.threw === false && hasSymbolSupport.value === true); | ||
// CONCATENATED MODULE: ./node_modules/require-object-coercible-x/dist/require-object-coercible-x.esm.js | ||
// CONCATENATED MODULE: ./node_modules/has-to-string-tag-x/dist/has-to-string-tag-x.esm.js | ||
/** | ||
* The abstract operation RequireObjectCoercible throws an error if argument | ||
* is a value that cannot be converted to an Object using ToObject. | ||
* Indicates if `Symbol.toStringTag`exists and is the correct type. | ||
* `true`, if it exists and is the correct type, otherwise `false`. | ||
* | ||
* @param {*} [value] - The `value` to check. | ||
* @throws {TypeError} If `value` is a `null` or `undefined`. | ||
* @returns {string} The `value`. | ||
* @type boolean | ||
*/ | ||
var require_object_coercible_x_esm_requireObjectCoercible = function requireObjectCoercible(value) { | ||
if (is_nil_x_esm(value)) { | ||
throw new TypeError("Cannot call method on ".concat(value)); | ||
} | ||
/* harmony default export */ var has_to_string_tag_x_esm = (has_symbol_support_x_esm && | ||
/* eslint-disable-next-line compat/compat */ | ||
is_symbol_default()(Symbol.toStringTag)); | ||
return value; | ||
}; | ||
/* harmony default export */ var require_object_coercible_x_esm = (require_object_coercible_x_esm_requireObjectCoercible); | ||
// EXTERNAL MODULE: ./node_modules/is-primitive/index.js | ||
var is_primitive = __webpack_require__(1); | ||
var is_primitive_default = /*#__PURE__*/__webpack_require__.n(is_primitive); | ||
// CONCATENATED MODULE: ./node_modules/to-string-x/dist/to-string-x.esm.js | ||
@@ -912,6 +885,6 @@ | ||
var trim_left_x_esm_EMPTY_STRING = ''; | ||
var EMPTY_STRING = ''; | ||
var RegExpCtr = /none/.constructor; | ||
var reLeft = new RegExpCtr("^[".concat(white_space_x_esm, "]+")); | ||
var replace = trim_left_x_esm_EMPTY_STRING.replace; | ||
var replace = EMPTY_STRING.replace; | ||
/** | ||
@@ -926,3 +899,3 @@ * This method removes whitespace from the start of a string. (ES2019). | ||
var trim_left_x_esm_trimStart = function trimStart(string) { | ||
return replace.call(require_coercible_to_string_x_esm(string), reLeft, trim_left_x_esm_EMPTY_STRING); | ||
return replace.call(require_coercible_to_string_x_esm(string), reLeft, EMPTY_STRING); | ||
}; | ||
@@ -1101,2 +1074,58 @@ | ||
// CONCATENATED MODULE: ./node_modules/to-string-symbols-supported-x/dist/to-string-symbols-supported-x.esm.js | ||
/* eslint-disable-next-line compat/compat */ | ||
var pToString = has_symbol_support_x_esm && Symbol.prototype.toString; | ||
var isSymbolFn = typeof pToString === 'function' && is_symbol_default.a; | ||
/** @type {Function} */ | ||
var to_string_symbols_supported_x_esm_castString = ''.constructor; | ||
/** | ||
* The abstract operation ToString converts argument to a value of type String, | ||
* however the specification states that if the argument is a Symbol then a | ||
* 'TypeError' is thrown. This version also allows Symbols be converted to | ||
* a string. Other uncoercible exotics will still throw though. | ||
* | ||
* @param {*} [value] - The value to convert to a string. | ||
* @returns {string} The converted value. | ||
*/ | ||
var toStringSymbolsSupported = function toStringSymbolsSupported(value) { | ||
return isSymbolFn && isSymbolFn(value) ? pToString.call(value) : to_string_symbols_supported_x_esm_castString(value); | ||
}; | ||
/* harmony default export */ var to_string_symbols_supported_x_esm = (toStringSymbolsSupported); | ||
// CONCATENATED MODULE: ./node_modules/assert-is-function-x/dist/assert-is-function-x.esm.js | ||
/** | ||
* Tests `callback` to see if it is a function, throws a `TypeError` if it is | ||
* not. Otherwise returns the `callback`. | ||
* | ||
* @param {*} callback - The argument to be tested. | ||
* @throws {TypeError} Throws if `callback` is not a function. | ||
* @returns {*} Returns `callback` if it is function. | ||
*/ | ||
var assert_is_function_x_esm_assertIsFunction = function assertIsFunction(callback) { | ||
if (is_function_x_esm(callback) === false) { | ||
var msg = is_primitive_default()(callback) ? to_string_symbols_supported_x_esm(callback) : '#<Object>'; | ||
throw new TypeError("".concat(msg, " is not a function")); | ||
} | ||
return callback; | ||
}; | ||
/* harmony default export */ var assert_is_function_x_esm = (assert_is_function_x_esm_assertIsFunction); | ||
// EXTERNAL MODULE: ./node_modules/is-date-object/index.js | ||
var is_date_object = __webpack_require__(2); | ||
var is_date_object_default = /*#__PURE__*/__webpack_require__.n(is_date_object); | ||
// CONCATENATED MODULE: ./node_modules/to-primitive-x/dist/to-primitive-x.esm.js | ||
@@ -1570,75 +1599,126 @@ | ||
// CONCATENATED MODULE: ./node_modules/to-object-x/dist/to-object-x.esm.js | ||
var castObject = {}.constructor; | ||
// CONCATENATED MODULE: ./node_modules/has-boxed-string-x/dist/has-boxed-string-x.esm.js | ||
var has_boxed_string_x_esm_string = 'a'; | ||
var boxedString = {}.constructor(has_boxed_string_x_esm_string); | ||
/** | ||
* The abstract operation ToObject converts argument to a value of | ||
* type Object. | ||
* Check failure of by-index access of string characters (IE < 9) | ||
* and failure of `0 in boxedString` (Rhino). | ||
* | ||
* @param {*} value - The `value` to convert. | ||
* @throws {TypeError} If `value` is a `null` or `undefined`. | ||
* @returns {!object} The `value` converted to an object. | ||
* `true` if no failure; otherwise `false`. | ||
* | ||
* @type boolean | ||
*/ | ||
var to_object_x_esm_toObject = function toObject(value) { | ||
return castObject(require_object_coercible_x_esm(value)); | ||
}; | ||
var hasBoxed = boxedString[0] === has_boxed_string_x_esm_string && 0 in boxedString; | ||
/* harmony default export */ var has_boxed_string_x_esm = (hasBoxed); | ||
/* harmony default export */ var to_object_x_esm = (to_object_x_esm_toObject); | ||
// EXTERNAL MODULE: ./node_modules/is-string/index.js | ||
var is_string = __webpack_require__(3); | ||
var is_string_default = /*#__PURE__*/__webpack_require__.n(is_string); | ||
// CONCATENATED MODULE: ./node_modules/to-string-symbols-supported-x/dist/to-string-symbols-supported-x.esm.js | ||
// CONCATENATED MODULE: ./node_modules/split-if-boxed-bug-x/dist/split-if-boxed-bug-x.esm.js | ||
/* eslint-disable-next-line compat/compat */ | ||
var pToString = has_symbol_support_x_esm && Symbol.prototype.toString; | ||
var isSymbolFn = typeof pToString === 'function' && is_symbol_default.a; | ||
/** @type {Function} */ | ||
var to_string_symbols_supported_x_esm_castString = ''.constructor; | ||
var split_if_boxed_bug_x_esm_EMPTY_STRING = ''; | ||
var strSplit = split_if_boxed_bug_x_esm_EMPTY_STRING.split; | ||
var isStringFn = has_boxed_string_x_esm === false && typeof strSplit === 'function' && is_string_default.a; | ||
/** | ||
* The abstract operation ToString converts argument to a value of type String, | ||
* however the specification states that if the argument is a Symbol then a | ||
* 'TypeError' is thrown. This version also allows Symbols be converted to | ||
* a string. Other uncoercible exotics will still throw though. | ||
* This method tests if a value is a string with the boxed bug; splits to an | ||
* array for iteration; otherwise returns the original value. | ||
* | ||
* @param {*} [value] - The value to convert to a string. | ||
* @returns {string} The converted value. | ||
* @param {*} [value] - The value to be tested. | ||
* @returns {*} An array or characters if value was a string with the boxed bug; | ||
* otherwise the value. | ||
*/ | ||
var toStringSymbolsSupported = function toStringSymbolsSupported(value) { | ||
return isSymbolFn && isSymbolFn(value) ? pToString.call(value) : to_string_symbols_supported_x_esm_castString(value); | ||
var splitIfBoxedBug = function splitIfBoxedBug(value) { | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, split_if_boxed_bug_x_esm_EMPTY_STRING) : value; | ||
}; | ||
/* harmony default export */ var to_string_symbols_supported_x_esm = (toStringSymbolsSupported); | ||
/* harmony default export */ var split_if_boxed_bug_x_esm = (splitIfBoxedBug); | ||
// CONCATENATED MODULE: ./node_modules/assert-is-function-x/dist/assert-is-function-x.esm.js | ||
// CONCATENATED MODULE: ./node_modules/array-any-x/dist/array-any-x.esm.js | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var performCallback = function performCallback(args) { | ||
var _args = _slicedToArray(args, 6), | ||
noThis = _args[0], | ||
thisArg = _args[1], | ||
callBack = _args[2], | ||
iterable = _args[3], | ||
index = _args[4], | ||
object = _args[5]; | ||
var item = iterable[index]; | ||
return noThis ? callBack(item, index, object) : callBack.call(thisArg, item, index, object); | ||
}; | ||
var array_any_x_esm_getIterableLengthPair = function getIterableLengthPair(object) { | ||
var iterable = split_if_boxed_bug_x_esm(object); | ||
return [iterable, to_length_x_esm(iterable.length)]; | ||
}; // eslint-disable jsdoc/check-param-names | ||
// noinspection JSCommentMatchesSignature | ||
/** | ||
* Tests `callback` to see if it is a function, throws a `TypeError` if it is | ||
* not. Otherwise returns the `callback`. | ||
* This method tests whether some element in the array passes the test | ||
* implemented by the provided function. | ||
* | ||
* @param {*} callback - The argument to be tested. | ||
* @throws {TypeError} Throws if `callback` is not a function. | ||
* @returns {*} Returns `callback` if it is function. | ||
* @function any | ||
* @param {Array} array - The array to iterate over. | ||
* @param {Function} callBack - Function to test for each element. | ||
* @param {*} [thisArg] - Value to use as this when executing callback. | ||
* @throws {TypeError} If array is null or undefined. | ||
* @throws {TypeError} If callBack is not a function. | ||
* @returns {boolean} `true` if the callback function returns a truthy value for | ||
* any array element; otherwise, `false`. | ||
*/ | ||
// eslint-enable jsdoc/check-param-names | ||
var assert_is_function_x_esm_assertIsFunction = function assertIsFunction(callback) { | ||
if (is_function_x_esm(callback) === false) { | ||
var msg = is_primitive_default()(callback) ? to_string_symbols_supported_x_esm(callback) : '#<Object>'; | ||
throw new TypeError("".concat(msg, " is not a function")); | ||
var array_any_x_esm_any = function any(array, callBack | ||
/* , thisArg */ | ||
) { | ||
var object = to_object_x_esm(array); // If no callback function or if callback is not a callable function | ||
assert_is_function_x_esm(callBack); | ||
var _getIterableLengthPai = array_any_x_esm_getIterableLengthPair(object), | ||
_getIterableLengthPai2 = _slicedToArray(_getIterableLengthPai, 2), | ||
iterable = _getIterableLengthPai2[0], | ||
length = _getIterableLengthPai2[1]; | ||
/* eslint-disable-next-line prefer-rest-params,no-void */ | ||
var thisArg = arguments.length > 2 ? arguments[2] : void 0; | ||
var noThis = typeof thisArg === 'undefined'; | ||
if (length) { | ||
for (var index = 0; index < length; index += 1) { | ||
if (performCallback([noThis, thisArg, callBack, iterable, index, object])) { | ||
return true; | ||
} | ||
} | ||
} | ||
return callback; | ||
return false; | ||
}; | ||
/* harmony default export */ var assert_is_function_x_esm = (assert_is_function_x_esm_assertIsFunction); | ||
/* harmony default export */ var array_any_x_esm = (array_any_x_esm_any); | ||
// CONCATENATED MODULE: ./dist/array-some-x.esm.js | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "implementation", function() { return array_some_x_esm_implementation; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "implementation", function() { return implementation; }); | ||
@@ -1664,3 +1744,3 @@ | ||
var spy = ''; | ||
var res = attempt_x_esm.call({}.constructor('abc'), nativeSome, function spyAdd2(item, index) { | ||
var res = attempt_x_esm.call(to_object_x_esm('abc'), nativeSome, function spyAdd2(item, index) { | ||
spy += item; | ||
@@ -1720,3 +1800,3 @@ return index === 1; | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
return true.constructor(this) === false; | ||
return to_boolean_x_esm(this) === false; | ||
}(); | ||
@@ -1726,6 +1806,9 @@ | ||
var spy = null; | ||
var res = attempt_x_esm.call([1], nativeSome, function thisTest() { | ||
var thisTest = function thisTest() { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
spy = typeof this === 'string'; | ||
}, 'x'); | ||
}; | ||
var res = attempt_x_esm.call([1], nativeSome, thisTest, 'x'); | ||
return res.threw === false && res.value === false && spy === true; | ||
@@ -1742,22 +1825,20 @@ } | ||
var res = attempt_x_esm(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, true.constructor); | ||
var res = attempt_x_esm(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, to_boolean_x_esm); | ||
return res.threw === false && res.value === false && spy.value !== true; | ||
}; | ||
var isWorking = true.constructor(nativeSome) && array_some_x_esm_test1() && array_some_x_esm_test2() && array_some_x_esm_test3() && array_some_x_esm_test4() && array_some_x_esm_test5() && array_some_x_esm_test6() && array_some_x_esm_test7(); | ||
var isWorking = to_boolean_x_esm(nativeSome) && array_some_x_esm_test1() && array_some_x_esm_test2() && array_some_x_esm_test3() && array_some_x_esm_test4() && array_some_x_esm_test5() && array_some_x_esm_test6() && array_some_x_esm_test7(); | ||
var array_some_x_esm_patchedSome = function patchedSome() { | ||
return function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
require_object_coercible_x_esm(array); | ||
var args = [assert_is_function_x_esm(callBack)]; | ||
var patchedSome = function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
require_object_coercible_x_esm(array); | ||
var args = [assert_is_function_x_esm(callBack)]; | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
return nativeSome.apply(array, args); | ||
}; | ||
return nativeSome.apply(array, args); | ||
}; // ES5 15.4.4.17 | ||
@@ -1768,23 +1849,18 @@ // http://es5.github.com/#x15.4.4.17 | ||
var array_some_x_esm_implementation = function implementation() { | ||
return function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
var object = to_object_x_esm(array); // If no callback function or if callback is not a callable function | ||
var implementation = function some(array, callBack | ||
/* , thisArg */ | ||
) { | ||
var object = to_object_x_esm(array); // If no callback function or if callback is not a callable function | ||
assert_is_function_x_esm(callBack); | ||
var iterable = split_if_boxed_bug_x_esm(object); | ||
var length = to_length_x_esm(iterable.length); | ||
/* eslint-disable-next-line prefer-rest-params,no-void */ | ||
assert_is_function_x_esm(callBack); | ||
var thisArg = arguments.length > 2 ? arguments[2] : void 0; | ||
var noThis = typeof thisArg === 'undefined'; | ||
var iteratee = function iteratee() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
var i = arguments[1]; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
for (var i = 0; i < length; i += 1) { | ||
if (i in iterable) { | ||
var item = iterable[i]; | ||
if (noThis ? callBack(item, i, object) : callBack.call(thisArg, item, i, object)) { | ||
return true; | ||
} | ||
if (i in arguments[2]) { | ||
/* eslint-disable-next-line prefer-rest-params,babel/no-invalid-this */ | ||
if (callBack.call(this, arguments[0], i, object)) { | ||
return true; | ||
} | ||
@@ -1795,2 +1871,6 @@ } | ||
}; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return array_any_x_esm(object, iteratee, arguments[2]); | ||
}; | ||
@@ -1810,3 +1890,3 @@ /** | ||
var $some = isWorking ? array_some_x_esm_patchedSome() : array_some_x_esm_implementation(); | ||
var $some = isWorking ? patchedSome : implementation; | ||
/* harmony default export */ var array_some_x_esm = __webpack_exports__["default"] = ($some); | ||
@@ -1813,0 +1893,0 @@ |
@@ -5,12 +5,12 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-07-31T22:57:04.678Z", | ||
"date": "2019-08-05T18:52:36.836Z", | ||
"describe": "", | ||
"description": "Tests whether some element passes the provided function.", | ||
"file": "array-some-x.min.js", | ||
"hash": "cd1ac1ed2377e2bb5234", | ||
"hash": "314f1024d39a6978c6a0", | ||
"license": "MIT", | ||
"version": "3.0.13" | ||
"version": "3.0.14" | ||
} | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.arraySomeX=t():e.arraySomeX=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,c=/^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()&&c.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"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.arraySomeX=t():e.arraySomeX=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,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(c?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,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(c?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"),c="a"===o[0]&&0 in o,i=n(2),u="".split,s=!1===c&&"function"==typeof u&&n.n(i).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),v=n.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,P=function(e){if(l()(e))throw new TypeError(x);return T(e)},E=function(e){return P(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,_=0;_<M;_+=1)F[_].es2016&&F[_].string,F[_].es2018&&(N+=F[_].string);var C=N,k=new(0,/none/.constructor)("^[".concat(C,"]+")),D="".replace,$=function(e){return D.call(E(e),k,"")},A=new(0,/none/.constructor)("[".concat(C,"]+$")),B="".replace,I=function(e){return B.call(E(e),A,"")},X=function(e){return $(I(e))},q=new(0,/none/.constructor)("[".concat(C,"]+"),"g"),L=" ".replace,G=function(e){return L.call(X(e),q," ")},H=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,R="".replace,U=function(e,t){return R.call(E(e),H,arguments.length>1?P(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,G(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,m(t)):(!Q||!1!==m(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"],ce=["valueOf","toString"],ie=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:ce,c=0;c<2;c+=1)if(n=e[o[c]],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&&(v()(e)||l()(e))?"string":t;return ie(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,ve=function(e,t){var n=$(P(e));return""===de.call(n,0)?NaN:pe(n,ye(t)||(ge.call(be,n)?16:10))},me=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 ve(he.call(e,2),t)},Pe=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},Ee=function(e,t){var n=Pe(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,me));if("string"==typeof n){var r=Ee(e,n);if(null!==r)return r}return me(n)},Ne=function(e){return e!=e},Me=function(e){return"number"==typeof e&&!1===Ne(e)&&e!==1/0&&e!==-1/0},_e=function(e){var t=Fe(e);return 0===t||Ne(t)?t:t>0?1:-1},Ce=Math.abs,ke=Math.floor,De=function(e){var t=Fe(e);return Ne(t)?0:0===t||!1===Me(t)?t:_e(t)*ke(Ce(t))},$e=function(e){var t=De(e);return t<=0?0:t>9007199254740991?9007199254740991:t},Ae={}.constructor,Be=function(e){return Ae(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)},Ge=function(e){if(!1===Z(e)){var t=b()(e)?Le(e):"#<Object>";throw new TypeError("".concat(t," is not a function"))}return e};n.d(t,"implementation",function(){return Je});var He,Re,Ue=[].some,Ve="function"==typeof Ue&&Ue,ze=(!0).constructor(Ve)&&(He=0,!1===(Re=r.call([1,2],Ve,function(e){return He+=e,!1})).threw&&!1===Re.value&&3===He)&&function(){var e="",t=r.call({}.constructor("abc"),Ve,function(t,n){return e+=t,1===n});return!1===t.threw&&!0===t.value&&"ab"===e}()&&function(){var e=0,t=r.call(function(){return arguments}(1,2,3),Ve,function(t,n){return e+=t,2===n});return!1===t.threw&&!0===t.value&&6===e}()&&function(){var e=0,t=r.call({0:1,1:2,3:3,4:4,length:4},Ve,function(t){return e+=t,!1});return!1===t.threw&&!1===t.value&&6===e}()&&function(){var e="undefined"!=typeof document&&document;if(e){var t=null,n=e.createDocumentFragment(),o=e.createElement("div");n.appendChild(o);var c=r.call(n.childNodes,Ve,function(e){return t=e,e});return!1===c.threw&&!0===c.value&&t===o}return!0}()&&function(){if(function(){return!1===(!0).constructor(this)}()){var e=null,t=r.call([1],Ve,function(){e="string"==typeof this},"x");return!1===t.threw&&!1===t.value&&!0===e}return!0}()&&function(){var e={},t=r(Function("nativeSome","spy","castBoolean",'return nativeSome.call("foo", function (_, __, context) {if (castBoolean(context) === false || typeof context !== "object") {spy.value = true;}});'),Ve,e,(!0).constructor);return!1===t.threw&&!1===t.value&&!0!==e.value}(),Je=function(){return function(e,t){var n=Be(e);Ge(t);for(var r=a(n),o=$e(r.length),c=arguments.length>2?arguments[2]:void 0,i=void 0===c,u=0;u<o;u+=1)if(u in r){var s=r[u];if(i?t(s,u,n):t.call(c,s,u,n))return!0}return!1}},Ke=ze?function(e,t){O(e);var n=[Ge(t)];return arguments.length>2&&(n[1]=arguments[2]),Ve.apply(e,n)}:Je();t.default=Ke}])}); | ||
*/e.exports=function(e){return"object"==typeof e?null===e:"function"!=typeof 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";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";(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=function(e){return null==e},i=function(e){if(o(e))throw new TypeError("Cannot call method on ".concat(e));return e},c={}.constructor,u=function(e){return c(i(e))},s=function(e){return!!e},a={}.toString,f=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":a.call(e)},l=n(0),p=n.n(l);for(var y=r(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&p()(Symbol(""))}.bind(void 0)),d=!1===y.threw&&!0===y.value,b=d&&p()(Symbol.toStringTag),v=n(1),g=n.n(v),m="Cannot convert a Symbol value to a string",h=m.constructor,w=function(e){if(p()(e))throw new TypeError(m);return h(e)},S=function(e){return w(i(e))},j=[{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"}],O="",x=j.length,T=0;T<x;T+=1)j[T].es2016&&j[T].string,j[T].es2018&&(O+=j[T].string);var E=O,P=new(0,/none/.constructor)("^[".concat(E,"]+")),F="".replace,N=function(e){return F.call(S(e),P,"")},M=new(0,/none/.constructor)("[".concat(E,"]+$")),_="".replace,C=function(e){return _.call(S(e),M,"")},k=function(e){return N(C(e))},D=new(0,/none/.constructor)("[".concat(E,"]+"),"g"),$=" ".replace,A=function(e){return $.call(k(e),D," ")},I=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,B="".replace,X=function(e,t){return B.call(S(e),I,arguments.length>1?w(t):"")},q=r.constructor,L=r.toString,G=/^class /,H=G.test,R=!1===r(function(){return q('"use strict"; return class My {};')()}).threw,U=function(e){return H.call(G,A(X(L.call(e)," ")))},V=function(e){var t=r(U,e);return!1===t.threw&&t.value},z=function(e,t){return!g()(e)&&(b?function(e,t){return!(R&&!1===t&&V(e)||!1!==r.call(e,L).threw)}(e,s(t)):(!R||!1!==s(t)||!V(e))&&function(e){var t=f(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t}(e))},J=d&&Symbol.prototype.toString,K="function"==typeof J&&p.a,Q="".constructor,W=function(e){return K&&K(e)?J.call(e):Q(e)},Y=function(e){if(!1===z(e)){var t=g()(e)?W(e):"#<Object>";throw new TypeError("".concat(t," is not a function"))}return e},Z=n(2),ee=n.n(Z),te="string".constructor,ne=(0).constructor,re=d&&Symbol.toPrimitive,oe=d&&Symbol.prototype.valueOf,ie=["toString","valueOf"],ce=["valueOf","toString"],ue=function(e,t){i(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?ie:ce,c=0;c<2;c+=1)if(n=e[o[c]],z(n)&&(r=n.call(e),g()(r)))return r;throw new TypeError("No default value")},se=function(e,t){if(t){if(e===te)return"string";if(e===ne)return"number"}return"default"},ae=function(e){if(d){if(re)return function(e,t){var n=e[t];if(!1===o(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,re);if(p()(e))return oe}},fe=function(e){var t=e.exoticToPrim,n=e.input,r=e.hint,o=t.call(n,r);if(g()(o))return o;throw new TypeError("unable to convert exotic object to primitive")},le=function(e,t){var n="default"===t&&(ee()(e)||p()(e))?"string":t;return ue(e,"default"===n?"number":n)},pe=function(e,t){if(g()(e))return e;var n=se(t,arguments.length>1),r=ae(e);return void 0===r?le(e,n):fe({exoticToPrim:r,input:e,hint:n})},ye=parseInt,de=(0).constructor,be="".charAt,ve=/^[-+]?0[xX]/,ge=ve.test,me=function(e,t){var n=N(w(e));return""===be.call(n,0)?NaN:ye(n,de(t)||(ge.call(ve,n)?16:10))},he=2..constructor,we="Cannot convert a Symbol value to a number".slice,Se=/^0b[01]+$/i,je=Se.test,Oe=/^0o[0-7]+$/i,xe=new(0,Se.constructor)("[ ]","g"),Te=/^[-+]0x[0-9a-f]+$/i,Ee=function(e,t){return me(we.call(e,2),t)},Pe=function(e,t){return function(e){return je.call(Se,e)}(t)?e(Ee(t,2)):function(e){return je.call(Oe,e)}(t)?e(Ee(t,8)):null},Fe=function(e,t){var n=Pe(e,t);if(null!==n)return n;if(function(e){return je.call(xe,e)}(t)||function(e){return je.call(Te,e)}(t))return NaN;var r=k(t);return r!==t?e(r):null},Ne=function e(t){var n=function(e){if(p()(e))throw new TypeError("Cannot convert a Symbol value to a number");return e}(pe(t,he));if("string"==typeof n){var r=Fe(e,n);if(null!==r)return r}return he(n)},Me=function(e){return e!=e},_e=function(e){return"number"==typeof e&&!1===Me(e)&&e!==1/0&&e!==-1/0},Ce=function(e){var t=Ne(e);return 0===t||Me(t)?t:t>0?1:-1},ke=Math.abs,De=Math.floor,$e=function(e){var t=Ne(e);return Me(t)?0:0===t||!1===_e(t)?t:Ce(t)*De(ke(t))},Ae=function(e){var t=$e(e);return t<=0?0:t>9007199254740991?9007199254740991:t},Ie={}.constructor("a"),Be="a"===Ie[0]&&0 in Ie,Xe=n(3),qe="".split,Le=!1===Be&&"function"==typeof qe&&n.n(Xe).a,Ge=function(e){return Le&&Le(e)?qe.call(e,""):e};function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Re=function(e){var t=He(e,6),n=t[0],r=t[1],o=t[2],i=t[3],c=t[4],u=t[5],s=i[c];return n?o(s,c,u):o.call(r,s,c,u)},Ue=function(e){var t=Ge(e);return[t,Ae(t.length)]},Ve=function(e,t){var n=u(e);Y(t);var r=Ue(n),o=He(r,2),i=o[0],c=o[1],s=arguments.length>2?arguments[2]:void 0,a=void 0===s;if(c)for(var f=0;f<c;f+=1)if(Re([a,s,t,i,f,n]))return!0;return!1};n.d(t,"implementation",function(){return Ye});var ze,Je,Ke=[].some,Qe="function"==typeof Ke&&Ke,We=s(Qe)&&(ze=0,!1===(Je=r.call([1,2],Qe,function(e){return ze+=e,!1})).threw&&!1===Je.value&&3===ze)&&function(){var e="",t=r.call(u("abc"),Qe,function(t,n){return e+=t,1===n});return!1===t.threw&&!0===t.value&&"ab"===e}()&&function(){var e=0,t=r.call(function(){return arguments}(1,2,3),Qe,function(t,n){return e+=t,2===n});return!1===t.threw&&!0===t.value&&6===e}()&&function(){var e=0,t=r.call({0:1,1:2,3:3,4:4,length:4},Qe,function(t){return e+=t,!1});return!1===t.threw&&!1===t.value&&6===e}()&&function(){var e="undefined"!=typeof document&&document;if(e){var t=null,n=e.createDocumentFragment(),o=e.createElement("div");n.appendChild(o);var i=r.call(n.childNodes,Qe,function(e){return t=e,e});return!1===i.threw&&!0===i.value&&t===o}return!0}()&&function(){if(function(){return!1===s(this)}()){var e=null,t=r.call([1],Qe,function(){e="string"==typeof this},"x");return!1===t.threw&&!1===t.value&&!0===e}return!0}()&&function(){var e={},t=r(Function("nativeSome","spy","castBoolean",'return nativeSome.call("foo", function (_, __, context) {if (castBoolean(context) === false || typeof context !== "object") {spy.value = true;}});'),Qe,e,s);return!1===t.threw&&!1===t.value&&!0!==e.value}(),Ye=function(e,t){var n=u(e);Y(t);var r=function(){var e=arguments[1];return!!(e in arguments[2]&&t.call(this,arguments[0],e,n))};return Ve(n,r,arguments[2])},Ze=We?function(e,t){i(e);var n=[Y(t)];return arguments.length>2&&(n[1]=arguments[2]),Qe.apply(e,n)}:Ye;t.default=Ze}])}); | ||
//# sourceMappingURL=array-some-x.min.js.map |
{ | ||
"name": "array-some-x", | ||
"version": "3.0.13", | ||
"version": "3.0.14", | ||
"description": "Tests whether some element passes the provided function.", | ||
@@ -53,7 +53,7 @@ "homepage": "https://github.com/Xotic750/array-some-x", | ||
"dependencies": { | ||
"array-any-x": "^1.0.1", | ||
"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-length-x": "^4.0.26", | ||
"to-boolean-x": "^2.0.25", | ||
"to-object-x": "^2.0.21" | ||
@@ -70,3 +70,3 @@ }, | ||
"@types/jest": "^24.0.16", | ||
"@types/node": "^12.6.8", | ||
"@types/node": "^12.6.9", | ||
"@xotic750/eslint-config-recommended": "^1.0.5", | ||
@@ -112,3 +112,3 @@ "babel-core": "^7.0.0-0", | ||
"typescript": "^3.5.3", | ||
"webpack": "^4.38.0", | ||
"webpack": "^4.39.1", | ||
"webpack-bundle-analyzer": "^3.4.1", | ||
@@ -115,0 +115,0 @@ "webpack-cli": "^3.3.6", |
import attempt from 'attempt-x'; | ||
import splitIfBoxedBug from 'split-if-boxed-bug-x'; | ||
import toLength from 'to-length-x'; | ||
import toObject from 'to-object-x'; | ||
import assertIsFunction from 'assert-is-function-x'; | ||
import requireObjectCoercible from 'require-object-coercible-x'; | ||
import any from 'array-any-x'; | ||
import toBoolean from 'to-boolean-x'; | ||
@@ -24,3 +24,3 @@ const ns = [].some; | ||
let spy = ''; | ||
const res = attempt.call({}.constructor('abc'), nativeSome, function spyAdd2(item, index) { | ||
const res = attempt.call(toObject('abc'), nativeSome, function spyAdd2(item, index) { | ||
spy += item; | ||
@@ -54,17 +54,7 @@ | ||
let spy = 0; | ||
const res = attempt.call( | ||
{ | ||
0: 1, | ||
1: 2, | ||
3: 3, | ||
4: 4, | ||
length: 4, | ||
}, | ||
nativeSome, | ||
function spyAdd4(item) { | ||
spy += item; | ||
const res = attempt.call({0: 1, 1: 2, 3: 3, 4: 4, length: 4}, nativeSome, function spyAdd4(item) { | ||
spy += item; | ||
return false; | ||
}, | ||
); | ||
return false; | ||
}); | ||
@@ -97,3 +87,3 @@ return res.threw === false && res.value === false && spy === 6; | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
return true.constructor(this) === false; | ||
return toBoolean(this) === false; | ||
})(); | ||
@@ -103,12 +93,10 @@ | ||
let spy = null; | ||
const res = attempt.call( | ||
[1], | ||
nativeSome, | ||
function thisTest() { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
spy = typeof this === 'string'; | ||
}, | ||
'x', | ||
); | ||
const thisTest = function thisTest() { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
spy = typeof this === 'string'; | ||
}; | ||
const res = attempt.call([1], nativeSome, thisTest, 'x'); | ||
return res.threw === false && res.value === false && spy === true; | ||
@@ -128,3 +116,3 @@ } | ||
/* eslint-disable-next-line no-new-func */ | ||
const res = attempt(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, true.constructor); | ||
const res = attempt(Function('nativeSome', 'spy', 'castBoolean', fn), nativeSome, spy, toBoolean); | ||
@@ -134,16 +122,14 @@ return res.threw === false && res.value === false && spy.value !== true; | ||
const isWorking = true.constructor(nativeSome) && test1() && test2() && test3() && test4() && test5() && test6() && test7(); | ||
const isWorking = toBoolean(nativeSome) && test1() && test2() && test3() && test4() && test5() && test6() && test7(); | ||
const patchedSome = function patchedSome() { | ||
return function some(array, callBack /* , thisArg */) { | ||
requireObjectCoercible(array); | ||
const args = [assertIsFunction(callBack)]; | ||
const patchedSome = function some(array, callBack /* , thisArg */) { | ||
requireObjectCoercible(array); | ||
const args = [assertIsFunction(callBack)]; | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
if (arguments.length > 2) { | ||
/* eslint-disable-next-line prefer-rest-params,prefer-destructuring */ | ||
args[1] = arguments[2]; | ||
} | ||
return nativeSome.apply(array, args); | ||
}; | ||
return nativeSome.apply(array, args); | ||
}; | ||
@@ -154,19 +140,16 @@ | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some | ||
export const implementation = function implementation() { | ||
return function some(array, callBack /* , thisArg */) { | ||
const object = toObject(array); | ||
// If no callback function or if callback is not a callable function | ||
assertIsFunction(callBack); | ||
const iterable = splitIfBoxedBug(object); | ||
const length = toLength(iterable.length); | ||
/* eslint-disable-next-line prefer-rest-params,no-void */ | ||
const thisArg = arguments.length > 2 ? arguments[2] : void 0; | ||
const noThis = typeof thisArg === 'undefined'; | ||
for (let i = 0; i < length; i += 1) { | ||
if (i in iterable) { | ||
const item = iterable[i]; | ||
export const implementation = function some(array, callBack /* , thisArg */) { | ||
const object = toObject(array); | ||
// If no callback function or if callback is not a callable function | ||
assertIsFunction(callBack); | ||
if (noThis ? callBack(item, i, object) : callBack.call(thisArg, item, i, object)) { | ||
return true; | ||
} | ||
const iteratee = function iteratee() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
const i = arguments[1]; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
if (i in arguments[2]) { | ||
/* eslint-disable-next-line prefer-rest-params,babel/no-invalid-this */ | ||
if (callBack.call(this, arguments[0], i, object)) { | ||
return true; | ||
} | ||
@@ -177,2 +160,5 @@ } | ||
}; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return any(object, iteratee, arguments[2]); | ||
}; | ||
@@ -192,4 +178,4 @@ | ||
*/ | ||
const $some = isWorking ? patchedSome() : implementation(); | ||
const $some = isWorking ? patchedSome : implementation; | ||
export default $some; |
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
239736
1839
+ Addedarray-any-x@^1.0.1
+ Addedto-boolean-x@^2.0.25
+ Addedarray-any-x@1.1.2(transitive)
- Removedsplit-if-boxed-bug-x@^2.0.23
- Removedto-length-x@^4.0.26