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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

1489};
1490
1491const rowMatchesPluginStorageWhere = (
1492 row: CoreRow<"plugin_storage">,
1493 where: Readonly<Record<string, unknown>> | undefined,
1494): boolean => {
1495 if (!where) return true;
1496 for (const [field, condition] of Object.entries(where)) {
1497 const value = pluginStorageDataField(row.data, field);
1498 if (isPluginStorageWhereFilter(condition)) {
1499 if (!matchesWhereOperators(value, condition)) return false;
1500 } else if (comparePluginStorageValues(value, condition) !== 0) {
1501 return false;
1502 }
1503 }
1504 return true;
1505};
1506
1507const makePluginStorageFacade = (input: {
1508 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected