You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

is-symbol

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-symbol

Determine if a value is an ES6 Symbol or not.


Version published
Weekly downloads
31M
decreased by-0.64%
Maintainers
1
Install size
41.2 kB
Created
Weekly downloads
 

Package description

What is is-symbol?

The `is-symbol` npm package is designed to provide a simple and efficient way to check if a given value is a Symbol. This can be particularly useful when working with ES6 Symbols, ensuring that operations or functions that require a symbol as an argument are provided with the correct type of value.

What are is-symbol's main functionalities?

Check if a value is a Symbol

This feature allows you to verify whether a given value is a Symbol. It's useful in scenarios where the type of a variable needs to be asserted before performing operations that are specific to Symbols.

const isSymbol = require('is-symbol');

console.log(isSymbol(Symbol('foo'))); // true
console.log(isSymbol('bar')); // false

Other packages similar to is-symbol

Changelog

Source

v1.0.4 - 2021-05-08

Commits

  • [Tests] migrate tests to Github Actions 997d43c
  • [actions] use node/install instead of node/run; use codecov action fe0ccb7
  • [meta] remove unused Makefile and associated utilities 3ab2748
  • [meta] do not publish github action workflow files f20fafe
  • [Tests] run nyc on all tests 5c332fc
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, object-inspect, tape c5a58a8
  • [readme] fix repo URLs; remove travis badge bcd9258
  • [actions] add "Allow Edits" workflow 33ae2d3
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, object-inspect, tape e53def0
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, object-inspect ae36504
  • [readme] add actions and codecov badges aae7f09
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape d993fae
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 51808a5
  • [Dev Deps] update auto-changelog, tape c90040f
  • [Dev Deps] update eslint, tape 9fee159
  • [meta] use prepublishOnly script for npm 7+ b166afc
  • [meta] gitignore coverage output 4a0fe3a
  • [actions] update workflows fbcbc9e
  • [Dev Deps] update auto-changelog; add aud e66ab98
  • [Deps] update has-symbols 6ce7de5
  • [actions] update rebase action to use checkout v2 1173c79
  • [actions] switch Automatic Rebase workflow to pull_request_target event 94a6348
  • [Tests] only audit prod deps 0692681
  • [meta] do not publish .nvmrc file ed47833

Readme

Source

is-symbol Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this an ES6 Symbol value?

Example

var isSymbol = require('is-symbol');
assert(!isSymbol(function () {}));
assert(!isSymbol(null));
assert(!isSymbol(function* () { yield 42; return Infinity; });

assert(isSymbol(Symbol.iterator));
assert(isSymbol(Symbol('foo')));
assert(isSymbol(Symbol.for('foo')));
assert(isSymbol(Object(Symbol('foo'))));

Tests

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

Keywords

FAQs

Package last updated on 08 May 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc