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.

335 B
Raw Blame
/** Checks if an element matches a predicate
 * if it does it returns [T] otherwise it returns [false]
 * this is a useful utility for patten matching using solid-js's `<Switch>` & `<Match>` */
export function matches<S extends T, T = unknown>(
  e: T,
  predicate: (e: T) => e is S
): S | false {
  return predicate(e) ? e : false;
}