Module mime.common

Common functions and constants to work with MIME types.

Functions

NameDescription
defaultGenericIconName(mimeType) Default generic icon for MIME type.
defaultIconName(mimeType) Default icon for MIME type.
implicitParent(mimeType) Get implicit parent type if mimeType. This is text/plain for all text/* types and application/octet-stream for all streamable types.
isNoGlobs(pattern) Check is pattern is _NOGLOBS__. This means glob patterns from the less preferable MIME paths should be ignored.
isNoMagic(value) Check if value is _NOMAGIC__. This means magic rules from the less preferable MIME paths should be ignored.
isValidMimeTypeName(name) Check if name is valid MIME type name.
parseMimeTypeName(name) Parse MIME type name into pair of media and subtype strings.

Manifest constants

NameTypeDescription
defaultGlobWeight Default glob pattern weight to use when it's not explicitly provided.
defaultMatchWeight Default magic rule priority to use when it's not explicitly provided.
maximumGlobWeight Maximum glob pattern weight as defined by spec.
maximumMatchWeight Maximum magic rule priority as defined by spec.