export async function resolveValue(...fns: (() => Promise)[]): Promise { for (const fn of fns) { const result = await fn(); if (typeof result !== 'undefined') { return result; } } } export function resolveValueSync(...fns: (() => T | undefined)[]): T | undefined { for (const fn of fns) { const result = fn(); if (typeof result !== 'undefined') { return result; } } }