src/reattach.js
function depth(root) {
	let i = 0;
	let walker = document.createTreeWalker(root, 0xFFFFFFFF, {
		acceptNode: function(node){
			let nt = node.nodeType;
			return nt === 1 || nt === 3;
		}
	});

	while(walker.nextNode()) {
		i++;
	}
	return i;
}
function depth(root) {
	let i = 0;
	let walker = document.createTreeWalker(root, 0xFFFFFFFF, {
		acceptNode: function(node){
			let nt = node.nodeType;
			return nt === 1 || nt === 3;
		}
	});

	while(walker.nextNode()) {
		i++;
	}
	return i;
}
function depth ( root ) { let i = 0 ; let walker = document . createTreeWalker ( root , 0xFFFFFFFF , { acceptNode : function ( node ) { let nt = node . nodeType ; return nt === 1 || nt === 3 ; } } ) ; while ( walker . nextNode ( ) ) { i ++ ; } return i ; }
Get the depth of a Node
Get the depth of a Node