Files
simple-mail-cleaner/backend/node_modules/@fastify/swagger/lib/util/should-route-hide.js
2026-01-22 15:49:12 +01:00

26 lines
354 B
JavaScript

'use strict'
function shouldRouteHide (schema, opts) {
const { hiddenTag, hideUntagged } = opts
if (schema?.hide) {
return true
}
const tags = schema?.tags || []
if (tags.length === 0 && hideUntagged) {
return true
}
if (tags.includes(hiddenTag)) {
return true
}
return false
}
module.exports = {
shouldRouteHide
}