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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

1503};
1504
1505const rowMatchesPluginStorageWhere = (
1506 row: CoreRow<"plugin_storage">,
1507 where: Readonly<Record<string, unknown>> | undefined,
1508): boolean => {
1509 if (!where) return true;
1510 for (const [field, condition] of Object.entries(where)) {
1511 const value = pluginStorageDataField(row.data, field);
1512 if (isPluginStorageWhereFilter(condition)) {
1513 if (!matchesWhereOperators(value, condition)) return false;
1514 } else if (comparePluginStorageValues(value, condition) !== 0) {
1515 return false;
1516 }
1517 }
1518 return true;
1519};
1520
1521const makePluginStorageFacade = (input: {
1522 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected