aboutsummaryrefslogtreecommitdiff
path: root/node_modules/object-keys/isArguments.js
blob: 74a098978b08b0abbbf085e2dcd9f82d592ec3d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var toString = Object.prototype.toString;

module.exports = function isArguments(value) {
	var str = toString.call(value);
	var isArguments = str === '[object Arguments]';
	if (!isArguments) {
		isArguments = str !== '[object Array]'
			&& value !== null
			&& typeof value === 'object'
			&& typeof value.length === 'number'
			&& value.length >= 0
			&& toString.call(value.callee) === '[object Function]';
	}
	return isArguments;
};