mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Move time travelers store to separate module
This commit is contained in:
15
common/script/src/content/time-traveler-store.js
Normal file
15
common/script/src/content/time-traveler-store.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import {keys, reduce} from 'lodash';
|
||||
import mystery from './mystery-sets';
|
||||
|
||||
function timeTravelerStore(owned) {
|
||||
var ownedKeys = keys((typeof owned.toObject === "function" ? owned.toObject() : void 0) || owned);
|
||||
return reduce(mystery, (m, v, k) => {
|
||||
if (k === 'wondercon' || ~ownedKeys.indexOf(v.items[0].key)) {
|
||||
return m;
|
||||
}
|
||||
m[k] = v;
|
||||
return m;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export default timeTravelerStore;
|
||||
Reference in New Issue
Block a user