( row: CoreRow<"plugin_storage">, where: Readonly<Record<string, unknown>> | undefined, )
| 1131 | }; |
| 1132 | |
| 1133 | const rowMatchesPluginStorageWhere = ( |
| 1134 | row: CoreRow<"plugin_storage">, |
| 1135 | where: Readonly<Record<string, unknown>> | undefined, |
| 1136 | ): boolean => { |
| 1137 | if (!where) return true; |
| 1138 | for (const [field, condition] of Object.entries(where)) { |
| 1139 | const value = pluginStorageDataField(row.data, field); |
| 1140 | if (isPluginStorageWhereFilter(condition)) { |
| 1141 | if (!matchesWhereOperators(value, condition)) return false; |
| 1142 | } else if (comparePluginStorageValues(value, condition) !== 0) { |
| 1143 | return false; |
| 1144 | } |
| 1145 | } |
| 1146 | return true; |
| 1147 | }; |
| 1148 | |
| 1149 | const makePluginStorageFacade = (input: { |
| 1150 | readonly core: CoreDb; |
no test coverage detected