Required
module Required| Assembly | Fable.UrlParser |
Functions and values
custom<'A, 'Output> (key: string) (typeName: string) (tryParse: string -> 'A option) (innerParser: UrlParser<('A -> 'Output)>) : UrlParser<'Output>
custom<'A, 'Output> (key: string) (typeName: string) (tryParse: string -> 'A option) (innerParser: UrlParser<('A -> 'Output)>) : UrlParser<'Output>Parse a single query parameter, using a custom conversion function.
This function will fail if:
- The key is absent.
tryParsereturnsNonefor the value.- The key is present more than once in the query.
| Parameter | |
|---|---|
key | Key to look up |
typeName | Name reported in the error message when conversion fails, e.g. "Guid" |
tryParse | Function attempting to convert the value string into 'A |
innerParser | Parser to apply |
Returns. The converted value if the key is present exactly once and converts successfully
int<'Output> (key: string) (innerParser: UrlParser<(int -> 'Output)>) : UrlParser<'Output>
int<'Output> (key: string) (innerParser: UrlParser<(int -> 'Output)>) : UrlParser<'Output>Parse a single query parameter as an int.
This function will fail if:
- The key is absent.
- The key is present but cannot be parsed as a valid integer.
- The key is present more than once in the query.
| Parameter | |
|---|---|
key | Key to look up |
innerParser | Parser to apply |
Returns. The integer value if the key is present exactly once and is a valid int
string<'Output> (key: string) (innerParser: UrlParser<(string -> 'Output)>) : UrlParser<'Output>
string<'Output> (key: string) (innerParser: UrlParser<(string -> 'Output)>) : UrlParser<'Output>Parse a single query parameter as a string.
This function will fail if:
- The key is absent.
- The key is present more than once in the query.
| Parameter | |
|---|---|
key | Key to look up |
innerParser | Parser to apply |
Returns. The string value if the key is present exactly once