![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | test/ | 6 days ago | - | |
![]() | CHANGELOG.md | 6 days ago | 1.0K | |
![]() | LICENSE | 6 days ago | 1.0K | |
![]() | README.md | 6 days ago | 2.0K | |
![]() | getInferredName.js | 6 days ago | 287 | |
![]() | index.js | 6 days ago | 1.2K | |
![]() | package.json | 6 days ago | 1.9K |
Gets the description of a Symbol. Handles Symbol()
vs Symbol('')
properly when possible.
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');
Simply clone the repo, npm install
, and run npm test