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

Function addMissingKeysToFile

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

Source from the content-addressed store, hash-verified

6}
7
8function addMissingKeysToFile(base: string, output: string) {
9 const basePath = path.join(process.cwd(), base);
10 const outputPath = path.join(process.cwd(), output);
11 const baseFile = JSON.parse(fs.readFileSync(basePath, "utf8"));
12 const outputFile = JSON.parse(fs.readFileSync(outputPath, "utf8"));
13
14 const updatedFile = addMissingKeys(baseFile, outputFile);
15
16 fs.writeFileSync(outputPath, JSON.stringify(updatedFile));
17}
18
19function addMissingKeys(nodeA: any, nodeB: any): any {
20 for (const key in nodeA) {

Callers 1

update-i18n.tsFile · 0.85

Calls 1

addMissingKeysFunction · 0.85

Tested by

no test coverage detected