There was an error while loading. Please reload this page.
1 parent 7974be0 commit 596c5c4Copy full SHA for 596c5c4
1 file changed
document-ai/process-document-specialized.js
@@ -74,7 +74,8 @@ async function main(projectId, location, processorId, filePath) {
74
const key = entity.type;
75
// some other value formats in addition to text are availible
76
// e.g. dates: `entity.normalizedValue.dateValue.year`
77
- const textValue = entity.textAnchor.content;
+ const textValue =
78
+ entity.textAnchor !== null ? entity.textAnchor.content : '';
79
const conf = entity.confidence * 100;
80
console.log(
81
`* ${JSON.stringify(key)}: ${JSON.stringify(textValue)}(${conf.toFixed(
0 commit comments