UNPKG

mindee

Version:

Mindee Client Library for Node.js

31 lines (30 loc) 956 B
import { cleanOutString, } from "../../../../v1/parsing/common/index.js"; import { StringField } from "../../../../v1/parsing/standard/index.js"; /** * Bank Account Details API version 1.0 document data. */ export class BankAccountDetailsV1Document { constructor(rawPrediction, pageId) { this.accountHolderName = new StringField({ prediction: rawPrediction["account_holder_name"], pageId: pageId, }); this.iban = new StringField({ prediction: rawPrediction["iban"], pageId: pageId, }); this.swift = new StringField({ prediction: rawPrediction["swift"], pageId: pageId, }); } /** * Default string representation. */ toString() { const outStr = `:IBAN: ${this.iban} :Account Holder's Name: ${this.accountHolderName} :SWIFT Code: ${this.swift}`.trimEnd(); return cleanOutString(outStr); } }