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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

1123};
1124
1125const rowMatchesPluginStorageWhere = (
1126 row: CoreRow<"plugin_storage">,
1127 where: Readonly<Record<string, unknown>> | undefined,
1128): boolean => {
1129 if (!where) return true;
1130 for (const [field, condition] of Object.entries(where)) {
1131 const value = pluginStorageDataField(row.data, field);
1132 if (isPluginStorageWhereFilter(condition)) {
1133 if (!matchesWhereOperators(value, condition)) return false;
1134 } else if (comparePluginStorageValues(value, condition) !== 0) {
1135 return false;
1136 }
1137 }
1138 return true;
1139};
1140
1141const makePluginStorageFacade = (input: {
1142 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected