Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

442 B
Raw Blame
export type UrlResolver = string | (() => string | Promise<string>);

function isThunk(
  url: UrlResolver
): url is (() => string) | (() => Promise<string>) {
  return typeof url === 'function';
}

export function isString(url: UrlResolver): url is string {
  return typeof url === 'string';
}

export async function resolveUrl(url: UrlResolver): Promise<string> {
  if (isThunk(url)) {
    return await url();
  }
  return url as string;
}