Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"ajv": "^8.0.0",
"fast-json-patch": "^2.0.0",
"fast-json-patch": "^3.1.1",
"glob": "^7.1.0",
"js-yaml": "^3.14.0",
"json-schema-migrate": "^2.0.0",
Expand Down
6 changes: 4 additions & 2 deletions src/commands/ajv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ export default function (argv: ParsedArgs): AjvCore {
registerer = require("ts-node").register()
} catch (err) {
/* istanbul ignore next */
if (err.code === "MODULE_NOT_FOUND") {
if ((err as {code?: string; message: string}).code === "MODULE_NOT_FOUND") {
throw new Error(
`'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${err.message}`
`'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${
(err as Error).message
}`
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function openFile(filename: string, suffix: string): any {
json = require(file)
}
} catch (err) {
const msg: string = err.message
const msg: string = (err as Error).message
console.error(`error: ${msg.replace(" module", " " + suffix)}`)
process.exit(2)
}
Expand Down Expand Up @@ -82,7 +82,7 @@ export function compile(ajv: Ajv, schemaFile: string): AnyValidateFunction {
return ajv.compile(schema)
} catch (err) {
console.error(`schema ${schemaFile} is invalid`)
console.error(`error: ${err.message}`)
console.error(`error: ${(err as Error).message}`)
process.exit(1)
}
}