MCPcopy Create free account
hub / github.com/Starcounter-Jack/JSON-Patch / getPath

Function getPath

module/helpers.mjs:109–118  ·  view source on GitHub ↗
(root, obj)

Source from the content-addressed store, hash-verified

107 return '';
108}
109export function getPath(root, obj) {
110 if (root === obj) {
111 return '/';
112 }
113 var path = _getPathRecursive(root, obj);
114 if (path === '') {
115 throw new Error("Object not found in root");
116 }
117 return "/" + path;
118}
119/**
120* Recursively checks whether an object has any undefined values inside.
121*/

Callers

nothing calls this directly

Calls 1

_getPathRecursiveFunction · 0.70

Tested by

no test coverage detected