UNPKG

grasp-equery

Version:

grasp query using example code with wildcards

21 lines (20 loc) 501 B
// Generated by LiveScript 1.5.0 (function(){ var attrMap, getNodeAtPath; attrMap = require('grasp-syntax-javascript').attrMap; getNodeAtPath = function(node, path){ var i$, len$, prop, that; for (i$ = 0, len$ = path.length; i$ < len$; ++i$) { prop = path[i$]; if ((that = node[attrMap[prop] || prop]) != null) { node = that; } else { return; } } return node; }; module.exports = { getNodeAtPath: getNodeAtPath }; }).call(this);