types: improve isDef typing (#7124)
* types: improve isDef typing * chore: update
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ export const isServer: boolean = Vue.prototype.$isServer;
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
export function noop() {}
|
||||
|
||||
export function isDef(val: unknown): boolean {
|
||||
export function isDef<T>(val: T): val is NonNullable<T> {
|
||||
return val !== undefined && val !== null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user