Don't convert functions with parameters

This commit is contained in:
thepaperpilot 2024-12-25 11:13:29 -06:00
parent 5bdb5ceed1
commit 0a5f63ff04

View file

@ -5,7 +5,7 @@ import { computed } from "vue";
export type MaybeGetter<T> = T | (() => T);
export function processGetter<T>(obj: T): T extends () => infer S ? ComputedRef<S> : T {
if (isFunction(obj)) {
if (isFunction(obj) && obj.length === 0) {
return computed(obj) as ReturnType<typeof processGetter<T>>;
}
return obj as ReturnType<typeof processGetter<T>>;