Skip to main content
Module

x/http_compress/mod.ts>isCompressible

Compress HTTP response, supported Web standard compression methods
Latest
function isCompressible
import { isCompressible } from "https://deno.land/x/http_compress@1.0.1/mod.ts";

Whether the media type is compressible or not.

This refers to the mime-db.

import { isCompressible } from "https://deno.land/x/http_compress@$VERSION/mod.ts";
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts";

assertEquals(isCompressible("text/html"), true);
assertEquals(isCompressible("image/png"), false);

Parameters

mediaType: string

Returns

boolean