( poly: Pick<ChallengeFile, 'contents' | 'source'> & Rest )
| 126 | |
| 127 | // createSource(poly: PolyVinyl) => PolyVinyl |
| 128 | export function createSource<Rest>( |
| 129 | poly: Pick<ChallengeFile, 'contents' | 'source'> & Rest |
| 130 | ): Rest & { contents: string; source: string } { |
| 131 | return { |
| 132 | ...poly, |
| 133 | source: poly.source ?? poly.contents |
| 134 | }; |
| 135 | } |