@monstermann/fn
Version:
A utility library for TypeScript.
20 lines (18 loc) • 441 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/option/isSome.ts
/**
* `isSome(value)`
*
* Checks if a value is not `null` or `undefined`. Returns `true` if the value is neither `null` nor `undefined`, otherwise returns `false`.
*
* ```ts
* isSome(0); // true
* isSome(""); // true
* isSome(false); // true
* isSome(null); // false
*/
const isSome = dfdlT((value) => {
return value != null;
}, 1);
//#endregion
export { isSome };