You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
422 B

4 years ago
  1. 'use strict';
  2. var toStr = Object.prototype.toString;
  3. module.exports = function isArguments(value) {
  4. var str = toStr.call(value);
  5. var isArgs = str === '[object Arguments]';
  6. if (!isArgs) {
  7. isArgs = str !== '[object Array]' &&
  8. value !== null &&
  9. typeof value === 'object' &&
  10. typeof value.length === 'number' &&
  11. value.length >= 0 &&
  12. toStr.call(value.callee) === '[object Function]';
  13. }
  14. return isArgs;
  15. };