remeda
Version:
A utility library for JavaScript and Typescript.
1 lines • 691 B
Source Map (JSON)
{"version":3,"file":"isNonNull.cjs","names":[],"sources":["../src/isNonNull.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is not `null` and narrows its type accordingly.\n * Notice that `undefined` is not null!\n *\n * @param data - The variable to check.\n * @returns True if the passed input is defined, false otherwise.\n * @signature\n * R.isNonNull(data)\n * @example\n * R.isNonNull('string') //=> true\n * R.isNonNull(null) //=> false\n * R.isNonNull(undefined) //=> true\n * @category Guard\n */\nexport function isNonNull<T>(data: T | null): data is T {\n return data !== null;\n}\n"],"mappings":"AAcA,SAAgB,EAAa,EAA2B,CACtD,OAAO,IAAS"}