get-symbol-description (1.1.0)
Published 2026-02-24 13:57:13 +00:00 by atheaadmin
Installation
registry=npm install get-symbol-description@1.1.0"get-symbol-description": "1.1.0"About this package
get-symbol-description 
Gets the description of a Symbol. Handles Symbol() vs Symbol('') properly when possible.
Example
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');
Tests
Simply clone the repo, npm install, and run npm test
Dependencies
Dependencies
| ID | Version |
|---|---|
| call-bound | ^1.0.3 |
| es-errors | ^1.3.0 |
| get-intrinsic | ^1.2.6 |
Development Dependencies
| ID | Version |
|---|---|
| @arethetypeswrong/cli | ^0.17.1 |
| @ljharb/eslint-config | ^21.1.1 |
| @ljharb/tsconfig | ^0.2.2 |
| @types/for-each | ^0.3.3 |
| @types/get-intrinsic | ^1.2.3 |
| @types/object-inspect | ^1.13.0 |
| @types/tape | ^5.7.0 |
| auto-changelog | ^2.5.0 |
| encoding | ^0.1.13 |
| es-value-fixtures | ^1.5.0 |
| eslint | =8.8.0 |
| evalmd | ^0.0.19 |
| for-each | ^0.3.3 |
| hasown | ^2.0.2 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.1 |
| nyc | ^10.3.2 |
| object-inspect | ^1.13.3 |
| safe-publish-latest | ^2.0.0 |
| tape | ^5.9.0 |
| typescript | ^5.8.0-dev.20241216 |
Keywords
symbol
ecmascript
javascript
description
