UNPKG

mindee

Version:

Mindee Client Library for Node.js

63 lines (62 loc) 2.63 kB
"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _PayslipV2BankAccountDetail_instances, _PayslipV2BankAccountDetail_printableValues; Object.defineProperty(exports, "__esModule", { value: true }); exports.PayslipV2BankAccountDetail = void 0; /** * Information about the employee's bank account. */ class PayslipV2BankAccountDetail { constructor({ prediction = {} }) { _PayslipV2BankAccountDetail_instances.add(this); /** Confidence score */ this.confidence = 0.0; /** * Contains the relative vertices coordinates (points) of a polygon containing * the field in the document. */ this.polygon = []; this.bankName = prediction["bank_name"]; this.iban = prediction["iban"]; this.swift = prediction["swift"]; this.pageId = prediction["page_id"]; this.confidence = prediction["confidence"] ? prediction.confidence : 0.0; if (prediction["polygon"]) { this.polygon = prediction.polygon; } } /** * Default string representation. */ toString() { const printable = __classPrivateFieldGet(this, _PayslipV2BankAccountDetail_instances, "m", _PayslipV2BankAccountDetail_printableValues).call(this); return ("Bank Name: " + printable.bankName + ", IBAN: " + printable.iban + ", SWIFT: " + printable.swift); } /** * Output in a format suitable for inclusion in a field list. */ toFieldList() { const printable = __classPrivateFieldGet(this, _PayslipV2BankAccountDetail_instances, "m", _PayslipV2BankAccountDetail_printableValues).call(this); return ` :Bank Name: ${printable.bankName} :IBAN: ${printable.iban} :SWIFT: ${printable.swift}`.trimEnd(); } } exports.PayslipV2BankAccountDetail = PayslipV2BankAccountDetail; _PayslipV2BankAccountDetail_instances = new WeakSet(), _PayslipV2BankAccountDetail_printableValues = function _PayslipV2BankAccountDetail_printableValues() { return { bankName: this.bankName ?? "", iban: this.iban ?? "", swift: this.swift ?? "", }; };