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