mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Add baseIsArguments.
This commit is contained in:
19
lodash.js
19
lodash.js
@@ -1473,6 +1473,7 @@
|
|||||||
getPrototype = overArg(Object.getPrototypeOf, Object),
|
getPrototype = overArg(Object.getPrototypeOf, Object),
|
||||||
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
||||||
objectCreate = Object.create,
|
objectCreate = Object.create,
|
||||||
|
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||||
splice = arrayProto.splice,
|
splice = arrayProto.splice,
|
||||||
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
||||||
|
|
||||||
@@ -3203,6 +3204,17 @@
|
|||||||
return func == null ? undefined : apply(func, object, args);
|
return func == null ? undefined : apply(func, object, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.isArguments`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
||||||
|
*/
|
||||||
|
function baseIsArguments(value) {
|
||||||
|
return isObjectLike(value) && objectToString.call(value) == argsTag;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
|
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
|
||||||
*
|
*
|
||||||
@@ -11186,9 +11198,10 @@
|
|||||||
* _.isArguments([1, 2, 3]);
|
* _.isArguments([1, 2, 3]);
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
var isArguments = baseIsArguments(arguments) ? baseIsArguments : function(value) {
|
||||||
return isObjectLike(value) && objectToString.call(value) == argsTag;
|
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
||||||
}
|
!propertyIsEnumerable.call(value, 'callee');
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is classified as an `Array` object.
|
* Checks if `value` is classified as an `Array` object.
|
||||||
|
|||||||
Reference in New Issue
Block a user