rjweb-server
Version:
Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS
8 lines (7 loc) • 421 B
TypeScript
import { HttpResponse } from "@rjweb/uws";
import { CompressTypes } from "./handleCompressType";
import { GlobalContext } from "../types/context";
/**
* Get the best compression using a header
* @since 8.0.0
*/ export default function getCompressMethod(doCompress: boolean, header: string, res: HttpResponse, totalSize: number, ctg: GlobalContext): [CompressTypes, string | undefined, (chunk: ArrayBuffer) => boolean];