split user.fns

This commit is contained in:
Matteo Pagliazzi
2016-03-08 18:58:39 +01:00
parent 393a26e51a
commit bb6f0f4252
21 changed files with 808 additions and 704 deletions

View File

@@ -0,0 +1,12 @@
import dotSet from '../libs/dotSet';
/*
This allows you to set object properties by dot-path. Eg, you can run pathSet('stats.hp',50,user) which is the same as
user.stats.hp = 50. This is useful because in our habitrpg-shared functions we're returning changesets as {path:value},
so that different consumers can implement setters their own way. Derby needs model.set(path, value) for example, where
Angular sets object properties directly - in which case, this function will be used.
*/
module.exports = function(user, path, val) {
return dotSet(user, path, val);
};