.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / domutils / lib / traversal.js
1 var getChildren = exports.getChildren = function(elem){
2         return elem.children;
3 };
4
5 var getParent = exports.getParent = function(elem){
6         return elem.parent;
7 };
8
9 exports.getSiblings = function(elem){
10         var parent = getParent(elem);
11         return parent ? getChildren(parent) : [elem];
12 };
13
14 exports.getAttributeValue = function(elem, name){
15         return elem.attribs && elem.attribs[name];
16 };
17
18 exports.hasAttrib = function(elem, name){
19         return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
20 };
21
22 exports.getName = function(elem){
23         return elem.name;
24 };