is-symbol
Determine if a value is an ES6 Symbol or not.
Last updated 6 months 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

Build Status dependency status dev dependency status License Downloads

npm badge

[![browser support][9]][10]

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.0.3                                ...           latest (6 months ago)

4 Versions

  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2017 © taobao.org |