diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-05-01 12:43:58 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-05-06 12:29:05 -0300 |
commit | cad44bfd247272ea8c11764d3b65dfd6a1b2b224 (patch) | |
tree | c9494dc8febb039951dc70f7ea7837c3839bda3a /src/data/composite/things/commentary-entry | |
parent | 4c99ad241cd8d34c0a6a68a4edac15b869ce6ee1 (diff) |
data: #things/commentary-entry -> #things/content
Diffstat (limited to 'src/data/composite/things/commentary-entry')
-rw-r--r-- | src/data/composite/things/commentary-entry/index.js | 1 | ||||
-rw-r--r-- | src/data/composite/things/commentary-entry/withWebArchiveDate.js | 41 |
2 files changed, 0 insertions, 42 deletions
diff --git a/src/data/composite/things/commentary-entry/index.js b/src/data/composite/things/commentary-entry/index.js deleted file mode 100644 index 091bae1a..00000000 --- a/src/data/composite/things/commentary-entry/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default as withWebArchiveDate} from './withWebArchiveDate.js'; diff --git a/src/data/composite/things/commentary-entry/withWebArchiveDate.js b/src/data/composite/things/commentary-entry/withWebArchiveDate.js deleted file mode 100644 index 3aaa4f64..00000000 --- a/src/data/composite/things/commentary-entry/withWebArchiveDate.js +++ /dev/null @@ -1,41 +0,0 @@ -import {input, templateCompositeFrom} from '#composite'; - -import {raiseOutputWithoutDependency} from '#composite/control-flow'; - -export default templateCompositeFrom({ - annotation: `withWebArchiveDate`, - - outputs: ['#webArchiveDate'], - - steps: () => [ - { - dependencies: ['annotation'], - - compute: (continuation, {annotation}) => - continuation({ - ['#dateText']: - annotation - ?.match(/https?:\/\/web.archive.org\/web\/([0-9]{8,8})[0-9]*\//) - ?.[1] ?? - null, - }), - }, - - raiseOutputWithoutDependency({ - dependency: '#dateText', - output: input.value({['#webArchiveDate']: null}), - }), - - { - dependencies: ['#dateText'], - compute: (continuation, {['#dateText']: dateText}) => - continuation({ - ['#webArchiveDate']: - new Date( - dateText.slice(0, 4) + '/' + - dateText.slice(4, 6) + '/' + - dateText.slice(6, 8)), - }), - }, - ], -}); |