This module will parse a given media type into its component parts, like type,
subtype, and suffix. A formatter is also provided to put them back together and
the two can be combined to normalize media types into a canonical form.
If you are looking to parse the string that represents a media type and its
parameters in HTTP (for example, the Content-Type header), use the
content-type module.
Format an object into a media type string. This will return a string of the
mime type for the given object. For the properties of the object, see the
documentation for typer.parse(string).
If any of the given object values are invalid, then a TypeError is thrown.
typer.test(string)
const valid = typer.test("image/svg+xml");
Validate a media type string. This will return true if the string is a well-
formatted media type, or false otherwise.