@types/media-typer

  • Version 1.1.3
  • Published
  • 5.42 kB
  • No dependencies
  • MIT license

Install

npm i @types/media-typer
yarn add @types/media-typer
pnpm add @types/media-typer

Overview

TypeScript definitions for media-typer

Index

Functions

function format

format: (mediaTypeDescriptor: MediaType) => string;
  • Format an object into a media type string. This will return a string of the mime type for the given object

    Throws

    TypeError If any of the given object values are invalid

function parse

parse: (mediaType: string) => MediaType;
  • Parse a media type string

    Throws

    TypeError If the given type string is invalid

function test

test: (mediaType: string) => boolean;
  • Validate a media type string

Interfaces

interface MediaType

interface MediaType {}

    property subtype

    subtype: string;
    • The subtype of the media type (always lower case). Example: svg

    property suffix

    suffix?: string | undefined;
    • The suffix of the media type (always lower case). Example: xml

    property type

    type: string;
    • The type of the media type (always lower case). Example: image

    Package Files (1)

    Dependencies (0)

    No dependencies.

    Dev Dependencies (0)

    No dev dependencies.

    Peer Dependencies (0)

    No peer dependencies.

    Badge

    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/media-typer.

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/media-typer)
    • HTML
      <a href="https://www.jsdocs.io/package/@types/media-typer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>