UNPKG

@types/is-symbol

Version:
39 lines (32 loc) 1.13 kB
# Installation > `npm install --save @types/is-symbol` # Summary This package contains type definitions for is-symbol (https://github.com/inspect-js/is-symbol#readme). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-symbol. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-symbol/index.d.ts) ````ts export = isSymbol; /** * Is this an ES6 Symbol value? * * @example * import assert = require('node:assert'); * import 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')))); */ declare function isSymbol(value: any): value is symbol; ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 03:09:37 GMT * Dependencies: none # Credits These definitions were written by [BendingBender](https://github.com/BendingBender).