-
-
Save btshft/f15f590f9fc4518095eabc47c14c0405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private initNullProperties(target : any, source: any){ | |
let self = this; | |
Object.keys(target).forEach(targetKey =>{ | |
if(target[targetKey] === null && source!== null && typeof source !== "undefined" && source[targetKey] !== null && typeof source[targetKey] === "object"){ | |
target[targetKey] = source[targetKey]; | |
} | |
else if(target[targetKey] !== null && typeof target[targetKey] === "object" && source!== null && typeof source !== "undefined"){ | |
self.initNullProperties(target[targetKey], source[targetKey]) | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment