docs: use Node.TEXT_NODE in more places

pull/4670/head
Conduitry 4 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 }) {
const valid = (
node.childNodes.length === 1 &&
node.childNodes[0].nodeType === 3
node.childNodes[0].nodeType === Node.TEXT_NODE
);
if (!valid) return {};

@ -4,7 +4,7 @@
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) {
@ -33,4 +33,4 @@
<p in:typewriter>
The quick brown fox jumps over the lazy dog
</p>
{/if}
{/if}

@ -4,7 +4,7 @@
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) {
@ -33,4 +33,4 @@
<p in:typewriter>
The quick brown fox jumps over the lazy dog
</p>
{/if}
{/if}

Loading…
Cancel
Save