(body: Buffer | string | Stats, encoding: BufferEncoding)
| 3 | import { Stats } from 'fs' |
| 4 | |
| 5 | export const createETag = (body: Buffer | string | Stats, encoding: BufferEncoding) => { |
| 6 | if (body instanceof Stats) { |
| 7 | return eTag(body, { weak: true }) |
| 8 | } else { |
| 9 | return eTag(!Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body, { weak: true }) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | export function setCharset(type: string, charset: string) { |
| 14 | const parsed = parse(type) |