import { extension } from "https://deno.land/std@0.190.0/media_types/mod.ts";
For a given media type, return the most relevant extension, or undefined
if no extension can be found.
Extensions are returned without a leading .
.
Examples
Example 1
Example 1
import { extension } from "https://deno.land/std@0.190.0/media_types/extension.ts";
extension("text/plain"); // `txt`
extension("application/json"); // `json`
extension("text/html; charset=UTF-8"); // `html`
extension("application/foo"); // undefined