(target: TargetVersion, data: VersionChanges<T>)
| 29 | * easy iterable array. |
| 30 | */ |
| 31 | export function getChangesForTarget<T>(target: TargetVersion, data: VersionChanges<T>): T[] { |
| 32 | if (!data) { |
| 33 | const version = (TargetVersion as Record<string, string>)[target]; |
| 34 | throw new Error(`No data could be found for target version: ${version}`); |
| 35 | } |
| 36 | |
| 37 | return (data[target] || []).reduce((result, prData) => result.concat(prData.changes), [] as T[]); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Gets all changes from the specified version changes object. This is helpful in case a migration |
no outgoing calls
no test coverage detected