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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1464 isPluginStorageRecord(data) ? data[field] : undefined;
1465
1466const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1467 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1468 if (operator === "in") {
1469 return (
1470 Array.isArray(operand) &&
1471 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1472 );
1473 }
1474 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1475 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1476 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1477 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1478 return false;
1479};
1480
1481const matchesWhereOperators = (
1482 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected