normalizeReferenceIdentifier
Normalize a reference identifier for general entity usage. For http(s) URLs this canonicalizes protocol/host casing and removes default ports. Non-URL values are returned unchanged.
Node Runtime Required
This function requires a Node.js runtime and is disabled in the browser docs preview.
normalizeReferenceIdentifier(referenceIdentifier, options)
Parameters
referenceIdentifierstring*
Reference identifier value.
optionsNormalizeReferenceIdentifierOptions
Normalization options.
skipUrlNormalization
Returns
Prop
Type
import { normalizeReferenceIdentifier } from '@fide-work/id';
const result = normalizeReferenceIdentifier(
'https://x.com/Alice',
{"skipUrlNormalization":false}
);Type Definitions
type NormalizeReferenceIdentifierOptions
NormalizeReferenceIdentifierOptionsProperties
Prop
Type
normalizePropertyReferenceIdentifier
Normalize a property reference identifier to canonical URL form. Property reference identifiers must be canonical absolute `https` URLs without userinfo.
buildStatementReferenceIdentifier
Build the canonical reference identifier string for a Statement. Format: `s|p|o` (subject, property, object) separated by ASCII `|`. No whitespace. Always 155 chars. Validated at runtime via assertFideId.