Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@types/media-typer
Advanced tools
TypeScript definitions for media-typer
npm install --save @types/media-typer
This package contains type definitions for media-typer (https://github.com/jshttp/media-typer).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/media-typer.
// Type definitions for media-typer 1.1
// Project: https://github.com/jshttp/media-typer
// Definitions by: BendingBender <https://github.com/BendingBender>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Simple RFC 6838 media type parser.
* 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
*/
/**
* Parse a media type string
* @throws TypeError If the given type string is invalid
*/
export function parse(mediaType: string): MediaType;
/**
* 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
*/
export function format(mediaTypeDescriptor: MediaType): string;
/**
* Validate a media type string
*/
export function test(mediaType: string): boolean;
export interface MediaType {
/**
* The type of the media type (always lower case). Example: `image`
*/
type: string;
/**
* The subtype of the media type (always lower case). Example: `svg`
*/
subtype: string;
/**
* The suffix of the media type (always lower case). Example: `xml`
*/
suffix?: string | undefined;
}
These definitions were written by BendingBender, and Piotr Błażejewicz.
FAQs
TypeScript definitions for media-typer
The npm package @types/media-typer receives a total of 25,712 weekly downloads. As such, @types/media-typer popularity was classified as popular.
We found that @types/media-typer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.