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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

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

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected