DieselDepot-APP/node_modules/es-toolkit/dist/predicate/isNull.mjs
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

26 lines
723 B
JavaScript

//#region src/predicate/isNull.ts
/**
* Checks if the given value is null.
*
* This function tests whether the provided value is strictly equal to `null`.
* It returns `true` if the value is `null`, and `false` otherwise.
*
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.
*
* @param x - The value to test if it is null.
* @returns True if the value is null, false otherwise.
*
* @example
* const value1 = null;
* const value2 = undefined;
* const value3 = 42;
*
* console.log(isNull(value1)); // true
* console.log(isNull(value2)); // false
* console.log(isNull(value3)); // false
*/
function isNull(x) {
return x === null;
}
//#endregion
export { isNull };