mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
10 lines
231 B
JavaScript
10 lines
231 B
JavaScript
import _ from 'lodash';
|
|
|
|
module.exports = function(obj, path) {
|
|
return _.reduce(path.split('.'), ((function(_this) {
|
|
return function(curr, next) {
|
|
return curr != null ? curr[next] : void 0;
|
|
};
|
|
})(this)), obj);
|
|
};
|