( plugins: SqlCommenterPlugin[], context: SqlCommenterContext, )
| 40 | * that could affect other plugins. |
| 41 | */ |
| 42 | export function applySqlCommenters( |
| 43 | plugins: SqlCommenterPlugin[], |
| 44 | context: SqlCommenterContext, |
| 45 | ): Record<string, string> { |
| 46 | const merged: Record<string, string> = {} |
| 47 | |
| 48 | for (const plugin of plugins) { |
| 49 | const tags = plugin(klona(context)) |
| 50 | for (const [key, value] of Object.entries(tags)) { |
| 51 | if (value !== undefined) { |
| 52 | merged[key] = value |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | return merged |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Applies SQL commenter plugins and returns the formatted comment. |
no test coverage detected