Make text node type more explicit

Instead of placing magic numbers around, I feel this should better portray what this is.
pull/4663/head
Ademola 6 years ago committed by GitHub
parent 1087e31059
commit 917bb8eb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@ While you should generally use CSS for transitions as much as possible, there ar
function typewriter(node, { speed = 50 }) {
const valid = (
node.childNodes.length === 1 &&
node.childNodes[0].nodeType === 3
node.childNodes[0].nodeType === Node.TEXT_NODE
);
if (!valid) {
@ -26,4 +26,4 @@ function typewriter(node, { speed = 50 }) {
}
};
}
```
```

Loading…
Cancel
Save