Checks if a value is a valid IRI.
Validates IRIs according to RFC 3987 with variant-specific rules:
"absolute"
"internal"
/
"relative"
For non-absolute variants, rejects paths where .. segments would climb above the root.
..
Excluded characters (per RFC 3987 § 2.2): Control characters (U+0000-U+001F, U+007F-U+009F), whitespace, and < > " { } | \ ^ `` (backtick)
< > " { } | \ ^ ``
The value to validate as an IRI
The identifier variant to validate against (default: "absolute")
true if the value is a string conforming to IRI syntax rules for the specified variant
true
This function serves as a type guard, narrowing the type from string to IRI when used in conditional checks.
string
Checks if a value is a valid IRI.
Validates IRIs according to RFC 3987 with variant-specific rules:
"absolute": Must contain a valid scheme followed by non-empty scheme-specific part"internal": Root-relative path starting with/, or opaque scheme-specific part"relative": Any relative referenceFor non-absolute variants, rejects paths where
..segments would climb above the root.Excluded characters (per RFC 3987 § 2.2): Control characters (U+0000-U+001F, U+007F-U+009F), whitespace, and
< > " { } | \ ^ ``(backtick)