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/context-protocol';
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.
parseFideId
Parse a Fide ID into its constituent components. Decomposes a Fide ID into entity type code (2 hex), reference type code (2 hex), and fingerprint (36 hex), converting type/source codes to their corresponding entity type names.