Skip to content

Commit

Permalink
Merge 21953d0 into 55264e6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferroin committed Apr 30, 2019
2 parents 55264e6 + 21953d0 commit c0ac520
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/get-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import namify from 'namify';
import { IOpts } from './types';
import read from './read';

export default function getSchema(dir: string, options: IOpts = {}) {
export default function getSchema(
dir: string,
options: IOpts = {},
schemas: yaml.Schema[] = [yaml.DEFAULT_SAFE_SCHEMA]
) {
if (!options.hasOwnProperty('ext') || !Array.isArray(options.ext)) {
options.ext = ['.yml', '.yaml'];
}
Expand Down Expand Up @@ -110,6 +114,6 @@ export default function getSchema(dir: string, options: IOpts = {}) {
}
})
];
const schema = yaml.Schema.create(types);
const schema = yaml.Schema.create(schemas, types);
return schema;
}

0 comments on commit c0ac520

Please sign in to comment.