# @types/type-is

> TypeScript definitions for type-is

Latest version **1.6.7** (published 2025-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/type-is
pnpm add @types/type-is
yarn add @types/type-is
bun add @types/type-is
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.6.7 |
| Published | 2025-01-15 |
| First published | 2017-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/type-is
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is
- npm.io page: https://npm.io/package/@types/type-is

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 1.6.7 (latest) — 2025-01-15
- 1.6.6 (ts4.5) — 2023-11-07
- 1.6.4 (ts4.3) — 2023-09-12
- 1.6.3 (ts3.9) — 2019-08-19
- 1.6.2 (ts2.2) — 2017-12-03
- 1.6.0 (ts2.0) — 2017-08-15
- 1.6.5 — 2023-10-18
- 1.6.1 — 2017-11-09

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-is/index.d.ts)
````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 05:02:45 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [BendingBender](https://github.com/BendingBender).

---
_Source: https://npm.io/package/@types/type-is · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
