@types/media-typer
Advanced tools
Comparing version 0.3.0 to 1.1.0
@@ -1,13 +0,44 @@ | ||
// Type definitions for media-typer 0.3 | ||
// 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; | ||
} |
{ | ||
"name": "@types/media-typer", | ||
"version": "0.3.0", | ||
"version": "1.1.0", | ||
"description": "TypeScript definitions for media-typer", | ||
@@ -9,15 +9,22 @@ "license": "MIT", | ||
"name": "BendingBender", | ||
"url": "https://github.com/BendingBender" | ||
"url": "https://github.com/BendingBender", | ||
"githubUsername": "BendingBender" | ||
}, | ||
{ | ||
"name": "Piotr Błażejewicz", | ||
"url": "https://github.com/peterblazejewicz", | ||
"githubUsername": "peterblazejewicz" | ||
} | ||
], | ||
"main": "", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/media-typer" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "4cc72ebc06ad8d71e372a33d38458c55841be0027aae7873fd1f63b74996a0cb", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "ec7ba9a55ff60ac29121630a3633b565ece023e8747ecd6c1ae5dc2d71bca4f2", | ||
"typeScriptVersion": "2.9" | ||
} |
@@ -8,6 +8,6 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/media-typer | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/media-typer. | ||
Additional Details | ||
* Last updated: Tue, 15 Aug 2017 18:11:20 GMT | ||
### Additional Details | ||
* Last updated: Tue, 12 May 2020 19:57:56 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by BendingBender <https://github.com/BendingBender>. | ||
These definitions were written by [BendingBender](https://github.com/BendingBender), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4199
40
1