( row: CoreRow<"plugin_storage">, where: Readonly<Record<string, unknown>> | undefined, )
| 1503 | }; |
| 1504 | |
| 1505 | const rowMatchesPluginStorageWhere = ( |
| 1506 | row: CoreRow<"plugin_storage">, |
| 1507 | where: Readonly<Record<string, unknown>> | undefined, |
| 1508 | ): boolean => { |
| 1509 | if (!where) return true; |
| 1510 | for (const [field, condition] of Object.entries(where)) { |
| 1511 | const value = pluginStorageDataField(row.data, field); |
| 1512 | if (isPluginStorageWhereFilter(condition)) { |
| 1513 | if (!matchesWhereOperators(value, condition)) return false; |
| 1514 | } else if (comparePluginStorageValues(value, condition) !== 0) { |
| 1515 | return false; |
| 1516 | } |
| 1517 | } |
| 1518 | return true; |
| 1519 | }; |
| 1520 | |
| 1521 | const makePluginStorageFacade = (input: { |
| 1522 | readonly core: CoreDb; |
no test coverage detected