wallet-core/node_modules/object-keys/isArguments.js

18 lines
422 B
JavaScript
Raw Normal View History

2018-09-20 02:56:13 +02:00
'use strict';
var toStr = Object.prototype.toString;
2016-10-10 03:43:44 +02:00
module.exports = function isArguments(value) {
2018-09-20 02:56:13 +02:00
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr.call(value.callee) === '[object Function]';
2016-10-10 03:43:44 +02:00
}
2018-09-20 02:56:13 +02:00
return isArgs;
2016-10-10 03:43:44 +02:00
};