# @types/http-assert

> TypeScript definitions for http-assert

Latest version **1.5.6** (published 2024-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/http-assert
pnpm add @types/http-assert
yarn add @types/http-assert
bun add @types/http-assert
```

## 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.5.6 |
| Published | 2024-10-24 |
| First published | 2017-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51430 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.5.6 (latest) — 2024-10-24
- 1.5.5 (ts4.5) — 2023-11-07
- 1.5.3 (ts3.8) — 2021-08-26
- 1.5.2 (ts3.6) — 2021-08-06
- 1.5.1 (ts2.8) — 2019-08-19
- 1.5.0 (ts2.2) — 2019-07-08
- 1.2.1 (ts2.0) — 2017-10-25
- 1.5.4 — 2023-10-18
- 1.4.1 — 2019-07-02
- 1.4.0 — 2018-12-26
- 1.3.0 — 2018-05-22
- 1.2.2 — 2017-11-09
- 1.2.0 — 2017-01-06

## README

# Installation
> `npm install --save @types/http-assert`

# Summary
This package contains type definitions for http-assert (https://github.com/jshttp/http-assert).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-assert.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-assert/index.d.ts)
````ts
/**
 * @param status the status code
 * @param msg the message of the error, defaulting to node's text for that status code
 * @param opts custom properties to attach to the error object
 */
declare function assert(value: any, status?: number, msg?: string, opts?: Record<string, any>): asserts value;
declare function assert(value: any, status?: number, opts?: Record<string, any>): asserts value;

declare namespace assert {
    /**
     * @param status the status code
     * @param msg the message of the error, defaulting to node's text for that status code
     * @param opts custom properties to attach to the error object
     */
    type Assert = <T>(a: T, b: T, status?: number, msg?: string, opts?: Record<string, any>) => void;

    /**
     * @param status the status code
     * @param msg the message of the error, defaulting to node's text for that status code
     * @param opts custom properties to attach to the error object
     */
    type AssertOK = (a: any, status?: number, msg?: string, opts?: Record<string, any>) => asserts a;

    /**
     * @param status the status code
     * @param msg the message of the error, defaulting to node's text for that status code
     * @param opts custom properties to attach to the error object
     */
    type AssertFail = (status?: number, msg?: string, opts?: Record<string, any>) => void;

    /**
     * @param status the status code
     * @param msg the message of the error, defaulting to node's text for that status code
     * @param opts custom properties to attach to the error object
     */
    type AssertEqual = (a: any, b: any, status?: number, msg?: string, opts?: Record<string, any>) => void;

    const equal: Assert;
    const notEqual: Assert;
    const ok: AssertOK;
    const strictEqual: AssertEqual;
    const notStrictEqual: AssertEqual;
    const deepEqual: AssertEqual;
    const notDeepEqual: AssertEqual;
    const fail: AssertFail;
}

export = assert;

````

### Additional Details
 * Last updated: Thu, 24 Oct 2024 14:35:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [jKey Lu](https://github.com/jkeylu), [Peter Squicciarini](https://github.com/stripedpajamas), and [Alex Bulanov](https://github.com/sapfear).

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