@regulaforensics/document-reader-typings
v7.4.210
Published
Document Reader API typings
Downloads
5,021
Readme
document-reader-typings
TypeScript definitions for Regula Document Reader SDK
Installation
npm install --save @regulaforensics/document-reader-typings
Setup tests
- Copy
.env.example
to.env
and set all variables (or set environment variables manually, if some variables are not set, tests for this functionality will be skipped) - Run
node tools/inspect-test-dirs-configuration.js
to check if all test directories are configured correctly - Run
npm run test
Manual check of separate file
- Build project with
npm run build
- Run
node tools/analize-json.js --f <path-to-file>
Output when file is invalid:
Errors: {
"ContainerList.List.0.light": [
"light must be a number",
"light must be one of the following values: 0, 6, 24, 128"
]
}
Output when file is valid:
File is valid
Difference check
Option -d
allows to run check a difference between validated file and original file:
If there will be any difference, it will be printed to console. For example:
Differences: [
{
"kind": "change occurred within an array",
"path": "ContainerList.List.1"
},
{
"kind": "property/element was deleted",
"path": "TransactionInfo.Version"
},
{
"kind": "newly added property/element",
"path": "log"
}
]
You can also change the file .excluded
to exclude some properties from difference check. File is located in root of project.
This file exclude path for analyze-json
tool and for tests.