root 3bf41bf355 update | vor 1 Jahr | |
---|---|---|
.. | ||
.github | vor 1 Jahr | |
test | vor 1 Jahr | |
.eslintignore | vor 1 Jahr | |
.eslintrc | vor 1 Jahr | |
.nycrc | vor 1 Jahr | |
CHANGELOG.md | vor 1 Jahr | |
LICENSE | vor 1 Jahr | |
README.md | vor 1 Jahr | |
getInferredName.js | vor 1 Jahr | |
index.js | vor 1 Jahr | |
package.json | vor 1 Jahr |
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