is_mime: Check if an argument is a MIME type string

View source: R/string.R

is_mimeR Documentation

Check if an argument is a MIME type string

Description

Validates the type/subtype format where the top-level type must be one of the IANA-registered types: application, audio, font, image, message, model, multipart, text, or video.

Usage

is_mime(x)

Arguments

x

(any)
Object to check.

Value

TRUE if x is a valid MIME type string, FALSE otherwise.

References

https://www.iana.org/assignments/media-types/media-types.xhtml

Examples

is_mime("application/json")
is_mime("text/plain")

checkstring documentation built on Sept. 28, 2026, 5:07 p.m.