« get me outta code hell

make data in text nodes string (cur: 84k/sec) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-04-15 13:34:19 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-04-15 13:34:19 -0300
commit8a0fb4488ccb5dc5c799fe44977ca55edadba3cb (patch)
tree003e1b89bb5e7ab02d88b6e2da6db3b2c715ab81
parentae755a3c27c12f2928aa4e32ac99a1736a286e20 (diff)
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.
-rwxr-xr-xupd8.js6
1 files 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 = '';
             }
         };