@types/valid-url
Advanced tools
Comparing version 1.0.3 to 1.0.4
// Type definitions for valid-url v1.0.9 | ||
// Project: https://github.com/ogt/valid-url | ||
// Definitions by: Steve Hipwell <https://github.com/stevehipwell> | ||
// Gabriel Cangussu <https://github.com/gcangussu> | ||
// Definitions by: Gabriel Cangussu <https://github.com/gcangussu> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -6,0 +5,0 @@ |
{ | ||
"name": "@types/valid-url", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "TypeScript definitions for valid-url", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/valid-url", | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "Steve Hipwell", | ||
"url": "https://github.com/stevehipwell", | ||
"githubUsername": "stevehipwell" | ||
}, | ||
{ | ||
"name": "Gabriel Cangussu", | ||
@@ -27,4 +23,4 @@ "url": "https://github.com/gcangussu", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "5d10a798113b29380170b6de8a7d9edbf86ee83a45b364c8f0a58de6b0067b8d", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "35e8c46d1db2f9c30082b956dc31105abac63ff591f491d446574a60840f9d33", | ||
"typeScriptVersion": "4.2" | ||
} |
@@ -9,5 +9,52 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/valid-url. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/valid-url/index.d.ts) | ||
````ts | ||
// Type definitions for valid-url v1.0.9 | ||
// Project: https://github.com/ogt/valid-url | ||
// Definitions by: Gabriel Cangussu <https://github.com/gcangussu> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
/** | ||
* Is the value a well-formed uri? | ||
* Returns the untainted URI if the test value appears to be well-formed. Note that you may really want one of the more practical methods like is_http_uri or is_https_uri, since the URI standard (RFC 3986) allows a lot of things you probably don't want. | ||
* @param value - The potential URI to test. | ||
* @returns The untainted RFC 3986 URI on success, undefined on failure. | ||
*/ | ||
export function isUri(value: string): string | undefined; | ||
/** | ||
* Is the value a well-formed HTTP uri? | ||
* Specialized version of isUri() that only likes http:// urls. As a result, it can also do a much more thorough job validating. Also, unlike isUri() it is more concerned with only allowing real-world URIs through. Things like relative hostnames are allowed by the standards, but probably aren't wise. Conversely, null paths aren't allowed per RFC 2616 (should be '/' instead), but are allowed by this function. | ||
* | ||
* This function only works for fully-qualified URIs. /bob.html won't work. See RFC 3986 for the appropriate method to turn a relative URI into an absolute one given its context. | ||
* | ||
* Note that you probably want to either call this in combo with is_https_uri(). | ||
* i.e. if(isHttpUri(uri) || isHttpsUri(uri)) console.log('Good'); | ||
* or use the convenience method isWebUri which is equivalent. | ||
* @param value - The potential URI to test. | ||
* @returns The untainted RFC 3986 URI on success, undefined on failure. | ||
*/ | ||
export function isHttpUri(value: string): string | undefined; | ||
/** | ||
* Is the value a well-formed HTTPS uri? | ||
*See is_http_uri() for details. This version only likes the https URI scheme. Otherwise it's identical to is_http_uri(). | ||
* @param value - The potential URI to test. | ||
* @returns The untainted RFC 3986 URI on success, undefined on failure. | ||
*/ | ||
export function isHttpsUri(value: string): string | undefined; | ||
/** | ||
* Is the value a well-formed HTTP or HTTPS uri? | ||
* This is just a convenience method that combines isHttpUri and isHttpsUri to accept most common real-world URLs. | ||
* @param value - The potential URI to test. | ||
* @returns The untainted RFC 3986 URI on success, undefined on failure. | ||
*/ | ||
export function isWebUri(value: string): string | undefined; | ||
```` | ||
### Additional Details | ||
* Last updated: Wed, 25 Mar 2020 07:03:41 GMT | ||
* Last updated: Wed, 15 Feb 2023 19:32:46 GMT | ||
* Dependencies: none | ||
@@ -17,2 +64,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Steve Hipwell](https://github.com/stevehipwell), and [Gabriel Cangussu](https://github.com/gcangussu). | ||
These definitions were written by [Gabriel Cangussu](https://github.com/gcangussu). |
Sorry, the diff of this file is not supported yet
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7409
0
64
71600
39