[go: nahoru, domu]

tree: 81f9d2b2bc361d66ce57b0d4d606ca2e87a51531 [path history] [tgz]
  1. .github/
  2. test/
  3. .editorconfig
  4. .eslintignore
  5. .eslintrc
  6. .nycrc
  7. CHANGELOG.md
  8. index.js
  9. LICENSE
  10. package.json
  11. README.md
node_modules/is-symbol/README.md

is-symbol Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this an ES6 Symbol value?

Example

var isSymbol = require('is-symbol');
assert(!isSymbol(function () {}));
assert(!isSymbol(null));
assert(!isSymbol(function* () { yield 42; return Infinity; });

assert(isSymbol(Symbol.iterator));
assert(isSymbol(Symbol('foo')));
assert(isSymbol(Symbol.for('foo')));
assert(isSymbol(Object(Symbol('foo'))));

Tests

Simply clone the repo, npm install, and run npm test