Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-symbol-description

inspect-js151.2mMIT1.1.0TypeScript support: included

Gets the description of a Symbol. Handles Symbol() vs Symbol('') properly when possible.

symbol, ecmascript, javascript, description

readme

get-symbol-description Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.0 - 2024-12-17

Commits

v1.0.2 - 2024-02-07

Fixed

  • [Deps] add missing get-intrinsic #3

v1.0.1 - 2024-02-05

Commits

  • [actions] reuse common workflows 168adf2
  • [meta] use npmignore to autogenerate an npmignore file fa3b323
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, es-value-fixtures, foreach, object-inspect, tape 9301b9e
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, object-inspect, tape a92a011
  • [actions] update rebase action to use reusable workflow 66cea29
  • [actions] update codecov uploader 84079e1
  • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, safe-publish-latest, tape 9f298a5
  • [Dev Deps] use hasown instead of has e993bd6
  • [Dev Deps] update aud, npmignore, tape 5044bed
  • [Dev Deps] update @ljharb/eslint-config, aud, tape 3923eab
  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic a24f5c5
  • [Deps] update call-bind, get-intrinsic accd484
  • [Dev Deps] update object-inspect, tape 6c66623
  • [Dev Deps] update object-inspect, tape 586dfe3
  • [Dev Deps] update @ljharb/eslint-config, aud bc8c7e0
  • [Tests] use for-each instead of foreach ca97918
  • [Robustness] cache String slice 5ce0c56
  • [Deps] update get-intrinsic b656c5c
  • [Deps] update get-intrinsic 74cf3b6
  • [meta] fix FUNDING.yml 6cf76c8

v1.0.0 - 2021-08-17

Commits

  • Initial commit: pulled from es-abstract 6e34a05
  • Initial commit 3862092
  • [meta] do not publish github action workflow files 9d1e2b9
  • npm init 5051b32
  • Only apps should have lockfiles b866d1c