( row: CoreRow<"plugin_storage">, where: Readonly<Record<string, unknown>> | undefined, )
| 1489 | }; |
| 1490 | |
| 1491 | const rowMatchesPluginStorageWhere = ( |
| 1492 | row: CoreRow<"plugin_storage">, |
| 1493 | where: Readonly<Record<string, unknown>> | undefined, |
| 1494 | ): boolean => { |
| 1495 | if (!where) return true; |
| 1496 | for (const [field, condition] of Object.entries(where)) { |
| 1497 | const value = pluginStorageDataField(row.data, field); |
| 1498 | if (isPluginStorageWhereFilter(condition)) { |
| 1499 | if (!matchesWhereOperators(value, condition)) return false; |
| 1500 | } else if (comparePluginStorageValues(value, condition) !== 0) { |
| 1501 | return false; |
| 1502 | } |
| 1503 | } |
| 1504 | return true; |
| 1505 | }; |
| 1506 | |
| 1507 | const makePluginStorageFacade = (input: { |
| 1508 | readonly core: CoreDb; |
no test coverage detected