Recursively walks through an object and calls any function passing the object as parameter.
npm install invoke-deep
import invokeDeep from 'invoke-deep';
const result = invokeDeep({
colors: ['red', 'green', 'blue'],
font: {
colors: config => config.colors,
},
});
result.font.colors == ['red', 'green', 'blue'];