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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1136 isPluginStorageRecord(data) ? data[field] : undefined;
1137
1138const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1139 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1140 if (operator === "in") {
1141 return (
1142 Array.isArray(operand) &&
1143 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1144 );
1145 }
1146 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1147 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1148 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1149 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1150 return false;
1151};
1152
1153const matchesWhereOperators = (
1154 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected