(base: string, output: string)
| 32 | } |
| 33 | |
| 34 | function removeUselessKeysToFile(base: string, output: string) { |
| 35 | const basePath = path.join(process.cwd(), base); |
| 36 | const outputPath = path.join(process.cwd(), output); |
| 37 | const baseFile = JSON.parse(fs.readFileSync(basePath, "utf8")); |
| 38 | const outputFile = JSON.parse(fs.readFileSync(outputPath, "utf8")); |
| 39 | |
| 40 | const updatedFile = removeUselessKeys(baseFile, outputFile); |
| 41 | |
| 42 | fs.writeFileSync(outputPath, JSON.stringify(updatedFile)); |
| 43 | } |
| 44 | |
| 45 | function removeUselessKeys(nodeA: any, nodeB: any): any { |
| 46 | for (const key in nodeB) { |
no test coverage detected