download
raw
649 Bytes
// src/helper/accepts/accepts.ts
import { parseAccept } from "../../utils/accept.js";
var defaultMatch = (accepts2, config) => {
const { supports, default: defaultSupport } = config;
const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type));
return accept ? accept.type : defaultSupport;
};
var accepts = (c, options) => {
const acceptHeader = c.req.header(options.header);
if (!acceptHeader) {
return options.default;
}
const accepts2 = parseAccept(acceptHeader);
const match = options.match || defaultMatch;
return match(accepts2, options);
};
export {
accepts,
defaultMatch
};

Xet Storage Details

Size:
649 Bytes
·
Xet hash:
5d3e378a5d0025b05653b2670cdf8865abeb15888cfaa7af79dd9d74be6311f7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.