const oget = ( obj , path , defaultValue ? ) : any => { const res = path . replace ( /\[/g , '.' ) . replace ( /\]/g , '' ) . replace ( /^\./ , '' ) . split ( '.' ) . reduce ( ( prev , curr ) => ( prev && prev [ curr ] ) , obj ) ; return ( res === undefined ) ? defaultValue : res ; } ; export default oget ;