@types/bogon
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Installation

npm install --save @types/bogon

Summary

This package contains type definitions for bogon (https://github.com/mafintosh/bogon).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bogon.

index.d.ts

export = bogon;

/**
 * Check if an IP is a bogon.
 *
 * @param ip The IP to check
 *
 * @example
 * import bogon = require('bogon');
 *
 * console.log(bogon('192.168.0.1')); // true
 * console.log(bogon('8.8.8.8')); // false
 */
declare function bogon(ip: string): boolean;

declare namespace bogon {
    /**
     * Check if an IP is a bogon.
     *
     * @param ip The IP to check
     *
     * @example
     * import bogon = require('bogon');
     *
     * console.log(bogon.isBogon('192.168.0.1')); // true
     * console.log(bogon.isBogon('8.8.8.8')); // false
     */
    const isBogon: typeof bogon;

    /**
     * Detect if a bogon IP is a private IP address on a local network.
     *
     * @param ip The IP to check
     *
     * @example
     * import bogon = require('bogon');
     *
     * console.log(bogon.isPrivate('192.168.0.1')) // true
     * console.log(bogon('224.0.1.1')) // true
     * console.log(bogon.isPrivate('224.0.1.1')) // false
     */
    function isPrivate(ip: string): boolean;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

/@types/bogon/

    Package Sidebar

    Install

    npm i @types/bogon

    Weekly Downloads

    168

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.55 kB

    Total Files

    5

    Last publish

    Collaborators

    • types