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

Function matchesWhereOperator

packages/core/sdk/src/executor.ts:861–874  ·  view source on GitHub ↗
(operator: string, value: unknown, operand: unknown)

Source from the content-addressed store, hash-verified

859 isPluginStorageRecord(data) ? data[field] : undefined;
860
861const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
862 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
863 if (operator === "in") {
864 return (
865 Array.isArray(operand) &&
866 operand.some((item) => comparePluginStorageValues(value, item) === 0)
867 );
868 }
869 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
870 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
871 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
872 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
873 return false;
874};
875
876const matchesWhereOperators = (
877 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected