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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

1131};
1132
1133const rowMatchesPluginStorageWhere = (
1134 row: CoreRow<"plugin_storage">,
1135 where: Readonly<Record<string, unknown>> | undefined,
1136): boolean => {
1137 if (!where) return true;
1138 for (const [field, condition] of Object.entries(where)) {
1139 const value = pluginStorageDataField(row.data, field);
1140 if (isPluginStorageWhereFilter(condition)) {
1141 if (!matchesWhereOperators(value, condition)) return false;
1142 } else if (comparePluginStorageValues(value, condition) !== 0) {
1143 return false;
1144 }
1145 }
1146 return true;
1147};
1148
1149const makePluginStorageFacade = (input: {
1150 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected