Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Type aliases

EmailData

EmailData: z.infer<typeof emailSchema>

Variables

Const addressListSchema

addressListSchema: ZodArray<ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}>> = z.array(addressSchema)

Const addressSchema

addressSchema: ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}> = z.object({name: z.string(),address: z.string(),})

Const emailSchema

emailSchema: ZodObject<{ bodyHtml: ZodUnion<[ZodString, ZodUndefined]>; bodyText: ZodUnion<[ZodString, ZodUndefined]>; cc: ZodArray<ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}>>; date: ZodUnion<[ZodString, ZodUndefined]>; from: ZodArray<ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}>>; messageId: ZodUnion<[ZodString, ZodUndefined]>; replyTo: ZodArray<ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}>>; source: ZodUnion<[ZodString, ZodUndefined]>; subject: ZodUnion<[ZodString, ZodUndefined]>; to: ZodArray<ZodObject<{ address: ZodString; name: ZodString }, { strict: true }, {}>> }, { strict: true }, {}> = z.object({messageId: optionalString,to: addressListSchema,replyTo: addressListSchema,from: addressListSchema,cc: addressListSchema,subject: optionalString,bodyText: optionalString,bodyHtml: optionalString,date: optionalString,source: optionalString,})

Const optionalString

optionalString: ZodUnion<[ZodString, ZodUndefined]> = z.string().optional()

Functions

assertEmailData

  • assertEmailData(value: unknown): assertsvalue is EmailData
  • Asserts that the given value is compatible with EmailData, otherwise throws ane Error.

    throws

    {Error}

    Parameters

    • value: unknown

    Returns assertsvalue is EmailData

Const isEmailData

  • isEmailData(value: unknown): value is EmailData
  • Checks if the given value is compatible with EmailData.

    Parameters

    • value: unknown

    Returns value is EmailData

Const parseEmailData

  • Returns the given value as EmailData if it is valid, otherwise throws an Error.

    throws

    {Error}

    Parameters

    • value: unknown

    Returns EmailData

Generated using TypeDoc