Socket
Socket
Sign inDemoInstall

@types/http-assert

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/http-assert

TypeScript definitions for http-assert


Version published
Weekly downloads
1.6M
decreased by-1.12%
Maintainers
1
Install size
6.04 kB
Created
Weekly downloads
 

Readme

Source

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

/**
 * @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 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;
}

export = assert;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by jKey Lu, Peter Squicciarini, and Alex Bulanov.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc