Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspect-js/get-symbol-description
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
https://github.com/inspect-js/get-symbol-description
description ecmascript javascript symbol
Last synced: 3 months ago
JSON representation
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
- Host: GitHub
- URL: https://github.com/inspect-js/get-symbol-description
- Owner: inspect-js
- License: mit
- Created: 2021-08-17T21:58:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T05:47:02.000Z (9 months ago)
- Last Synced: 2024-08-18T19:13:01.371Z (5 months ago)
- Topics: description, ecmascript, javascript, symbol
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# get-symbol-description [![Version Badge][2]][1]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][11]][1]
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
## Example
```js
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`[1]: https://npmjs.org/package/get-symbol-description
[2]: https://versionbadg.es/inspect-js/get-symbol-description.svg
[5]: https://david-dm.org/inspect-js/get-symbol-description.svg
[6]: https://david-dm.org/inspect-js/get-symbol-description
[7]: https://david-dm.org/inspect-js/get-symbol-description/dev-status.svg
[8]: https://david-dm.org/inspect-js/get-symbol-description#info=devDependencies
[11]: https://nodei.co/npm/get-symbol-description.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/get-symbol-description.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/get-symbol-description.svg
[downloads-url]: https://npm-stat.com/charts.html?package=get-symbol-description
[codecov-image]: https://codecov.io/gh/inspect-js/get-symbol-description/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/get-symbol-description/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/get-symbol-description
[actions-url]: https://github.com/inspect-js/get-symbol-description/actions