/**
 * @param {string[]} path
 * @param {*} source
 * @returns {*}
 */
function getPartial(path, source) {
  return path.reduce((previous, key) => (previous ? previous[key] : undefined), source);
}

module.exports = getPartial;
