MCPcopy Create free account
hub / github.com/api-platform/website / removeUselessKeysToFile

Function removeUselessKeysToFile

pwa/update-i18n.ts:34–43  ·  view source on GitHub ↗
(base: string, output: string)

Source from the content-addressed store, hash-verified

32}
33
34function 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
45function removeUselessKeys(nodeA: any, nodeB: any): any {
46 for (const key in nodeB) {

Callers 1

update-i18n.tsFile · 0.85

Calls 1

removeUselessKeysFunction · 0.85

Tested by

no test coverage detected