From 4092b36b1f8b1a86eafcdf4b351b14dd2d0d03ab Mon Sep 17 00:00:00 2001 From: Gabriel Rocheleau Date: Wed, 11 Sep 2024 16:17:55 -0400 Subject: [PATCH] statemanager: remove script file accidentally pushed --- packages/statemanager/test/testdata/script.js | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 packages/statemanager/test/testdata/script.js diff --git a/packages/statemanager/test/testdata/script.js b/packages/statemanager/test/testdata/script.js deleted file mode 100644 index 67e7d95aa2..0000000000 --- a/packages/statemanager/test/testdata/script.js +++ /dev/null @@ -1,36 +0,0 @@ -import fs from 'fs' -import path from 'path' - -const inputDir = '.' // Directory containing JSON files -const outputDir = './' // Directory to save TypeScript files - -// Ensure the output directory exists -if (!fs.existsSync(outputDir)) { - fs.mkdirSync(outputDir) -} - -// Function to convert JSON file to TypeScript file -function convertJsonToTs(fileName) { - const filePath = path.join(inputDir, fileName) - const outputFilePath = path.join(outputDir, fileName.replace('.json', '.ts')) - - // Read the JSON file - const jsonData = fs.readFileSync(filePath, 'utf8') - - // Parse the JSON content - const jsonObject = JSON.parse(jsonData) - - // Create the TypeScript content - const tsContent = `export const ${fileName.slice(0, -5)}Data = ${JSON.stringify(jsonObject, null, 2)};\n` - - // Write the TypeScript file - fs.writeFileSync(outputFilePath, tsContent, 'utf8') - console.log(`Converted ${fileName} to ${outputFilePath}`) -} - -// Read all JSON files in the input directory -fs.readdirSync(inputDir).forEach((file) => { - if (path.extname(file) === '.json') { - convertJsonToTs(file) - } -})