⁘ utils

MIME

MIME is a wrapper class that contains a bunch of utilitary static methods to manipulate MIME types. It also contains a collection of the most commonly used mime types.

go to → Members

Members

staticmimes :Map

The Map of all the currently registered MIMEDefinitions.

Methods

staticGet(p_ext) → { → MIMEDefinition">MIMEDefinition}

Returns the MIMEDefinitionassociated with a given extension, if any. Any MIMEDefinition registered with the same .ext will be overwritten.

Parameters:
Name Type Description
p_ext string
Examples:
MIME.Get('.js');

staticSet(p_mime)

Registers a MIMEDefinition that can be retrieved using MIME.Get

Parameters:
Name Type Description
p_mime MIMEDefinition

MIME Definition to be added. Will be mapped to its ext property.

Examples:
MIME.Set({ ext: '.js', desc: 'JavaScript', type: 'text/javascript' });