Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rafamel/yaml-import
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed May 1, 2019
2 parents 184ed8d + 9cf1f3c commit 2281e6b
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 2281e6b

Please sign in to comment.