mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
v3: fix cron middleware, remove unused code from shared
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
module.exports = function(obj, path, val) {
|
||||
var arr;
|
||||
arr = path.split('.');
|
||||
return _.reduce(arr, (function(_this) {
|
||||
return function(curr, next, index) {
|
||||
if ((arr.length - 1) === index) {
|
||||
curr[next] = val;
|
||||
}
|
||||
return curr[next] != null ? curr[next] : curr[next] = {};
|
||||
};
|
||||
})(this), obj);
|
||||
};
|
||||
// TODO remove completely
|
||||
|
||||
module.exports = _.set;
|
||||
|
||||
Reference in New Issue
Block a user