close

parseClassName

Parse a machine-readable class ID into display-friendly components.

Serialized class instances reference their class with machine-readable IDs like class//./src/models//User. This function parses them into components suitable for display in a UI.

import { parseClassName } from "workflow/observability"; 

const parsed = parseClassName("class//./src/models//User"); 
// parsed?.shortName → "User"
// parsed?.moduleSpecifier → "./src/models"
// parsed?.functionName → "User"

API Signature

Parameters

ParameterTypeDescription
namestringThe machine-readable class ID

Returns

{ shortName: string; moduleSpecifier: string; functionName: string } | null

PropertyDescription
shortNameThe display name of the class (e.g. "User").
moduleSpecifierThe module the class is defined in — a relative path (./src/models) or a package specifier (point@0.0.1).
functionNameThe class name as recorded by the compiler.

Returns null when the input is not a valid class ID.

On this page

GitHubEdit this page on GitHub