Skip to content

elementUriToEntryUri

elementUriToEntryUri(registryEntryUri): EntriesUri

Converts a registry entry URI to a simpler identifier URI.

registryEntryUri: `entry:cord:${string}`

The registry entry URI to be converted. Format: ‘entry:cord::‘.

EntriesUri

A simplified identifier URI: ‘entry:cord:’.

This function processes a registry entry URI and returns a URI containing only the identifier part.

const entryUri = 'entry:cord:1234:abcd';
const identifierUri = elementUriToEntryUri(entryUri);
console.log('Identifier URI:', identifierUri);

If the registryEntryUri does not conform to the expected format.

The function splits the registryEntryUri, validates its structure, and constructs a URI using only the identifier part.

identifier/src/Identifier.ts:945