(attrs, callback, path, depth)
| 400 | } |
| 401 | |
| 402 | function crawl(attrs, callback, path, depth) { |
| 403 | Object.keys(attrs).forEach(function(attrName) { |
| 404 | var attr = attrs[attrName]; |
| 405 | |
| 406 | if(attrName[0] === '_') return; |
| 407 | |
| 408 | var thisPath = path + (depth > 0 ? '.' : '') + attrName; |
| 409 | |
| 410 | if(Lib.isPlainObject(attr)) { |
| 411 | crawl(attr, callback, thisPath, depth + 1); |
| 412 | } else { |
| 413 | // Only execute the callback on leaf nodes: |
| 414 | callback(thisPath, attrName, attr); |
| 415 | } |
| 416 | }); |
| 417 | } |
no test coverage detected
searching dependent graphs…