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.