UNPKG

1.28 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/type-is`
3
4# Summary
5This package contains type definitions for type-is (https://github.com/jshttp/type-is#readme).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is/index.d.ts)
10````ts
11/// <reference types="node" />
12import { IncomingMessage } from "http";
13
14export = typeIs;
15
16declare function typeIs(request: IncomingMessage, types: string[]): string | false | null;
17declare function typeIs(request: IncomingMessage, ...types: string[]): string | false | null;
18
19declare namespace typeIs {
20 function normalize(type: string): string | false;
21 function hasBody(request: IncomingMessage): boolean;
22 function is(mediaType: string, types: string[]): string | false;
23 function is(mediaType: string, ...types: string[]): string | false;
24 function mimeMatch(expected: false | string, actual: string): boolean;
25}
26
27````
28
29### Additional Details
30 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
31 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
32
33# Credits
34These definitions were written by [BendingBender](https://github.com/BendingBender).
35
\No newline at end of file