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.

45 lines
1.8 KiB

4 years ago
  1. # has-symbols <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. Determine if the JS environment has Symbol support. Supports spec, or shams.
  9. ## Example
  10. ```js
  11. var hasSymbols = require('has-symbols');
  12. hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable.
  13. var hasSymbolsKinda = require('has-symbols/shams');
  14. hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec.
  15. ```
  16. ## Supported Symbol shams
  17. - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
  18. - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
  19. ## Tests
  20. Simply clone the repo, `npm install`, and run `npm test`
  21. [1]: https://npmjs.org/package/has-symbols
  22. [2]: http://versionbadg.es/ljharb/has-symbols.svg
  23. [3]: https://travis-ci.org/ljharb/has-symbols.svg
  24. [4]: https://travis-ci.org/ljharb/has-symbols
  25. [5]: https://david-dm.org/ljharb/has-symbols.svg
  26. [6]: https://david-dm.org/ljharb/has-symbols
  27. [7]: https://david-dm.org/ljharb/has-symbols/dev-status.svg
  28. [8]: https://david-dm.org/ljharb/has-symbols#info=devDependencies
  29. [9]: https://ci.testling.com/ljharb/has-symbols.png
  30. [10]: https://ci.testling.com/ljharb/has-symbols
  31. [11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true
  32. [license-image]: http://img.shields.io/npm/l/has-symbols.svg
  33. [license-url]: LICENSE
  34. [downloads-image]: http://img.shields.io/npm/dm/has-symbols.svg
  35. [downloads-url]: http://npm-stat.com/charts.html?package=has-symbols