swagger-routes-express
Version:
Connect Express route controllers to restful paths using a Swagger 2 or OpenAPI 3 definition file
16 lines (14 loc) • 372 B
JavaScript
const connectSecurity = (key, options) => {
const { scopes = {}, security = {} } = options
if (key) {
if (scopes[key]) {
process.emitWarning(
'The `scopes` option has been deprecated. Please use `security` instead.',
'DeprecationWarning'
)
return scopes[key]
}
return security[key]
}
}
module.exports = connectSecurity