UNPKG

mindee

Version:

Mindee Client Library for Node.js

24 lines (23 loc) 875 B
import { cleanOutString } from "../../../../v1/parsing/common/index.js"; import { ClassificationField } from "../../../../v1/parsing/standard/index.js"; import { IdCardV2Document } from "./idCardV2Document.js"; /** * Carte Nationale d'Identité API version 2.0 page data. */ export class IdCardV2Page extends IdCardV2Document { constructor(rawPrediction, pageId) { super(rawPrediction, pageId); this.documentSide = new ClassificationField({ prediction: rawPrediction["document_side"], }); this.documentType = new ClassificationField({ prediction: rawPrediction["document_type"], }); } toString() { let outStr = `:Document Type: ${this.documentType} :Document Sides: ${this.documentSide}`.trimEnd(); outStr += "\n" + super.toString(); return cleanOutString(outStr); } }