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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1098 isPluginStorageRecord(data) ? data[field] : undefined;
1099
1100const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1101 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1102 if (operator === "in") {
1103 return (
1104 Array.isArray(operand) &&
1105 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1106 );
1107 }
1108 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1109 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1110 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1111 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1112 return false;
1113};
1114
1115const matchesWhereOperators = (
1116 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected