mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
split user.fns
This commit is contained in:
9
common/script/libs/dotGet.js
Normal file
9
common/script/libs/dotGet.js
Normal file
@@ -0,0 +1,9 @@
|
||||
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);
|
||||
};
|
||||
Reference in New Issue
Block a user