Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

symbol.prototype.description

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symbol.prototype.description

Spec-compliant shim for Symbol.prototype.description proposal.

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
increased by0.09%
Maintainers
1
Weekly downloads
 
Created
Source

Symbol.prototype.description Version Badge

dependency status dev dependency status License Downloads

npm badge

An ECMAScript spec-compliant Symbol.prototype.description shim. Invoke its "shim" method to shim Symbol.prototype.description if it is unavailable. Note: Symbol#description requires a true ES6 environment, specifically one with native Symbols.

This package implements the es-shim API interface. It works in an ES6-supported environment and complies with the spec.

Most common usage:

var description = require('symbol.prototype.description');

assert(description(Symbol('foo')) === 'foo');
assert(description(Symbol()) === undefined);
assert(description(Symbol(undefined)) === undefined);
assert(description(Symbol(null)) === 'null');

// note: this should be the empty string, but in many engines,
// it is impossible to distinguish Symbol() and Symbol('')
// without globally replacing `Symbol`
assert(description(Symbol('')) === undefined);

if (!Symbol.prototype.description) {
	description.shim();
}

assert(description(Symbol('foo')) === Symbol('foo').description);
assert(description(Symbol()) === Symbol().description);
assert(description(Symbol(undefined)) === Symbol(undefined).description);
assert(description(Symbol(null)) === Symbol(null).description);

assert(Symbol('').description === ''); // this works fine!

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Package last updated on 17 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc