diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 00:10:27 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 00:10:27 -0400 |
commit | 8bbd9ac0b5cf8cc64ccbae7ae16b23f05d93d880 (patch) | |
tree | 5fa425a301904e9bfddb5c0a454e386089d97ac3 /src/data | |
parent | 9f81a9395a68e7f1c00e4e0340911c09975eded3 (diff) |
data: inputSoupyFind.input()
occasionally we use a soupyFind.input() from #composite/wiki-data code, so this exposes a no-dependency frontend for that token
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/composite/wiki-data/inputSoupyFind.js | 10 | ||||
-rw-r--r-- | src/data/composite/wiki-properties/soupyFind.js | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/data/composite/wiki-data/inputSoupyFind.js b/src/data/composite/wiki-data/inputSoupyFind.js index 4ae7bd3b..020f4990 100644 --- a/src/data/composite/wiki-data/inputSoupyFind.js +++ b/src/data/composite/wiki-data/inputSoupyFind.js @@ -1,8 +1,8 @@ import {input} from '#composite'; import {anyOf, isFunction, isString} from '#validators'; -export default () => - input({ +function inputSoupyFind() { + return input({ validate: anyOf( isFunction, @@ -16,6 +16,12 @@ export default () => return true; }), }); +} + +inputSoupyFind.input = key => + input.value('_soupyFind:' + key); + +export default inputSoupyFind; export function getSoupyFindInputKey(value) { return value.slice('_soupyFind:'.length); diff --git a/src/data/composite/wiki-properties/soupyFind.js b/src/data/composite/wiki-properties/soupyFind.js index 87798588..b922e04a 100644 --- a/src/data/composite/wiki-properties/soupyFind.js +++ b/src/data/composite/wiki-properties/soupyFind.js @@ -1,6 +1,8 @@ import {input} from '#composite'; import {isObject} from '#validators'; +import {inputSoupyFind} from '#composite/wiki-data'; + function soupyFind() { return { flags: {update: true}, @@ -8,7 +10,6 @@ function soupyFind() { }; } -soupyFind.input = key => - input.value('_soupyFind:' + key); +soupyFind.input = inputSoupyFind.input; export default soupyFind; |