import type { IframeMessageEvent, WrappedIframePushEvent } from "./types"; export const isWrappedEventOfType = ( event: IframeMessageEvent, type: string, ) => { return event.data.type === type; }; export const toWrappedEventOfType = ( payload: T, type: S, ): WrappedIframePushEvent => { return { type, payload, }; };