UNPKG

mindee

Version:

Mindee Client Library for Node.js

30 lines (29 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CompanyRegistrationField = void 0; const field_1 = require("./field"); const common_1 = require("../common"); /** * A company registration item. */ class CompanyRegistrationField extends field_1.Field { constructor({ prediction = {}, valueKey = "value", reconstructed = false, pageId, }) { super({ prediction, valueKey, reconstructed, pageId }); this.type = prediction["type"]; } toTableLine() { const printable = this.printableValues(); return `| ${printable["type"].padEnd(15)} | ${printable["value"].padEnd(20)} `; } toString() { const printable = this.printableValues(); return `Type: ${printable["type"]}, Value: ${printable["value"]}`; } printableValues() { const printable = {}; printable["type"] = (0, common_1.cleanOutString)(this.type); printable["value"] = (0, common_1.cleanOutString)((this.value ?? "").toString()); return printable; } } exports.CompanyRegistrationField = CompanyRegistrationField;