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

Function getPath

commonjs/helpers.js:117–126  ·  view source on GitHub ↗
(root, obj)

Source from the content-addressed store, hash-verified

115}
116exports._getPathRecursive = _getPathRecursive;
117function getPath(root, obj) {
118 if (root === obj) {
119 return '/';
120 }
121 var path = _getPathRecursive(root, obj);
122 if (path === '') {
123 throw new Error("Object not found in root");
124 }
125 return "/" + path;
126}
127exports.getPath = getPath;
128/**
129* Recursively checks whether an object has any undefined values inside.

Callers

nothing calls this directly

Calls 1

_getPathRecursiveFunction · 0.70

Tested by

no test coverage detected