From 8a0fb4488ccb5dc5c799fe44977ca55edadba3cb Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 15 Apr 2021 13:34:19 -0300 Subject: make data in text nodes string (cur: 84k/sec) This doesn't actually impact the performance at all, 8ut it's going to 8e nicer to work with later. --- upd8.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/upd8.js b/upd8.js index 3b495b9..37b72ae 100755 --- a/upd8.js +++ b/upd8.js @@ -997,9 +997,7 @@ const replacerSpec = { return ( nodes.length === 0 ? null : nodes.length === 1 ? nodes[0] : - makeNode(i, 'text', { - string: nodes.map(node => node.string).join(' ') - }) + makeNode(i, 'text', nodes.map(node => node.string).join(' ')) ); }; @@ -1011,7 +1009,7 @@ const replacerSpec = { const pushTextNode = () => { if (string.length) { - nodes.push(makeNode(iString, 'text', {string})); + nodes.push(makeNode(iString, 'text', string)); string = ''; } }; -- cgit 1.3.0-6-gf8a5