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

2.0.2 • Public • Published

Installation

npm install --save @types/is-http-url

Summary

This package contains type definitions for is-http-url (https://github.com/emilbayes/is-http-url#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-http-url.

index.d.ts

export = isHttpUrl;

/**
 * Validate URLs for sane values.
 *
 * Does the following:
 *
 * - Protocol should be one of `http:` or `https:`
 * - Hostname should be [valid domain](http://github.com/emilbayes/is-domain-name) name or IPv4 address (TODO: IPv6)
 * - Port, if given, should be an integer in the range `[1, 65535]`
 *
 * @example
 * // Example usage could be to validate the Origin or Referer HTTP headers
 * import * as assert from 'assert'
 * import isHttpUrl = require('is-http-url')
 *
 * assert.ok(isHttpUrl('http://example.com/hello-world.txt'))
 * assert.ok(!isHttpUrl('//test'))
 */
declare function isHttpUrl(url: string): boolean;

Additional Details

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

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/is-http-url

Weekly Downloads

118

Version

2.0.2

License

MIT

Unpacked Size

3.88 kB

Total Files

5

Last publish

Collaborators

  • types