MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / decodePathSegment

Function decodePathSegment

packages/sdk/src/engine/patches.ts:43–46  ·  view source on GitHub ↗

Decode a path segment that may contain RFC 6902-escaped characters back to an hf-id.

(segment: string)

Source from the content-addressed store, hash-verified

41
42/** Decode a path segment that may contain RFC 6902-escaped characters back to an hf-id. */
43function decodePathSegment(segment: string): string {
44 // RFC 6902 §3: unescape ~1 → /, then ~0 → ~ (reverse order)
45 return segment.replace(/~1/g, "/").replace(/~0/g, "~");
46}
47
48export function stylePath(id: string, prop: string): string {
49 return `/elements/${escapeIdForPath(id)}/inlineStyles/${prop}`;

Callers 1

pathToKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected