is-symbol
Determine if a value is an ES6 Symbol or not.
Last updated a year ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (a year ago)

7 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 82
This Month 116
Last Day 15
Last Week 51
Last Month 288
Dependencies (3)
Dev Dependencies (19)

Copyright 2013 - present © cnpmjs.org | Home |