--- category: Utilities --- # isDefined Non-nullish checking type guard for Ref. ## Usage ```ts import { isDefined } from '@vueuse/core' const example = ref(Math.random() ? 'example' : undefined) // Ref if (isDefined(example)) example // Ref ``` ## Type Declarations ```ts export type IsDefinedReturn = boolean export declare function isDefined( v: ComputedRef, ): v is ComputedRef> export declare function isDefined( v: Ref, ): v is Ref> export declare function isDefined(v: T): v is Exclude ```