Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fastro/http/server/deps.ts>extensionsByType

Full Stack Framework for Deno, TypeScript, Preact JS and Tailwind CSS
Go to Latest
function extensionsByType
Re-export
import { extensionsByType } from "https://deno.land/x/fastro@v0.85.1/http/server/deps.ts";

Returns the extensions known to be associated with the media type type. When type has no associated extensions, the function returns undefined.

Extensions are returned without a leading ..

Examples

Example 1

import { extensionsByType } from "https://deno.land/std@0.224.0/media_types/extensions_by_type.ts";

extensionsByType("application/json"); // ["json", "map"]
extensionsByType("text/html; charset=UTF-8"); // ["html", "htm", "shtml"]
extensionsByType("application/foo"); // undefined

Parameters

type: string

Returns

string[] | undefined