UNPKG

mindee

Version:

Mindee Client Library for Node.js

15 lines (14 loc) 560 B
import { FieldLocation } from "./fieldLocation.js"; export class BaseField { constructor(rawResponse, indentLevel = 0) { this._indentLevel = indentLevel; if ("confidence" in rawResponse && rawResponse["confidence"] !== null) { this.confidence = rawResponse["confidence"]; } if ("locations" in rawResponse && rawResponse["locations"]) { this.locations = rawResponse["locations"].map((location) => { return location ? new FieldLocation(location) : ""; }); } } }