XuelesszzZ 94af2b8e7b 6-30-5 | 1 سال پیش | |
---|---|---|
.. | ||
.github | 1 سال پیش | |
test | 1 سال پیش | |
.eslintignore | 1 سال پیش | |
.eslintrc | 1 سال پیش | |
.nycrc | 1 سال پیش | |
CHANGELOG.md | 1 سال پیش | |
LICENSE | 1 سال پیش | |
README.md | 1 سال پیش | |
getInferredName.js | 1 سال پیش | |
index.js | 1 سال پیش | |
package.json | 1 سال پیش |
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