added doga
This commit is contained in:
15
25_02_24/node_modules/@tinyhttp/send/dist/utils.js
generated
vendored
Normal file
15
25_02_24/node_modules/@tinyhttp/send/dist/utils.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Stats } from 'node:fs';
|
||||
import { format, parse } from '@tinyhttp/content-type';
|
||||
import { eTag } from '@tinyhttp/etag';
|
||||
export const createETag = (body, encoding) => {
|
||||
if (body instanceof Stats) {
|
||||
return eTag(body, { weak: true });
|
||||
}
|
||||
return eTag(!Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body, { weak: true });
|
||||
};
|
||||
export function setCharset(type, charset) {
|
||||
const parsed = parse(type);
|
||||
parsed.parameters.charset = charset;
|
||||
return format(parsed);
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
||||
Reference in New Issue
Block a user