getURI()function
getURI(possible: Nullish<PossibleURI>): ImmutableURI | undefined
| Param | Type | |
|---|---|---|
possible | Nullish<PossibleURI> | Possible URI value to convert (a nullish value returns undefined). required |
| Return | |
|---|---|
ImmutableURI | undefined | Converted ImmutableURI, or undefined if conversion fails. |
Convert a possible URI to a URI, or return undefined if conversion fails.
- Only inputs that already encode a complete URI succeed — relative inputs return
undefined. No implicit fallback to the document or window URL. - To resolve a relative ref against a base, use
getBasedURI()fromurl.ts.
Examples
getURI("http://shax.com") // URL { … }