Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function compileOas(config: Config) {
let openApiObject: any = config.spec || loadFromFile(config.file);
if (!oasValidator.validateSync(openApiObject, {})) {
throw new Error('Invalid Openapi document');
}
return {
compiled: new ChowChow(openApiObject),
doc: openApiObject,
};
}