Function
upsertByKey
(plugin: string, key: string, value: string)
Source from the content-addressed store, hash-verified
| 12 | } |
| 13 | |
| 14 | export async function upsertByKey(plugin: string, key: string, value: string) { |
| 15 | const doc = await getByKey(plugin, key); |
| 16 | return doc |
| 17 | ? update(doc, { |
| 18 | value, |
| 19 | }) |
| 20 | : create({ |
| 21 | plugin, |
| 22 | key, |
| 23 | value, |
| 24 | }); |
| 25 | } |
| 26 | |
| 27 | export async function removeByKey(plugin: string, key: string) { |
| 28 | return db.removeWhere<PluginData>(type, { plugin, key }); |
Callers
nothing calls this directly
Tested by
no test coverage detected