npm.io
1.6.7 • Published 1 year ago

@types/type-is

Licence
MIT
Version
1.6.7
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/type-is

Summary

This package contains type definitions for type-is (https://github.com/jshttp/type-is#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is.

index.d.ts

/// <reference types="node" />
import { IncomingMessage } from "http";

export = typeIs;

declare function typeIs(request: IncomingMessage, types: string[]): string | false | null;
declare function typeIs(request: IncomingMessage, ...types: string[]): string | false | null;

declare namespace typeIs {
    function normalize(type: string): string | false;
    function hasBody(request: IncomingMessage): boolean;
    function is(mediaType: string, types: string[]): string | false;
    function is(mediaType: string, ...types: string[]): string | false;
    function match(expected: false | string, actual: string): boolean;
}

Additional Details

  • Last updated: Wed, 15 Jan 2025 0545 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.