|
|
hace 2 años | |
|---|---|---|
| .. | ||
| .github | hace 2 años | |
| test | hace 2 años | |
| .eslintignore | hace 2 años | |
| .eslintrc | hace 2 años | |
| .nycrc | hace 2 años | |
| CHANGELOG.md | hace 2 años | |
| LICENSE | hace 2 años | |
| README.md | hace 2 años | |
| getInferredName.js | hace 2 años | |
| index.js | hace 2 años | |
| package.json | hace 2 años | |
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