« get me outta code hell

data, replacer: withContentNodes, splitContentNodesAround - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/withContentNodes.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-01 16:49:02 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-06 12:29:06 -0300
commit2e5b3352a3ab82e4d6fa249f3c74fb8a1f8fad04 (patch)
treecde0493e1771c160a1531416b2172810a480ff5a /src/data/composite/wiki-data/withContentNodes.js
parent301f1466b9d0e2e04d5bed6b948cae6683d61224 (diff)
data, replacer: withContentNodes, splitContentNodesAround
Diffstat (limited to 'src/data/composite/wiki-data/withContentNodes.js')
-rw-r--r--src/data/composite/wiki-data/withContentNodes.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/data/composite/wiki-data/withContentNodes.js b/src/data/composite/wiki-data/withContentNodes.js
new file mode 100644
index 00000000..25352020
--- /dev/null
+++ b/src/data/composite/wiki-data/withContentNodes.js
@@ -0,0 +1,25 @@
+import {input, templateCompositeFrom} from '#composite';
+import {parseInput} from '#replacer';
+
+export default templateCompositeFrom({
+  annotation: `withContentNodes`,
+
+  inputs: {
+    from: input({type: 'string', acceptsNull: false}),
+  },
+
+  outputs: ['#contentNodes'],
+
+  steps: () => [
+    {
+      dependencies: [input('from')],
+
+      compute: (continuation, {
+        [input('from')]: string,
+      }) => continuation({
+        ['#contentNodes']:
+          parseInput(string),
+      }),
+    },
+  ],
+});