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

Function escapeIdForPath

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

* RFC 6902 JSON Pointer escaping for an hf-id (bare or scoped). * Scoped ids contain "/" which must be encoded as "~1" in a path segment. * "~" must be encoded as "~0" first (order matters per RFC 6902 §3).

(id: string)

Source from the content-addressed store, hash-verified

36 * "~" must be encoded as "~0" first (order matters per RFC 6902 §3).
37 */
38function escapeIdForPath(id: string): string {
39 return id.replace(/~/g, "~0").replace(/\//g, "~1");
40}
41
42/** Decode a path segment that may contain RFC 6902-escaped characters back to an hf-id. */
43function decodePathSegment(segment: string): string {

Callers 7

stylePathFunction · 0.85
textPathFunction · 0.85
attrPathFunction · 0.85
timingPathFunction · 0.85
holdPathFunction · 0.85
elementPathFunction · 0.85
keyToPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected