is-symbol
Determine if a value is an ES6 Symbol or not.
Last updated 5 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-symbol 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.1                                ...           latest (12 days ago)

7 Versions

  • 1.1.1                                ...           12 days ago
  • 1.1.0                                ...           23 days ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)

© 2010 - cnpmjs.org x YWFE | Home | YWFE