Files
tasq/node_modules/@ai-sdk/provider-utils/src/is-non-nullable.ts
T
2026-04-09 19:01:53 +08:00

13 lines
376 B
TypeScript

/**
* Type guard that checks whether a value is not `null` or `undefined`.
*
* @template T - The type of the value to check.
* @param value - The value to check.
* @returns `true` if the value is neither `null` nor `undefined`, otherwise `false`.
*/
export function isNonNullable<T>(
value: T | undefined | null,
): value is NonNullable<T> {
return value != null;
}