Fix "decend" typo

Signed-off-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
Tulir Asokan
2019-10-13 14:10:11 +03:00
parent a160bdf4df
commit 29367766fd
2 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ import DocumentOffset from "./offset";
export function walkDOMDepthFirst(rootNode, enterNodeCallback, leaveNodeCallback) {
let node = rootNode.firstChild;
while (node && node !== rootNode) {
const shouldDecend = enterNodeCallback(node);
if (shouldDecend && node.firstChild) {
const shouldDescend = enterNodeCallback(node);
if (shouldDescend && node.firstChild) {
node = node.firstChild;
} else if (node.nextSibling) {
node = node.nextSibling;