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

Function matchesWhereOperator

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

Source from the content-addressed store, hash-verified

1384 isPluginStorageRecord(data) ? data[field] : undefined;
1385
1386const matchesWhereOperator = (operator: string, value: unknown, operand: unknown): boolean => {
1387 if (operator === "eq") return comparePluginStorageValues(value, operand) === 0;
1388 if (operator === "in") {
1389 return (
1390 Array.isArray(operand) &&
1391 operand.some((item) => comparePluginStorageValues(value, item) === 0)
1392 );
1393 }
1394 if (operator === "gt") return comparePluginStorageValues(value, operand) > 0;
1395 if (operator === "gte") return comparePluginStorageValues(value, operand) >= 0;
1396 if (operator === "lt") return comparePluginStorageValues(value, operand) < 0;
1397 if (operator === "lte") return comparePluginStorageValues(value, operand) <= 0;
1398 return false;
1399};
1400
1401const matchesWhereOperators = (
1402 value: unknown,

Callers 1

matchesWhereOperatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected