MCPcopy
hub / github.com/dianping/cat / get

Function get

cat-home/src/main/webapp/assets/js/editor/worker-xquery.js:2027–2040  ·  view source on GitHub ↗
(node, path)

Source from the content-addressed store, hash-verified

2025 var Handlers = require('./handlers');
2026
2027 var get = function(node, path){
2028 var result = [];
2029 if(path.length === 0){
2030 return node;
2031 }
2032 node.children.forEach(function(child){
2033 if(child.name === path[0] && path.length > 1) {
2034 result = get(child, path.slice(1));
2035 } else if(child.name === path[0]) {
2036 result.push(child);
2037 }
2038 });
2039 return result;
2040 };
2041
2042 var markers = [];
2043 this.apply = function(fn) {

Callers 1

worker-xquery.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected