Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | var baseIsArguments = require('./_baseIsArguments'),
|
---|
2 | isObjectLike = require('./isObjectLike');
|
---|
3 |
|
---|
4 | /** Used for built-in method references. */
|
---|
5 | var objectProto = Object.prototype;
|
---|
6 |
|
---|
7 | /** Used to check objects for own properties. */
|
---|
8 | var hasOwnProperty = objectProto.hasOwnProperty;
|
---|
9 |
|
---|
10 | /** Built-in value references. */
|
---|
11 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Checks if `value` is likely an `arguments` object.
|
---|
15 | *
|
---|
16 | * @static
|
---|
17 | * @memberOf _
|
---|
18 | * @since 0.1.0
|
---|
19 | * @category Lang
|
---|
20 | * @param {*} value The value to check.
|
---|
21 | * @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
---|
22 | * else `false`.
|
---|
23 | * @example
|
---|
24 | *
|
---|
25 | * _.isArguments(function() { return arguments; }());
|
---|
26 | * // => true
|
---|
27 | *
|
---|
28 | * _.isArguments([1, 2, 3]);
|
---|
29 | * // => false
|
---|
30 | */
|
---|
31 | var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
---|
32 | return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
---|
33 | !propertyIsEnumerable.call(value, 'callee');
|
---|
34 | };
|
---|
35 |
|
---|
36 | module.exports = isArguments;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.