( populate: PopulateOptions<Entity>[], hints: Record<string, PopulateHintOptions>, )
| 121 | * @internal |
| 122 | */ |
| 123 | export function applyPopulateHints<Entity>( |
| 124 | populate: PopulateOptions<Entity>[], |
| 125 | hints: Record<string, PopulateHintOptions>, |
| 126 | ): void { |
| 127 | for (const [path, hint] of Object.entries(hints)) { |
| 128 | const entry = findPopulateEntry(populate, path.split('.')); |
| 129 | |
| 130 | if (!entry) { |
| 131 | continue; |
| 132 | } |
| 133 | |
| 134 | for (const key of Object.keys(hint) as (keyof PopulateHintOptions)[]) { |
| 135 | if (hint[key] != null) { |
| 136 | (entry as Record<string, unknown>)[key] = hint[key]; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
no test coverage detected