feat!: remove vue 2

This commit is contained in:
Yue JIN
2025-05-11 16:00:37 +08:00
committed by Yue JIN
parent b7852ab643
commit ca6d44f8db
14 changed files with 350 additions and 368 deletions

View File

@ -1,7 +1,3 @@
import { unref, isRef } from "vue-demi";
import type { Injection } from "./types";
type Attrs = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
@ -22,16 +18,3 @@ export function omitOn(attrs: Attrs): Attrs {
return result;
}
export function unwrapInjected<T, V>(
injection: Injection<T>,
defaultValue: V
): T | V {
const value = isRef(injection) ? unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}