Skip to content

Instantly share code, notes, and snippets.

@vkurchatkin
Created September 9, 2017 16:51
Show Gist options
  • Save vkurchatkin/7e5736c85a748b1aa484df0c4f14ec69 to your computer and use it in GitHub Desktop.
Save vkurchatkin/7e5736c85a748b1aa484df0c4f14ec69 to your computer and use it in GitHub Desktop.
'use strict';
const fs = require('fs');
const n = 1000;
const m = 100;
for (let i = 0; i < n; i++) {
const contents = `
/* @flow */
${
Array(m).fill().map(
(_, i) =>
`
type T${i} = {
foo: number,
bar: string,
};
export function testT${i}(v: T${i}) {
}
import { testT${i} as testT${i}_ } from './${Math.random() * n >>> 0}'
testT${i}_({ foo: 1, bar: '2' });
`
).join('\n')
}
`
fs.writeFileSync(`./src/f/${i}.ts`, contents);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment