( row: CoreRow<"plugin_storage">, where: Readonly<Record<string, unknown>> | undefined, )
| 1122 | }; |
| 1123 | |
| 1124 | const rowMatchesPluginStorageWhere = ( |
| 1125 | row: CoreRow<"plugin_storage">, |
| 1126 | where: Readonly<Record<string, unknown>> | undefined, |
| 1127 | ): boolean => { |
| 1128 | if (!where) return true; |
| 1129 | for (const [field, condition] of Object.entries(where)) { |
| 1130 | const value = pluginStorageDataField(row.data, field); |
| 1131 | if (isPluginStorageWhereFilter(condition)) { |
| 1132 | if (!matchesWhereOperators(value, condition)) return false; |
| 1133 | } else if (comparePluginStorageValues(value, condition) !== 0) { |
| 1134 | return false; |
| 1135 | } |
| 1136 | } |
| 1137 | return true; |
| 1138 | }; |
| 1139 | |
| 1140 | const makePluginStorageFacade = (input: { |
| 1141 | readonly core: CoreDb; |
no test coverage detected