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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

885};
886
887const rowMatchesPluginStorageWhere = (
888 row: CoreRow<"plugin_storage">,
889 where: Readonly<Record<string, unknown>> | undefined,
890): boolean => {
891 if (!where) return true;
892 for (const [field, condition] of Object.entries(where)) {
893 const value = pluginStorageDataField(row.data, field);
894 if (isPluginStorageWhereFilter(condition)) {
895 if (!matchesWhereOperators(value, condition)) return false;
896 } else if (comparePluginStorageValues(value, condition) !== 0) {
897 return false;
898 }
899 }
900 return true;
901};
902
903const makePluginStorageFacade = (input: {
904 readonly core: CoreDb;

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected