Created
March 21, 2018 20:09
-
-
Save robfe/0e4cf56b2c87ccd8f663e7b960205672 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rows: string[] = []; | |
for (let count = 1; count <= 10; count++) { | |
let numbers = Array.from(new Array(count)).map((x, i) => i + 1); | |
let genericDef = numbers.map(x => `T${x} extends string`).join(', '); | |
let parameterDef = numbers.map(x => `a${x}: T${x}`).join(', '); | |
let recordDef = numbers.map(x => `T${x}`).join('|'); | |
rows.push(`<${genericDef}>(strings: TemplateStringsArray, ${parameterDef}): HasRouteTemplate & ((r: Record<${recordDef}, string>) => string);`); | |
} | |
console.log('\n\n' + rows.join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment