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

Function rowMatchesPluginStorageWhere

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

Source from the content-addressed store, hash-verified

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

Callers 1

queryCollectionFunction · 0.85

Calls 4

pluginStorageDataFieldFunction · 0.85
matchesWhereOperatorsFunction · 0.85

Tested by

no test coverage detected