1 export function isDefined<T = undefined | unknown>(
2 val: T
3 ): val is T extends undefined ? never : T {
4 return typeof val !== "undefined"
5 }