MCPcopy Index your code
hub / github.com/Starcounter-Jack/JSON-Patch / escapePathComponent

Function escapePathComponent

module/helpers.mjs:79–83  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

77* @return the Escaped path
78*/
79export function escapePathComponent(path) {
80 if (path.indexOf('/') === -1 && path.indexOf('~') === -1)
81 return path;
82 return path.replace(/~/g, '~0').replace(/\//g, '~1');
83}
84/**
85 * Unescapes a json pointer path
86 * @param path The escaped pointer

Callers 3

_generateFunction · 0.90
_generateFunction · 0.90
_getPathRecursiveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…