Skip to content

Instantly share code, notes, and snippets.

@HiveSolution
Created July 11, 2018 15:39
Show Gist options
  • Save HiveSolution/8fd264681cf920709fb30af0ffb63eed to your computer and use it in GitHub Desktop.
Save HiveSolution/8fd264681cf920709fb30af0ffb63eed to your computer and use it in GitHub Desktop.
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