Function allExtensions
- all
Extensions (type): string[] | undefined Parameters
- type: string
The media type to get the extensions for.
Returns string[] | undefined
The extensions for the given media type, or
undefinedif no extensions are found.Example: Usage
import { allExtensions } from "@std/media-types/all-extensions";
import { assertEquals } from "@std/assert";
assertEquals(allExtensions("application/json"), ["json", "map"]);
assertEquals(allExtensions("text/html; charset=UTF-8"), ["html", "htm", "shtml"]);
assertEquals(allExtensions("application/foo"), undefined);- type: string
Returns all the extensions known to be associated with the media type
type, orundefinedif no extensions are found.Extensions are returned without a leading
..