Files
habitica/common/script/libs/dotGet.js
Matteo Pagliazzi bb6f0f4252 split user.fns
2016-03-08 18:58:39 +01:00

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);
};