mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Remove unused v2 code from /website/common/script (#8034)
* remove apiv2 behavior from ops * remove apiv2 behavior from fns
This commit is contained in:
committed by
Blade Barringer
parent
8f9ed6e377
commit
5f0c1687b5
@@ -1,7 +0,0 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
// TODO remove completely, use _.get, only used in client
|
||||
|
||||
module.exports = function dotGet (user, path) {
|
||||
return _.get(user, path);
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// TODO use directly _.set and remove this fn, only used in client
|
||||
|
||||
module.exports = function dotSet (user, path, val) {
|
||||
return _.set(user, path, val);
|
||||
};
|
||||
@@ -2,24 +2,18 @@ import handleTwoHanded from './handleTwoHanded';
|
||||
import predictableRandom from './predictableRandom';
|
||||
import crit from './crit';
|
||||
import randomVal from './randomVal';
|
||||
import dotSet from './dotSet';
|
||||
import dotGet from './dotGet';
|
||||
import randomDrop from './randomDrop';
|
||||
import autoAllocate from './autoAllocate';
|
||||
import updateStats from './updateStats';
|
||||
import ultimateGear from './ultimateGear';
|
||||
import nullify from './nullify';
|
||||
|
||||
module.exports = {
|
||||
handleTwoHanded,
|
||||
predictableRandom,
|
||||
crit,
|
||||
randomVal,
|
||||
dotSet,
|
||||
dotGet,
|
||||
randomDrop,
|
||||
autoAllocate,
|
||||
updateStats,
|
||||
ultimateGear,
|
||||
nullify,
|
||||
};
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// TODO remove once v2 is retired
|
||||
|
||||
module.exports = function nullify (user) {
|
||||
user.ops = null;
|
||||
user.fns = null;
|
||||
user = null;
|
||||
};
|
||||
Reference in New Issue
Block a user