From 917bb8eb449a84d7e570cd7c9f0cc86ddb03c94d Mon Sep 17 00:00:00 2001 From: Ademola Date: Sat, 11 Apr 2020 21:26:08 +0100 Subject: [PATCH] Make text node type more explicit Instead of placing magic numbers around, I feel this should better portray what this is. --- .../tutorial/10-transitions/05-custom-js-transitions/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md b/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md index da775bbeb3..cc25861c7b 100644 --- a/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md +++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/text.md @@ -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 }) { } }; } -``` \ No newline at end of file +```