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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1478 isPluginStorageRecord(data) ? data[field] : undefined;
1479
1480const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1481 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1482 if (operator === "in") {
1483 return (
1484 Array.isArray(operand) &&
1485 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1486 );
1487 }
1488 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1489 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1490 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1491 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1492 return false;
1493};
1494
1495const matchesWhereOperators = (
1496 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected