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.

18 lines
452 B

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