@monstermann/fn
Version:
A utility library for TypeScript.
21 lines (19 loc) • 501 B
TypeScript
import { NonNil } from "../internals/types.js";
//#region src/option/isSome.d.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
*/
declare const isSome: {
<T>(): (value: T) => value is NonNil<T>;
<T>(value: T): value is NonNil<T>;
};
//#endregion
export { isSome };