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

Function addMissingKeys

pwa/update-i18n.ts:19–32  ·  view source on GitHub ↗
(nodeA: any, nodeB: any)

Source from the content-addressed store, hash-verified

17}
18
19function addMissingKeys(nodeA: any, nodeB: any): any {
20 for (const key in nodeA) {
21 if (Object.prototype.hasOwnProperty.call(nodeA, key)) {
22 if (!Object.prototype.hasOwnProperty.call(nodeB, key)) {
23 nodeB[key] = nodeA[key];
24 } else {
25 if (typeof nodeA[key] === "object") {
26 nodeB[key] = addMissingKeys(nodeA[key], nodeB[key]);
27 }
28 }
29 }
30 }
31 return nodeB;
32}
33
34function removeUselessKeysToFile(base: string, output: string) {
35 const basePath = path.join(process.cwd(), base);

Callers 1

addMissingKeysToFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected