UNPKG

remeda

Version:

A utility library for JavaScript and Typescript.

1 lines 756 B
{"version":3,"file":"isBigInt.cjs","names":[],"sources":["../src/isBigInt.ts"],"sourcesContent":["import type { NarrowedTo } from \"./internal/types/NarrowedTo\";\n\n/**\n * A function that checks if the passed parameter is a bigint and narrows its\n * type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a number, false otherwise.\n * @signature\n * R.isBigInt(data)\n * @example\n * R.isBigInt(1n); // => true\n * R.isBigInt(1); // => false\n * R.isBigInt('notANumber'); // => false\n * @category Guard\n */\nexport function isBigInt<T>(data: T | bigint): data is NarrowedTo<T, bigint> {\n return typeof data === \"bigint\";\n}\n"],"mappings":"AAgBA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS"}