Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await cliSuppressExceptions(async () => {
log.debug(argv.toString())
const specPath = argv.specPath
const operationIds = argv.operationIds
const vOptions: validate.Options = {
consoleLogLevel: argv.logLevel,
logFilepath: argv.f,
pretty: argv.p
}
if (specPath.match(/.*composite.*/gi) !== null) {
const result = await validate.validateExamplesInCompositeSpec(specPath, vOptions)
return iterator.flat(result).some(() => true) ? 1 : 0
} else {
const result = await validate.validateExamples(specPath, operationIds, vOptions)
return result.length > 0 ? 1 : 0
}
})
}