Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getCompressResponse = function({ specific: { req } }) {
const negotiator = new Negotiator(req)
const algos = negotiator.encodings()
const compressResponse = findAlgo(algos)
return compressResponse
}
const getAcceptFormat = function({ specific: { req } }) {
const negotiator = new Negotiator(req)
const mimes = negotiator.mediaTypes()
if (mimes.length === 0) {
return
}
const formatB = mimes
.map(mime => eGetByMime({ mime, safe: true }))
.find(formatA => formatA !== undefined)
if (formatB !== undefined) {
return formatB.name
}
const suggestions = getMimes({ safe: true })
throwPb({