Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

256 B
Raw Blame
export function isDataAppMessage<Type extends string>(
  data: unknown,
  type: Type,
): data is { type: Type } & Record<string, unknown> {
  return (
    typeof data === "object" &&
    data !== null &&
    "type" in data &&
    data.type === type
  );
}