Plato on Github
Report Home
node_modules/domutils/lib/traversal.js
Maintainability
89.59
Lines of code
24
Difficulty
15.60
Estimated Errors
0.15
Function weight
By Complexity
By SLOC
var getChildren = exports.getChildren = function(elem){ return elem.children; }; var getParent = exports.getParent = function(elem){ return elem.parent; }; exports.getSiblings = function(elem){ var parent = getParent(elem); return parent ? getChildren(parent) : [elem]; }; exports.getAttributeValue = function(elem, name){ return elem.attribs && elem.attribs[name]; }; exports.hasAttrib = function(elem, name){ return hasOwnProperty.call(elem.attribs, name); }; exports.getName = function(elem){ return elem.name; };