MCPcopy Create free account
hub / github.com/codemix/graph / getLabelFromElementId

Function getLabelFromElementId

packages/graph/src/GraphStorage.ts:25–32  ·  view source on GitHub ↗
(id: ElementId<TLabel>)

Source from the content-addressed store, hash-verified

23 * @returns The label.
24 */
25export function getLabelFromElementId<const TLabel extends string>(id: ElementId<TLabel>): TLabel {
26 for (let i = 0; i < id.length; i++) {
27 if (id.charAt(i) === ":") {
28 return id.slice(0, i) as TLabel;
29 }
30 }
31 throw new Error(`Invalid element id: ${id}`);
32}
33
34export interface GraphStorage {
35 /**

Callers 10

getElementByIdMethod · 0.85
updatePropertyMethod · 0.85
getVerticesMethod · 0.85
getEdgesMethod · 0.85
buildIndexMethod · 0.85
onElementAddMethod · 0.85
onElementRemoveMethod · 0.85
onPropertyUpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected