|
|
há 2 anos atrás | |
|---|---|---|
| .. | ||
| .github | há 2 anos atrás | |
| test | há 2 anos atrás | |
| .eslintignore | há 2 anos atrás | |
| .eslintrc | há 2 anos atrás | |
| .nycrc | há 2 anos atrás | |
| CHANGELOG.md | há 2 anos atrás | |
| LICENSE | há 2 anos atrás | |
| README.md | há 2 anos atrás | |
| getInferredName.js | há 2 anos atrás | |
| index.js | há 2 anos atrás | |
| package.json | há 2 anos atrás | |
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