MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / put

Function put

packages/plugins/apps/src/plugin/store.test.ts:34–49  ·  view source on GitHub ↗
(input: {
    readonly owner: "org" | "user";
    readonly collection: string;
    readonly key: string;
    readonly data: object;
  })

Source from the content-addressed store, hash-verified

32 const rowKey = (owner: string, collection: string, key: string) =>
33 `${owner}:${collection}:${key}`;
34 const put = (input: {
35 readonly owner: "org" | "user";
36 readonly collection: string;
37 readonly key: string;
38 readonly data: object;
39 }) =>
40 Effect.sync(() => {
41 const next = entry({
42 owner: input.owner,
43 collection: input.collection,
44 key: input.key,
45 data: input.data,
46 });
47 rows.set(rowKey(input.owner, input.collection, input.key), next);
48 return next;
49 });
50 return {
51 collection: <const TDefinition extends PluginStorageCollectionDefinition>(
52 definition: TDefinition,

Callers 1

makeMemoryPluginStorageFunction · 0.85

Calls 4

entryFunction · 0.85
setMethod · 0.80
rowKeyFunction · 0.70
syncMethod · 0.65

Tested by

no test coverage detected