mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* update(media-typer): version 1.1 - add new `test` method - missing docs comments - version bump to 1.1 - v0 created for compatibility - maintainer added https://github.com/jshttp/media-typer/compare/v0.3.0...v1.1.0 https://github.com/jshttp/media-typer#typerteststring Thanks! * Update types/media-typer/index.d.ts thx to @sandersn Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> * Update types/media-typer/index.d.ts thx to @sandersn Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
19 lines
428 B
TypeScript
19 lines
428 B
TypeScript
import typer = require('media-typer');
|
|
|
|
const obj = typer.parse('image/svg+xml');
|
|
// $ExpectType MediaType
|
|
obj;
|
|
// $ExpectType string
|
|
obj.type;
|
|
// $ExpectType string
|
|
obj.subtype;
|
|
// $ExpectType string | undefined
|
|
obj.suffix;
|
|
|
|
// $ExpectType string
|
|
typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' });
|
|
typer.format({ type: 'image', subtype: 'svg' });
|
|
|
|
// $ExpectType boolean
|
|
const valid = typer.test('image/svg+xml');
|