import * as selectively from "selectively" export type Account = | { bic: string iban: string local?: string } | string export namespace Account { export function is(value: any | Account): value is Account { return ( typeof value == "string" || (typeof value == "object" && typeof value.bic == "string" && typeof value.iban == "string" && (value.local == undefined || typeof value.local == "string")) ) } export const template = new selectively.Type.Union([ new selectively.Type.Object({ bic: new selectively.Type.String(), iban: new selectively.Type.String(), local: new selectively.Type.String(), }), new selectively.Type.String(), ]) }