(nodeA: any, nodeB: any)
| 43 | } |
| 44 | |
| 45 | function 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 | |
| 60 | function sortJson(fileToSort: string) { |
| 61 | // Lire le fichier JSON |
no outgoing calls
no test coverage detected