docs: use Node.TEXT_NODE in more places

pull/7738/head
Conduitry 6 years ago
parent 1377c46a15
commit d3cac382d5

@ -893,7 +893,7 @@ A custom transition function can also return a `tick` function, which is called
function typewriter(node, { speed = 50 }) { function typewriter(node, { speed = 50 }) {
const valid = ( const valid = (
node.childNodes.length === 1 && node.childNodes.length === 1 &&
node.childNodes[0].nodeType === 3 node.childNodes[0].nodeType === Node.TEXT_NODE
); );
if (!valid) return {}; if (!valid) return {};

@ -4,7 +4,7 @@
function typewriter(node, { speed = 50 }) { function typewriter(node, { speed = 50 }) {
const valid = ( const valid = (
node.childNodes.length === 1 && node.childNodes.length === 1 &&
node.childNodes[0].nodeType === 3 node.childNodes[0].nodeType === Node.TEXT_NODE
); );
if (!valid) { if (!valid) {
@ -33,4 +33,4 @@
<p in:typewriter> <p in:typewriter>
The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog
</p> </p>
{/if} {/if}

@ -4,7 +4,7 @@
function typewriter(node, { speed = 50 }) { function typewriter(node, { speed = 50 }) {
const valid = ( const valid = (
node.childNodes.length === 1 && node.childNodes.length === 1 &&
node.childNodes[0].nodeType === 3 node.childNodes[0].nodeType === Node.TEXT_NODE
); );
if (!valid) { if (!valid) {
@ -33,4 +33,4 @@
<p in:typewriter> <p in:typewriter>
The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog
</p> </p>
{/if} {/if}

Loading…
Cancel
Save