docs: use Node.TEXT_NODE in more places

pull/4670/head
Conduitry 6 years ago
parent 8ddb073199
commit 0d263cc1ea

@ -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