get-symbol-description
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
Last updated 8 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install get-symbol-description 
SYNC missed versions from official npm registry.

get-symbol-description Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Gets the description of a Symbol. Handles Symbol() vs Symbol('') properly when possible.

Example

var getSymbolDescription = require('get-symbol-description');
var assert = require('assert');

assert(getSymbolDescription(Symbol()) === undefined);
assert(getSymbolDescription(Symbol('')) === ''); // or `undefined`, if in an engine that lacks name inference from concise method
assert(getSymbolDescription(Symbol('foo')) === 'foo');
assert(getSymbolDescription(Symbol.iterator) === 'Symbol.iterator');

Tests

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

Current Tags

  • 1.0.2                                ...           latest (8 months ago)

3 Versions

  • 1.0.2                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (14)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |