(operator: string, value: unknown, operand: unknown)
| 1478 | isPluginStorageRecord(data) ? data[field] : undefined; |
| 1479 | |
| 1480 | const 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 | |
| 1495 | const matchesWhereOperators = ( |
| 1496 | value: unknown, |
no test coverage detected