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

Function rowMatchesPluginStorageWhere

packages/core/sdk/src/executor.ts:1111–1125  ·  view source on GitHub ↗
(
  row: CoreRow<"plugin_storage">,
  where: Readonly<Record<string, unknown>> | undefined,
)

Source from the content-addressed store, hash-verified

1109};
1110
1111const rowMatchesPluginStorageWhere = (
1112 row: CoreRow<"plugin_storage">,
1113 where: Readonly<Record<string, unknown>> | undefined,
1114): boolean => {
1115 if (!where) return true;
1116 for (const [field, condition] of Object.entries(where)) {
1117 const value = pluginStorageDataField(row.data, field);
1118 if (isPluginStorageWhereFilter(condition)) {
1119 if (!matchesWhereOperators(value, condition)) return false;
1120 } else if (comparePluginStorageValues(value, condition) !== 0) {
1121 return false;
1122 }
1123 }
1124 return true;
1125};
1126
1127const makePluginStorageFacade = (input: {
1128 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected