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.

49 lines
1.6 KiB

4 years ago
  1. #is-arguments <sup>[![Version Badge][2]][1]</sup>
  2. [![Build Status][3]][4]
  3. [![dependency status][5]][6]
  4. [![dev dependency status][7]][8]
  5. [![License][license-image]][license-url]
  6. [![Downloads][downloads-image]][downloads-url]
  7. [![npm badge][11]][1]
  8. [![browser support][9]][10]
  9. Is this an arguments object? It's a harder question than you think.
  10. ## Example
  11. ```js
  12. var isArguments = require('is-arguments');
  13. var assert = require('assert');
  14. assert.equal(isArguments({}), false);
  15. assert.equal(isArguments([]), false);
  16. (function () {
  17. assert.equal(isArguments(arguments), true);
  18. }())
  19. ```
  20. ## Caveats
  21. If you have modified an actual `arguments` object by giving it a `Symbol.toStringTag` property, then this package will return `false`.
  22. ## Tests
  23. Simply clone the repo, `npm install`, and run `npm test`
  24. [1]: https://npmjs.org/package/is-arguments
  25. [2]: http://versionbadg.es/ljharb/is-arguments.svg
  26. [3]: https://travis-ci.org/ljharb/is-arguments.svg
  27. [4]: https://travis-ci.org/ljharb/is-arguments
  28. [5]: https://david-dm.org/ljharb/is-arguments.svg
  29. [6]: https://david-dm.org/ljharb/is-arguments
  30. [7]: https://david-dm.org/ljharb/is-arguments/dev-status.svg
  31. [8]: https://david-dm.org/ljharb/is-arguments#info=devDependencies
  32. [9]: https://ci.testling.com/ljharb/is-arguments.png
  33. [10]: https://ci.testling.com/ljharb/is-arguments
  34. [11]: https://nodei.co/npm/is-arguments.png?downloads=true&stars=true
  35. [license-image]: http://img.shields.io/npm/l/is-arguments.svg
  36. [license-url]: LICENSE
  37. [downloads-image]: http://img.shields.io/npm/dm/is-arguments.svg
  38. [downloads-url]: http://npm-stat.com/charts.html?package=is-arguments