Created
July 11, 2018 15:39
-
-
Save HiveSolution/8fd264681cf920709fb30af0ffb63eed 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 findObjectByPath (obj, path: string) { | |
const pathArr: Array<string> = path.split('.'); | |
let counter: number = 0 | |
let tempObj = obj; | |
while (counter < pathArr.length) { | |
const cur = pathArr[counter]; | |
tempObj = tempObj[cur]; | |
counter++; | |
} | |
return tempObj; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment