remeda
Version:
A utility library for JavaScript and Typescript.
1 lines • 713 B
Source Map (JSON)
{"version":3,"file":"isSymbol.cjs","names":[],"sources":["../src/isSymbol.ts"],"sourcesContent":["import type { NarrowedTo } from \"./internal/types/NarrowedTo\";\n\n/**\n * A function that checks if the passed parameter is a symbol and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a symbol, false otherwise.\n * @signature\n * R.isSymbol(data)\n * @example\n * R.isSymbol(Symbol('foo')) //=> true\n * R.isSymbol(1) //=> false\n * @category Guard\n */\nexport function isSymbol<T>(data: T | symbol): data is NarrowedTo<T, symbol> {\n return typeof data === \"symbol\";\n}\n"],"mappings":"AAcA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS"}