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

Function removeUselessKeys

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

Source from the content-addressed store, hash-verified

43}
44
45function removeUselessKeys(nodeA: any, nodeB: any): any {
46 for (const key in nodeB) {
47 if (Object.prototype.hasOwnProperty.call(nodeB, key)) {
48 if (!Object.prototype.hasOwnProperty.call(nodeA, key)) {
49 delete nodeB[key];
50 } else {
51 if (typeof nodeA[key] === "object") {
52 nodeB[key] = removeUselessKeys(nodeA[key], nodeB[key]);
53 }
54 }
55 }
56 }
57 return nodeB;
58}
59
60function sortJson(fileToSort: string) {
61 // Lire le fichier JSON

Callers 1

removeUselessKeysToFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected