UNPKG

tdc-js-modules

Version:

13 lines (12 loc) 313 B
const getValueFromSelector = (selector: string | null, object: any) => { const keys = selector? selector.split('.'): []; let obj: any = object; keys.forEach(key => { if (obj.hasOwnProperty(key)){ obj = obj[key]; console.log({obj}) } }); return obj }; export { getValueFromSelector }