( row: CoreRow<"plugin_storage">, where: Readonly<Record<string, unknown>> | undefined, )
| 1109 | }; |
| 1110 | |
| 1111 | const rowMatchesPluginStorageWhere = ( |
| 1112 | row: CoreRow<"plugin_storage">, |
| 1113 | where: Readonly<Record<string, unknown>> | undefined, |
| 1114 | ): boolean => { |
| 1115 | if (!where) return true; |
| 1116 | for (const [field, condition] of Object.entries(where)) { |
| 1117 | const value = pluginStorageDataField(row.data, field); |
| 1118 | if (isPluginStorageWhereFilter(condition)) { |
| 1119 | if (!matchesWhereOperators(value, condition)) return false; |
| 1120 | } else if (comparePluginStorageValues(value, condition) !== 0) { |
| 1121 | return false; |
| 1122 | } |
| 1123 | } |
| 1124 | return true; |
| 1125 | }; |
| 1126 | |
| 1127 | const makePluginStorageFacade = (input: { |
| 1128 | readonly core: CoreDb; |
no test coverage detected