time-to-botec/js/node_modules/@stdlib/assert/is-uri/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

49 lines
942 B
Plaintext

{{alias}}( value )
Tests if a value is a URI.
Parameters
----------
value: any
Value to test.
Returns
-------
bool: boolean
Boolean indicating whether value is a URI.
Examples
--------
> var bool = {{alias}}( 'http://google.com' )
true
> bool = {{alias}}( 'http://localhost/' )
true
> bool = {{alias}}( 'http://example.w3.org/path%20with%20spaces.html' )
true
> bool = {{alias}}( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' )
true
// No scheme:
> bool = {{alias}}( '' )
false
> bool = {{alias}}( 'foo@bar' )
false
> bool = {{alias}}( '://foo/' )
false
// Illegal characters:
> bool = {{alias}}( 'http://<foo>' )
false
// Invalid path:
> bool = {{alias}}( 'http:////foo.html' )
false
// Incomplete hex escapes:
> bool = {{alias}}( 'http://example.w3.org/%a' )
false
See Also
--------