MCPcopy Create free account
hub / github.com/Kong/insomnia / upsertByKey

Function upsertByKey

packages/insomnia-data/node-src/services/plugin-data.ts:14–25  ·  view source on GitHub ↗
(plugin: string, key: string, value: string)

Source from the content-addressed store, hash-verified

12}
13
14export 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
27export async function removeByKey(plugin: string, key: string) {
28 return db.removeWhere<PluginData>(type, { plugin, key });

Callers

nothing calls this directly

Calls 3

getByKeyFunction · 0.85
updateFunction · 0.70
createFunction · 0.70

Tested by

no test coverage detected