Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function use (path, fn) {
if (typeof path === 'string') {
const prefix = this[symbols.kRoutePrefix]
path = prefix + (path === '/' && prefix.length > 0 ? '' : path)
}
this[kMiddlewares].push([path, fn])
if (fn == null) {
this[kMiddie].use(path)
} else {
this[kMiddie].use(path, fn)
}
return this
}