File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change
1
+ import * as yamlParser from "js-yaml" ;
1
2
import * as path from "path" ;
2
3
import * as _ from "lodash" ;
3
4
import * as fs from "fs" ;
Original file line number Diff line number Diff line change 1
- import * as ncp from "ncp" ;
1
+ import ncp from "ncp" ;
2
2
import * as path from "path" ;
3
3
import { promisify } from "util" ;
4
4
Original file line number Diff line number Diff line change @@ -5,13 +5,14 @@ import schema from "./schema";
5
5
// @ts -ignore ajv typings not working
6
6
import JsonSchema from "ajv" ;
7
7
8
- export function validateSchema ( json : T . Tutorial ) {
8
+ export function validateSchema ( json : any ) {
9
9
// validate using https://json-schema.org/
10
10
const jsonSchema = new JsonSchema ( { allErrors : true , verbose : true } ) ;
11
11
// support draft-07 of json schema
12
12
jsonSchema . addMetaSchema ( require ( "ajv/lib/refs/json-schema-draft-07.json" ) ) ;
13
13
14
- const valid = jsonSchema . compile ( schema , json ) ;
14
+ const validator = jsonSchema . compile ( schema ) ;
15
+ const valid = validator ( json ) ;
15
16
16
17
if ( ! valid ) {
17
18
// log errors
You can’t perform that action at this time.
0 commit comments