This file contains hidden or 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
| import { readFile, writeFile } from 'fs/promises'; | |
| import path from 'path'; | |
| function extractResolution(filePath) { | |
| const match = filePath.match(/\/(\d+x\d+)\//); | |
| return match ? match[1] : null; | |
| } | |
| function compareResolutions(res1, res2) { |
This file contains hidden or 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
| import { readFile, writeFile } from 'fs/promises'; | |
| async function convertTextToJson(inputFile, outputFile) { | |
| try { | |
| const data = await readFile(inputFile, 'utf8'); | |
| const filePaths = data.split('\n').map(line => line.trim()).filter(Boolean); | |
| const jsonContent = JSON.stringify(filePaths, null, 2); |