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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1084 isPluginStorageRecord(data) ? data[field] : undefined;
1085
1086const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1087 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1088 if (operator === "in") {
1089 return (
1090 Array.isArray(operand) &&
1091 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1092 );
1093 }
1094 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1095 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1096 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1097 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1098 return false;
1099};
1100
1101const matchesWhereOperators = (
1102 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected