Skip to content

Commit 2634a52

Browse files
committed
Reverted some files
1 parent d8a32b7 commit 2634a52

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/commands/ajv.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ export default function (argv: ParsedArgs): AjvCore {
2222
if (invalid) process.exit(1)
2323
return ajv
2424

25-
function addSchemas(
26-
args: string | string[] | undefined,
27-
method: AjvMethod,
28-
fileType: string
29-
): void {
25+
function addSchemas(args: string | string[] | undefined, method: AjvMethod, fileType: string): void {
3026
if (!args) return
3127
const files = util.getFiles(args)
3228
files.forEach((file) => {

src/commands/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function execute(argv: ParsedArgs): boolean {
5050
const sch = openFile(file, `schema ${file}`)
5151
try {
5252
const id = sch?.$id
53-
ajv.addSchema(sch, id ? undefined : file)
53+
ajv.addSchema(sch, id ? undefined : file )
5454
const validate = ajv.getSchema(id || file)
5555
if (argv.o !== true) console.log(`schema ${file} is valid`)
5656
return validate
@@ -61,7 +61,7 @@ function execute(argv: ParsedArgs): boolean {
6161
}
6262
}
6363

64-
function getRefs(validators: AnyValidateFunction[], files: string[]): {[K in string]?: string} {
64+
function getRefs(validators: AnyValidateFunction[], files: string[]): {[K in string]?: string} {
6565
const refs: {[K in string]?: string} = {}
6666
validators.forEach((v, i) => {
6767
const ref = typeof v.schema == "object" ? v.schema.$id || files[i] : files[i]

src/commands/test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ function execute(argv: ParsedArgs): boolean {
3333
const ajv = getAjv(argv)
3434
const validate = compile(ajv, argv.s)
3535
const shouldBeValid = !!argv.valid && argv.valid !== "false"
36-
return getFiles(argv.d)
37-
.map(testDataFile)
38-
.every((x) => x)
36+
return getFiles(argv.d).map(testDataFile).every((x) => x)
3937

4038
function testDataFile(file: string): boolean {
4139
const data = openFile(file, `data file ${file}`)

0 commit comments

Comments
 (0)