mindee
Version:
Mindee Client Library for Node.js
30 lines (29 loc) • 969 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CropperExtra = void 0;
const standard_1 = require("../../standard");
const summaryHelper_1 = require("../summaryHelper");
const extras_1 = require("./extras");
class CropperExtra extends extras_1.ExtraField {
constructor(rawPrediction, pageId) {
super();
this.cropping = [];
rawPrediction["cropping"] !== undefined &&
rawPrediction["cropping"].forEach((crop) => {
this.cropping.push(new standard_1.PositionField({
prediction: crop,
pageId: pageId,
}));
});
}
/**
* Default string representation.
*/
toString() {
const cropping = this.cropping
.map((crop) => crop.toString())
.join("\n ");
return (0, summaryHelper_1.cleanOutString)(cropping);
}
}
exports.CropperExtra = CropperExtra;