TypeScript definitions for Regula Document Reader SDK
npm install --save @regulaforensics/document-reader-typings
- 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
- 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
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.