toInput
Function toInput
toInput<Profile extends ZugferdProfile<any>>(input: { data: ParserOutput<Extract<Profile["schema"], ProfileSchemaType>>; profile: Profile }): ProfileInput<Profile>Turn parser output back into the structure accepted by create().
Parser leaves differ from input leaves:
- dates:
{ format, date: Date, value: string }→Date - amounts without a currency:
{ value }→number - quantities that do not take a unit:
{ value }→number
Parameters
-
input: { data: ParserOutput<Extract<Profile["schema"], ProfileSchemaType>>; profile: Profile }
Returns ProfileInput<Profile>
Defined in packages/parser/src/to-input.ts:33