JSPM

@silen/is-symbol

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q35637F
  • License MIT

Check if the parameter is symbol

Package Exports

  • @silen/is-symbol

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@silen/is-symbol) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-symbol

Determine if a value is Symbol

install

npm i @silen/is-symbol

api

  • declare function isSymbol(val: any): boolean;

usage

const { isSymbol } = require('@silen/is-symbol');
// or
import { isSymbol } from '@silen/is-symbol';

console.log(isSymbol(new Buffer(4)));
console.log(isSymbol(Buffer.alloc(4)));
console.log(isSymbol(undefined));
console.log(isSymbol(null));
console.log(isSymbol(''));
console.log(isSymbol(true));
console.log(isSymbol(0));
console.log(isSymbol(1));
console.log(isSymbol(1.0));
console.log(isSymbol('string'));
console.log(isSymbol({}));
console.log(isSymbol(function foo() {}));
console.log(isSymbol(Symbol()));
console.log(isSymbol(new Set));
console.log(isSymbol(new Map));
console.log(isSymbol(new WeakMap));
console.log(isSymbol(new WeakSet));

// or
console.log(window.Type.isSymbol(new WeakSet));

This is a demo for testing the usage of isSymbol from @silen/is-symbol module. You can try the others and do likewise.

others