forked from srijanpaul-deepsource/bad-javascript-stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (19 loc) · 674 Bytes
/
script.js
File metadata and controls
24 lines (19 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const fs = require('fs');
// Function to generate a TypeScript object with 10 keys
function generateObject(index) {
let objectContent = `const obj${index} = {\n`;
for (let i = 0; i < 10; i++) {
objectContent += ` key${i}: 'value${index}_${i}',\n`;
}
objectContent += `};\n\n`;
return objectContent;
}
// Specify the number of objects you want to generate
const totalObjects = 1000;
let code = '';
for (let i = 0; i < totalObjects; i++) {
code += generateObject(i);
}
// Write the generated code to a .ts file
fs.writeFileSync('LargeTypeScriptFile.ts', code);
console.log('Generated LargeTypeScriptFile.ts with 1000 objects, each containing 10 keys.');