Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Fix for empty group for OCRSecurity
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrozd committed Jun 7, 2024
1 parent 00254a9 commit df0587a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.64",
"version": "0.0.65",
"author": "Regula Forensics, Inc.",
"name": "@regulaforensics/document-reader-recipes",
"description": "Document Reader Recipes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export const getAuthenticityCheckList = (input: ProcessResponse): RAuthenticityC
}

if (AuthenticityOCRSecurityTextCheckResult.isBelongs(item)) {
item.List.forEach((subItem) => {
let groupIndex = current.groups.findIndex((group) => group.group === subItem.Type)
let groupIndex = current.groups.findIndex((group) => group.group === item.Type)

item.List.forEach((subItem) => {
if (groupIndex === -1) {
current.groups.push(RAuthenticityCheckGroup.fromPlain({
group: subItem.Type,
Expand All @@ -134,6 +134,14 @@ export const getAuthenticityCheckList = (input: ProcessResponse): RAuthenticityC
}
}))
})

if (!item.List?.length) {
current.groups.push(RAuthenticityCheckGroup.fromPlain({
group: item.Type,
checkResult: item.Result,
checks: []
}))
}
}

if (AuthenticityPhotoIdentCheckResult.isBelongs(item)) {
Expand Down

0 comments on commit df0587a

Please sign in to comment.