Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-localhost/docs/types/index.d"

Index

Functions

Functions

Export assignment isLocalhost

  • isLocalhost(value: any): boolean
  • Tests whether a value is a localhost hostname.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating whether value is a localhost hostname

    Example

    var bool = isLocalhost( 'localhost' );
    // returns true

    Example

    var bool = isLocalhost( '127.0.0.1' );
    // returns true

    Example

    var bool = isLocalhost( '[::1]' );
    // returns true

    Example

    var bool = isLocalhost( 'wikipedia.org' );
    // returns false

    Example

    var bool = isLocalhost( 'stdlib.io' );
    // returns false

    Example

    var bool = isLocalhost( null );
    // returns false