diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 14:13:55 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 14:13:55 -0400 |
commit | 95cd0873ca80f05acb4100ebe08bc43e8107a429 (patch) | |
tree | 55771ce36b8aec6201b9161465505a3f62eb5605 /src/reverse.js | |
parent | 5b16090a206db99a266fcc006921782b37f8d1a0 (diff) |
find, reverse: factor out some common interfaces & stub reverse
no bindReverse yet
Diffstat (limited to 'src/reverse.js')
-rw-r--r-- | src/reverse.js | 32 |
1 files changed, 32 insertions, 0 deletions
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}), +}); |