Module: nupp.io.URI
Parsing and inspection operations for immutable absolute URIs.
Module contents
Constructors
| Constructor | Description |
|---|---|
new | Parses and normalizes an absolute URI. |
Functions
| Function | Kind | Description |
|---|---|---|
isURI | function | Reports whether a value is a URI object. |
validate | function | Checks whether text is a valid absolute URI without retaining an object. |
Constructors#
newconstructor#
Parses and normalizes an absolute URI.
Arguments
| Name | Type | Description |
|---|---|---|
value | string | Components | URI text or its individual components |
Returns
| Type | Description |
|---|---|
URI? | the parsed URI, or nil on failure |
string? | a failure reason, when unsuccessful |
Functions#
isURIfunction#
Reports whether a value is a URI object.
local isURI: function(value: any): booleanArguments
| Name | Type | Description |
|---|---|---|
value | any | the value to inspect |
Returns
| Type | Description |
|---|---|
boolean | whether the value is a URI |
validatefunction#
Checks whether text is a valid absolute URI without retaining an object.
local validate: function(text: string): (boolean, string?)Arguments
| Name | Type | Description |
|---|---|---|
text | string | the URI text to validate |
Returns
| Type | Description |
|---|---|
boolean | whether the text is valid |
string? | a failure reason, when invalid |