From 95cd0873ca80f05acb4100ebe08bc43e8107a429 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" <qznebula@protonmail.com> Date: Sat, 11 Jan 2025 14:13:55 -0400 Subject: find, reverse: factor out some common interfaces & stub reverse no bindReverse yet --- src/reverse.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/reverse.js (limited to 'src/reverse.js') diff --git a/src/reverse.js b/src/reverse.js new file mode 100644 index 00000000..b5a4bf4c --- /dev/null +++ b/src/reverse.js @@ -0,0 +1,32 @@ +import {findSpec, getAllSpecs, tokenProxy} from './find-reverse.js'; + +const hardcodedReverseSpecs = {}; + +const findReverseHelperConfig = { + word: `reverse`, + constructorKey: Symbol.for('Thing.reverseSpecs'), + + hardcodedSpecs: hardcodedReverseSpecs, + postprocessSpec: postprocessReverseSpec, +}; + +export function postprocessReverseSpec(spec, {thingConstructor}) { + const newSpec = {...spec}; + + void thingConstructor; + + return newSpec; +} + +export function getAllReverseSpecs() { + return getAllSpecs(findReverseHelperConfig); +} + +export function findReverseSpec(key) { + return findSpec(key, findReverseHelperConfig); +} + +export default tokenProxy({ + findSpec: findReverseSpec, + prepareBehavior: spec => from => ({spec, from}), +}); -- cgit 1.3.0-6-gf8a5