refactor: update all

This commit is contained in:
openstappsbot
2021-09-28 13:14:12 +00:00
committed by Rainer Killinger
parent 9bc05d2c99
commit 8cf40900bb
4 changed files with 267 additions and 366 deletions

617
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@
}, },
"dependencies": { "dependencies": {
"@openstapps/logger": "0.7.0", "@openstapps/logger": "0.7.0",
"ajv": "6.12.6", "ajv": "8.6.3",
"better-ajv-errors": "0.7.0", "better-ajv-errors": "0.7.0",
"chai": "4.3.4", "chai": "4.3.4",
"commander": "8.2.0", "commander": "8.2.0",
@@ -75,7 +75,7 @@
"@types/fs-extra": "9.0.13", "@types/fs-extra": "9.0.13",
"@types/glob": "7.1.4", "@types/glob": "7.1.4",
"@types/json-schema": "7.0.9", "@types/json-schema": "7.0.9",
"@types/lodash": "4.14.174", "@types/lodash": "4.14.175",
"@types/mocha": "9.0.0", "@types/mocha": "9.0.0",
"@types/mustache": "4.1.2", "@types/mustache": "4.1.2",
"@types/node": "14.17.19", "@types/node": "14.17.19",
@@ -85,8 +85,8 @@
"conventional-changelog-cli": "2.1.1", "conventional-changelog-cli": "2.1.1",
"eslint-config-prettier": "8.3.0", "eslint-config-prettier": "8.3.0",
"eslint-plugin-jsdoc": "36.1.0", "eslint-plugin-jsdoc": "36.1.0",
"eslint-plugin-prettier": "3.4.1", "eslint-plugin-prettier": "4.0.0",
"eslint-plugin-unicorn": "35.0.0", "eslint-plugin-unicorn": "36.0.0",
"mocha": "9.1.2", "mocha": "9.1.2",
"nock": "13.1.3", "nock": "13.1.3",
"prepend-file-cli": "1.0.6", "prepend-file-cli": "1.0.6",

View File

@@ -39,7 +39,7 @@ export class Converter {
/** /**
* Schema validator instance * Schema validator instance
*/ */
private readonly schemaValidator: Ajv.Ajv; private readonly schemaValidator: Ajv;
/** /**
* Create a new converter * Create a new converter

View File

@@ -31,7 +31,7 @@ export class Validator {
/** /**
* JSON Schema Validator * JSON Schema Validator
*/ */
private readonly ajv = Ajv({verbose: true, jsonPointers: true, extendRefs: true}); private readonly ajv = new Ajv({verbose: true});
/** /**
* Map of schema names to schemas * Map of schema names to schemas
@@ -127,7 +127,7 @@ function fromAjvResult(
result: boolean | PromiseLike<unknown>, result: boolean | PromiseLike<unknown>,
schema: JSONSchema7, schema: JSONSchema7,
instance: unknown, instance: unknown,
ajvInstance: Ajv.Ajv, ajvInstance: Ajv,
): ValidationResult { ): ValidationResult {
// @ts-expect-error function can return void, which at runtime will be undefined. TS doesn't allow to assign void to undefined // @ts-expect-error function can return void, which at runtime will be undefined. TS doesn't allow to assign void to undefined
const betterErrorObject: betterAjvErrors.IOutputError[] | undefined = betterAjvErrors( const betterErrorObject: betterAjvErrors.IOutputError[] | undefined = betterAjvErrors(
@@ -142,7 +142,7 @@ function fromAjvResult(
errors: errors:
ajvInstance.errors?.map((ajvError, index) => { ajvInstance.errors?.map((ajvError, index) => {
const error: ValidationError = { const error: ValidationError = {
dataPath: ajvError.dataPath, dataPath: ajvError.instancePath,
instance: instance, instance: instance,
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
message: betterErrorObject?.[index].error!, message: betterErrorObject?.[index].error!,