UNPKG

@scribelabsai/amazon-trp

Version:

Amazon Textract Response Parser library for Node.

21 lines 549 B
export class Form { constructor() { this.fields = []; this.fieldsMap = {}; } addField(field) { this.fields.push(field); this.fieldsMap[field.key?.text || ''] = field; } toString() { return this.fields.join('\n'); } getFieldByKey(key) { return this.fieldsMap[key]; } searchFieldsByKey(key) { const searchKey = key.toLowerCase(); return this.fields.filter((f) => f.key?.text.toLowerCase().includes(searchKey)); } } //# sourceMappingURL=Form.js.map